Set default pin to “0000”

This commit is contained in:
Kristian Lauszus 2013-11-25 02:20:57 +01:00
parent 253b43c06f
commit eed70438be
4 changed files with 6 additions and 6 deletions

View file

@ -72,9 +72,9 @@ public:
* Constructor for the BTHID class.
* @param p Pointer to the BTD class instance.
* @param pair Set this to true in order to pair with the device. If the argument is omitted then it will not pair with it. One can use ::PAIR to set it to true.
* @param pin Write the pin to BTD#btdPin. If argument is omitted, then "1234" will be used.
* @param pin Write the pin to BTD#btdPin. If argument is omitted, then "0000" will be used.
*/
BTHID(BTD *p, bool pair = false, const char *pin = "1234");
BTHID(BTD *p, bool pair = false, const char *pin = "0000");
/** @name BluetoothService implementation */
/**

4
SPP.h
View file

@ -96,9 +96,9 @@ public:
* Constructor for the SPP class.
* @param p Pointer to BTD class instance.
* @param name Set the name to BTD#btdName. If argument is omitted, then "Arduino" will be used.
* @param pin Write the pin to BTD#btdPin. If argument is omitted, then "1234" will be used.
* @param pin Write the pin to BTD#btdPin. If argument is omitted, then "0000" will be used.
*/
SPP(BTD *p, const char* name = "Arduino", const char* pin = "1234");
SPP(BTD *p, const char *name = "Arduino", const char *pin = "0000");
/**
* Used to provide Boolean tests for the class.

View file

@ -19,7 +19,7 @@ USB Usb;
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
/* You can create the instances of the bluetooth services in two ways */
SPP SerialBT(&Btd); // This will set the name to the defaults: "Arduino" and the pin to "1234"
SPP SerialBT(&Btd); // This will set the name to the defaults: "Arduino" and the pin to "0000"
//SPP SerialBTBT(&Btd,"Lauszus's Arduino","0000"); // You can also set the name and pin like so
PS3BT PS3(&Btd); // This will just create the instance
//PS3BT PS3(&Btd,0x00,0x15,0x83,0x3D,0x0A,0x57); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch

View file

@ -18,7 +18,7 @@ uint8_t buffer[50];
void setup() {
for (uint8_t i = 0; i < length; i++)
SerialBT[i] = new SPP(&Btd); // This will set the name to the default: "Arduino" and the pin to "1234" for all connections
SerialBT[i] = new SPP(&Btd); // This will set the name to the default: "Arduino" and the pin to "0000" for all connections
Serial.begin(115200);
while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection