TI BLE5-Stack API Documentation  2.02.06.00
Modules | Files | Functions
Gap Scanner

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)
 

Detailed Description

This module implements the Host Scanner.

Function Documentation

§ GapScan_AddDeviceToPeriodicAdvList()

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

Parameters
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)
Returns
SUCCESS
FAILURE
bleInvalidRange

§ GapScan_ClearPeriodicAdvList()

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

Returns
SUCCESS

§ GapScan_disable()

status_t GapScan_disable ( void  )

Stop currently running scanning operation.

Returns
SUCCESS
FAILURE
bleIncorrectMode

§ GapScan_discardAdvReportList()

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

Returns
SUCCESS
bleIncorrectMode

§ 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.

Parameters
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.
Returns
SUCCESS
bleNotReady
bleInvalidRange
bleMemAllocError
bleAlreadyInRequestedMode
bleIncorrectMode

§ GapScan_getAdvReport()

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.

Parameters
rptIdxIndex of the advertising report in the list
pAdvRptpointer to where the retrieved advertising report is to be stored
Returns
SUCCESS
bleInvalidRange
INVALIDPARAMETER

§ GapScan_getParam()

status_t GapScan_getParam ( GapScan_ParamId_t  paramId,
void *  pValue,
uint8_t *  pLen 
)

Set a parameter.

Parameters
paramIdparameter ID
pValuepointer to where the parameter value is to be stored
pLenoutput 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.
Returns
SUCCESS
bleInvalidRange
INVALIDPARAMETER

§ GapScan_getPhyParams()

status_t GapScan_getPhyParams ( uint8_t  primPhy,
GapScan_ScanType_t pType,
uint16_t *  pInterval,
uint16_t *  pWindow 
)

Get parameters of the specified PHY.

Note
that primPhy shall indicate only one PHY.
Parameters
primPhyPrimary advertising channel PHY.Shall be one from GapScan_PrimPhy_t.
pTypepointer to where type value is to be stored
pIntervalpointer to where scanning interval value is to be stored
pWindowpointer to where scanning window value is to be stored
Returns
SUCCESS
bleInvalidRange
INVALIDPARAMETER

§ GapScan_PeriodicAdvCreateSync()

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

Parameters
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
Returns
SUCCESS
FAILURE
bleInvalidRange

§ GapScan_PeriodicAdvCreateSyncCancel()

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

Returns
SUCCESS

§ GapScan_PeriodicAdvTerminateSync()

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

Parameters
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
Returns
SUCCESS
FAILURE
bleInvalidRange

§ GapScan_ReadPeriodicAdvListSize()

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

Returns
SUCCESS

§ GapScan_registerCb()

status_t GapScan_registerCb ( pfnGapCB_t  cb,
uintptr_t  arg 
)

Register the callback that will be called when a new GAP_SCAN event occurs.

Parameters
cbcallback fiction that must be provided by the application
arguser-defined argument to be passed back through the callback. This is optional
Returns
SUCCESS
INVALIDPARAMETER

§ GapScan_RemoveDeviceFromPeriodicAdvList()

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

Parameters
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)
Returns
SUCCESS
FAILURE
bleInvalidRange

§ GapScan_setEventMask()

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.

Parameters
eventMaskbit mask of the events

§ GapScan_setParam()

status_t GapScan_setParam ( GapScan_ParamId_t  paramId,
void *  pValue 
)

Set a parameter.

Parameters
paramIdparameter ID
pValuepointer to the value to set the parameter with
Returns
SUCCESS
bleInvalidRange
INVALIDPARAMETER
bleIncorrectMode

§ GapScan_SetPeriodicAdvReceiveEnable()

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

Parameters
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
Returns
SUCCESS
FAILURE
bleInvalidRange

§ GapScan_setPhyParams()

status_t GapScan_setPhyParams ( uint8_t  primPhys,
GapScan_ScanType_t  type,
uint16_t  interval,
uint16_t  window 
)

Set parameters dependent on PHY.

Note
that if primPhys contains more than one PHY, the same parameters of those PHYs will be set with the same values.
Change of the parameters will not affect an ongoing scanning. If changed during scanning, it will take effect when the scanning is re-enabled after disabled.
Parameters
primPhysPrimary advertising channel PHY(s). Individual values of GapScan_PrimPhy_t can be OR'ed.
typeScanning type
intervalScanning interval. This shall be equal to or greater than window
windowScanning window
Returns
SUCCESS
bleInvalidRange
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale