OpenDevice
Open IoT (Internet Of Things) Platform and Framework http://opendevice.io
DeviceConnection Class Reference
Collaboration diagram for DeviceConnection:

Public Member Functions

 DeviceConnection (Stream &serial)
 
virtual void begin (void)
 
void flush (void)
 
virtual bool checkDataAvalible (void)
 
void setStream (Stream *stream)
 
void setDefaultListener (CommandListener)
 
void getBuffer (uint8_t[])
 
void printBuffer ()
 
String readString ()
 
int readInt ()
 
long readLong ()
 
float readFloat ()
 
int readIntValues (int values[], int max)
 
int readLongValues (long values[], int max)
 
int readFloatValues (float values[], int max)
 
virtual void write (uint8_t)
 
virtual void doStart ()
 
virtual void doEnd ()
 
void doToken ()
 
void send (char)
 
void send (const char[])
 
void send (int[], int)
 
void send (long values[], int size)
 
void send (uint8_t)
 
void send (int)
 
void send (unsigned int)
 
void send (long)
 
void send (unsigned long)
 
void send (long, int)
 
void send (double)
 
void send (Command, bool complete=true)
 
template<class T >
void sendCmdArg (T arg)
 
template<class T >
void print (T arg)
 

Static Public Member Functions

static int api_version ()
 

Public Attributes

const char * SEPARATOR_LIST = ";"
 
Stream * conn
 
Command cmd
 

Static Public Attributes

static const uint8_t START_BIT = Command::START_BIT
 
static const uint8_t ACK_BIT = Command::ACK_BIT
 
static const uint8_t SEPARATOR = Command::SEPARATOR
 

Protected Member Functions

virtual void init ()
 
virtual void onMessageReceived (Command)
 
long parseInt ()
 
float parseFloat ()
 
int available ()
 
size_t store (uint8_t byte)
 
void parseCommand (uint8_t type)
 

Protected Attributes

bool processing
 
uint8_t _buffer [DATA_BUFFER]
 
const uint16_t _len = DATA_BUFFER
 
bool _buffer_overflow
 
uint16_t _endOffset
 
volatile uint8_t _readOffset
 

Detailed Description

Implements the application level protocol of the OpenDevice.

Member Function Documentation

◆ print()

template<class T >
void DeviceConnection::print ( arg)
inline

Umanaged send data, must be used with doStart/doToken/doEnd

◆ readIntValues()

int DeviceConnection::readIntValues ( int  values[],
int  max 
)

Can read single value list like: [1,2,3,4] If you need to read two different arrays like: [1,2,3];[5,2,3,4] call the method 'readIntValues' twice


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