This file contains configuration, initialization, and parameter management of Micro BLE Stack. It also contains interfacing between Micro BLE Stack and the application.
|
|
#define | BLE_LOG_INT_INT(handle, type, format, param1, param2) |
| |
|
#define | BLE_LOG_INT_STR(handle, type, format, param1, param2) |
| |
|
#define | BLE_LOG_INT_TIME(handle, type, start_str, param1) |
| |
|
#define | BLE_ROLE_CENTRAL 8 |
| |
|
#define | BLE_ROLE_PERIPHERAL 4 |
| |
|
#define | BLE_TO_RAT 2500 |
| | 1 BLE tick(0.625 ms) = 2500 RAT tick
|
| |
|
#define | BLE_TO_SYSTICK (625 / Clock_tickPeriod) |
| | 0.625 ms = (625 / Clock_tickPeriod) system tick
|
| |
|
#define | BYTE_TO_RAT (8 * US_TO_RAT) |
| | 1 byte = 8 us = 32 RAT tick, assuming 1 Mbps PHY
|
| |
|
#define | MS_TO_RAT 4000 |
| | 1 ms = 4000 RAT tick
|
| |
|
#define | MS_TO_SYSTICK (1000 / Clock_tickPeriod) |
| | 1 ms = (1000 / Clock_tickPeriod) system tick
|
| |
|
#define | RF_TIME_CRITICAL 1 |
| | Critical Timing.
|
| |
|
#define | RF_TIME_RELAXED 0 |
| | Relaxed Timing.
|
| |
|
#define | SYSTICK_TO_RAT (Clock_tickPeriod * US_TO_RAT) |
| | 1 system tick = (Clock_tickPeriod * US_TO_RAT) RAT tick
|
| |
|
#define | UBLE_ADDRTYPE_BD 4 |
| | Device that is currently being used.
|
| |
|
#define | UBLE_ADDRTYPE_NONRESOLVABLE 2 |
| | Random Private Nonresolvable Address.
|
| |
|
#define | UBLE_ADDRTYPE_PUBLIC 0 |
| | Public Address.
|
| |
|
#define | UBLE_ADDRTYPE_RESOLVABLE 3 |
| | Random Private Resolvable Address.
|
| |
|
#define | UBLE_ADDRTYPE_STATIC 1 |
| | Random Static Address.
|
| |
|
#define | UBLE_ADV_CHAN_37 0x01 |
| | Channel 37.
|
| |
|
#define | UBLE_ADV_CHAN_38 0x02 |
| | Channel 38.
|
| |
|
#define | UBLE_ADV_CHAN_39 0x04 |
| | Channel 39.
|
| |
|
#define | UBLE_ADV_CHAN_ALL (UBLE_ADV_CHAN_37 | UBLE_ADV_CHAN_38 | UBLE_ADV_CHAN_39) |
| | All Channels.
|
| |
|
#define | UBLE_ADVTYPE_ADV_NC 5 |
| | associated with CMD_BLE_ADV_NC
|
| |
|
#define | UBLE_ADVTYPE_ADV_SCAN 6 |
| | associated with CMD_BLE_ADV_SCAN
|
| |
|
#define | UBLE_EVTDST_GAP 1 |
| | GAP.
|
| |
| #define | UBLE_EVTDST_LL 0 |
| | LL. More...
|
| |
|
#define | UBLE_MAX_32BIT_TIME 0xFFFFFFFF |
| |
|
#define | UBLE_MAX_ADV_INTERVAL 16384 |
| | Maximum Advertising Interval.
|
| |
|
#define | UBLE_MAX_ADVDATA_LEN B_MAX_ADV_LEN |
| | Max Advertising Data Length.
|
| |
|
#define | UBLE_MAX_CHANNEL_MAP UBLE_ADV_CHAN_ALL |
| | Maximum Channel Map.
|
| |
|
#define | UBLE_MAX_MONITOR_CHAN 39 |
| | Maximum Monitor channel.
|
| |
|
#define | UBLE_MAX_MONITOR_DURATION 64000 |
| | Maximum Monitor duration.
|
| |
|
#define | UBLE_MAX_MONITOR_HANDLE 8 |
| | Maximum Monitor handle.
|
| |
|
#define | UBLE_MAX_OVERLAP_TIME_LIMIT 0x7270E000 |
| |
|
#define | UBLE_MAX_SCAN_INTERVAL 16384 |
| | Maximum Scanning Interval.
|
| |
|
#define | UBLE_MAX_SCAN_WINDOW 16384 |
| | Maximum Scanning window.
|
| |
|
#define | UBLE_MAX_TX_POWER TX_POWER_5_DBM |
| | 5 dBm
|
| |
|
#define | UBLE_MIN_ADV_INTERVAL 160 |
| | Minimum Advertising interval.
|
| |
|
#define | UBLE_MIN_CHANNEL_MAP UBLE_ADV_CHAN_37 |
| | Minimum Channel Map.
|
| |
|
#define | UBLE_MIN_MONITOR_CHAN 0 |
| | Minimum Monitor channel.
|
| |
|
#define | UBLE_MIN_MONITOR_DURATION 0 |
| | Minimum Monitor duration.
|
| |
|
#define | UBLE_MIN_MONITOR_HANDLE 0 |
| | Minimum Monitor handle.
|
| |
|
#define | UBLE_MIN_SCAN_INTERVAL 4 |
| | Minimum Scanning interval.
|
| |
|
#define | UBLE_MIN_SCAN_WINDOW 4 |
| | Minimum Scanning window.
|
| |
|
#define | UBLE_MIN_TX_POWER TX_POWER_MINUS_21_DBM |
| | -21 dBm
|
| |
|
#define | UBLE_NUM_EVTDST 2 |
| | Number of Event Destinations.
|
| |
| #define | UBLE_PARAM_ADVCHANMAP (UBLE_PARAM_ADV_CMN_START+1) |
| | Advertising Channel map. More...
|
| |
| #define | UBLE_PARAM_ADVDATA (UBLE_PARAM_ADV_CMN_START+4) |
| | Advertising Data. More...
|
| |
| #define | UBLE_PARAM_ADVFLTPOLICY (UBLE_PARAM_ADV_SR_START+1) |
| | Advertising Filter Policy. More...
|
| |
| #define | UBLE_PARAM_ADVINTERVAL (UBLE_PARAM_ADV_CMN_START+0) |
| | Advertising Interval (n * 0.625 ms) More...
|
| |
| #define | UBLE_PARAM_ADVTYPE (UBLE_PARAM_ADV_CMN_START+2) |
| | Type of Advertising. More...
|
| |
|
#define | UBLE_PARAM_DFLT_ADVCHANMAP UBLE_ADV_CHAN_ALL |
| | All Channels.
|
| |
|
#define | UBLE_PARAM_DFLT_ADVDATA {0} |
| | No data.
|
| |
|
#define | UBLE_PARAM_DFLT_ADVFLTPOLICY 0 |
| | Filter policy TBD.
|
| |
|
#define | UBLE_PARAM_DFLT_ADVINTERVAL 1600 |
| | 1 sec
|
| |
|
#define | UBLE_PARAM_DFLT_ADVTYPE UBLE_ADVTYPE_ADV_NC |
| | ADV_NONCONN_IND.
|
| |
|
#define | UBLE_PARAM_DFLT_FLTDUPLICATE 0 |
| | Filter duplicate TBD.
|
| |
|
#define | UBLE_PARAM_DFLT_MONITOR_ACCESS_ADDR 0x8E89BED6 |
| | Adv address.
|
| |
|
#define | UBLE_PARAM_DFLT_MONITOR_CHAN 37 |
| | Channel monitored.
|
| |
|
#define | UBLE_PARAM_DFLT_MONITOR_CRCINIT 0x555555 |
| | crcInit value
|
| |
|
#define | UBLE_PARAM_DFLT_MONITOR_DURATION 320 |
| | Monitor duration 200 ms.
|
| |
|
#define | UBLE_PARAM_DFLT_MONITOR_HANDLE 0 |
| | Monitor session handle.
|
| |
|
#define | UBLE_PARAM_DFLT_MONITOR_START_TIME 6400 |
| | Monitor start time 4 s.
|
| |
|
#define | UBLE_PARAM_DFLT_RFPRIORITY UBLE_RF_PRI_NORMAL |
| | RF_PriorityNormal.
|
| |
|
#define | UBLE_PARAM_DFLT_RFTIMECRIT RF_TIME_RELAXED |
| | Time-relaxed.
|
| |
|
#define | UBLE_PARAM_DFLT_SCANCHAN UBLE_ADV_CHAN_ALL |
| | All Channels.
|
| |
|
#define | UBLE_PARAM_DFLT_SCANFLTPOLICY 0 |
| | Scan filter policy TBD.
|
| |
|
#define | UBLE_PARAM_DFLT_SCANINTERVAL 16 |
| | Scan interval.
|
| |
|
#define | UBLE_PARAM_DFLT_SCANRSPDATA {0} |
| | No data.
|
| |
|
#define | UBLE_PARAM_DFLT_SCANTYPE 0 |
| | Scan type.
|
| |
|
#define | UBLE_PARAM_DFLT_SCANWINDOW 16 |
| | Scan window.
|
| |
|
#define | UBLE_PARAM_DFLT_TIMETOADV 0 |
| | Disabled.
|
| |
|
#define | UBLE_PARAM_DFLT_TXPOWER TX_POWER_0_DBM |
| | 0 dBm
|
| |
| #define | UBLE_PARAM_RFPRIORITY (UBLE_PARAM_COMMON_START+0) |
| | Priority used for RF command scheduling. More...
|
| |
| #define | UBLE_PARAM_SCANRSPDATA (UBLE_PARAM_ADV_SR_START+0) |
| | Scan response Data. More...
|
| |
| #define | UBLE_PARAM_TIMETOADV (UBLE_PARAM_ADV_CMN_START+3) |
| | How early the application wants to get a notification before each advertising event happens (ms) More...
|
| |
| #define | UBLE_PARAM_TXPOWER (UBLE_PARAM_COMMON_START+1) |
| | TX Power. More...
|
| |
|
#define | UBLE_RF_PRI_HIGH ((uint8) RF_PriorityHigh) |
| | High Priority.
|
| |
|
#define | UBLE_RF_PRI_HIGHEST ((uint8) RF_PriorityHighest) |
| | Highest Priority.
|
| |
|
#define | UBLE_RF_PRI_NORMAL ((uint8) RF_PriorityNormal) |
| | Normal Priority.
|
| |
|
#define | UBLE_TX_POWER_INVALID 0xFFFF |
| | Invalid TX Power Register value.
|
| |
| #define | US_TO_RAT 4 |
| | 1 us = 4 RAT tick More...
|
| |
|
| bStatus_t | uble_checkAddr (ubleAddrType_t addrType, uint8 *pAddr) |
| | Check if the given address is valid. More...
|
| |
| bStatus_t | uble_getAddr (ubleAddrType_t addrType, uint8 *pAddr) |
| | Retrieve the address corresponding to the given address type. More...
|
| |
| bStatus_t | uble_getParameter (uint8 param, void *pValue) |
| | Get a Micro BLE Stack parameter. More...
|
| |
| void | uble_processMsg (void) |
| | Let the Micro Stack process the queued messages. More...
|
| |
| bStatus_t | uble_registerAntSwitchCB (ubleAntSwitchCB_t pfnAntSwitchCB) |
| | Register callback for antenna switch. More...
|
| |
|
void | uble_resetAddr (void) |
| | Make BD Addr revert to Random Static Address if exists or Public Address otherwise.
|
| |
| bStatus_t | uble_setParameter (uint8 param, uint8 len, void *pValue) |
| | Set a Micro BLE Stack parameter. More...
|
| |
| bStatus_t | uble_stackInit (ubleAddrType_t addrType, uint8 *pStaticAddr, ublePostEvtProxyCB_t pfnPostEvtProxyCB, uint8 timeCritical) |
| | Initialize Micro BLE Stack. More...
|
| |
| uint8 | uble_timeCompare (uint32 time1, uint32 time2) |
| | This function determines if the first time parameter is greater than the second time parameter, taking timer counter wrap into account. If so, TRUE is returned. More...
|
| |
| uint32 | uble_timeDelta (uint32 time1, uint32 time2) |
| | This function determines the difference between two time parameters, taking timer counter wrap into account. More...
|
| |