Skip to content

Commit c5ec4c2

Browse files
committed
Allow the user to write the remote Bluetooth address LSB, as it is normally shown
1 parent d9bbd6f commit c5ec4c2

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

SPPClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ SPPBase(p)
4242
pBtd->pairWithOtherDevice = pair;
4343

4444
for (uint8_t i = 0; i < 6; i++)
45-
pBtd->remote_bdaddr[i] = addr[i];
45+
pBtd->remote_bdaddr[i] = addr[5 - i];
4646

4747
/* Set device cid for the SDP and RFCOMM channels */
4848
sdp_scid[0] = 0x50; // 0x0050

SPPServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ SPPBase(p)
3333
pBtd->pairWithOtherDevice = pair;
3434

3535
for (uint8_t i = 0; i < 6; i++)
36-
pBtd->remote_bdaddr[i] = addr[i];
36+
pBtd->remote_bdaddr[i] = addr[5 - i];
3737

3838
/* Set device cid for the SDP and RFCOMM channelse */
3939
sdp_dcid[0] = 0x50; // 0x0050

examples/Bluetooth/SPP/SPPClient/SPPClient.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ USB Usb;
1616

1717
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
1818

19-
uint8_t addr[6] = { 0x71, 0xB4, 0xB0, 0xC8, 0xBC, 0xC8 }; // Set this to the Bluetooth address you want to connect to
19+
uint8_t addr[6] = { 0x00, 0x12, 0x02, 0x10, 0x45, 0x13 }; // Set this to the Bluetooth address you want to connect to
20+
2021
SPPClient SerialBT(&Btd, "Arduino", "0000", true, addr);
2122

2223
boolean firstMessage = true;

0 commit comments

Comments
 (0)