I am working to create a new service with a characteristic.
The code compiles. LightBlue can list the service after I connect to it. However, when connecting to it with code, I can’t seem to list MY service. i do however get the 6fa90001-5c4e-48a8-94f4-8030546f36fc service which I am guessing is the mesh service. This also consequently eats up all the advertising space.
Here is the current iteration of the code if anyone has ideas. Thanks!
SYSTEM_THREAD(ENABLED);
const char* serviceUuidId = "98AE4000-7F06-4BF1-AA40-FA79B014467D";
const char* touchResultId = "98AE4001-7F06-4BF1-AA40-FA79B014467D";
const BleUuid serviceUuid(serviceUuidId);
const BleUuid valueUuid(touchResultId);
void setup() {
BleCharacteristic touchCharacteristic("touch", BleCharacteristicProperty::NOTIFY, valueUuid, serviceUuid);
BLE.addCharacteristic(touchCharacteristic);
BleAdvertisingData data;
data.appendServiceUUID(serviceUuid);
BLE.advertise(&data);
pinMode(D0, INPUT_PULLDOWN);
pinMode(D7, OUTPUT);
}
void loop() {
// if (BLE.connected()) {
// touchCharacteristic.setValue((uint8_t)77);
// } else {
if(digitalRead(D0) == 0) {
digitalWrite(D7, 1);
// touchCharacteristic.setValue((uint8_t)0);
} else {
digitalWrite(D7, 0);
// touchCharacteristic.setValue((uint8_t)1);
}
// }
}

