Skip to content

Commit 0376547

Browse files
committed
Jira 870, Change sensortag_button.ino to use localName
Feature added: - Since the BLE library now support the Scan Response Data processing, update the sketch to look for the sensorTag localName instead of its specific unit address. Cod mods: 1. sensortag_button.ino: - Replace MAC address comparison with localName string comparison.
1 parent 17d642b commit 0376547

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

libraries/CurieBLE/examples/central/sensortag_button/sensortag_button.ino

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,12 @@ void loop() {
4343
Serial.print(peripheral.advertisedServiceUuid());
4444
Serial.println();
4545

46-
/*see if peripheral is a SensorTag
47-
The localName SensorTag is in the Scan Response data packet
48-
In this release we do not have the feature that gets the scan response data and hence
49-
the local name in the scan is blank
50-
We have to explicitly find the BLE mac address
51-
Please use another deviice like nrfConnect app to discover the Bluetooth Address
52-
*/
53-
//if (peripheral.localName() == "SensorTag") {
54-
55-
56-
/******************************************************
57-
* ATTENTION:
58-
* Change to the mac address according to your device!
59-
* Use a central app that can display the BT MAC address
60-
* ******************************************************
61-
*/
62-
if (peripheral.address() == "68:C9:0B:06:BC:81") {
46+
/* see if peripheral is a SensorTag
47+
* The localName, CC2650 SensorTag, is in the Scan Response Data packet.
48+
* If this is not the expected name, please change the following
49+
* if-statement accordingly.
50+
*/
51+
if (peripheral.localName() == "CC2650 SensorTag") {
6352
// stop scanning
6453
BLE.stopScan();
6554

0 commit comments

Comments
 (0)