Tiny protocol  0.7.0
Tiny communication protocol for microcontrollers
Tiny Protocol

Table of Contents

This is Tiny protocol implementation for microcontrollers (Arduino, Stellaris).

Introduction

This protocol is intended to be used in low-memory systems, like microcontrollers (Stellaris, Arduino). It is also can be compiled for desktop Linux systems, and it is possible to build it for Windows.

Tiny Protocol API

Linux API supports C-Style functions, while Arduino API supports both C-Style and C++ classes. Usage C++ Arduino classes makes easy use of the protocol for Arduino projects. Please refer to documentation.

Packet Structure

Full packet format:

     8       16       any len    None/8/16/32     8
 |   7E   |  UID  |  USER DATA  |    FCS     |   7E   |

User-defined callbacks

Tiny HDLC protocol API functions needs 3 callback functions, defined by a user (you may use any function names you need).

HDLC callbacks:

int write_func_cb(void *user_data, const void *data, int len);
int on_frame_read(void *user_data, void *data, int len);
int on_frame_sent(void *user_data, const void *data, int len);

All higher level protocols (Tiny light protocol API functions, Tiny Half Duplex API functions) needs 4 callback functions, defined by a user: read_func_cb() is added. The list of callbacks:

int write_func_cb(void *user_data, const void *data, int len);
int read_func_cb(void *user_data, void *data, int len);
int on_frame_read(void *user_data, void *data, int len);
int on_frame_sent(void *user_data, const void *data, int len);

Unlike HDLC implementation, higher level protocols use different approach. They control both TX and RX channels, for example, to transparently send ACK frames, etc. That's why higher level protocols need to read_func_cb to be defined:

Arduino related documentation

Arduino related API (C++)