Sam Grove / Mbed 2 deprecated canopen_masternode

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

sdo.c File Reference

sdo.c File Reference

Go to the source code of this file.

Functions

INLINE UNS8 _writeNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS32 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize)
INLINE UNS8 _readNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback)
void SDOTimeoutAlarm (CO_Data *d, UNS32 id)
 Reset of a SDO exchange on timeout.
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.
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.
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.
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 getSDOlineToClose (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)
 Close a transmission.
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.
UNS8 proceedSDO (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 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

Author:
Edouard TISSERANT and Francis DUPIN
Date:
Tue Jun 5 09:32:32 2007

Definition in file sdo.c.


Function Documentation

INLINE UNS8 _readNetworkDict ( CO_Data d,
UNS8  nodeId,
UNS16  index,
UNS8  subIndex,
UNS8  dataType,
SDOCallback_t  Callback 
)

Called by readNetworkDict

Parameters:
d
nodeId
index
subIndex
dataType
Callback
Returns:
Parameters:
d
nodeId
index
subIndex
dataType
Callback
Returns:

Definition at line 1609 of file sdo.c.

INLINE UNS8 _writeNetworkDict ( CO_Data d,
UNS8  nodeId,
UNS16  index,
UNS8  subIndex,
UNS32  count,
UNS8  dataType,
void *  data,
SDOCallback_t  Callback,
UNS8  endianize 
)

Called by writeNetworkDict

Parameters:
d
nodeId
index
subIndex
count
dataType
data
Callback
endianize
Returns:
Parameters:
d
nodeId
index
subIndex
count
dataType
data
Callback
endianize
Returns:

Normal transfert

Definition at line 1373 of file sdo.c.

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

Close a transmission.

Parameters:
d
nodeId
whoami
Returns:

Definition at line 554 of file sdo.c.

UNS8 failedSDO ( CO_Data d,
UNS8  nodeId,
UNS8  whoami,
UNS16  index,
UNS8  subIndex,
UNS32  abortCode 
)

Called when an internal SDO abort occurs.

Parameters:
d
nodeId
whoami
index
subIndex
abortCode
Returns:

Definition at line 382 of file sdo.c.

UNS8 getSDOfreeLine ( CO_Data d,
UNS8  whoami,
UNS8 *  line 
)

Search for an unused line in the transfers array to store a new SDO.

Parameters:
d
whoami
line
Returns:

Definition at line 475 of file sdo.c.

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.

Parameters:
d
nodeId
whoami
line
Returns:

Definition at line 501 of file sdo.c.

UNS8 getSDOlineRestBytes ( CO_Data d,
UNS8  line,
UNS32 *  nbBytes 
)

Bytes in the line structure which must be transmited (or received)

Parameters:
d
line
nbBytes
Returns:

Definition at line 576 of file sdo.c.

UNS8 getSDOlineToClose ( 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.

Parameters:
d
nodeId
whoami
line
Returns:

Definition at line 528 of file sdo.c.

UNS8 initSDOline ( CO_Data d,
UNS8  line,
UNS8  nodeId,
UNS16  index,
UNS8  subIndex,
UNS8  state 
)

Initialize some fields of the structure.

Parameters:
d
line
nodeId
index
subIndex
state
Returns:

Definition at line 441 of file sdo.c.

UNS8 lineToSDO ( CO_Data d,
UNS8  line,
UNS32  nbBytes,
UNS8 *  data 
)

Copy data from an existant line in the argument "* data".

Parameters:
d
line
nbBytes
data
Returns:

Definition at line 268 of file sdo.c.

UNS32 objdictToSDOline ( CO_Data d,
UNS8  line 
)

Copy the data from the object dictionary to the SDO line for a network transfert.

Parameters:
d
line
Returns:

Definition at line 227 of file sdo.c.

UNS8 proceedSDO ( CO_Data d,
Message m 
)

Treat a SDO frame reception call the function sendSDO.

Parameters:
d
m
Returns:

The server node Id;

The server node Id;

Definition at line 735 of file sdo.c.

void resetSDO ( CO_Data d )

Reset all SDO buffers.

Reset all sdo buffers

Parameters:
d

Definition at line 169 of file sdo.c.

void resetSDOline ( CO_Data d,
UNS8  line 
)

Reset an unused line.

Parameters:
d
line

Definition at line 413 of file sdo.c.

UNS32 SDOlineToObjdict ( CO_Data d,
UNS8  line 
)

Copy the data received from the SDO line transfert to the object dictionary.

Parameters:
d
line
Returns:

Definition at line 186 of file sdo.c.

void SDOTimeoutAlarm ( CO_Data d,
UNS32  id 
)

Reset of a SDO exchange on timeout.

Parameters:
d
id

Definition at line 128 of file sdo.c.

UNS8 SDOtoLine ( CO_Data d,
UNS8  line,
UNS32  nbBytes,
UNS8 *  data 
)

Add data to an existant line.

Parameters:
d
line
nbBytes
data
Returns:

Definition at line 318 of file sdo.c.

UNS8 sendSDO ( CO_Data d,
UNS8  whoami,
s_SDO  sdo 
)

Transmit a SDO frame on the bus bus_id.

Parameters:
d
whoami
sdo
Returns:

Definition at line 617 of file sdo.c.

UNS8 sendSDOabort ( CO_Data d,
UNS8  whoami,
UNS8  nodeID,
UNS16  index,
UNS8  subIndex,
UNS32  abortCode 
)

Transmit a SDO error to the client.

Parameters:
d
whoami
index
subIndex
abortCode
Returns:

Definition at line 697 of file sdo.c.

UNS8 setSDOlineRestBytes ( CO_Data d,
UNS8  line,
UNS32  nbBytes 
)

Store in the line structure the nb of bytes which must be transmited (or received)

Parameters:
d
line
nbBytes
Returns:

Definition at line 595 of file sdo.c.