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) More... | |
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) |
const app_lib_radio_cfg_t *lib_radio_cfg __attribute | ( | (weak) | ) |
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.
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) |
#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 ERR_NOT_OPEN APP_RES_INVALID_NULL_POINTER |
#define Sys_clearFastAppIrq | ( | _irqn | ) | lib_system ? lib_system->clearPendingFastAppIrq(_irqn) : ERR_NOT_OPEN |
#define Sys_disableAppIrq | ( | _irqn | ) | lib_system ? lib_system->disableAppIrq(_irqn) : 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_enableFastAppIrq | ( | _irqn, | |
_prio, | |||
_isr | |||
) | lib_system ? lib_system->enableAppIrq(true, _irqn, _prio, _isr) : ERR_NOT_OPEN |
#define Sys_enterCriticalSection | ( | ) | lib_system ? lib_system->enterCriticalSection() : ERR_NOT_OPEN |
#define Sys_exitCriticalSection | ( | ) | lib_system ? lib_system->exitCriticalSection() : ERR_NOT_OPEN |