Closed MartinALL91 closed 6 months ago
This is really nice, I'm also not happy with my current solution but was not clever enough to come up with an idea like yours. Though at some point I was also pondering on adapting the CANopen libraries way of SDO read and write. I just need to further think this through, test it and think about how to introduce this API change.
I do have another idea, in order to maintain backward compatibility, as long as there was no call to add_emergency_callback()
the SDO read/write functions and mbx_receive()
will trow an Emergency exception as it was before. I will make this change myself after I merged your PR.
Thank you again for your contirbution. This is good stuff!
Thank you again for your contirbution. This is good stuff!
You are welcome. Thank you for making this amazing library.
I do have another idea, in order to maintain backward compatibility, as long as there was no call to
add_emergency_callback()
the SDO read/write functions andmbx_receive()
will trow an Emergency exception as it was before. I will make this change myself after I merged your PR.
That's a good idea!
I think that it would be useful that instead of raising an exception when emergency messages are received, we could consume them via a callback function (similarly as it is done in the CANopen library). By doing so we don't interrupt the flow of the SDO read and SDO write operations.