SDO server/client
CANopen_301 » Driver » Stack configuration

## Macros

#define | CO_CONFIG_SDO_SRV (CO_CONFIG_SDO_SRV_SEGMENTED)
| Configuration of SDO server. More...
#define | CO_CONFIG_SDO_SRV_BUFFER_SIZE 32
| Size of the internal data buffer for the SDO server. More...
#define | CO_CONFIG_SDO_CLI (0)
| Configuration of SDO client. More...
#define | CO_CONFIG_SDO_CLI_BUFFER_SIZE 32
| Size of the internal data buffer for the SDO client. More...

## Detailed Description

## Macro Definition Documentation

## CO_CONFIG_SDO_SRV

#define CO_CONFIG_SDO_SRV (CO_CONFIG_SDO_SRV_SEGMENTED)

Configuration of SDO server.

Possible flags, can be ORed:

- CO_CONFIG_SDO_SRV_SEGMENTED - Enable SDO server segmented transfer.
- CO_CONFIG_SDO_SRV_BLOCK - Enable SDO server block transfer. If set, then CO_CONFIG_SDO_SRV_SEGMENTED must also be set.
- CO_CONFIG_FLAG_CALLBACK_PRE - Enable custom callback after preprocessing received SDO CAN message. Callback is configured by CO_SDOserver_initCallbackPre().
- CO_CONFIG_FLAG_TIMERNEXT - Enable calculation of timerNext_us variable inside CO_SDOserver_process().
- CO_CONFIG_FLAG_OD_DYNAMIC - Enable dynamic configuration of additional SDO servers (Writing to object 0x1201+ re-configures the additional server).

## CO_CONFIG_SDO_SRV_BUFFER_SIZE

#define CO_CONFIG_SDO_SRV_BUFFER_SIZE 32

Size of the internal data buffer for the SDO server.

If size is less than size of some variables in Object Dictionary, then data will be transferred to internal buffer in several segments. Minimum size is 8 or 899 (127*7) for block transfer.

## CO_CONFIG_SDO_CLI

#define CO_CONFIG_SDO_CLI (0)

Configuration of SDO client.

Possible flags, can be ORed:

- CO_CONFIG_SDO_CLI_ENABLE - Enable SDO client.
- CO_CONFIG_SDO_CLI_SEGMENTED - Enable SDO client segmented transfer.
- CO_CONFIG_SDO_CLI_BLOCK - Enable SDO client block transfer. If set, then CO_CONFIG_SDO_CLI_SEGMENTED, CO_CONFIG_FIFO_ALT_READ and CO_CONFIG_FIFO_CRC16_CCITT must also be set.
- CO_CONFIG_SDO_CLI_LOCAL - Enable local transfer, if Node-ID of the SDO server is the same as node-ID of the SDO client. (SDO client is the same device as SDO server.) Transfer data directly without communication on CAN.
- CO_CONFIG_FLAG_CALLBACK_PRE - Enable custom callback after preprocessing received SDO CAN message. Callback is configured by CO_SDOclient_initCallbackPre().
- CO_CONFIG_FLAG_TIMERNEXT - Enable calculation of timerNext_us variable inside CO_SDOclientDownloadInitiate(), CO_SDOclientDownload(), CO_SDOclientUploadInitiate(), CO_SDOclientUpload().
- CO_CONFIG_FLAG_OD_DYNAMIC - Enable dynamic configuration of SDO clients (Writing to object 0x1280+ re-configures the client).

## CO_CONFIG_SDO_CLI_BUFFER_SIZE

#define CO_CONFIG_SDO_CLI_BUFFER_SIZE 32

Size of the internal data buffer for the SDO client.

Circular buffer is used for SDO communication. It can be read or written between successive SDO calls. So size of the buffer can be lower than size of the actual size of data transferred. If only segmented transfer is used, then buffer size can be as low as 7 bytes, if data are read/written each cycle. If block transfer is used, buffer size should be set to at least 1000 bytes, so maximum blksize can be used (blksize is calculated from free buffer space). Default value for block transfer is 1000, otherwise 32.