-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Periodic send api #80
Comments
So here is what I'm thinking, as always I'd appreciate any thoughts and feedback. Primarily I want the API to be as simple as possible for users, and also straightforward to implement for each backend. I'm in favor of extending the Using a
This public api Bus level method would probably return an object like We can implement a concrete default implementation of this entire idea in the Bus's abstract base class (eg see christiansandberg:cyclic-fallback branch) and each interface would be encouraged to pass off to the hardware where it makes the most sense for them. IMO The tricky part is working out the api. |
It's a tricky question. I think it should be started using an existing Bus instance, since some interfaces require a handle and even if they only require a channel name then that could be read from the Bus instance. I guess usually you would like to both send and receive messages. We could have both an API with a CyclicTask class where you pass a Bus instance as argument and a I started the thread based fallback but I'm a bit unsure how to prevent calling the SocketcanUses channel name when configuring BCM. Bitrate is determined when setting up the link externally. KvaserHas "object buffers" for sending periodically. Requires a handle to configure it. NI-CANHas "CAN objects" for sending periodically. Can be configured with a channel name but probably requires the CAN-bus to be configured beforehand with correct bitrate etc. RemoteWould benefit from re-using an existing bus connection instead of creating one connection for each task. |
Ok starting to have a crack at the Another more minor threading concern crops up with dealing with task Still feel that exploring the hardware apis more will help find the best common ground.
|
I don't know what the need for a duration is but Kvaser would support it ( It would probably be good if the bus instance could stop all tasks on shutdown. Here is the APIs for Kvaser and NI-CAN: |
Hiya. I'm just dropping in to say hello as I've been working on some BCM changes locally which I suspect potentially cover some common ground. I've been working on supporting more of the (kernel) broadcast manager API via python-can, in particular, adding RX content subscription and handling responses such as What I can't quite see is what the right way should be to extend Apologies if this should really be a new thread rather than extending this but I think it's probably part of the same discussion...! |
Sorry I've gotten more than a little distracted with politics recently... if anyone does feel like taking this on I'll not take offense! I've found duration useful - but usually not requiring high accuracy so I don't think it would be overly missed. @pevsonic that is very interesting, I'd always glossed over the receive side of bcm as I hadn't quite understood the point! Only looking at it now do I see that it can notify you when the message content has changed. That actually does sound very useful! I think due to the ever expanding scope of v2.0 I'll ask that we mostly concentrate on the transmit side here and follow up in another issue regarding rx. - Please do stay involved though! As another aside, I noticed another python can project can4python that offers bcm support - perhaps an opportunity there. I haven't reached out or looked closely at the code. |
I've added a thread based fallback to your branch, hope you don't mind. Feel free to change anything. |
Just wanted to add that apart from Kvaser and NI-CAN, IXXAT also has support for periodic transmits. Hopefully someone with access to the right hardware and time may implement some of these in the future... :) |
I think the API looks good as it is now. Should we close this issue? |
Sounds good :-) |
Originally reported by: Brian Thorne (Bitbucket: hardbyte, GitHub: hardbyte)
The interfaces in
can/broadcastmanager.py
should take python-canBus
instances not channels - this would be more backend agnostic.It might be worth adding this periodic api directly to the bus itself too.
The text was updated successfully, but these errors were encountered: