Wirepas SDK
poslib_event.h File Reference

Header file for the poslib_event.c. More...

Detailed Description

Header file for the poslib_event.c.

Definition in file poslib_event.h.

Go to the source code of this file.

Functions

bool PosLibEvent_add (poslib_internal_event_type_e type)
 
poslib_ret_e PosLibEvent_register (poslib_events_e event, poslib_events_listen_info_f cb, uint8_t *id)
 Register an PosLib event subscriber for. More...
 
void PosLibEvent_deregister (uint8_t id)
 Deregister the PosLib event subscriber id. More...
 

Data Structures

struct  poslib_internal_event_t
 

Enumerations

enum  poslib_internal_event_type_e {
  POSLIB_CTRL_EVENT_NONE = 0, POSLIB_CTRL_EVENT_SCAN_STARTED = 1, POSLIB_CTRL_EVENT_SCAN_END = 2, POSLIB_CTRL_EVENT_ONLINE = 3,
  POSLIB_CTRL_EVENT_OFFLINE = 4, POSLIB_CTRL_EVENT_APPCFG = 5, POSLIB_CTRL_EVENT_TIMEOUT = 6, POSLIB_CTRL_EVENT_DATA_SENT = 7,
  POSLIB_CTRL_EVENT_ONESHOT = 8, POSLIB_CTRL_EVENT_CONFIG_CHANGE = 9, POSLIB_CTRL_EVENT_ROUTE_CHANGE = 10, POSLIB_CTRL_EVENT_UPDATE_START = 11,
  POSLIB_CTRL_EVENT_UPDATE_END = 12, POSLIB_CTRL_EVENT_OUTSIDE_WM = 13, POSLIB_CTRL_EVENT_UNDER_WM = 14, POSLIB_CTRL_EVENT_MOTION = 15,
  POSLIB_CTRL_EVENT_BLE_START = 16, POSLIB_CTRL_EVENT_BLE_STOP = 17, POSLIB_CTRL_EVENT_LED_ON = 18, POSLIB_CTRL_EVENT_LED_OFF = 19
}
 

Macros

#define MAX_INTERNAL_EVENTS   16
 

Function Documentation

◆ PosLibEvent_add()

bool PosLibEvent_add ( poslib_internal_event_type_e  type)

◆ PosLibEvent_deregister()

void PosLibEvent_deregister ( uint8_t  id)

Deregister the PosLib event subscriber id.

Parameters
idthe subscriber ID
Returns
void

◆ PosLibEvent_register()

poslib_ret_e PosLibEvent_register ( poslib_events_e  event,
poslib_events_listen_info_f  cb,
uint8_t *  id 
)

Register an PosLib event subscriber for.

Parameters
eventEvents of interest (type of poslib_events_e)
cbCallback to be called (type poslib_events_listen_info_f)
idReturned subscriber ID
Returns
POS_RET_OK is succesful / POS_RET_EVENT_ERROR if failed

Data Structure Documentation

◆ poslib_internal_event_t

struct poslib_internal_event_t

Definition at line 57 of file poslib_event.h.

Data Fields
sl_list_t list
poslib_internal_event_type_e type

Enumeration Type Documentation

◆ poslib_internal_event_type_e

Enumerator
POSLIB_CTRL_EVENT_NONE 

No event Scan started

POSLIB_CTRL_EVENT_SCAN_STARTED 

Scan ended

POSLIB_CTRL_EVENT_SCAN_END 

Stack entered in online mode

POSLIB_CTRL_EVENT_ONLINE 

Stack entered in offline mode

POSLIB_CTRL_EVENT_OFFLINE 

AppCfg received

POSLIB_CTRL_EVENT_APPCFG 

Timeout occured while waiting for an event

POSLIB_CTRL_EVENT_TIMEOUT 

Measurement data sent

POSLIB_CTRL_EVENT_DATA_SENT 

Oneshot update requested

POSLIB_CTRL_EVENT_ONESHOT 

Configuration changed

POSLIB_CTRL_EVENT_CONFIG_CHANGE 

Stack route changed

POSLIB_CTRL_EVENT_ROUTE_CHANGE 

Update started

POSLIB_CTRL_EVENT_UPDATE_START 

Update ended

POSLIB_CTRL_EVENT_UPDATE_END 

Node is outside WM coverage

POSLIB_CTRL_EVENT_OUTSIDE_WM 

Node is under WM coverage

POSLIB_CTRL_EVENT_UNDER_WM 

Motion changed

POSLIB_CTRL_EVENT_MOTION 

BLE start

POSLIB_CTRL_EVENT_BLE_START 

BLE stop

POSLIB_CTRL_EVENT_BLE_STOP 

LED on event

POSLIB_CTRL_EVENT_LED_ON 

LED off event

POSLIB_CTRL_EVENT_LED_OFF 

Definition at line 14 of file poslib_event.h.

Macro Definition Documentation

◆ MAX_INTERNAL_EVENTS

#define MAX_INTERNAL_EVENTS   16

Definition at line 12 of file poslib_event.h.

POSLIB_CTRL_EVENT_OUTSIDE_WM
@ POSLIB_CTRL_EVENT_OUTSIDE_WM
Definition: poslib_event.h:42
POSLIB_CTRL_EVENT_DATA_SENT
@ POSLIB_CTRL_EVENT_DATA_SENT
Definition: poslib_event.h:30
POSLIB_CTRL_EVENT_ONLINE
@ POSLIB_CTRL_EVENT_ONLINE
Definition: poslib_event.h:22
POSLIB_CTRL_EVENT_TIMEOUT
@ POSLIB_CTRL_EVENT_TIMEOUT
Definition: poslib_event.h:28
POSLIB_CTRL_EVENT_OFFLINE
@ POSLIB_CTRL_EVENT_OFFLINE
Definition: poslib_event.h:24
POSLIB_CTRL_EVENT_SCAN_STARTED
@ POSLIB_CTRL_EVENT_SCAN_STARTED
Definition: poslib_event.h:18
POSLIB_CTRL_EVENT_NONE
@ POSLIB_CTRL_EVENT_NONE
Definition: poslib_event.h:16
POSLIB_CTRL_EVENT_CONFIG_CHANGE
@ POSLIB_CTRL_EVENT_CONFIG_CHANGE
Definition: poslib_event.h:34
POSLIB_CTRL_EVENT_UPDATE_END
@ POSLIB_CTRL_EVENT_UPDATE_END
Definition: poslib_event.h:40
POSLIB_CTRL_EVENT_LED_OFF
@ POSLIB_CTRL_EVENT_LED_OFF
Definition: poslib_event.h:54
POSLIB_CTRL_EVENT_BLE_START
@ POSLIB_CTRL_EVENT_BLE_START
Definition: poslib_event.h:48
poslib_internal_event_type_e
poslib_internal_event_type_e
Definition: poslib_event.h:14
POSLIB_CTRL_EVENT_APPCFG
@ POSLIB_CTRL_EVENT_APPCFG
Definition: poslib_event.h:26
POSLIB_CTRL_EVENT_ONESHOT
@ POSLIB_CTRL_EVENT_ONESHOT
Definition: poslib_event.h:32
POSLIB_CTRL_EVENT_SCAN_END
@ POSLIB_CTRL_EVENT_SCAN_END
Definition: poslib_event.h:20
POSLIB_CTRL_EVENT_ROUTE_CHANGE
@ POSLIB_CTRL_EVENT_ROUTE_CHANGE
Definition: poslib_event.h:36
POSLIB_CTRL_EVENT_LED_ON
@ POSLIB_CTRL_EVENT_LED_ON
Definition: poslib_event.h:52
POSLIB_CTRL_EVENT_BLE_STOP
@ POSLIB_CTRL_EVENT_BLE_STOP
Definition: poslib_event.h:50
POSLIB_CTRL_EVENT_MOTION
@ POSLIB_CTRL_EVENT_MOTION
Definition: poslib_event.h:46
POSLIB_CTRL_EVENT_UPDATE_START
@ POSLIB_CTRL_EVENT_UPDATE_START
Definition: poslib_event.h:38
POSLIB_CTRL_EVENT_UNDER_WM
@ POSLIB_CTRL_EVENT_UNDER_WM
Definition: poslib_event.h:44