There was a problem with block transfer, when transmitting sequence of
data. If CANsend() failed (socket buffer full), message was dropped.
Now dropped message is marked with bufferFull flag and then it is
re-transmitted later by the driver, as is in the original behaviour of
CANopenNode.
- CO_config.h: use global macros for common definitions 8cff68f1
- Remove CO_errinfo() from driver (unused)
- Some reorder in Makefile and socketCAN/CO_main_basic.c
Testing and multiple fixes were made in newOD branch. This commit includes
relevant code from newOD branch, synchronized to this branch.
Following modules were updated:
- SDO client, CO_gateway_ascii, CO_fifo
- socketCAN : CO_epoll_interface, CO_main_basic
SDO client (with gateway and fifo) which was rewritten after v1.3 is now
tested and works the same as in newOD branch. Same is socketCAN. Works as here:
https://github.com/CANopenNode/CANopenSocket/tree/master/examples/basicDevice
SDO server is quite the same as in v1.3. I made no additional testing at
this point.
There are some other updates:
- CO_driver.h, CO_config.h: additional CO_CONFIG_DEBUG macro.
- CO_driver.h: fixed some typos, added optional CO_errinfo() macro.
- CO_NMT_Heartbeat: added CO_NMT_setInternalState().
- documentation synchronized.
- example/_project.xml updated, can be used as template with libedssharp.
After adding -Wshadow to build options, gcc produced following warning:
305/CO_LSSslave.c: In function ‘CO_LSSslave_receive’:
305/CO_LSSslave.c:114:30: warning: declaration of ‘valSw’ shadows a
previous local [-Wshadow]
114 | uint32_t valSw;
| ^~~~~
305/CO_LSSslave.c:76:22: note: shadowed declaration is here
76 | uint32_t valSw;
| ^~~~~
The user may decide whether he/she wants one common callback for all
monitored nodes (CO_CONFIG_HB_CONS_CALLBACK_CHANGE) or maybe separate
callbacks configured individually for each monitored mode
(CO_CONFIG_HB_CONS_CALLBACK_MULTI). These options cannot be set
simultaneously.
This change is related to the discussion in #237
* Implement a better solution for #229
Instead of playing with incrementing pointers in various places it is
better to just set it once at the start of loop.
* Make "remote NMT changed" callback of HB consumer node-specific
This way "remote NMT changed" callback is much more similar to other
"multi" callbacks of HB consumer, and it was node-specific anyway, as
you have to first configure the monitoring node to have that callback
executed.
This change breaks the API.
* Merge CO_CONFIG_HB_CONS_CALLBACK_CHANGE with ..._HB_CONS_CALLBACK_MULTI
These settings are now very similar, so there's no need to have two
separate config options.
This change breaks the configuration API.
- Rename files to CO_epoll_interface
- Object oriented, more flexible, separate functions
- move epoll, timerfd and eventfd system calls from CO_driver.c to CO_epoll_interface.c
- rearranged and better documented
- default values moved from CO_driver.h into appropriate files
- rearranged also in CO_driver_target.h files
- parts of the stack or whole objects can be disabled.
- configuration is verified for depencies
Additional:
- renamed some members of CO_Default_CAN_ID_t
- moved helpers CO_setUint32() etc from CO_SDOserver.h into CO_driver.h.
- change wrong CO_ERROR_PARAMETERS to CO_ERROR_ILLEGAL_ARGUMENT.
- renamed CO_ERROR_PARAMETERS to CO_ERROR_OD_PARAMETERS