CANopen Master Documentation
Version 6.08.00
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 "com_defs.h"
#include "com_dict.h"
+ 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.

◆ ComSdoSrvExpReadRequest()

void ComSdoSrvExpReadRequest ( uint8_t ubNetV)

◆ ComSdoSrvExpReadResponse()

void ComSdoSrvExpReadResponse ( uint8_t ubNetV,
uint8_t ubRespCodeV )

◆ ComSdoSrvExpWriteRequest()

void ComSdoSrvExpWriteRequest ( uint8_t ubNetV,
uint8_t ubReqCodeV )

◆ ComSdoSrvExpWriteResponse()

void ComSdoSrvExpWriteResponse ( uint8_t ubNetV)

◆ ComSdoSrvGetCurrentIndex()

uint16_t ComSdoSrvGetCurrentIndex ( uint8_t ubNetV)

◆ ComSdoSrvInit()

ComStatus_tv ComSdoSrvInit ( uint8_t ubNetV)

◆ ComSdoSrvMessageHandler()

void ComSdoSrvMessageHandler ( uint8_t ubNetV,
CpCanMsg_ts * ptsCanMsgV )

◆ ComSdoSrvResponse()

void ComSdoSrvResponse ( uint8_t ubNetV,
uint8_t ubResponseV )

◆ ComSdoSrvSegReadRequest()

void ComSdoSrvSegReadRequest ( uint8_t ubNetV,
uint8_t ubReqCodeV )

◆ 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.

◆ ComSdoSrvSegWriteRequest()

void ComSdoSrvSegWriteRequest ( uint8_t ubNetV,
uint8_t ubReqCodeV )

◆ ComSdoSrvSendAbort()

void ComSdoSrvSendAbort ( uint8_t ubNetV,
uint32_t ulErrCodeV )