#include <inttypes.h>
#include "net/buffers.h"
Go to the source code of this file.
Data Structures | |
struct | lnk_err_t |
Link layer error statistics. More... | |
Functions | |
void | lnk_init (void) |
Perform initialization of link layer. | |
void | lnk_process (void) |
Process link layer specific tasks. | |
int8_t | lnk_requ (net_buf_t *buf, uint8_t backlog) |
Schedule a packet for sending. | |
uint8_t | lnk_clear_to_send (void) |
Check if link layer is able to process further packets. | |
void | lnk_get_error_stats (struct lnk_err_t *buf) |
Fill a buffer with link layer error statistics. |
This module implements the link layer of the OpenHome protocol stack. Include it in your main module and call lnk_init() for initialization. Also call lnk_process() directly from your main loop. Check net.h for static configuration parameters.
Definition in file link.h.
|
Check if link layer is able to process further packets.
Definition at line 426 of file link.c. References SEND_STAT_IDLE, and send_info_t::status. Referenced by net_clear_to_send(), and net_requ(). |
|
Fill a buffer with link layer error statistics.
|
|
Perform initialization of link layer. This function must be called before any other network functions are called. Definition at line 289 of file link.c. References receive_info_t::crc16, send_info_t::slot, and receive_info_t::slots. |
|
Process link layer specific tasks. Call this function as often as possible from your main loop. It processes link layer specific tasks such as passing received packets to upper layers and scheduling send requests.
Definition at line 317 of file link.c. References send_info_t::backlog, send_info_t::backlog_add, receive_info_t::buf, receive_info_t::crc16, lnk_con(), lnk_ind(), receive_info_t::pos, RECV_STAT_EXAMINE, RECV_STAT_FREE, lnk_err_t::rx_crc, lnk_err_t::rx_len, SEND_STAT_IDLE, SEND_STAT_INFORM, SEND_STAT_WAIT, send_info_t::slot, receive_info_t::slots, receive_info_t::status, and send_info_t::status. |
|
Schedule a packet for sending. This function returns without waiting for the packet to be sent. If the packet is fully transmitted then lnk_con is called.
Definition at line 383 of file link.c. References send_info_t::backlog_add, send_info_t::data, POLY_CRC16, SEND_STAT_IDLE, SEND_STAT_WAIT, send_info_t::slot, and send_info_t::status. Referenced by net_requ(). |