CANopenNode
CO_SDOserver.h File Reference

CANopen Service Data Object - server protocol. More...

#include "301/CO_driver.h"
#include "301/CO_ODinterface.h"

Go to the source code of this file.

Data Structures

struct  CO_SDOserver_t
 SDO server object. More...
 

Macros

#define CO_SDO_ST_FLAG_DOWNLOAD   0x10U
 Internal state flags indicate type of transfer. More...
 

Enumerations

enum  CO_SDO_state_t {
  CO_SDO_ST_IDLE = 0x00U, CO_SDO_ST_ABORT = 0x01U, CO_SDO_ST_DOWNLOAD_LOCAL_TRANSFER = 0x10U, CO_SDO_ST_DOWNLOAD_INITIATE_REQ = 0x11U,
  CO_SDO_ST_DOWNLOAD_INITIATE_RSP = 0x12U, CO_SDO_ST_DOWNLOAD_SEGMENT_REQ = 0x13U, CO_SDO_ST_DOWNLOAD_SEGMENT_RSP = 0x14U, CO_SDO_ST_UPLOAD_LOCAL_TRANSFER = 0x20U,
  CO_SDO_ST_UPLOAD_INITIATE_REQ = 0x21U, CO_SDO_ST_UPLOAD_INITIATE_RSP = 0x22U, CO_SDO_ST_UPLOAD_SEGMENT_REQ = 0x23U, CO_SDO_ST_UPLOAD_SEGMENT_RSP = 0x24U,
  CO_SDO_ST_DOWNLOAD_BLK_INITIATE_REQ = 0x51U, CO_SDO_ST_DOWNLOAD_BLK_INITIATE_RSP = 0x52U, CO_SDO_ST_DOWNLOAD_BLK_SUBBLOCK_REQ = 0x53U, CO_SDO_ST_DOWNLOAD_BLK_SUBBLOCK_RSP = 0x54U,
  CO_SDO_ST_DOWNLOAD_BLK_END_REQ = 0x55U, CO_SDO_ST_DOWNLOAD_BLK_END_RSP = 0x56U, CO_SDO_ST_UPLOAD_BLK_INITIATE_REQ = 0x61U, CO_SDO_ST_UPLOAD_BLK_INITIATE_RSP = 0x62U,
  CO_SDO_ST_UPLOAD_BLK_INITIATE_REQ2 = 0x63U, CO_SDO_ST_UPLOAD_BLK_SUBBLOCK_SREQ = 0x64U, CO_SDO_ST_UPLOAD_BLK_SUBBLOCK_CRSP = 0x65U, CO_SDO_ST_UPLOAD_BLK_END_SREQ = 0x66U,
  CO_SDO_ST_UPLOAD_BLK_END_CRSP = 0x67U
}
 Internal states of the SDO state machine. More...
 
enum  CO_SDO_abortCode_t {
  CO_SDO_AB_NONE = 0x00000000UL, CO_SDO_AB_TOGGLE_BIT = 0x05030000UL, CO_SDO_AB_TIMEOUT = 0x05040000UL, CO_SDO_AB_CMD = 0x05040001UL,
  CO_SDO_AB_BLOCK_SIZE = 0x05040002UL, CO_SDO_AB_SEQ_NUM = 0x05040003UL, CO_SDO_AB_CRC = 0x05040004UL, CO_SDO_AB_OUT_OF_MEM = 0x05040005UL,
  CO_SDO_AB_UNSUPPORTED_ACCESS = 0x06010000UL, CO_SDO_AB_WRITEONLY = 0x06010001UL, CO_SDO_AB_READONLY = 0x06010002UL, CO_SDO_AB_NOT_EXIST = 0x06020000UL,
  CO_SDO_AB_NO_MAP = 0x06040041UL, CO_SDO_AB_MAP_LEN = 0x06040042UL, CO_SDO_AB_PRAM_INCOMPAT = 0x06040043UL, CO_SDO_AB_DEVICE_INCOMPAT = 0x06040047UL,
  CO_SDO_AB_HW = 0x06060000UL, CO_SDO_AB_TYPE_MISMATCH = 0x06070010UL, CO_SDO_AB_DATA_LONG = 0x06070012UL, CO_SDO_AB_DATA_SHORT = 0x06070013UL,
  CO_SDO_AB_SUB_UNKNOWN = 0x06090011UL, CO_SDO_AB_INVALID_VALUE = 0x06090030UL, CO_SDO_AB_VALUE_HIGH = 0x06090031UL, CO_SDO_AB_VALUE_LOW = 0x06090032UL,
  CO_SDO_AB_MAX_LESS_MIN = 0x06090036UL, CO_SDO_AB_NO_RESOURCE = 0x060A0023UL, CO_SDO_AB_GENERAL = 0x08000000UL, CO_SDO_AB_DATA_TRANSF = 0x08000020UL,
  CO_SDO_AB_DATA_LOC_CTRL = 0x08000021UL, CO_SDO_AB_DATA_DEV_STATE = 0x08000022UL, CO_SDO_AB_DATA_OD = 0x08000023UL, CO_SDO_AB_NO_DATA = 0x08000024UL
}
 SDO abort codes. More...
 
enum  CO_SDO_return_t {
  CO_SDO_RT_waitingLocalTransfer = 6, CO_SDO_RT_uploadDataBufferFull = 5, CO_SDO_RT_transmittBufferFull = 4, CO_SDO_RT_blockDownldInProgress = 3,
  CO_SDO_RT_blockUploadInProgress = 2, CO_SDO_RT_waitingResponse = 1, CO_SDO_RT_ok_communicationEnd = 0, CO_SDO_RT_wrongArguments = -2,
  CO_SDO_RT_endedWithClientAbort = -9, CO_SDO_RT_endedWithServerAbort = -10
}
 Return values from SDO server or client functions. More...
 

Functions

CO_ReturnError_t CO_SDOserver_init (CO_SDOserver_t *SDO, const OD_t *OD, const OD_entry_t *OD_1200_SDOsrvPar, uint8_t nodeId, uint16_t SDOtimeoutTime_ms, CO_CANmodule_t *CANdevRx, uint16_t CANdevRxIdx, CO_CANmodule_t *CANdevTx, uint16_t CANdevTxIdx)
 Initialize SDO object. More...
 
void CO_SDOserver_initCallbackPre (CO_SDOserver_t *SDO, void *object, void(*pFunctSignalPre)(void *object))
 Initialize SDOrx callback function. More...
 
CO_SDO_return_t CO_SDOserver_process (CO_SDOserver_t *SDO, bool_t NMTisPreOrOperational, uint32_t timeDifference_us, uint32_t *timerNext_us)
 Process SDO communication. More...
 

Detailed Description

CANopen Service Data Object - server protocol.

Author
Janez Paternoster

This file is part of CANopenNode, an opensource CANopen Stack. Project home page is https://github.com/CANopenNode/CANopenNode. For more information on CANopen see http://www.can-cia.org/.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.