ContentsIndex
Example
LBTServerClass::connected Method
#include <LBT.h>
#include <LBTServer.h>
  
void setup()
{
  Serial.begin(9600);
  bool success = LBTServer.begin();
  if( !success )
  {
      Serial.println("Cannot begin Bluetooth Server successfully");
      // Do nothing.
      while(true);
  }
  else
  {
      Serial.println("Bluetooth Server begins successfully");
  }
 
}
 
void loop()
{
﹛﹛ if(!LBTServer.connected())
    {
       // waiting for Spp Client to connect
       bool connected = LBTServer.accept(20);
 
       if( !connected )
       {
           Serial.println("No connection request yet");
           // Do nothing.
           while(true);
       }
       else
       {
           Serial.println("Connected");
       }
    }
    else
    {
        char buffer[10];
        int read_size = LBTServer.read((uint8_t*)buffer, 10);
        if(read_size > 0)
        {
            Serial.print("size read: ");
            Serial.println(read_size);
            Serial.println(buffer);
        }
    }
}