@@ -74,9 +74,9 @@ Adafruit_NeoPixel neopixels = Adafruit_NeoPixel(NEOPIXEL_NUM, PIN_NEOPIXEL, NEO_
74
74
75
75
BLEService service (UUID_GEN(" 0000" ));
76
76
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 );
80
80
// BLECharacteristic inferenceTxChar (UUID_GEN("1004"), BLERead | BLENotify, 3);
81
81
//
82
82
// BLEUnsignedCharCharacteristic numClassesRxChar (UUID_GEN("2001"), BLEWrite);
@@ -427,10 +427,11 @@ void setup()
427
427
428
428
service.begin ();
429
429
430
+ versionTxChar.begin ();
431
+ dataProviderTxChar.begin ();
432
+ dataProviderLabelsTxChar.begin ();
433
+
430
434
#if 0
431
- service.addCharacteristic(versionTxChar);
432
- service.addCharacteristic(dataProviderTxChar);
433
- service.addCharacteristic(dataProviderLabelsTxChar);
434
435
service.addCharacteristic(inferenceTxChar);
435
436
436
437
service.addCharacteristic(numClassesRxChar);
@@ -526,13 +527,13 @@ void setup()
526
527
BLE.advertise();
527
528
528
529
Serial.println("Bluetooth device active, waiting for connections...");
530
+ #endif
529
531
530
532
// Broadcast sketch version
531
- versionTxChar.writeValue (VERSION);
533
+ versionTxChar.write8 (VERSION);
532
534
533
535
// 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" );
536
537
}
537
538
538
539
inline void updateIMU ()
0 commit comments