Syntax
int scan(
    size_t time_out = 20
);
ContentsIndex
PreviousUpNext
LBTClientClass::scan Method
LBTClientClass Class | Example
Syntax
int scan(
    size_t time_out = 20
);
Description

Scans for nearby Bluetooth devices, up to 10 devices can be scanned.

Parameters
Parameters 
Description 
size_t time_out = 20 
[IN] timeout duration in seconds of the scan process 
Returns

Number of devices scanned.

Example
#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()
{
  
}
File

LBTClient.h

Class