NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
sdo.h File Reference
#include "timer.h"

Go to the source code of this file.

Classes

struct  struct_s_transfer
 
struct  BODY
 
struct  struct_s_SDO
 

Typedefs

typedef void(* SDOCallback_t) (CO_Data *d, UNS8 nodeId)
 
typedef struct struct_s_transfer s_transfer
 
typedef struct struct_s_SDO s_SDO
 

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 closeSDOtransfer (CO_Data *d, UNS8 nodeId, UNS8 whoami)
 
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.
 
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.
 
UNS8 readNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType)
 Used to send a SDO request frame to read.
 
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 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.
 

Detailed Description

Created on: Oct 9, 2024 Author: jenej

Definition in file sdo.h.

Typedef Documentation

◆ s_SDO

typedef struct struct_s_SDO s_SDO

Definition at line 70 of file sdo.h.

◆ s_transfer

typedef struct struct_s_transfer s_transfer

Definition at line 56 of file sdo.h.

◆ SDOCallback_t

typedef void(* SDOCallback_t) (CO_Data *d, UNS8 nodeId)

Definition at line 15 of file sdo.h.

Function Documentation

◆ closeSDOtransfer()

UNS8 closeSDOtransfer ( CO_Data * d,
UNS8 nodeId,
UNS8 whoami )

Definition at line 456 of file sdo.c.