Alex exoskeleton
ALEX SoftwareDocumentation
|
#include <CO_driver.h>
#include "CO_SDO.h"
Go to the source code of this file.
Classes | |
struct | dataType_t |
Data types structure - Defined in CANOpen Code. More... | |
Enumerations | |
enum | respErrorCode_t { respErrorNone = 0, respErrorReqNotSupported = 100, respErrorSyntax = 101, respErrorInternalState = 102, respErrorNoDefaultNodeSet = 105, respErrorUnsupportedNet = 106, respErrorUnsupportedNode = 107 } |
Functions | |
int | dtpHex (char *strout, int stroutSize, char *bufSdo, int bufLen) |
int | dtsHex (char *bufSdo, int bufSdoSize, char *strin) |
char * | getTok (char *initStr, const char *delim, int *err) |
void | lastTok (char *initStr, const char *delim, int *err) |
uint32_t | getU32 (char *token, uint32_t min, uint32_t max, int *err) |
int32_t | getI32 (char *token, int32_t min, int32_t max, int *err) |
uint64_t | getU64 (char *token, uint64_t min, uint64_t max, int *err) |
int64_t | getI64 (char *token, int64_t min, int64_t max, int *err) |
float32_t | getR32 (char *token, int *err) |
float64_t | getR64 (char *token, int *err) |
const dataType_t * | getDataType (char *token, int *err) |
Variables | |
const char | spaceDelim [] |
Command interface for CANopenSocket - ASCII helper functions.
This file is part of CANopenSocket, a Linux implementation of CANopen stack with master functionality. Project home page is https://github.com/CANopenNode/CANopenSocket. CANopenSocket is based on CANopenNode: https://github.com/CANopenNode/CANopenNode.
CANopenSocket is free and open source software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file CO_comm_helpers.h.
enum respErrorCode_t |
Response errors as specified by CiA 309-3.
Enumerator | |
---|---|
respErrorNone | |
respErrorReqNotSupported | |
respErrorSyntax | |
respErrorInternalState | |
respErrorNoDefaultNodeSet | |
respErrorUnsupportedNet | |
respErrorUnsupportedNode |
Definition at line 38 of file CO_comm_helpers.h.
int dtpHex | ( | char * | strout, |
int | stroutSize, | ||
char * | bufSdo, | ||
int | bufLen | ||
) |
Data type print function.
Functions writes binary data from bufSdo to strout (with sprintf). dtpHex outputs in hex format (two hex digits, space separated). There are other dtp functions inside dataTypes[] array.
strout | Output string. |
bufSdo | Input binary data. |
bufLen | Size of input binary data. |
Definition at line 44 of file CO_comm_helpers.c.
int dtsHex | ( | char * | bufSdo, |
int | bufSdoSize, | ||
char * | strin | ||
) |
Data type scan function.
Functions scans input string string and writes binary data to bufSdo. dtsHex scans from hex format (two hex digits, space separated). There are other dts functions inside dataTypes[] array.
bufSdo | Output binary data. |
strin | Input string. |
Definition at line 110 of file CO_comm_helpers.c.
const dataType_t* getDataType | ( | char * | token, |
int * | err | ||
) |
Get data type from token.
Token must exactly match one of the 'syntax' from dataTypes[].
token | Input string. |
err | Input and returning parameter sets to true in case of error. If err is already true, function returns 0 immediately. |
Definition at line 385 of file CO_comm_helpers.c.
int32_t getI32 | ( | char * | token, |
int32_t | min, | ||
int32_t | max, | ||
int * | err | ||
) |
Definition at line 290 of file CO_comm_helpers.c.
int64_t getI64 | ( | char * | token, |
int64_t | min, | ||
int64_t | max, | ||
int * | err | ||
) |
Definition at line 328 of file CO_comm_helpers.c.
float32_t getR32 | ( | char * | token, |
int * | err | ||
) |
Definition at line 347 of file CO_comm_helpers.c.
float64_t getR64 | ( | char * | token, |
int * | err | ||
) |
Definition at line 366 of file CO_comm_helpers.c.
char* getTok | ( | char * | initStr, |
const char * | delim, | ||
int * | err | ||
) |
Get token from currently parsing string.
Function calls thread safe strtok_r function and returns token. getTok itself may be used from one thread only.
initStr | Same as first argument to strtok_r. |
delim | Same as second argument to strtok_r. |
err | Input and returning parameter sets to true in case of error. If err is already true, function returns NULL immediately. |
Definition at line 241 of file CO_comm_helpers.c.
Get number from token.
Token must contain no other characters and number must be inside limits.
token | Input string. |
min | Minimum value for the output number. |
max | Maximum value for the output number. |
err | Input and returning parameter sets to true in case of error. If err is already true, function returns 0 immediately. |
Definition at line 271 of file CO_comm_helpers.c.
uint64_t getU64 | ( | char * | token, |
uint64_t | min, | ||
uint64_t | max, | ||
int * | err | ||
) |
Definition at line 309 of file CO_comm_helpers.c.
void lastTok | ( | char * | initStr, |
const char * | delim, | ||
int * | err | ||
) |
Verify, if there are no more tokens.
Function calls getTok and if there is another token and that token doesn't start with '#', it sets err to 1. (Comments are ignored.)
initStr | Same as in getTok. |
delim | Same as in getTok. |
err | Same as in getTok. |
Definition at line 257 of file CO_comm_helpers.c.
const char spaceDelim[] |
Definition at line 36 of file CO_comm_helpers.c.