RUI3 (RAK Unified Interface 3) - RAK4631
BLE Scanner

Functions

void start (uint16_t timeout_sec)
 
bool setInterval (uint16_t scan_interval, uint16_t scan_window)
 
void setScannerCallback (void(*userFunc)(int8_t, uint8_t *, uint8_t *, uint16_t))
 

Detailed Description

Function Documentation

◆ start()

void start ( uint16_t  timeout_sec)
Description
Start scanning for BLE peripherals in range and parsing the advertising data that is being sent out by the peripherals
Syntax
api.ble.scanner.start(timeout_sec)
Parameters
timeout_secfield is scanning stop after x seconds. if timeout_sec= 0, always scanning on
Returns
void

◆ setInterval()

bool setInterval ( uint16_t  scan_interval,
uint16_t  scan_window 
)
Description
With BLE scanner , you specify a scan window (how long to scan) and interval (how long to wait between scans).
Syntax
api.ble.scanner.setInterval(scan_interval, scan_window);
Parameters
scan_intervalDefines at what intervals scanner is started. (3ms ~ 40960ms)
scan_winodwDefines how long to scan at each interval (3ms ~ 40960ms)
Returns
TRUE for success SET,FALSE for SET fail(Type: bool)

◆ setScannerCallback()

void setScannerCallback ( void(*)(int8_t, uint8_t *, uint8_t *, uint16_t)  userFunc)
Description
This API is used to register a callback function, so that application can be notified on receiving scan data.
Syntax
api.ble.scanner.setScannerCallback(userFunc)
Parameters
userFunccallback
Returns
void