Open-Agriculture / AgIsoStack-plus-plus

AgIsoStack++ is the completely free open-source C++ ISOBUS library for everyone
https://agisostack.com/
MIT License
187 stars 41 forks source link

PartneredControlFunction is broken? #328

Closed asherikov closed 1 year ago

asherikov commented 1 year ago

Describe the bug Was going through the tutorials and got stuck at sending messages with a destination: send_can_message(..., partner) returns false -- doesnt pass this check -> https://github.com/Open-Agriculture/AgIsoStack-plus-plus/blob/main/isobus/src/can_network_manager.cpp#L167. Looks like address is never set in PartneredControlFunction -> https://github.com/Open-Agriculture/AgIsoStack-plus-plus/blob/main/isobus/src/can_partnered_control_function.cpp#L22

ad3154 commented 1 year ago

Hello!

I am sorry to hear you are having issues.

The address of the partner is set when a control function on the bus address claims with a NAME that is compatible with that partner's NAME filters.

The address is set here when that happens.

And we have a unit test for the PartneredControlFunction behavior. So, as far as I can tell, PartneredControlFunction is working properly.

Generally if you're never seeing the partner become valid, that just means the stack hasn't seen any valid control function's address claim on the bus that matches the partner's filters, or the partner has no filter. It could also happen if your bus is in a bad state or not connected to your CAN adapter.

Some troubleshooting you can try:

asherikov commented 1 year ago

Ok, thank you for clarification.