CANopenNode
CANopen protocol stack
Loading...
Searching...
No Matches
CO_GTWA_t Struct Reference

CANopen Gateway-ascii object. More...

#include <CO_gateway_ascii.h>

+ Collaboration diagram for CO_GTWA_t:

Data Fields

size_t(* readCallback )(void *object, const char *buf, size_t count, uint8_t *connectionOK)
 Pointer to external function for reading response from Gateway-ascii object.
 
void * readCallbackObject
 Pointer to object, which will be used inside readCallback, from CO_GTWA_init()
 
uint32_t sequence
 Sequence number of the command.
 
int32_t net_default
 Default CANopen Net number is undefined (-1) at startup.
 
int16_t node_default
 Default CANopen Node ID number is undefined (-1) at startup.
 
uint16_t net
 Current CANopen Net number.
 
uint8_t node
 Current CANopen Node ID.
 
CO_fifo_t commFifo
 CO_fifo_t object for command (not pointer)
 
uint8_t commBuf [CO_CONFIG_GTWA_COMM_BUF_SIZE+1]
 Command buffer of usable size CO_CONFIG_GTWA_COMM_BUF_SIZE.
 
char respBuf [CO_GTWA_RESP_BUF_SIZE]
 Response buffer of usable size CO_GTWA_RESP_BUF_SIZE.
 
size_t respBufCount
 Actual size of data in respBuf.
 
size_t respBufOffset
 If only part of data has been successfully written into external application (with readCallback()), then Gateway-ascii object will stay in current state.
 
bool_t respHold
 See respBufOffset above.
 
uint32_t timeDifference_us_cumulative
 Sum of time difference from CO_GTWA_process() in case of respHold.
 
CO_GTWA_state_t state
 Current state of the gateway object.
 
uint32_t stateTimeoutTmr
 Timeout timer for the current state.
 
CO_SDOclient_tSDO_C
 SDO client object from CO_GTWA_init()
 
uint16_t SDOtimeoutTime
 Timeout time for SDO transfer in milliseconds, if no response.
 
bool_t SDOblockTransferEnable
 SDO block transfer enabled?
 
bool_t SDOdataCopyStatus
 Indicate status of data copy from / to SDO buffer.
 
const CO_GTWA_dataType_t * SDOdataType
 Data type of variable in current SDO communication.
 
CO_NMT_tNMT
 NMT object from CO_GTWA_init()
 
CO_LSSmaster_tLSSmaster
 LSSmaster object from CO_GTWA_init()
 
CO_LSS_address_t lssAddress
 128 bit number, uniquely identifying each node
 
uint8_t lssNID
 LSS Node-ID parameter.
 
uint16_t lssBitrate
 LSS bitrate parameter.
 
uint8_t lssInquireCs
 LSS inquire parameter.
 
CO_LSSmaster_fastscan_t lssFastscan
 LSS fastscan parameter.
 
uint8_t lssSubState
 LSS allnodes sub state parameter.
 
uint8_t lssNodeCount
 LSS allnodes node count parameter.
 
bool_t lssStore
 LSS allnodes store parameter.
 
uint16_t lssTimeout_ms
 LSS allnodes timeout parameter.
 
uint8_t logBuf [CO_CONFIG_GTWA_LOG_BUF_SIZE+1]
 Message log buffer of usable size CO_CONFIG_GTWA_LOG_BUF_SIZE.
 
CO_fifo_t logFifo
 CO_fifo_t object for message log (not pointer)
 
const char * helpString
 Offset, when printing help text.
 
CO_LEDs_tLEDs
 CO_LEDs_t object for CANopen status LEDs imitation from CO_GTWA_init()
 

Detailed Description

CANopen Gateway-ascii object.

Field Documentation

◆ readCallback

size_t(* CO_GTWA_t::readCallback) (void *object, const char *buf, size_t count, uint8_t *connectionOK)

Pointer to external function for reading response from Gateway-ascii object.

Pointer is initialized in CO_GTWA_initRead().

Parameters
objectVoid pointer to custom object
bufBuffer from which data can be read
countCount of bytes available inside buffer
[out]connectionOKdifferent than 0 indicates connection is OK.
Returns
Count of bytes actually transferred.

◆ respBufOffset

size_t CO_GTWA_t::respBufOffset

If only part of data has been successfully written into external application (with readCallback()), then Gateway-ascii object will stay in current state.

This situation is indicated with respHold variable and respBufOffset indicates offset to untransferred data inside respBuf.

◆ SDOdataCopyStatus

bool_t CO_GTWA_t::SDOdataCopyStatus

Indicate status of data copy from / to SDO buffer.

If reading, true indicates, that response has started. If writing, true indicates, that SDO buffer contains only part of data and more data will follow.


The documentation for this struct was generated from the following file: