DanielMartensson / Open-SAE-J1939

SAE J1939 protocol free to use for embedded systems or PC with CAN-bus
MIT License
455 stars 164 forks source link

Default Initialization of 'other_ECU_address' to 0xFF and Suggested Init Function for 'j1939' Structure #53

Closed Jefferson-Lopes closed 2 weeks ago

Jefferson-Lopes commented 4 weeks ago

Hello!

I have a question regarding the other_ECU_address variable in this library. Is this variable always initialized to 0xFF in all use cases?

If that's the case, would it be more user-friendly to have an initialization function to set up the j1939 structure at the start?

DanielMartensson commented 4 weeks ago

@Jefferson-Lopes

It's done here https://github.com/DanielMartensson/Open-SAE-J1939/blob/40dfafdb1d56cb9a905143cbb3a5f7397aaf1979/Src/Open_SAE_J1939/Startup_ECU.c#L38-L45