53 #define UBLE_PARAM_COMMON_START 0 66 #define UBLE_PARAM_RFPRIORITY (UBLE_PARAM_COMMON_START+0) 75 #define UBLE_PARAM_TXPOWER (UBLE_PARAM_COMMON_START+1) 78 #define UBLE_PARAM_COMMON_END UBLE_PARAM_TXPOWER 79 #if defined(FEATURE_ADVERTISER) 81 #define UBLE_PARAM_ADV_CMN_START (UBLE_PARAM_COMMON_END+1) 92 #define UBLE_PARAM_ADVINTERVAL (UBLE_PARAM_ADV_CMN_START+0) 100 #define UBLE_PARAM_ADVCHANMAP (UBLE_PARAM_ADV_CMN_START+1) 108 #define UBLE_PARAM_ADVTYPE (UBLE_PARAM_ADV_CMN_START+2) 120 #define UBLE_PARAM_TIMETOADV (UBLE_PARAM_ADV_CMN_START+3) 128 #define UBLE_PARAM_ADVDATA (UBLE_PARAM_ADV_CMN_START+4) 131 #define UBLE_PARAM_ADV_CMN_END UBLE_PARAM_ADVDATA 132 #if defined(FEATURE_SCAN_RESPONSE) 134 #define UBLE_PARAM_ADV_SR_START (UBLE_PARAM_ADV_CMN_END+1) 145 #define UBLE_PARAM_SCANRSPDATA (UBLE_PARAM_ADV_SR_START+0) 155 #define UBLE_PARAM_ADVFLTPOLICY (UBLE_PARAM_ADV_SR_START+1) 156 #define UBLE_PARAM_ADV_SR_END UBLE_PARAM_ADVFLTPOLICY 160 #define UBLE_PARAM_ADV_SR_END UBLE_PARAM_ADV_CMN_END 165 #define UBLE_PARAM_ADV_SR_END UBLE_PARAM_COMMON_END 169 #if defined(FEATURE_SCANNER) 170 #define UBLE_PARAM_SCAN_START (UBLE_PARAM_ADV_SR_END+1) 180 #define UBLE_PARAM_SCANINTERVAL (UBLE_PARAM_SCAN_START+0) 188 #define UBLE_PARAM_SCANWINDOW (UBLE_PARAM_SCAN_START+1) 196 #define UBLE_PARAM_SCANCHANMAP (UBLE_PARAM_SCAN_START+2) 204 #define UBLE_PARAM_SCANTYPE (UBLE_PARAM_SCAN_START+3) 212 #define UBLE_PARAM_FLTDUPLICATE (UBLE_PARAM_SCAN_START+4) 220 #define UBLE_PARAM_SCANFLTPOLICY (UBLE_PARAM_SCAN_START+5) 221 #define UBLE_PARAM_SCAN_END UBLE_PARAM_SCANFLTPOLICY 225 #define UBLE_PARAM_SCAN_END UBLE_PARAM_ADV_SR_END 229 #if defined(FEATURE_MONITOR) 230 #define UBLE_PARAM_MONITOR_START (UBLE_PARAM_ADV_SR_END+1) 241 #define UBLE_PARAM_SESSIONID (UBLE_PARAM_MONITOR_START+0) 249 #define UBLE_PARAM_MONITOR_CHAN (UBLE_PARAM_MONITOR_START+1) 257 #define UBLE_PARAM_MONITOR_DURATION (UBLE_PARAM_MONITOR_START+2) 265 #define UBLE_PARAM_MONITOR_START_TIME (UBLE_PARAM_MONITOR_START+3) 273 #define UBLE_PARAM_MONITOR_ACCESS_ADDR (UBLE_PARAM_MONITOR_START+4) 274 #define UBLE_PARAM_MONITOR_END UBLE_PARAM_MONITOR_ACCESS_ADDR 278 #define UBLE_PARAM_MONITOR_END UBLE_PARAM_ADV_SR_END 282 #define UBLE_NUM_PARAM (UBLE_PARAM_MONITOR_END+1) 290 #define UBLE_RF_PRI_NORMAL ((uint8) RF_PriorityNormal) 291 #define UBLE_RF_PRI_HIGH ((uint8) RF_PriorityHigh) 292 #define UBLE_RF_PRI_HIGHEST ((uint8) RF_PriorityHighest) 298 #define RF_TIME_RELAXED 0 299 #define RF_TIME_CRITICAL 1 303 #define UBLE_TX_POWER_INVALID 0xFFFF 308 #define UBLE_ADDRTYPE_PUBLIC 0 309 #define UBLE_ADDRTYPE_STATIC 1 310 #define UBLE_ADDRTYPE_NONRESOLVABLE 2 311 #define UBLE_ADDRTYPE_RESOLVABLE 3 312 #define UBLE_ADDRTYPE_BD 4 318 #define UBLE_ADVTYPE_ADV_NC 5 319 #define UBLE_ADVTYPE_ADV_SCAN 6 326 #define UBLE_ADV_CHAN_37 0x01 327 #define UBLE_ADV_CHAN_38 0x02 328 #define UBLE_ADV_CHAN_39 0x04 329 #define UBLE_ADV_CHAN_ALL (UBLE_ADV_CHAN_37 | UBLE_ADV_CHAN_38 | UBLE_ADV_CHAN_39) 333 #define UBLE_MIN_ADV_INTERVAL 160 334 #define UBLE_MAX_ADV_INTERVAL 16384 335 #define UBLE_MIN_CHANNEL_MAP UBLE_ADV_CHAN_37 336 #define UBLE_MAX_CHANNEL_MAP UBLE_ADV_CHAN_ALL 337 #define UBLE_MIN_TX_POWER TX_POWER_MINUS_21_DBM 338 #define UBLE_MAX_TX_POWER TX_POWER_5_DBM 339 #define UBLE_MIN_SCAN_INTERVAL 4 340 #define UBLE_MAX_SCAN_INTERVAL 16384 341 #define UBLE_MIN_SCAN_WINDOW 4 342 #define UBLE_MAX_SCAN_WINDOW 16384 343 #define UBLE_MIN_MONITOR_HANDLE 0 344 #define UBLE_MAX_MONITOR_HANDLE 8 345 #define UBLE_MIN_MONITOR_CHAN 0 346 #define UBLE_MAX_MONITOR_CHAN 39 347 #define UBLE_MIN_MONITOR_DURATION 0 348 #define UBLE_MAX_MONITOR_DURATION 64000 351 #define UBLE_PARAM_DFLT_RFPRIORITY UBLE_RF_PRI_NORMAL 352 #define UBLE_PARAM_DFLT_RFTIMECRIT RF_TIME_RELAXED 353 #define UBLE_PARAM_DFLT_TXPOWER TX_POWER_0_DBM 354 #define UBLE_PARAM_DFLT_ADVINTERVAL 1600 355 #define UBLE_PARAM_DFLT_ADVCHANMAP UBLE_ADV_CHAN_ALL 356 #define UBLE_PARAM_DFLT_ADVTYPE UBLE_ADVTYPE_ADV_NC 357 #define UBLE_PARAM_DFLT_TIMETOADV 0 358 #define UBLE_PARAM_DFLT_ADVDATA {0} 359 #define UBLE_PARAM_DFLT_SCANRSPDATA {0} 360 #define UBLE_PARAM_DFLT_ADVFLTPOLICY 0 361 #define UBLE_PARAM_DFLT_SCANINTERVAL 16 362 #define UBLE_PARAM_DFLT_SCANWINDOW 16 363 #define UBLE_PARAM_DFLT_SCANCHAN UBLE_ADV_CHAN_ALL 364 #define UBLE_PARAM_DFLT_SCANTYPE 0 365 #define UBLE_PARAM_DFLT_FLTDUPLICATE 0 366 #define UBLE_PARAM_DFLT_SCANFLTPOLICY 0 367 #define UBLE_PARAM_DFLT_MONITOR_HANDLE 0 368 #define UBLE_PARAM_DFLT_MONITOR_CHAN 37 369 #define UBLE_PARAM_DFLT_MONITOR_DURATION 320 370 #define UBLE_PARAM_DFLT_MONITOR_START_TIME 6400 371 #define UBLE_PARAM_DFLT_MONITOR_ACCESS_ADDR 0x8E89BED6 372 #define UBLE_PARAM_DFLT_MONITOR_CRCINIT 0x555555 378 #define UBLE_EVTDST_LL 0 379 #define UBLE_EVTDST_GAP 1 380 #define UBLE_NUM_EVTDST 2 388 #define MS_TO_RAT 4000 390 #define BLE_TO_RAT 2500 392 #define SYSTICK_TO_RAT (Clock_tickPeriod * US_TO_RAT) 394 #define MS_TO_SYSTICK (1000 / Clock_tickPeriod) 396 #define BLE_TO_SYSTICK (625 / Clock_tickPeriod) 398 #define BYTE_TO_RAT (8 * US_TO_RAT) 401 #define UBLE_MAX_ADVDATA_LEN B_MAX_ADV_LEN 403 #define UBLE_MAX_OVERLAP_TIME_LIMIT 0x7270E000 // 8 minutes in 625us ticks. chosen to be half of 17 minutes RF overlap. 404 #define UBLE_MAX_32BIT_TIME 0xFFFFFFFF 406 #define BLE_ROLE_PERIPHERAL 4 407 #define BLE_ROLE_CENTRAL 8 428 PACKED_TYPEDEF_STRUCT {
429 port_queueElem_t pElem;
437 PACKED_TYPEDEF_STRUCT {
473 PACKED_TYPEDEF_STRUCT {
476 #if defined(FEATURE_ADVERTISER) 482 #if defined(FEATURE_SCAN_RESPONSE) 487 #if defined(FEATURE_SCANNER) 495 #if defined(FEATURE_MONITOR) 498 uint16 monitorDuration;
510 PACKED_TYPEDEF_STRUCT {
664 #define BLE_LOG_MODULE_CTRL 0x01 665 #define BLE_LOG_MODULE_HOST 0x02 666 #define BLE_LOG_MODULE_APP 0x04 667 #define BLE_LOG_MODULE_OSAL_TASK 0x08 668 #define BLE_LOG_MODULE_RF_CMD 0x10 670 void bleLog_int_int(
void *handle, uint32_t type, uint8_t *format, uint32_t param1, uint32_t param2);
671 void bleLog_int_str(
void *handle, uint32_t type, uint8_t *format, uint32_t param1,
char *param2);
672 void bleLog_int_time(
void *handle, uint32_t type, uint8_t *start_str, uint32_t param1);
674 #define BLE_LOG_INT_INT(handle, type, format, param1, param2) bleLog_int_int(handle, type, format, param1, param2) 675 #define BLE_LOG_INT_STR(handle, type, format, param1, param2) bleLog_int_str(handle, type, format, param1, param2) 676 #define BLE_LOG_INT_TIME(handle, type, start_str, param1) bleLog_int_time(handle, type, start_str, param1) 678 #define BLE_LOG_INT_INT(handle, type, format, param1, param2) 679 #define BLE_LOG_INT_STR(handle, type, format, param1, param2) 680 #define BLE_LOG_INT_TIME(handle, type, start_str, param1) void uble_processMsg(void)
Let the Micro Stack process the queued messages.
bStatus_t uble_registerAntSwitchCB(ubleAntSwitchCB_t pfnAntSwitchCB)
Register callback for antenna switch.
void uble_resetAddr(void)
Make BD Addr revert to Random Static Address if exists or Public Address otherwise.
bStatus_t uble_stackInit(ubleAddrType_t addrType, uint8 *pStaticAddr, ublePostEvtProxyCB_t pfnPostEvtProxyCB, uint8 timeCritical)
Initialize Micro BLE Stack.
bStatus_t uble_getParameter(uint8 param, void *pValue)
Get a Micro BLE Stack parameter.
void(* ubleProcessMsg_t)(ubleEvtMsg_t *pEvtMsg)
Function to process event messages destined to the calle module.
Definition: uble.h:467
void(* ubleAntSwitchCB_t)(void)
Type of the callback to switch antenna in the application.
Definition: uble.h:462
#define UBLE_MAX_ADVDATA_LEN
Max Advertising Data Length.
Definition: uble.h:401
uint8 ubleEvt_t
Micro BLE Stack Event.
Definition: uble.h:426
bStatus_t uble_setParameter(uint8 param, uint8 len, void *pValue)
Set a Micro BLE Stack parameter.
uint8 ubleMsg_t
Type of Micro BLE Stack message.
Definition: uble.h:435
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:245
uint8 ubleEvtDst_t
Recipient of Micro BLE Stack Event.
Definition: uble.h:423
void(* ublePostEvtProxyCB_t)(void)
Type of the callback to have uble_processMsg called in the application task context.
Definition: uble.h:455
uint8 uble_timeCompare(uint32 time1, uint32 time2)
This function determines if the first time parameter is greater than the second time parameter...
uint8 ubleAddrType_t
Address Type.
Definition: uble.h:420
bStatus_t uble_getAddr(ubleAddrType_t addrType, uint8 *pAddr)
Retrieve the address corresponding to the given address type.
bStatus_t uble_checkAddr(ubleAddrType_t addrType, uint8 *pAddr)
Check if the given address is valid.
uint32 uble_timeDelta(uint32 time1, uint32 time2)
This function determines the difference between two time parameters, taking timer counter wrap into a...