From c5ec4c24029a7e75affdb42b77f42b2148439973 Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Mon, 21 Apr 2014 19:28:00 +0200 Subject: [PATCH] Allow the user to write the remote Bluetooth address LSB, as it is normally shown --- SPPClient.cpp | 2 +- SPPServer.cpp | 2 +- examples/Bluetooth/SPP/SPPClient/SPPClient.ino | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SPPClient.cpp b/SPPClient.cpp index 4f08a0c9..79bfe382 100755 --- a/SPPClient.cpp +++ b/SPPClient.cpp @@ -42,7 +42,7 @@ SPPBase(p) pBtd->pairWithOtherDevice = pair; for (uint8_t i = 0; i < 6; i++) - pBtd->remote_bdaddr[i] = addr[i]; + pBtd->remote_bdaddr[i] = addr[5 - i]; /* Set device cid for the SDP and RFCOMM channels */ sdp_scid[0] = 0x50; // 0x0050 diff --git a/SPPServer.cpp b/SPPServer.cpp index 88f90b84..eb1c47cf 100755 --- a/SPPServer.cpp +++ b/SPPServer.cpp @@ -33,7 +33,7 @@ SPPBase(p) pBtd->pairWithOtherDevice = pair; for (uint8_t i = 0; i < 6; i++) - pBtd->remote_bdaddr[i] = addr[i]; + pBtd->remote_bdaddr[i] = addr[5 - i]; /* Set device cid for the SDP and RFCOMM channelse */ sdp_dcid[0] = 0x50; // 0x0050 diff --git a/examples/Bluetooth/SPP/SPPClient/SPPClient.ino b/examples/Bluetooth/SPP/SPPClient/SPPClient.ino index 137f9771..e84767dc 100644 --- a/examples/Bluetooth/SPP/SPPClient/SPPClient.ino +++ b/examples/Bluetooth/SPP/SPPClient/SPPClient.ino @@ -16,7 +16,8 @@ USB Usb; BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so -uint8_t addr[6] = { 0x71, 0xB4, 0xB0, 0xC8, 0xBC, 0xC8 }; // Set this to the Bluetooth address you want to connect to +uint8_t addr[6] = { 0x00, 0x12, 0x02, 0x10, 0x45, 0x13 }; // Set this to the Bluetooth address you want to connect to + SPPClient SerialBT(&Btd, "Arduino", "0000", true, addr); boolean firstMessage = true;