So trying to follow the workshop at https://docs.particle.io/workshops/particle-101-workshop/ble/
But I seem to be getting caught at an error of the BleUuid type not being found.
Am I missing something simple here?
I am compiling this against an Argon with OS 1.5.1
BluetoothWorkshop.ino:13:7: error: 'BleUuid' does not name a type
const BleUuid serviceUuid("5c1b9a0d-b5be-4a40-8f7a-66b36d0a5176"); // CHANGE ME
Here is the code I am using.
SYSTEM_THREAD(ENABLED);
#include "DiagnosticsHelperRK.h"
// Private battery and power service UUID
const BleUuid serviceUuid("5c1b9a0d-b5be-4a40-8f7a-66b36d0a5176"); // CHANGE ME
BleCharacteristic uptimeCharacteristic(
"uptime",
BleCharacteristicProperty::NOTIFY,
BleUuid("fdcf4a3f-3fed-4ed2-84e6-04bbb9ae04d4"),
serviceUuid);
BleCharacteristic signalStrengthCharacteristic(
"strength",
BleCharacteristicProperty::NOTIFY,
BleUuid("cc97c20c-5822-4800-ade5-1f661d2133ee"),
serviceUuid);
BleCharacteristic freeMemoryCharacteristic(
"freeMemory",
BleCharacteristicProperty::NOTIFY,
BleUuid("d2b26bf3-9792-42fc-9e8a-41f6107df04c"),
serviceUuid);
void configureBLE() {
BLE.addCharacteristic(uptimeCharacteristic);
BLE.addCharacteristic(signalStrengthCharacteristic);
BLE.addCharacteristic(freeMemoryCharacteristic);
BleAdvertisingData advData;
// Advertise our private service only
advData.appendServiceUUID(serviceUuid);
// Continuously advertise when not connected
BLE.advertise(&advData);
}
void setup() {
configureBLE();
}
void loop() {
if (BLE.connected())
{
uint8_t uptime = (uint8_t)DiagnosticsHelper::getValue(DIAG_ID_SYSTEM_UPTIME);
uptimeCharacteristic.setValue(uptime);
uint8_t signalStrength = (uint8_t)(DiagnosticsHelper::getValue(DIAG_ID_NETWORK_SIGNAL_STRENGTH) >> 8);
signalStrengthCharacteristic.setValue(signalStrength);
int32_t usedRAM = DiagnosticsHelper::getValue(DIAG_ID_SYSTEM_USED_RAM);
int32_t totalRAM = DiagnosticsHelper::getValue(DIAG_ID_SYSTEM_TOTAL_RAM);
int32_t freeMem = (totalRAM - usedRAM);
freeMemoryCharacteristic.setValue(freeMem);
}
}