Syntax
boolean begin(
    const uint8_t* name = NULL, 
    const uint8_t* pinCode = NULL
);
ContentsIndex
PreviousUpNext
LBTServerClass::begin Method
LBTServerClass Class | Example
Syntax
boolean begin(
    const uint8_t* name = NULL, 
    const uint8_t* pinCode = NULL
);
Description

Initializes Bluetooth module and sets up a Bluetooth SPP server instance.

Parameters
Parameters 
Description 
const uint8_t* name = NULL 
The device name to set.
 
const uint8_t* pinCode = NULL 
Bluetooth 2.0 pincode, if you set it as a constant string, it will enable LinkIt One to communicate with a Bluetooth 2.0 device. 
Returns

true: Successful. 

false: Failed.

Example
#include <LBTServer.h>
  
void setup()
{
  Serial.begin(9600);
  bool success = LBTServer.begin((uint8_t*)"LBTServer"); //bool success = LBTServer.begin((uint8_t*)"BTServer",(uint8_t*)"1234");
  if( !success )
  {
      Serial.println("Cannot begin Bluetooth Server successfully");
      // Do nothing.
      while(true);
  }
  else
  {
      Serial.println("Bluetooth Server begins successfully");
  }
}
 
void loop()
{
  
}
File

LBTServer.h

Class