int scan( size_t time_out = 20 );
int scan( size_t time_out = 20 );
Scans for nearby Bluetooth devices, up to 10 devices can be scanned.
|
Parameters |
Description |
|
size_t time_out = 20 |
[IN] timeout duration in seconds of the scan process |
Number of devices scanned.
#include <LBTClient.h> void setup() { Serial.begin(9600); bool success = LBTClient.begin(); if( !success ) { Serial.println("Cannot begin Bluetooth Client successfully"); // Do nothing. while(true); } else { Serial.println("Bluetooth Client begins successfully"); // start scan, at most scan 15 seconds int num = LBTClient.scan(15); Serial.print("Scanned Device number:"); Serial.println(num); } } void loop() { }
LBTClient.h