Tiny protocol
0.7.0
Tiny communication protocol for microcontrollers
|
Classes | |
struct | STinyLightData |
Functions | |
int | tiny_light_init (void *handle, write_block_cb_t write_func, read_block_cb_t read_func, void *pdata) |
int | tiny_light_close (void *handle) |
int | tiny_light_send (void *handle, const uint8_t *pbuf, int len) |
sends frame with user payload to communication channel in blocking mode More... | |
int | tiny_light_read (void *handle, uint8_t *pbuf, int len) |
reads frame from the channel in blocking mode. More... | |
int tiny_light_close | ( | void * | handle | ) |
The function closes channel.
handle | - pointer to Tiny Light data. |
int tiny_light_init | ( | void * | handle, |
write_block_cb_t | write_func, | ||
read_block_cb_t | read_func, | ||
void * | pdata | ||
) |
The function initializes internal structures for Tiny channel and return handle to be used with all Tiny and IPC functions.
handle | - pointer to Tiny Light data |
write_func | - pointer to write data function (to communication channel). |
read_func | - pointer to read function (from communication channel). read_func is not required and should be NULL, if event-based API of Tiny Protocol is used. |
pdata | - pointer to a user private data. This pointer is passed to write_func/read_func. |
int tiny_light_read | ( | void * | handle, |
uint8_t * | pbuf, | ||
int | len | ||
) |
reads frame from the channel in blocking mode.
The function reads user data from communication channel
handle | - pointer to Tiny Light data. |
pbuf | a const pointer to unsigned char - buffer with data to send |
len | an integer argument - length of data to send |
int tiny_light_send | ( | void * | handle, |
const uint8_t * | pbuf, | ||
int | len | ||
) |
sends frame with user payload to communication channel in blocking mode
The function sends data to communication channel. The function works in blocking mode, i.e. it returns control only if user data are successfully sent, or in case of error.
handle | - pointer to Tiny Light data. |
pbuf | - a const pointer to unsigned char - buffer with data to send |
len | - an integer argument - length of data to send |