![]() |
Wirepas SDK
|
Implements global API for Wirepas library services
One can use the libraries individually, or use this interface that binds the libraries to function like macros for convenient (and safe) use
Definition in file api.h.
Go to the source code of this file.
Functions | |
const app_global_functions_t *global_func | __attribute ((weak)) |
bool | API_Open (const app_global_functions_t *functions) |
Open API (open all libraries) | |
Macros | |
#define | ERR_NOT_OPEN APP_RES_INVALID_NULL_POINTER |
#define | Sys_enterCriticalSection() lib_system ? lib_system->enterCriticalSection() : ERR_NOT_OPEN |
#define | Sys_exitCriticalSection() lib_system ? lib_system->exitCriticalSection() : ERR_NOT_OPEN |
#define | Sys_disableDs(_dis) lib_system ? lib_system->disableDeepSleep(_dis) : ERR_NOT_OPEN |
#define | Sys_enableAppIrq(_irqn, _isr) lib_system ? lib_system->enableAppIrq(false, _irqn, APP_LIB_SYSTEM_IRQ_PRIO_LO, _isr) : ERR_NOT_OPEN |
#define | Sys_disableAppIrq(_irqn) lib_system ? lib_system->disableAppIrq(_irqn) : ERR_NOT_OPEN |
#define | Sys_enableFastAppIrq(_irqn, _prio, _isr) lib_system ? lib_system->enableAppIrq(true, _irqn, _prio, _isr) : ERR_NOT_OPEN |
#define | Sys_clearFastAppIrq(_irqn) lib_system ? lib_system->clearPendingFastAppIrq(_irqn) : ERR_NOT_OPEN |
#define | Ble_beaconRx_setRxCb(_cb) lib_beacon_rx ? lib_beacon_rx->setBeaconReceivedCb(_cb) : ERR_NOT_OPEN |
#define | Ble_beaconRx_startScanner(_chan) lib_beacon_rx ? lib_beacon_rx->startScanner(_chan) : ERR_NOT_OPEN |
#define | Ble_beaconRx_stopScanner() lib_beacon_rx ? lib_beacon_rx->stopScanner() : ERR_NOT_OPEN |
#define | Ble_beaconRx_isStarted() (lib_beacon_rx ? lib_beacon_rx->isScannerStarted() : ERR_NOT_OPEN) |
|
extern |
bool API_Open | ( | const app_global_functions_t * | functions | ) |
Open API (open all libraries)
This function opens all libraries and stores the handle to those for function pointers (app_lib_<library>_t *
). Then, application may continue using those pointers. It is no more mandatory to call it from the App_init(). SDK has been updated to call it by default internally. Calling it has no effects.
Example on using this function. After opening, the system library can be used by using lib_system
handle.
functions | The root library address passed to Application startup App_init() |
#define Ble_beaconRx_isStarted | ( | ) | (lib_beacon_rx ? lib_beacon_rx->isScannerStarted() : ERR_NOT_OPEN) |
Definition at line 115 of file api.h.
#define Ble_beaconRx_setRxCb | ( | _cb | ) | lib_beacon_rx ? lib_beacon_rx->setBeaconReceivedCb(_cb) : ERR_NOT_OPEN |
Definition at line 106 of file api.h.
#define Ble_beaconRx_startScanner | ( | _chan | ) | lib_beacon_rx ? lib_beacon_rx->startScanner(_chan) : ERR_NOT_OPEN |
Definition at line 109 of file api.h.
#define Ble_beaconRx_stopScanner | ( | ) | lib_beacon_rx ? lib_beacon_rx->stopScanner() : ERR_NOT_OPEN |
Definition at line 112 of file api.h.
#define ERR_NOT_OPEN APP_RES_INVALID_NULL_POINTER |
#define Sys_clearFastAppIrq | ( | _irqn | ) | lib_system ? lib_system->clearPendingFastAppIrq(_irqn) : ERR_NOT_OPEN |
Definition at line 102 of file api.h.
#define Sys_disableAppIrq | ( | _irqn | ) | lib_system ? lib_system->disableAppIrq(_irqn) : ERR_NOT_OPEN |
Definition at line 96 of file api.h.
#define Sys_disableDs | ( | _dis | ) | lib_system ? lib_system->disableDeepSleep(_dis) : ERR_NOT_OPEN |
Definition at line 90 of file api.h.
#define Sys_enableAppIrq | ( | _irqn, | |
_isr | |||
) | lib_system ? lib_system->enableAppIrq(false, _irqn, APP_LIB_SYSTEM_IRQ_PRIO_LO, _isr) : ERR_NOT_OPEN |
Definition at line 93 of file api.h.
#define Sys_enableFastAppIrq | ( | _irqn, | |
_prio, | |||
_isr | |||
) | lib_system ? lib_system->enableAppIrq(true, _irqn, _prio, _isr) : ERR_NOT_OPEN |
Definition at line 99 of file api.h.
#define Sys_enterCriticalSection | ( | ) | lib_system ? lib_system->enterCriticalSection() : ERR_NOT_OPEN |
Definition at line 84 of file api.h.
#define Sys_exitCriticalSection | ( | ) | lib_system ? lib_system->exitCriticalSection() : ERR_NOT_OPEN |
Definition at line 87 of file api.h.