| ECC1C 145-944-00

Public Types | Public Member Functions | List of all members
Serial

## Public Types
enum | EscapeCodes
typedef CArg0< uint8 > | AcceptedType
typedef Binder::CArg0< Binder::Buffer > | Command

## Public Member Functions
void | setReceiveMode (bool simple)
Error | receive (const uint8 c)
Error | simpleReceive (const uint8 serialChar)
uint8 | GetSimpleCommandIdx (void)
Error | sendAnswer (const char *buffer, const size_t len)
Public Member Functions inherited from Binder
virtual Error | process (const Arguments &args)=0
template<typename T >
Error | operator() (T &t)
template<typename T >
Error | operator() (const T &t)

## Detailed Description

The serial interface mapping class. Since this system is based on a microcontroller, the serial interface is very limited.

## Member Typedef Documentation

## ◆ AcceptedType

typedef CArg0<uint8> AcceptedType

The accepted argument type for the binder class

## ◆ Command

typedef Binder::CArg0<Binder::Buffer> Command

The processCommand's and sendAnswer's expected arguments type

## Member Enumeration Documentation

## ◆ EscapeCodes

enum EscapeCodes

The escape code used in this system

Enumerator
DELIMITER | The delimiter character that should never appear anywhere in the stream.
ESCAPE | The escape code that's followed by either 5E or 5D depending on the byte to emit.

## Member Function Documentation

## ◆ GetSimpleCommandIdx()

uint8 GetSimpleCommandIdx | ( | void |  | ) |
| inline

Escape answer to fit the protocol escape codes and send it. Since this can happens anytime, we can't use the same FIFO as used for receiving, since an interrupt might break it.

## ◆ receive()

Error receive | ( | const uint8 | c | ) |

The data receiving implementation

References DELIMITER, and ESCAPE.

Referenced by setReceiveMode().

## ◆ sendAnswer()

Error sendAnswer | ( | const char * | buffer,
|  | const size_t | len
| ) |  |
| inline

Shortcut

References sendAnswer().

Referenced by sendAnswer().

## ◆ setReceiveMode()

void setReceiveMode | ( | bool | simple | ) |

Set the current receiving mode

References receive(), and simpleReceive().

## ◆ simpleReceive()

Error simpleReceive | ( | const uint8 | serialChar | ) |

The simple receive function

Referenced by setReceiveMode().