Wirepas SDK
stack_state.h File Reference

Go to the source code of this file.

Typedefs

typedef void(* stack_state_event_cb_f) (app_lib_stack_event_e event, void *param)
 

Functions

app_res_e Stack_State_init (void)
 Initialize the stack state library. More...
 
app_res_e Stack_State_startStack ()
 Start the stack. More...
 
app_res_e Stack_State_stopStack ()
 Stopt the stack. More...
 
bool Stack_State_isStarted ()
 Is the stack currently started. More...
 
app_res_e Stack_State_addEventCb (stack_state_event_cb_f callback, uint32_t event_bitfield)
 Add a new callback about event callback. More...
 
app_res_e Stack_State_removeEventCb (stack_state_event_cb_f callback)
 Remove an event callback from the list. Removed item fields are all set to 0. More...
 

Macros

#define STACK_STATE_ALL_EVENTS_BITFIELDS   (uint32_t)(-1)
 

Typedef Documentation

◆ stack_state_event_cb_f

typedef void(* stack_state_event_cb_f) (app_lib_stack_event_e event, void *param)

Definition at line 15 of file stack_state.h.

Function Documentation

◆ Stack_State_addEventCb()

app_res_e Stack_State_addEventCb ( stack_state_event_cb_f  callback,
uint32_t  event_bitfield 
)

Add a new callback about event callback.

Parameters
callbackNew callback
event_bitfieldBitfields of event to register. To be notified of event n, bit n must be set For example, to register only for APP_LIB_STATE_STACK_EVENT_SCAN_STARTED and APP_LIB_STATE_STACK_EVENT_SCAN_STOPPED, bit field is as followed: uint32_t bitfield = 1 << APP_LIB_STATE_STACK_EVENT_SCAN_STARTED | 1 << APP_LIB_STATE_STACK_EVENT_SCAN_STOPPED
Returns
APP_RES_OK if ok. See app_res_e for other result codes.

◆ Stack_State_init()

app_res_e Stack_State_init ( void  )

Initialize the stack state library.

Returns
APP_RES_OK.

◆ Stack_State_isStarted()

bool Stack_State_isStarted ( )

Is the stack currently started.

Returns
True if stack is started, False otherwise

◆ Stack_State_removeEventCb()

app_res_e Stack_State_removeEventCb ( stack_state_event_cb_f  callback)

Remove an event callback from the list. Removed item fields are all set to 0.

Parameters
callbackcallback to remove.
Returns
APP_RES_OK if ok. See app_res_e for other result codes.

◆ Stack_State_startStack()

app_res_e Stack_State_startStack ( )

Start the stack.

Returns
Return code of the operation app_res_e
Examples
ble_scanner/app.c.

◆ Stack_State_stopStack()

app_res_e Stack_State_stopStack ( )

Stopt the stack.

Returns
Return code of the operation app_res_e

Macro Definition Documentation

◆ STACK_STATE_ALL_EVENTS_BITFIELDS

#define STACK_STATE_ALL_EVENTS_BITFIELDS   (uint32_t)(-1)

Definition at line 12 of file stack_state.h.