Tiny protocol
0.9.0
Tiny communication protocol for microcontrollers
|
Classes | |
struct | tiny_fd_init_t_ |
class | Tiny::IProtoFd |
Typedefs | |
typedef struct tiny_fd_data_t * | tiny_fd_handle_t |
typedef struct tiny_fd_init_t_ | tiny_fd_init_t |
Functions | |
int | tiny_fd_init (tiny_fd_handle_t *handle, tiny_fd_init_t *init) |
Initialized communication for Tiny Full Duplex protocol. More... | |
void | tiny_fd_close (tiny_fd_handle_t handle) |
stops Tiny Full Duplex state machine More... | |
int | tiny_fd_run_tx (tiny_fd_handle_t handle, uint16_t timeout) |
runs tx processing for specified period of time. More... | |
int | tiny_fd_run_rx (tiny_fd_handle_t handle, uint16_t timeout) |
runs rx processing for specified period of time. More... | |
int | tiny_fd_send (tiny_fd_handle_t handle, const void *buf, int len) |
Sends userdata over full-duplex protocol. More... | |
int | tiny_fd_buffer_size_by_mtu (int mtu, int max_tx_frames) |
typedef struct tiny_fd_data_t* tiny_fd_handle_t |
This handle points to service data, required for full-duplex functioning.
typedef struct tiny_fd_init_t_ tiny_fd_init_t |
This structure is used for initialization of Tiny Full Duplex protocol.
int tiny_fd_buffer_size_by_mtu | ( | int | mtu, |
int | max_tx_frames | ||
) |
Returns minimum required buffer size for specified parameters.
mtu | size of desired user payload in bytes. |
max_tx_frames | maximum tx queue size of I-frames. |
void tiny_fd_close | ( | tiny_fd_handle_t | handle | ) |
stops Tiny Full Duplex state machine
stops Tiny Full Duplex state machine.
handle | handle of full-duplex protocol |
int tiny_fd_init | ( | tiny_fd_handle_t * | handle, |
tiny_fd_init_t * | init | ||
) |
Initialized communication for Tiny Full Duplex protocol.
The function initializes internal structures for Tiny Full Duplex state machine.
handle | - pointer to Tiny Full Duplex data |
init | - pointer to tiny_fd_init_t data. |
int tiny_fd_run_rx | ( | tiny_fd_handle_t | handle, |
uint16_t | timeout | ||
) |
runs rx processing for specified period of time.
Runs rx processing for specified period of time. After timeout happens, the function returns. If you need it to run in non-blocking mode, please using timeout 0 ms.
handle | handle of full-duplex protocol |
timeout | maximum timeout in milliseconds to perform rx operations |
int tiny_fd_run_tx | ( | tiny_fd_handle_t | handle, |
uint16_t | timeout | ||
) |
runs tx processing for specified period of time.
Runs tx processing for specified period of time. After timeout happens, the function returns. If you need it to run in non-blocking mode, please use timeout 0 ms.
handle | handle of full-duplex protocol |
timeout | maximum timeout in milliseconds to perform tx operations |
int tiny_fd_send | ( | tiny_fd_handle_t | handle, |
const void * | buf, | ||
int | len | ||
) |
Sends userdata over full-duplex protocol.
Sends userdata over full-duplex protocol. Note, that this command will return success, when data are copied to internal queue. That doesn't mean that data physically sent, but they are enqueued for sending.
When timeout happens, the data were not actually enqueued. Call this function once again. If TINY_ERR_DATA_TOO_LARGE is returned, try to send less data. If you don't want to care about data size, please, use different function tiny_fd_write()..
handle | pointer to tiny_fd_handle_t |
buf | data to send |
len | length of data to send |