|
NNP STM Generic Remote Module git-main
|

Functions | |
| void | SDOTimeoutAlarm (CO_Data *d, UNS32 id) |
| Reset of a SDO exchange on timeout. Send a SDO abort. | |
| void | resetSDO (CO_Data *d) |
| Reset all SDO buffers. | |
| UNS32 | SDOlineToObjdict (CO_Data *d, UNS8 line) |
| Copy the data received from the SDO line transfert to the object dictionary. | |
| UNS32 | objdictToSDOline (CO_Data *d, UNS8 line) |
| Copy the data from the object dictionary to the SDO line for a network transfert. | |
| UNS32 | objdictToSDOBlockline (CO_Data *d, UNS8 line, UNS8 numberOfIndexes) |
| Copy the data from the object dictionary to the SDO line for a network transfert. | |
| UNS8 | lineToSDO (CO_Data *d, UNS8 line, UNS32 nbBytes, UNS8 *data) |
| Copy data from an existant line in the argument "* data". | |
| UNS8 | SDOtoLine (CO_Data *d, UNS8 line, UNS32 nbBytes, UNS8 *data) |
| Add data to an existant line. | |
| UNS8 | failedSDO (CO_Data *d, UNS8 nodeId, UNS8 whoami, UNS16 index, UNS8 subIndex, UNS32 abortCode) |
| Called when an internal SDO abort occurs. Release the line * Only if server * If client, the line must be released manually in the core application. The reason of that is to permit the program to read the transfers structure before its reset, because many informations are stored on it : index, subindex, data received or trasmited, ... In all cases, sends a SDO abort. | |
| void | resetSDOline (CO_Data *d, UNS8 line) |
| Reset an unused line. | |
| UNS8 | initSDOline (CO_Data *d, UNS8 line, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 state) |
| Initialize some fields of the structure. | |
| UNS8 | getSDOfreeLine (CO_Data *d, UNS8 whoami, UNS8 *line) |
| Search for an unused line in the transfers array to store a new SDO. ie a line which value of the field "state" is "SDO_RESET" An unused line have the field "state" at the value SDO_RESET. | |
| UNS8 | getSDOlineOnUse (CO_Data *d, UNS8 nodeId, UNS8 whoami, UNS8 *line) |
| Search for the line, in the transfers array, which contains the beginning of the reception of a fragmented SDO. | |
| UNS8 | getSDOlineRestBytes (CO_Data *d, UNS8 line, UNS32 *nbBytes) |
| Bytes in the line structure which must be transmited (or received) | |
| UNS8 | setSDOlineRestBytes (CO_Data *d, UNS8 line, UNS32 nbBytes) |
| Store in the line structure the nb of bytes which must be transmited (or received) | |
| UNS8 | sendSDO (CO_Data *d, UNS8 whoami, s_SDO sdo) |
| Transmit a SDO frame on the bus bus_id. | |
| UNS8 | sendSDOabort (CO_Data *d, UNS8 whoami, UNS8 nodeID, UNS16 index, UNS8 subIndex, UNS32 abortCode) |
| Transmit a SDO error to the client. The reasons may be : Read/Write to a undefined object Read/Write to a undefined subindex Read/write a not valid length object Write a read only object. | |
| UNS8 | processSDO (CO_Data *d, Message *m) |
| Treat a SDO frame reception call the function sendSDO. | |
| INLINE UNS8 | _writeNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS32 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize) |
| Used to send a SDO request frame to write in a distant node dictionnary. | |
| UNS8 | writeNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS32 count, UNS8 dataType, void *data) |
| Used to send a SDO request frame to write the data at the index and subIndex indicated. | |
| UNS8 | writeNetworkDictCallBack (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS32 count, UNS8 dataType, void *data, SDOCallback_t Callback) |
| Used to send a SDO request frame to write in a distant node dictionnary. | |
| UNS8 | writeNetworkDictCallBackAI (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS32 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize) |
| Used to send a SDO request frame to write in a distant node dictionnary. | |
| INLINE UNS8 | _readNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback) |
| Used to send a SDO request frame to read. | |
| INLINE UNS8 | _readBlockNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 numberOfIndexes, UNS8 dataType, SDOCallback_t Callback) |
| Used to send a SDO request frame to read in a distant node dictionnary. | |
| UNS8 | readBlockNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 size, UNS8 dataType) |
| Used to send a SDO request frame to read in a distant node dictionnary. | |
| UNS8 | readNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType) |
| Used to send a SDO request frame to read. | |
| UNS8 | readNetworkDictCallback (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback) |
| Used to send a SDO request frame to read in a distant node dictionnary. | |
| UNS8 | readNetworkDictCallbackAI (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback) |
| Used to send a SDO request frame to read in a distant node dictionnary. | |
| UNS8 | getReadResultNetworkDict (CO_Data *d, UNS8 nodeId, void *data, UNS32 *size, UNS32 *abortCode) |
| Use this function after calling readNetworkDict to get the result. | |
| UNS8 | getWriteResultNetworkDict (CO_Data *d, UNS8 nodeId, UNS32 *abortCode) |
| Use this function after calling writeNetworkDict function to get the result of the write. | |
| INLINE UNS8 _readBlockNetworkDict | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS8 | numberOfIndexes, | ||
| UNS8 | dataType, | ||
| SDOCallback_t | Callback ) |
Used to send a SDO request frame to read in a distant node dictionnary.
The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort).
| *d | Pointer on a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
| Callback | Callback function |
Definition at line 1808 of file sdo.c.
Referenced by readBlockNetworkDict().


| INLINE UNS8 _readNetworkDict | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS8 | dataType, | ||
| SDOCallback_t | Callback ) |
Used to send a SDO request frame to read.
| *d | Pointer to a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
| Callback |
Definition at line 1699 of file sdo.c.
Referenced by readNetworkDict(), readNetworkDictCallback(), and readNetworkDictCallbackAI().


| INLINE UNS8 _writeNetworkDict | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS32 | count, | ||
| UNS8 | dataType, | ||
| void * | data, | ||
| SDOCallback_t | Callback, | ||
| UNS8 | endianize ) |
Used to send a SDO request frame to write in a distant node dictionnary.
The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort).
| *d | Pointer to a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| count | number of bytes to write in the dictionnary. |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
| *data | Pointer to data |
| Callback | Callback function |
| endiansize |
Normal transfert
Definition at line 1454 of file sdo.c.
Referenced by writeNetworkDict(), writeNetworkDictCallBack(), and writeNetworkDictCallBackAI().


| UNS8 failedSDO | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS8 | whoami, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS32 | abortCode ) |
Called when an internal SDO abort occurs. Release the line * Only if server * If client, the line must be released manually in the core application. The reason of that is to permit the program to read the transfers structure before its reset, because many informations are stored on it : index, subindex, data received or trasmited, ... In all cases, sends a SDO abort.
| *d | Pointer on a CAN object data structure |
| nodeId | |
| whoami | |
| index | |
| subIndex | |
| abortCode |
Definition at line 326 of file sdo.c.
Referenced by processSDO().


| UNS8 getReadResultNetworkDict | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| void * | data, | ||
| UNS32 * | size, | ||
| UNS32 * | abortCode ) |
Use this function after calling readNetworkDict to get the result.
| *d | Pointer to a CAN object data structure |
| nodeId | Node Id of the slave |
| *data | Pointer to the datas |
| *size | Pointer to the size |
| *abortCode | Pointer to the abortcode. (0 = not available. Else : SDO abort code. (received if return SDO_ABORTED_RCV) |
Definition at line 2054 of file sdo.c.

Search for an unused line in the transfers array to store a new SDO. ie a line which value of the field "state" is "SDO_RESET" An unused line have the field "state" at the value SDO_RESET.
| *d | Pointer on a CAN object data structure |
| whoami | Create the line for a SDO_SERVER or SDO_CLIENT. |
| *line | Pointer on a SDO line |
Definition at line 412 of file sdo.c.
Referenced by _readBlockNetworkDict(), _readNetworkDict(), _writeNetworkDict(), and processSDO().

Search for the line, in the transfers array, which contains the beginning of the reception of a fragmented SDO.
| *d | Pointer on a CAN object data structure |
| nodeId | correspond to the message node-id |
| whoami | takes 2 values : look for a line opened as SDO_CLIENT or SDO_SERVER |
| *line | Pointer on a SDO line |
Definition at line 439 of file sdo.c.
Referenced by _readBlockNetworkDict(), _readNetworkDict(), _writeNetworkDict(), failedSDO(), getReadResultNetworkDict(), getWriteResultNetworkDict(), and processSDO().

Bytes in the line structure which must be transmited (or received)
| *d | Pointer on a CAN object data structure |
| line | SDO line |
| *nbBytes | Pointer on nbBytes |
Definition at line 479 of file sdo.c.
Referenced by processSDO().

Use this function after calling writeNetworkDict function to get the result of the write.
It is mandatory to call this function because it is releasing the line used for the transfer.
| *d | Pointer to a CAN object data structure |
| nodeId | Node Id of the slave |
| *abortCode | Pointer to the abortcode
|
Definition at line 2120 of file sdo.c.

Initialize some fields of the structure.
| *d | Pointer on a CAN object data structure |
| line | |
| nodeId | |
| index | |
| subIndex | |
| state |
Definition at line 379 of file sdo.c.
Referenced by _readBlockNetworkDict(), _readNetworkDict(), _writeNetworkDict(), processSDO(), and resetSDOline().

Copy data from an existant line in the argument "* data".
| d | Pointer on a CAN object data structure |
| line | SDO line |
| nbBytes | |
| *data | Pointer on the data |
Definition at line 266 of file sdo.c.
Referenced by processSDO().

Copy the data from the object dictionary to the SDO line for a network transfert.
| *d | Pointer on a CAN object data structure |
| line | SDO line |
Definition at line 191 of file sdo.c.
Referenced by processSDO().

Copy the data from the object dictionary to the SDO line for a network transfert.
| *d | Pointer on a CAN object data structure |
| line | SDO line |
Definition at line 161 of file sdo.c.
Referenced by processSDO().

Treat a SDO frame reception call the function sendSDO.
| *d | Pointer on a CAN object data structure |
| *m | Pointer on a CAN message structure |
The server node Id;
The server node Id;
Definition at line 649 of file sdo.c.
Referenced by canDispatch().


| UNS8 readBlockNetworkDict | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS8 | size, | ||
| UNS8 | dataType ) |
Used to send a SDO request frame to read in a distant node dictionnary.
The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort). First free SDO client parameter is automatically initialized for specific node if not already defined.
| *d | Pointer on a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
Definition at line 1917 of file sdo.c.

Used to send a SDO request frame to read.
calls _readNetworkDict with Callback = NULL
| *d | Pointer to a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
Definition at line 1936 of file sdo.c.

| UNS8 readNetworkDictCallback | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS8 | dataType, | ||
| SDOCallback_t | Callback ) |
Used to send a SDO request frame to read in a distant node dictionnary.
The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort). calls _readNetworkDict with Callback = Callback
| *d | Pointer on a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
| Callback | Callback function |
Definition at line 1958 of file sdo.c.

| UNS8 readNetworkDictCallbackAI | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS8 | dataType, | ||
| SDOCallback_t | Callback ) |
Used to send a SDO request frame to read in a distant node dictionnary.
The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort). First free SDO client parameter is automatically initialized for specific node if not already defined.
| *d | Pointer on a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
| Callback | Callback function |
Definition at line 1979 of file sdo.c.

| void resetSDO | ( | CO_Data * | d | ) |
Reset all SDO buffers.
| *d | Pointer on a CAN object data structure |
Definition at line 120 of file sdo.c.
Referenced by switchCommunicationState().


Reset an unused line.
| *d | Pointer on a CAN object data structure |
| line | SDO line |
Definition at line 357 of file sdo.c.
Referenced by _readBlockNetworkDict(), _readNetworkDict(), _writeNetworkDict(), failedSDO(), processSDO(), resetSDO(), and SDOTimeoutAlarm().


Copy the data received from the SDO line transfert to the object dictionary.
| *d | Pointer on a CAN object data structure |
| line | SDO line |
Definition at line 136 of file sdo.c.
Referenced by processSDO().

Add data to an existant line.
| d | Pointer on a CAN object data structure |
| line | SDO line |
| nbBytes | |
| *data | Pointer on the data |
Definition at line 294 of file sdo.c.
Referenced by processSDO().

Transmit a SDO frame on the bus bus_id.
| *d | Pointer on a CAN object data structure |
| whoami | Takes 2 values : SDO_CLIENT or SDO_SERVER |
| sdo | SDO Structure which contains the sdo to transmit |
Definition at line 517 of file sdo.c.
Referenced by _readBlockNetworkDict(), _readNetworkDict(), _writeNetworkDict(), processSDO(), and sendSDOabort().

| UNS8 sendSDOabort | ( | CO_Data * | d, |
| UNS8 | whoami, | ||
| UNS8 | nodeID, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS32 | abortCode ) |
Transmit a SDO error to the client. The reasons may be : Read/Write to a undefined object Read/Write to a undefined subindex Read/write a not valid length object Write a read only object.
| *d | Pointer on a CAN object data structure |
| whoami | takes 2 values : SDO_CLIENT or SDO_SERVER |
| nodeId | |
| index | |
| subIndex | |
| abortCode |
Definition at line 608 of file sdo.c.
Referenced by failedSDO(), and SDOTimeoutAlarm().


Store in the line structure the nb of bytes which must be transmited (or received)
| *d | Pointer on a CAN object data structure |
| line | SDO line |
| nbBytes |
Definition at line 499 of file sdo.c.
Referenced by processSDO().

| UNS8 writeNetworkDict | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS32 | count, | ||
| UNS8 | dataType, | ||
| void * | data ) |
Used to send a SDO request frame to write the data at the index and subIndex indicated.
calls _writeNetworkDict with Callback = NULL and endiansize = 1.
| *d | Pointer to a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| count | number of bytes to write in the dictionnary. |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
| *data | Pointer to data |
Definition at line 1583 of file sdo.c.

| UNS8 writeNetworkDictCallBack | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS32 | count, | ||
| UNS8 | dataType, | ||
| void * | data, | ||
| SDOCallback_t | Callback ) |
Used to send a SDO request frame to write in a distant node dictionnary.
The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort). calls _writeNetworkDict with Callback = Callback and endiansize = 1.
| *d | Pointer to a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| count | number of bytes to write in the dictionnary. |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
| *data | Pointer to data |
| Callback | Callback function |
Definition at line 1608 of file sdo.c.

| UNS8 writeNetworkDictCallBackAI | ( | CO_Data * | d, |
| UNS8 | nodeId, | ||
| UNS16 | index, | ||
| UNS8 | subIndex, | ||
| UNS32 | count, | ||
| UNS8 | dataType, | ||
| void * | data, | ||
| SDOCallback_t | Callback, | ||
| UNS8 | endianize ) |
Used to send a SDO request frame to write in a distant node dictionnary.
The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort). First free SDO client parameter is automatically initialized for specific node if not already defined.
| *d | Pointer to a CAN object data structure |
| nodeId | Node Id of the slave |
| index | At index indicated |
| subIndex | At subIndex indicated |
| count | number of bytes to write in the dictionnary. |
| dataType | (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value. |
| *data | Pointer to data |
| Callback | Callback function |
| endianize | When not 0, data is endianized into network byte order when 0, data is not endianized and copied in machine native endianness |
Definition at line 1635 of file sdo.c.
