boolean begin( const uint8_t* name = NULL, const uint8_t* pinCode = NULL );
boolean begin( const uint8_t* name = NULL, const uint8_t* pinCode = NULL );
Initializes Bluetooth module and sets up a Bluetooth SPP server instance.
|
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. |
true: Successful.
false: Failed.
#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() { }
LBTServer.h