Syntax
boolean getHostDeviceInfo(
    LBTDeviceInfo* dev_info
);
ContentsIndex
PreviousUpNext
LBTServerClass::getHostDeviceInfo Method
LBTServerClass Class | Example
Syntax
boolean getHostDeviceInfo(
    LBTDeviceInfo* dev_info
);
Description

Gets scanned device information.

Parameters
Parameters 
Description 
LBTDeviceInfo* dev_info 
[OUT] Device information acquired. 
Returns

true: Successful. 

false: Failed. Possible causes include unreasonable index or the device hasn't been scanned before.

Example
#include <LBT.h>
#include <LBTServer.h>
 
void setup()
{
  Serial.begin(9600);
  bool success = LBTServer.begin("LBTServer");
  if( !success )
  {
      Serial.println("Cannot begin Bluetooth Server successfully");
      // Do nothing.
      while(true);
  }
  else
  {
      Serial.println("Bluetooth Server begins successfully");
      LBTDeviceInfo info = {0};
      bool success = LBTServer.getHostDeviceInfo(i, &info);
      if( success )
      {
          Serial.print("Device name:");
          Serial.println(info.name);
      }
  }
}
 
void loop()
{
  
}
File

LBTServer.h

Class