CANopenNode
CANopen protocol stack
Loading...
Searching...
No Matches
CO_gateway_ascii.h File Reference

CANopen access from other networks - ASCII mapping (CiA 309-3 DS v3.0.0) More...

#include "301/CO_driver.h"
#include "301/CO_fifo.h"
#include "301/CO_SDOclient.h"
#include "301/CO_NMT_Heartbeat.h"
#include "305/CO_LSSmaster.h"
#include "303/CO_LEDs.h"
+ Include dependency graph for CO_gateway_ascii.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CO_GTWA_t
 CANopen Gateway-ascii object. More...
 

Macros

#define CO_GTWA_RESP_BUF_SIZE   200U
 Size of response string buffer.
 
#define CO_GTWA_STATE_TIMEOUT_TIME_US   1200000U
 Timeout time in microseconds for some internal states.
 

Enumerations

enum  CO_GTWA_respErrorCode_t {
  CO_GTWA_respErrorNone = 0 , CO_GTWA_respErrorReqNotSupported = 100 , CO_GTWA_respErrorSyntax = 101 , CO_GTWA_respErrorInternalState = 102 ,
  CO_GTWA_respErrorTimeOut = 103 , CO_GTWA_respErrorNoDefaultNetSet = 104 , CO_GTWA_respErrorNoDefaultNodeSet = 105 , CO_GTWA_respErrorUnsupportedNet = 106 ,
  CO_GTWA_respErrorUnsupportedNode = 107 , CO_GTWA_respErrorLostGuardingMessage = 200 , CO_GTWA_respErrorLostConnection = 201 , CO_GTWA_respErrorHeartbeatStarted = 202 ,
  CO_GTWA_respErrorHeartbeatLost = 203 , CO_GTWA_respErrorWrongNMTstate = 204 , CO_GTWA_respErrorBootUp = 205 , CO_GTWA_respErrorErrorPassive = 300 ,
  CO_GTWA_respErrorBusOff = 301 , CO_GTWA_respErrorCANbufferOverflow = 303 , CO_GTWA_respErrorCANinit = 304 , CO_GTWA_respErrorCANactive = 305 ,
  CO_GTWA_respErrorPDOalreadyUsed = 400 , CO_GTWA_respErrorPDOlengthExceeded = 401 , CO_GTWA_respErrorLSSmanufacturer = 501 , CO_GTWA_respErrorLSSnodeIdNotSupported = 502 ,
  CO_GTWA_respErrorLSSbitRateNotSupported = 503 , CO_GTWA_respErrorLSSparameterStoringFailed = 504 , CO_GTWA_respErrorLSSmediaError = 505 , CO_GTWA_respErrorRunningOutOfMemory = 600
}
 Response error codes as specified by CiA 309-3. More...
 
enum  CO_GTWA_state_t {
  CO_GTWA_ST_IDLE = 0x00U , CO_GTWA_ST_READ = 0x10U , CO_GTWA_ST_WRITE = 0x11U , CO_GTWA_ST_WRITE_ABORTED = 0x12U ,
  CO_GTWA_ST_LSS_SWITCH_GLOB = 0x20U , CO_GTWA_ST_LSS_SWITCH_SEL = 0x21U , CO_GTWA_ST_LSS_SET_NODE = 0x22U , CO_GTWA_ST_LSS_CONF_BITRATE = 0x23U ,
  CO_GTWA_ST_LSS_STORE = 0x24U , CO_GTWA_ST_LSS_INQUIRE = 0x25U , CO_GTWA_ST_LSS_INQUIRE_ADDR_ALL = 0x26U , CO_GTWA_ST__LSS_FASTSCAN = 0x30U ,
  CO_GTWA_ST_LSS_ALLNODES = 0x31U , CO_GTWA_ST_LOG = 0x80U , CO_GTWA_ST_HELP = 0x81U , CO_GTWA_ST_LED = 0x82U
}
 Internal states of the Gateway-ascii state machine. More...
 

Functions

CO_ReturnError_t CO_GTWA_init (CO_GTWA_t *gtwa, CO_SDOclient_t *SDO_C, uint16_t SDOclientTimeoutTime_ms, bool_t SDOclientBlockTransfer, CO_NMT_t *NMT, CO_LSSmaster_t *LSSmaster, CO_LEDs_t *LEDs, uint8_t dummy)
 Initialize Gateway-ascii object.
 
void CO_GTWA_initRead (CO_GTWA_t *gtwa, size_t(*readCallback)(void *object, const char *buf, size_t count, uint8_t *connectionOK), void *readCallbackObject)
 Initialize read callback in Gateway-ascii object.
 
static size_t CO_GTWA_write_getSpace (CO_GTWA_t *gtwa)
 Get free write buffer space.
 
static size_t CO_GTWA_write (CO_GTWA_t *gtwa, const char *buf, size_t count)
 Write command into CO_GTWA_t object.
 
void CO_GTWA_log_print (CO_GTWA_t *gtwa, const char *message)
 Print message log string into fifo buffer.
 
void CO_GTWA_process (CO_GTWA_t *gtwa, bool_t enable, uint32_t timeDifference_us, uint32_t *timerNext_us)
 Process Gateway-ascii object.
 

Detailed Description

CANopen access from other networks - ASCII mapping (CiA 309-3 DS v3.0.0)

Author
Janez Paternoster
Martin Wagner

This file is part of https://github.com/CANopenNode/CANopenNode, a CANopen Stack.

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.