Tiny protocol  0.7.0
Tiny communication protocol for microcontrollers
Classes | Macros | Typedefs
tiny_proto_types.h File Reference

Tiny protocol Types. More...

#include <stdint.h>
#include "tiny_defines.h"
Include dependency graph for tiny_proto_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  STinyStats
 

Macros

#define TINY_SUCCESS   (1)
 Tiny operation successful. Only tiny_send_start and tiny_read_start functions return this code.
 
#define TINY_NO_ERROR   (0)
 No error. For tiny_send and tiny_read functions, this means, no data sent or received.
 
#define TINY_ERR_FAILED   (-1)
 Timeout.
 
#define TINY_ERR_TIMEOUT   (-2)
 Timeout happened. The function must be called once again.
 
#define TINY_ERR_DATA_TOO_LARGE   (-3)
 Data too large to fit the user buffer, valid for tiny_read function.
 
#define TINY_ERR_INVALID_DATA   (-4)
 Some invalid data passed to Tiny API function.
 
#define TINY_ERR_BUSY   (-5)
 API function detected that operation cannot be performed right now.
 
#define TINY_ERR_OUT_OF_SYNC   (-6)
 Out of sync - received some data, which are not part of the frame (tiny_read)
 
#define TINY_ERR_AGAIN   (-7)
 No data for now, need to retry reading once again.
 
#define TINY_FLAG_NO_WAIT   (0)
 This flag makes tiny API functions perform as non-blocking.
 
#define TINY_FLAG_READ_ALL   (1)
 This flag makes tiny_read function to read whole frame event if it doesn't fit the buffer.
 
#define TINY_FLAG_LOCK_SEND   (2)
 Informs advanced API that caller wants to start transmit new frame to the channel.
 
#define TINY_FLAG_WAIT_FOREVER   (0x80)
 This flag makes tiny API functions perform in blocking mode.
 

Typedefs

typedef int(* write_block_cb_t) (void *pdata, const void *buffer, int size)
 
typedef int(* read_block_cb_t) (void *pdata, void *buffer, int size)
 
typedef void(* on_frame_cb_t) (void *handle, uint16_t uid, uint8_t *pdata, int size)
 

Detailed Description

Tiny protocol Types.

This is Tiny protocol implementation for microcontrollers

Typedef Documentation

◆ on_frame_cb_t

typedef void(* on_frame_cb_t) (void *handle, uint16_t uid, uint8_t *pdata, int size)

on_frame_cb_t is a callback function, which is called every time new frame is received, or sent. refer to tiny_set_callbacks

Parameters
handle- handle of Tiny.
uid- UID of the received frame or sent frame (if uids are enabled).
pdata- data received over Tiny Protocol.
size- size of data received.
Returns
None.
See also
tiny_set_callbacks

◆ read_block_cb_t

typedef int(* read_block_cb_t) (void *pdata, void *buffer, int size)

The function reads data from communication channel.

Parameters
pdata- pointer to user private data. - absent in Arduino version
buffer- pointer to a buffer to read data to from the channel.
size- maximum size of the buffer.
See also
write_block_cb_t
Returns
the function must return negative value in case of error or number of bytes actually read or zero.

◆ write_block_cb_t

typedef int(* write_block_cb_t) (void *pdata, const void *buffer, int size)

The function writes data to communication channel port.

Parameters
pdata- pointer to user private data - absent in Arduino version
buffer- pointer to the data to send to channel.
size- size of data to write.
See also
read_block_cb_t
Returns
the function must return negative value in case of error or number of bytes written or zero.