CANopen Master Documentation
Version 6.06.04
Loading...
Searching...
No Matches
com_sdo_srv.h File Reference

Detailed Description

With Service Data Objects (SDOs) the access to entries of a device Object Dictionary is provided. As these entries may contain data of arbitrary size and data type SDOs can be used to transfer multiple data sets (each containing an arbitrary large block of data) from a client to a server and vice versa. The client can control via a multiplexor (index and sub-index of the Object Dictionary) which data set is to be transferred. The contents of the data set are defined within the Object Dictionary (see com_dict.h).

The functions in this module are called by the CANopen master stack on reception of a SDO request.

+ Include dependency graph for com_sdo_srv.h:

Functions

uint32_t ComSdoSrvBlkUpObjectSize (uint8_t ubNetV, uint16_t uwIndexV, uint8_t ubSubIndexV)
 
void ComSdoSrvCopyValueToMessage (uint8_t ubNetV, void *pvdValueV, uint8_t ubDataTypeV)
 
void ComSdoSrvCopyMessageToValue (uint8_t ubNetV, void *pvdValueV, uint8_t ubDataTypeV)
 
void ComSdoSrvSegSetup (uint8_t ubNetV, void *pvdDataV, uint32_t ulSizeV)
 

Function Documentation

◆ ComSdoSrvBlkUpObjectSize()

uint32_t ComSdoSrvBlkUpObjectSize ( uint8_t  ubNetV,
uint16_t  uwIndexV,
uint8_t  ubSubIndexV 
)
Parameters
[in]ubNetVCANopen Network channel
[in]uwIndexVObject index value
[in]ubSubIndexVObject sub-index value
Returns
Number of bytes

This function is called by the ComSdoSrvBlkUpInit() function in order to determine the size (in bytes) of the object to be uploaded using a SDO block transfer.

The action on this function is application specific. The function body is placed inside the file com_user.c.

◆ ComSdoSrvCopyMessageToValue()

void ComSdoSrvCopyMessageToValue ( uint8_t  ubNetV,
void *  pvdValueV,
uint8_t  ubDataTypeV 
)

Copy data field from SDO message into value.

Parameters
[in]ubNetVCANopen Network channel
[out]pvdValueVPointer to value
[in]ubDataTypeVDefines the value data type

This function copies the SDO data field into the location defined by pvdValueV. Depending on the data type the byte order is assigned according to CiA 301.

◆ ComSdoSrvCopyValueToMessage()

void ComSdoSrvCopyValueToMessage ( uint8_t  ubNetV,
void *  pvdValueV,
uint8_t  ubDataTypeV 
)
Parameters
[in]ubNetVCANopen Network channel
[in]pvdValueVPointer to value
[in]ubDataTypeVDefines the value data type

This function copies the given value into the data field of a SDO message. Depending on the data type the byte order is assigned according to CiA 301.

◆ ComSdoSrvSegSetup()

void ComSdoSrvSegSetup ( uint8_t  ubNetV,
void *  pvdDataV,
uint32_t  ulSizeV 
)

Initialise segmented data transfer.

Parameters
ubNetVNumber of corresponding network
pvdDataVPointer to data
ulSizeVSize of data be transferred

This function is used to initialise the Segmented SDO data transfer.