boolean getHostDeviceInfo( LBTDeviceInfo* dev_info );
boolean getHostDeviceInfo( LBTDeviceInfo* dev_info );
Gets scanned device information.
|
Parameters |
Description |
|
LBTDeviceInfo* dev_info |
[OUT] Device information acquired. |
true: Successful.
false: Failed. Possible causes include unreasonable index or the device hasn't been scanned before.
#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() { }
LBTServer.h