robertobucher / pysimCoder

Block diagram editor and real time code generator for Python
GNU General Public License v3.0
150 stars 32 forks source link

NuttX: Added support for SocketCAN #6

Closed michallenc closed 3 years ago

michallenc commented 3 years ago

This commit introduces SocketCAN support for NuttX. New functions socketCAN_open(char * dev) and socketCAN_saveMsg(struct can_frame m) were added to support different open proccess and different NuttX structure of message, the overall princip remains the same (functions canOpenTH(char * dev) and sendMsg(uint16_t ID, uint8_t DATA[], int len) are called from block´s source code). File canopen.c now can support both characteristic device dev/can0 and socketcan.

There are also few unused functions like rcvMsg(uint8_t DATA[], int timeout), rcvMsgCob(int cob, uint8_t DATA[], int timeout) and canOpen(char * dev). I am not sure whether they should be removed as they do not support real time receive or whether they can have some usage.

SocketCAN communication was tested on existing blocks.