Commanders
Arduino buttons/bus library
TextInterpreter Class Reference

#include "TextInterpreter.hpp"

Public Member Functions

 TextInterpreter ()
 
void Init ()
 
unsigned long SendChar (char inCharacter)
 
unsigned long SendString (char *inpString)
 

Detailed Description

This class 'interprets' a string and send an event when found.

The accepted syntax is

id separator event separator data

where id can be a number from 0 to 4 000 000 000, where separator can be ',' , ';' , '/' or ' ' where event can be any string of 9 characters long maximum, but must begin with (case insensitive)

id can be dccid:dccacc for Dcc id, where dccid is the dcc address and dccacc 0 or 1.

  • ex : 123 means ID 123 toggled
  • ex : 456 | T means ID 456 toggled
  • ex : 789 , p , 100 means ID 789 make an absolute movement to 100 .
  • ex : 20:0 T means Dcc id 20/0 toggled

Definition at line 45 of file TextInterpreter.hpp.

Constructor & Destructor Documentation

TextInterpreter::TextInterpreter ( )

Default constructor.

Definition at line 4 of file TextInterpreter.cpp.

Member Function Documentation

void TextInterpreter::Init ( )

Initialize internal data.

Definition at line 9 of file TextInterpreter.cpp.

unsigned long TextInterpreter::SendChar ( char  inCharacter)

Send a new character to the class.

Returns
Id if an event was found, or UNDEFINED_ID.

Definition at line 19 of file TextInterpreter.cpp.

unsigned long TextInterpreter::SendString ( char *  inpString)

Send a full string to the class.

Returns
Id if an event was found, or UNDEFINED_ID.

Definition at line 178 of file TextInterpreter.cpp.


The documentation for this class was generated from the following files: