Wirepas SDK
waps_item.h File Reference

Go to the source code of this file.

Typedefs

typedef void(* waps_pre_tx_cb_f) (waps_item_t *)
 
typedef void(* waps_post_tx_cb_f) (waps_item_t *)
 
typedef void(* waps_free_item_threshold_cb_t) (void)
 

Functions

__STATIC_INLINE void Waps_item_init (waps_item_t *item, uint8_t func, uint8_t len)
 Initialize common frame fields.
 
void Waps_itemInit (waps_free_item_threshold_cb_t thresold_cb, uint8_t thresold_percent)
 Initialize dynamic item bank.
 
waps_item_tWaps_itemReserve (waps_item_type_e type)
 Reserve item from item bank.
 
void Waps_itemFree (waps_item_t *item)
 Free item for item bank.
 

Data Structures

struct  waps_item_t
 

Enumerations

enum  waps_item_type_e { WAPS_ITEM_TYPE_REQUEST , WAPS_ITEM_TYPE_INDICATION }
 

Typedef Documentation

◆ waps_free_item_threshold_cb_t

typedef void(* waps_free_item_threshold_cb_t) (void)

Callback to be called when the defined thershold of free buffer is reached

Definition at line 32 of file waps_item.h.

◆ waps_post_tx_cb_f

typedef void(* waps_post_tx_cb_f) (waps_item_t *)

Callback for performing operations after successfully sending the frame

Definition at line 29 of file waps_item.h.

◆ waps_pre_tx_cb_f

typedef void(* waps_pre_tx_cb_f) (waps_item_t *)

Callback for preprocessing the frame just before attempting sending.

Definition at line 26 of file waps_item.h.

Function Documentation

◆ Waps_item_init()

__STATIC_INLINE void Waps_item_init ( waps_item_t item,
uint8_t  func,
uint8_t  len 
)

Initialize common frame fields.

Parameters
itemPointer to the item to initialize
funcFunction code to set
lenLength to set.

Definition at line 57 of file waps_item.h.

60{
61 if (item != NULL)
62 {
63 item->pre_cb = NULL;
64 item->post_cb = NULL;
65 item->frame.sfunc = func;
66 item->frame.splen = len;
67 }
68}
waps_pre_tx_cb_f pre_cb
Definition waps_item.h:39
waps_post_tx_cb_f post_cb
Definition waps_item.h:40
waps_frame_t frame
Definition waps_item.h:42
uint8_t splen
Definition waps_frames.h:71
uint8_t sfunc
Definition waps_frames.h:67

◆ Waps_itemFree()

void Waps_itemFree ( waps_item_t item)

Free item for item bank.

Parameters
itemItem to free

◆ Waps_itemInit()

void Waps_itemInit ( waps_free_item_threshold_cb_t  thresold_cb,
uint8_t  thresold_percent 
)

Initialize dynamic item bank.

◆ Waps_itemReserve()

waps_item_t * Waps_itemReserve ( waps_item_type_e  type)

Reserve item from item bank.

Parameters
typeType of item reserved
Returns
item or NIL if no free items

Enumeration Type Documentation

◆ waps_item_type_e

Types of buffers: requests and indications

Enumerator
WAPS_ITEM_TYPE_REQUEST 

Item is a request from lower layer

WAPS_ITEM_TYPE_INDICATION 

Item is an indication from upper layer

Definition at line 16 of file waps_item.h.

17{
waps_item_type_e
Definition waps_item.h:17
@ WAPS_ITEM_TYPE_INDICATION
Definition waps_item.h:19
@ WAPS_ITEM_TYPE_REQUEST
Definition waps_item.h:18