Go to the documentation of this file.
27 #ifndef CO_SDO_CLIENT_H
28 #define CO_SDO_CLIENT_H
36 #ifndef CO_CONFIG_SDO_CLI
37 #define CO_CONFIG_SDO_CLI (0)
39 #ifndef CO_CONFIG_SDO_CLI_BUFFER_SIZE
40 #if (CO_CONFIG_SDO_CLI) & CO_CONFIG_SDO_CLI_BLOCK
41 #define CO_CONFIG_SDO_CLI_BUFFER_SIZE 1000
43 #define CO_CONFIG_SDO_CLI_BUFFER_SIZE 32
47 #if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_SDO_CLI_ENABLE) || defined CO_DOXYGEN
68 #if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_SDO_CLI_LOCAL) || defined CO_DOXYGEN
88 #if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_FLAG_OD_DYNAMIC) || defined CO_DOXYGEN
128 #if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
130 void (*pFunctSignal)(
void *object);
134 #if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_SDO_CLI_SEGMENTED) || defined CO_DOXYGEN
138 #if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_SDO_CLI_BLOCK) || defined CO_DOXYGEN
189 #if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
206 void (*pFunctSignal)(
void *
object));
261 size_t sizeIndicated,
278 size_t sizeIndicated);
338 size_t *sizeTransferred,
398 size_t *sizeIndicated,
399 size_t *sizeTransferred,
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
Interface between CAN hardware and CANopenNode.
volatile void * CANrxNew
Indicates, if new SDO message received from CAN bus.
Definition: CO_SDOclient.h:125
OD_attr_t attribute
Attribute for locally transferred OD sub-object, see OD_attributes_t.
Definition: CO_SDOclient.h:76
CO_SDO_return_t
Return values from SDO server or client functions.
Definition: CO_SDOserver.h:410
bool_t block_crcEnabled
Server CRC support in block transfer.
Definition: CO_SDOclient.h:150
SDO client object.
Definition: CO_SDOclient.h:67
CO_SDO_return_t CO_SDOclient_setup(CO_SDOclient_t *SDO_C, uint32_t COB_IDClientToServer, uint32_t COB_IDServerToClient, uint8_t nodeIDOfTheSDOServer)
Setup SDO client object.
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
uint32_t COB_IDClientToServer
Copy of CANopen COB_ID Client -> Server, meaning of the specific bits:
Definition: CO_SDOclient.h:93
#define CO_CONFIG_SDO_CLI_BUFFER_SIZE
Size of the internal data buffer for the SDO client.
Definition: CO_config.h:386
size_t sizeInd
Size of data, which will be transferred.
Definition: CO_SDOclient.h:109
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
OD_IO_t OD_IO
Object dictionary interface for locally transferred object.
Definition: CO_SDOclient.h:74
CO_SDO_return_t CO_SDOclientUpload(CO_SDOclient_t *SDO_C, uint32_t timeDifference_us, bool_t abort, CO_SDO_abortCode_t *SDOabortCode, size_t *sizeIndicated, size_t *sizeTransferred, uint32_t *timerNext_us)
Process SDO upload communication.
CO_fifo_t bufFifo
CO_fifo_t object for data buffer (not pointer)
Definition: CO_SDOclient.h:119
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
CO_ReturnError_t CO_SDOclient_init(CO_SDOclient_t *SDO_C, const OD_t *OD, const OD_entry_t *OD_1280_SDOcliPar, uint8_t nodeId, CO_CANmodule_t *CANdevRx, uint16_t CANdevRxIdx, CO_CANmodule_t *CANdevTx, uint16_t CANdevTxIdx)
Initialize SDO client object.
uint32_t block_timeoutTimer
Timeout timer for SDO sub-block upload.
Definition: CO_SDOclient.h:142
uint8_t subIndex
Subindex of current object in Object Dictionary.
Definition: CO_SDOclient.h:104
const OD_t * OD
From CO_SDOclient_init()
Definition: CO_SDOclient.h:70
uint16_t index
Index of current object in Object Dictionary.
Definition: CO_SDOclient.h:102
void CO_SDOclient_initCallbackPre(CO_SDOclient_t *SDOclient, void *object, void(*pFunctSignal)(void *object))
Initialize SDOclient callback function.
uint8_t nodeIDOfTheSDOServer
Node-ID of the SDO server.
Definition: CO_SDOclient.h:98
CANopen Service Data Object - server protocol.
CO_CANmodule_t * CANdevRx
From CO_SDOclient_init()
Definition: CO_SDOclient.h:79
void CO_SDOclientDownloadInitiateSize(CO_SDOclient_t *SDO_C, size_t sizeIndicated)
Initiate SDO download communication - update size.
CO_SDO_return_t CO_SDOclientDownload(CO_SDOclient_t *SDO_C, uint32_t timeDifference_us, bool_t abort, bool_t bufferPartial, CO_SDO_abortCode_t *SDOabortCode, size_t *sizeTransferred, uint32_t *timerNext_us)
Process SDO download communication.
uint32_t COB_IDServerToClient
Copy of CANopen COB_ID Server -> Client, similar as above.
Definition: CO_SDOclient.h:95
uint16_t CANdevTxIdx
From CO_SDOclient_init()
Definition: CO_SDOclient.h:85
uint8_t toggle
Toggle bit toggled in each segment in segmented transfer.
Definition: CO_SDOclient.h:136
CO_CANtx_t * CANtxBuff
CAN transmit buffer inside CANdevTx for CAN tx message.
Definition: CO_SDOclient.h:87
uint32_t block_SDOtimeoutTime_us
Timeout time for SDO sub-block upload, half of SDOtimeoutTime_us.
Definition: CO_SDOclient.h:140
uint8_t block_seqno
Sequence number of segment in block, 1..127.
Definition: CO_SDOclient.h:144
CO_SDO_return_t CO_SDOclientUploadInitiate(CO_SDOclient_t *SDO_C, uint16_t index, uint8_t subIndex, uint16_t SDOtimeoutTime_ms, bool_t blockEnable)
Initiate SDO upload communication.
CO_SDO_abortCode_t
SDO abort codes.
Definition: CO_SDOserver.h:333
CO_SDO_return_t CO_SDOclientDownloadInitiate(CO_SDOclient_t *SDO_C, uint16_t index, uint8_t subIndex, size_t sizeIndicated, uint16_t SDOtimeoutTime_ms, bool_t blockEnable)
Initiate SDO download communication.
uint16_t block_crc
Calculated CRC checksum.
Definition: CO_SDOclient.h:154
CO_SDO_state_t
Internal states of the SDO state machine.
Definition: CO_SDOserver.h:102
Fifo object.
Definition: CO_fifo.h:60
size_t CO_SDOclientUploadBufRead(CO_SDOclient_t *SDO_C, char *buf, size_t count)
Read data from SDO client buffer.
uint8_t nodeId
From CO_SDOclient_init()
Definition: CO_SDOclient.h:72
volatile CO_SDO_state_t state
Internal state of the SDO client.
Definition: CO_SDOclient.h:113
CANopen Object Dictionary interface.
size_t CO_SDOclientDownloadBufWrite(CO_SDOclient_t *SDO_C, const char *buf, size_t count)
Write data into SDO client buffer.
size_t sizeTran
Size of data which is actually transferred.
Definition: CO_SDOclient.h:111
Object Dictionary.
Definition: CO_ODinterface.h:352
Complete CAN module object.
Definition: CO_driver.h:319
CO_CANmodule_t * CANdevTx
From CO_SDOclient_init()
Definition: CO_SDOclient.h:83
Structure for input / output on the OD variable.
Definition: CO_ODinterface.h:263
Object Dictionary entry for one OD object.
Definition: CO_ODinterface.h:336
void CO_SDOclientClose(CO_SDOclient_t *SDO_C)
Close SDO communication temporary.
uint8_t block_blksize
Number of segments per block, 1..127.
Definition: CO_SDOclient.h:146
uint8_t block_noData
Number of bytes in last segment that do not contain data.
Definition: CO_SDOclient.h:148
void * functSignalObject
From CO_SDOclient_initCallbackPre() or NULL.
Definition: CO_SDOclient.h:132
uint32_t SDOtimeoutTime_us
Maximum timeout time between request and response in microseconds.
Definition: CO_SDOclient.h:115
uint32_t timeoutTimer
Timeout timer for SDO communication.
Definition: CO_SDOclient.h:117
Configuration object for CAN transmit message for specific CANopenNode Object.
Definition: CO_driver.h:299
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151
uint16_t CANdevRxIdx
From CO_SDOclient_init()
Definition: CO_SDOclient.h:81
#define OD_attr_t
Size of Object Dictionary attribute.
Definition: CO_ODinterface.h:50