TI BLE5-Stack API Documentation
2.02.08.00
|
This module implements the Host Scanner. More...
Modules | |
GapScan Callbacks | |
GapScan Constants | |
GapScan Events | |
GapScan Params | |
GapScan Structures | |
Files | |
file | gap_scanner.h |
GAP Scanner layer interface. | |
Functions | |
bStatus_t | GapScan_AddDeviceToPeriodicAdvList (uint8 advAddrType, uint8 advAddress[6], uint8 advSID) |
bStatus_t | GapScan_ClearPeriodicAdvList (void) |
status_t | GapScan_disable (void) |
status_t | GapScan_discardAdvReportList (void) |
status_t | GapScan_enable (uint16_t period, uint16_t duration, uint8_t maxNumReport) |
status_t | GapScan_getAdvReport (uint8_t rptIdx, GapScan_Evt_AdvRpt_t *pAdvRpt) |
status_t | GapScan_getParam (GapScan_ParamId_t paramId, void *pValue, uint8_t *pLen) |
status_t | GapScan_getPhyParams (uint8_t primPhy, GapScan_ScanType_t *pType, uint16_t *pInterval, uint16_t *pWindow) |
uint8_t | GapScan_PeriodicAdvCreateSync (uint8 advSID, GapScan_PeriodicAdvCreateSyncParams_t *createSyncParams) |
bStatus_t | GapScan_PeriodicAdvCreateSyncCancel (void) |
bStatus_t | GapScan_PeriodicAdvTerminateSync (uint16 syncHandle) |
hciStatus_t | GapScan_ReadPeriodicAdvListSize (void) |
status_t | GapScan_registerCb (pfnGapCB_t cb, uintptr_t arg) |
bStatus_t | GapScan_RemoveDeviceFromPeriodicAdvList (uint8 advAddrType, uint8 advAddress[6], uint8 advSID) |
void | GapScan_setEventMask (GapScan_EventMask_t eventMask) |
status_t | GapScan_setParam (GapScan_ParamId_t paramId, void *pValue) |
bStatus_t | GapScan_SetPeriodicAdvReceiveEnable (uint16 syncHandle, uint8 enable) |
status_t | GapScan_setPhyParams (uint8_t primPhys, GapScan_ScanType_t type, uint16_t interval, uint16_t window) |
This module implements the Host Scanner.
bStatus_t GapScan_AddDeviceToPeriodicAdvList | ( | uint8 | advAddrType, |
uint8 | advAddress[6], | ||
uint8 | advSID | ||
) |
GapScan_AddDeviceToPeriodicAdvList
Used a scanner to add an entry, consisting of a single device address and SID, to the Periodic Advertiser list stored in the Controller.
/ref did_302932730
advAddrType | - Advertiser address type - 0x00 - Public or Public Identity Address 0x01 - Random or Random (static) Identity Address |
advAddress | - Advertiser address |
advSID | - Advertising SID subfield in the ADI field used to identify the Periodic Advertising (Range: 0x00 to 0x0F) |
bStatus_t GapScan_ClearPeriodicAdvList | ( | void | ) |
GapScan_ClearPeriodicAdvList
Used a scanner to remove all entries from the list of Periodic Advertisers in the Controller.
/ref did_302932730
status_t GapScan_disable | ( | void | ) |
Stop currently running scanning operation.
status_t GapScan_discardAdvReportList | ( | void | ) |
Deallocate advertising report list and all its reports created during scanning.
If they are not deallocated by the application, they will be deallocated and reallocated when a new scanning starts with GapScan_enable
status_t GapScan_enable | ( | uint16_t | period, |
uint16_t | duration, | ||
uint8_t | maxNumReport | ||
) |
Start scanning.
If duration is zero period shall be ignored and the scanner will continue scanning until GapScan_disable is called. If period is zero and duration is non-zero, the scanner will scan once until duration has expired or GapScan_disable is called. If both the duration and period are non-zero, the scanner will continue scanning periodically until GapScan_disable() is called.
period | - Scan period. Ignored if duration is zero. 1.28 sec unit. Range: 0x00-0xffff, where 0x00 is continuously scanning. |
duration | - Scan duration. 10 ms unit. The time of duration shall be greater than the time of scan interval set by GapScan_setPhyParams. Range: 0x00-0xffff, where 0x00 is continuously scanning. |
maxNumReport | - If non-zero, the list of advertising reports (the number of which is up to maxNumReport) will be generated and come with GAP_EVT_SCAN_DISABLED. |
status_t GapScan_getAdvReport | ( | uint8_t | rptIdx, |
GapScan_Evt_AdvRpt_t * | pAdvRpt | ||
) |
Get a specific advertising report from the advertising report list.
Only the fields specified by GapScan_setParam (SCAN_PARAM_RPT_FIELDS, etc) will be filled out. All other fields will be filled with 0's.
rptIdx | Index of the advertising report in the list |
pAdvRpt | pointer to where the retrieved advertising report is to be stored |
status_t GapScan_getParam | ( | GapScan_ParamId_t | paramId, |
void * | pValue, | ||
uint8_t * | pLen | ||
) |
Set a parameter.
paramId | parameter ID |
pValue | pointer to where the parameter value is to be stored |
pLen | output parameter to return the length of the parameter. This is an optional return parameter. If the caller does not care about this, it can pass in NULL. |
status_t GapScan_getPhyParams | ( | uint8_t | primPhy, |
GapScan_ScanType_t * | pType, | ||
uint16_t * | pInterval, | ||
uint16_t * | pWindow | ||
) |
Get parameters of the specified PHY.
primPhy | Primary advertising channel PHY.Shall be one from GapScan_PrimPhy_t. |
pType | pointer to where type value is to be stored |
pInterval | pointer to where scanning interval value is to be stored |
pWindow | pointer to where scanning window value is to be stored |
uint8_t GapScan_PeriodicAdvCreateSync | ( | uint8 | advSID, |
GapScan_PeriodicAdvCreateSyncParams_t * | createSyncParams | ||
) |
GapScan_PeriodicAdvCreateSync
Used a scanner to synchronize with a periodic advertising train from an advertiser and begin receiving periodic advertising packets.
/ref did_302932730
advSID | - Advertising SID subfield in the ADI field used to identify the Periodic Advertising (Range: 0x00 to 0x0F) |
createSyncParams | - Pointer to the create sync parameters |
bStatus_t GapScan_PeriodicAdvCreateSyncCancel | ( | void | ) |
GapScan_PeriodicAdvCreateSyncCancel
Used a scanner to cancel the HCI_LE_Periodic_Advertising_Create_Sync command while it is pending.
/ref did_302932730
bStatus_t GapScan_PeriodicAdvTerminateSync | ( | uint16 | syncHandle | ) |
GapScan_PeriodicAdvTerminateSync
Used a scanner to stop reception of the periodic advertising train identified by the syncHandle parameter.
/ref did_302932730
syncHandle | - Handle identifying the periodic advertising train (Range: 0x0000 to 0x0EFF) The handle was assigned by the Controller while generating the LE Periodic Advertising Sync Established event |
hciStatus_t GapScan_ReadPeriodicAdvListSize | ( | void | ) |
GapScan_ReadPeriodicAdvListSize
Used a scanner to read the total number of Periodic Advertiser list entries that can be stored in the Controller.
/ref did_302932730
status_t GapScan_registerCb | ( | pfnGapCB_t | cb, |
uintptr_t | arg | ||
) |
Register the callback that will be called when a new GAP_SCAN event occurs.
cb | callback fiction that must be provided by the application |
arg | user-defined argument to be passed back through the callback. This is optional |
bStatus_t GapScan_RemoveDeviceFromPeriodicAdvList | ( | uint8 | advAddrType, |
uint8 | advAddress[6], | ||
uint8 | advSID | ||
) |
GapScan_RemoveDeviceFromPeriodicAdvertiserList
Used a scanner to remove one entry from the list of Periodic Advertisers stored in the Controller.
/ref did_302932730
advAddrType | - Advertiser address type - 0x00 - Public or Public Identity Address 0x01 - Random or Random (static) Identity Address |
advAddress | - Advertiser address |
advSID | - Advertising SID subfield in the ADI field used to identify the Periodic Advertising (Range: 0x00 to 0x0F) |
void GapScan_setEventMask | ( | GapScan_EventMask_t | eventMask | ) |
Set which events to receive through the callback.
One bit per event. If a bit is set to 1, the callback provided by GapScan_registerCb will be called upon corresponding event.
eventMask | bit mask of the events |
status_t GapScan_setParam | ( | GapScan_ParamId_t | paramId, |
void * | pValue | ||
) |
Set a parameter.
paramId | parameter ID |
pValue | pointer to the value to set the parameter with |
bStatus_t GapScan_SetPeriodicAdvReceiveEnable | ( | uint16 | syncHandle, |
uint8 | enable | ||
) |
GapScan_SetPeriodicAdvReceiveEnable
Used a scanner to enable or disable reports for the periodic advertising train identified by the syncHandle parameter.
/ref did_302932730
syncHandle | - Handle identifying the periodic advertising train (Range: 0x0000 to 0x0EFF) The handle was assigned by the Controller while generating the LE Periodic Advertising Sync Established event |
enable | - 0x00 - Reporting disable 0x01 - Reporting enable |
status_t GapScan_setPhyParams | ( | uint8_t | primPhys, |
GapScan_ScanType_t | type, | ||
uint16_t | interval, | ||
uint16_t | window | ||
) |
Set parameters dependent on PHY.
primPhys | Primary advertising channel PHY(s). Individual values of GapScan_PrimPhy_t can be OR'ed. |
type | Scanning type |
interval | Scanning interval. This shall be equal to or greater than window |
window | Scanning window |