Arduino Function: BLECentralRole.setScanParameters

Name

setScanParameters

Description

Function to set the parameters of the scanning process. When scanning, the board will act as observer role and will be able to read all the advertising packets in the nearby.

Syntax

bleCentral.setScanParameters(interval, window, timeout, active);

Parameters

  • interval: short. Time inside the scan window during the which the board will scan. The value is expressed in 0.625 ms increments and must be between  0x0004 (2.5 ms) and 0x4000 (10.24 s).
  • window: short. Duration of the scan windows. The value is expressed in 0.625 ms increments and must be between  0x0004 (2.5 ms) and 0x4000 (10.24 s). If this value is equal to the interval parameter, the board will scan continuously.
  • timeout: short. Set a timeout for the scanning. The value is expressed in 1 s increments and must be between  0x0000 and 0xFFFF. The value 0X0000 disables timeout.
  • active: bool. Set if the scan has to be active or not. If true, the board will request for further information by sending the scan request. The peripheral can response with another advertising packet called scan response, to add more information.

Returns

none 

Note

If you want to have more information about how advertising and scanning work, try to take a look at this guide.

Written by arduino.org