![]() |
TCode Library
A library to aid in decoding/using of Toy Code ("T-Code") data.
|
Wrapper for parsing commands from TCode. More...
#include <TCodeParser.h>
Static Public Member Functions | |
static char | toupper (const char value) |
Converts Lowecase Ascii to Uppercase. | |
static bool | isnumber (const char value) |
Checks if the inputed ascii char is a number. | |
static bool | isextention (const char value) |
Checks if an inputted char is one used for an extention Command in the decoding of TCode. | |
static bool | isramp (const char value) |
Checks if an inputted char is one used for an ramp Command in the decoding of TCode. | |
static long | getNextInt (unsigned char *buffer, const size_t length, size_t &index) |
In a string at the index pointed to by the index paramater gets the Integer contained at and after incrementing the index value. | |
static char | getCharAt (unsigned char *buffer, const size_t length, size_t index) |
Gets the char at an index in an inputted buffer. | |
static size_t | uintToStr (unsigned long value, unsigned char *buffer, const size_t length, size_t &placeIndex) |
Puts a converted int to string into a buffer. | |
static bool | idValidRange (const TCode_Channel_Type type, const uint8_t channel, const uint8_t maxChannel) |
Checks if the given ID is in a valid range compared to a max channel input. | |
static bool | idValidRange (const TCode_ChannelID id, const uint8_t maxChannel) |
Checks if the given id is in a valid range compared to a max channel input. | |
static bool | idValid (const TCode_Channel_Type type, const uint8_t channel) |
Checks if the inputted type and channel number are valid. | |
static bool | idValid (const TCode_ChannelID id) |
Checks if the inputted type and channel number are valid. | |
static int | getStrfromID (unsigned char *buffer, const size_t length, const TCode_ChannelID &id) |
For a given ID returns the string representation of the ID. | |
static void | getStrfromID (const TCode_ChannelID &id, String &out) |
For a given ID returns the string representation of the ID. | |
static TCode_ChannelID | constructID (const TCode_Channel_Type type, const uint8_t channel) |
Takes a channel type and channel number and creates a Channel ID. | |
static TCode_Axis_Extention_Type | getExtentionTypeFromStr (unsigned char *buffer, const size_t length, size_t &startIndex) |
Gets the Extention type from a string at the index specified. | |
static TCode_Axis_Ramp_Type | getRampTypeFromStr (unsigned char *buffer, const size_t length, size_t &startIndex) |
Gets the Ramp type from a string at the index specified. | |
static TCode_ChannelID | getIDFromStr (unsigned char *buffer, const size_t length, size_t &startIndex) |
Gets the ID from an inputted string from a given index. | |
static TCode_Command_Type | getCommandType (unsigned char *buffer, const size_t length, size_t startIndex) |
Returns the type of command provided by the input string. | |
static bool | parseAxisCommand (unsigned char *buffer, const size_t length, TCode_Axis_Command &out) |
Parses an Axis Command. | |
static bool | parseDeviceCommand (unsigned char *buffer, const size_t length, TCode_Device_Command &out) |
Parses a Device Command. | |
static bool | parseSetupCommand (unsigned char *buffer, const size_t length, TCode_Setup_Command &out) |
Parses a Setup Command. | |
static bool | parseExternalCommand (unsigned char *buffer, const size_t length, TCode_External_Command &out) |
Parses an External Command. | |
Wrapper for parsing commands from TCode.
Definition at line 15 of file TCodeParser.h.
|
static |
Takes a channel type and channel number and creates a Channel ID.
type | the TCode Channel Type |
channel | the Channel number |
Definition at line 88 of file TCodeParser.cpp.
|
inlinestatic |
Gets the char at an index in an inputted buffer.
buffer | pointer to buffer to be processed |
length | length of buffer |
index | index to get char from |
Definition at line 126 of file TCodeParser.h.
|
static |
Returns the type of command provided by the input string.
buffer | string to be processed |
length | length of buffer |
Definition at line 167 of file TCodeParser.cpp.
|
static |
Gets the Extention type from a string at the index specified.
buffer | string to be processed |
length | length of buffer |
startIndex | starting index of the char to be processed |
Definition at line 93 of file TCodeParser.cpp.
|
static |
Gets the ID from an inputted string from a given index.
buffer | string to be processed |
length | length of buffer |
startIndex | starting index of the char to be processed |
Definition at line 142 of file TCodeParser.cpp.
|
inlinestatic |
In a string at the index pointed to by the index paramater gets the Integer contained at and after incrementing the index value.
buffer | string to be processed |
length | length of buffer |
index | the index pointing to a position in the string |
Definition at line 95 of file TCodeParser.h.
|
static |
Gets the Ramp type from a string at the index specified.
buffer | string to be processed |
length | length of buffer |
startIndex | starting index of the char to be processed |
Definition at line 107 of file TCodeParser.cpp.
|
static |
For a given ID returns the string representation of the ID.
id | Is the combined form of TCode_Channel_Type and the channel number |
out | The Output String |
Definition at line 75 of file TCodeParser.cpp.
|
static |
For a given ID returns the string representation of the ID.
buffer | output buffer |
length | length of buffer |
id | Is the combined form of TCode_Channel_Type and the channel number |
Definition at line 49 of file TCodeParser.cpp.
|
static |
Checks if the inputted type and channel number are valid.
type | the TCode Channel Type |
channel | the Channel number |
Definition at line 39 of file TCodeParser.cpp.
|
static |
Checks if the inputted type and channel number are valid.
id | Is the combined form of TCode_Channel_Type and the channel number |
Definition at line 44 of file TCodeParser.cpp.
|
static |
Checks if the given ID is in a valid range compared to a max channel input.
type | The channel type Linear,Rotation,Vibration,Auxiliary |
channel | The channel number if the ID |
maxChannel | the max channel to check against |
Definition at line 9 of file TCodeParser.cpp.
|
static |
Checks if the given id is in a valid range compared to a max channel input.
id | The ID to check |
maxChannel | the max channel to check against |
Definition at line 34 of file TCodeParser.cpp.
|
inlinestatic |
Checks if an inputted char is one used for an extention Command in the decoding of TCode.
value | is the char value which needs checking |
Definition at line 58 of file TCodeParser.h.
|
inlinestatic |
Checks if the inputed ascii char is a number.
value | is the char value which needs checking |
Definition at line 33 of file TCodeParser.h.
|
inlinestatic |
Checks if an inputted char is one used for an ramp Command in the decoding of TCode.
value | is the char value which needs checking |
Definition at line 75 of file TCodeParser.h.
|
static |
Parses an Axis Command.
buffer | string to be processed |
length | length of buffer |
out | a TCode Axis command struct so that the command can be executed easier |
Definition at line 190 of file TCodeParser.cpp.
|
static |
Parses a Device Command.
buffer | string to be processed |
length | length of buffer |
out | Command to be outputted to |
Definition at line 281 of file TCodeParser.cpp.
|
static |
Parses an External Command.
buffer | string to be processed |
length | length of buffer |
out | a TCode Setup command struct in a data representation to be processed easier |
Definition at line 268 of file TCodeParser.cpp.
|
static |
Parses a Setup Command.
buffer | string to be processed |
length | length of buffer |
out | a TCode Setup command struct in a data representation to be processed easier |
Definition at line 239 of file TCodeParser.cpp.
|
inlinestatic |
Converts Lowecase Ascii to Uppercase.
value | is the value of the char which needs converting to uppercase |
Definition at line 23 of file TCodeParser.h.
|
inlinestatic |
Puts a converted int to string into a buffer.
value | integer to be converted |
buffer | pointer to buffer where string is going to be put |
length | length of buffer |
placeIndex | index to put the converted int |
Definition at line 141 of file TCodeParser.h.