Skip to content

Commit b28bba7

Browse files
committed
mimic version, data provider, data provider label
1 parent 97fad97 commit b28bba7

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/tf4micro-motion-kit/tf4micro-motion-kit.ino

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ Adafruit_NeoPixel neopixels = Adafruit_NeoPixel(NEOPIXEL_NUM, PIN_NEOPIXEL, NEO_
7474

7575
BLEService service (UUID_GEN("0000"));
7676

77-
//BLECharacteristic dataProviderTxChar (UUID_GEN("1001"), BLERead | BLENotify, 9 * FLOAT_BYTE_SIZE);
78-
//BLECharacteristic dataProviderLabelsTxChar (UUID_GEN("1002"), BLERead, 128);
79-
//BLEUnsignedCharCharacteristic versionTxChar (UUID_GEN("1003"), BLERead);
77+
BLECharacteristic dataProviderTxChar (UUID_GEN("1001"), BLERead | BLENotify, 9 * FLOAT_BYTE_SIZE);
78+
BLECharacteristic dataProviderLabelsTxChar (UUID_GEN("1002"), BLERead, 128);
79+
BLECharacteristic versionTxChar (UUID_GEN("1003"), BLERead, 1, true);
8080
//BLECharacteristic inferenceTxChar (UUID_GEN("1004"), BLERead | BLENotify, 3);
8181
//
8282
//BLEUnsignedCharCharacteristic numClassesRxChar (UUID_GEN("2001"), BLEWrite);
@@ -427,10 +427,11 @@ void setup()
427427

428428
service.begin();
429429

430+
versionTxChar.begin();
431+
dataProviderTxChar.begin();
432+
dataProviderLabelsTxChar.begin();
433+
430434
#if 0
431-
service.addCharacteristic(versionTxChar);
432-
service.addCharacteristic(dataProviderTxChar);
433-
service.addCharacteristic(dataProviderLabelsTxChar);
434435
service.addCharacteristic(inferenceTxChar);
435436

436437
service.addCharacteristic(numClassesRxChar);
@@ -526,13 +527,13 @@ void setup()
526527
BLE.advertise();
527528

528529
Serial.println("Bluetooth device active, waiting for connections...");
530+
#endif
529531

530532
// Broadcast sketch version
531-
versionTxChar.writeValue(VERSION);
533+
versionTxChar.write8(VERSION);
532534

533535
// Used for Tiny Motion Trainer to label / filter values
534-
dataProviderLabelsTxChar.writeValue("acc.x, acc.y, acc.z, gyro.x, gyro.y, gyro.z, mag.x, mag.y, max.zl");
535-
#endif
536+
dataProviderLabelsTxChar.write("acc.x, acc.y, acc.z, gyro.x, gyro.y, gyro.z, mag.x, mag.y, max.zl");
536537
}
537538

538539
inline void updateIMU()

0 commit comments

Comments
 (0)