Skip to content

Commit

Permalink
Changed NimbleCharacteristicCallbacks to match new signatures. Also g…
Browse files Browse the repository at this point in the history
…ave them override so if this happens again we will notice.
  • Loading branch information
jackjansen committed Jan 10, 2025
1 parent 3a39da4 commit 8d1b062
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
13 changes: 12 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
; http://docs.platformio.org/page/projectconf.html
[platformio]
default_envs =
lolin32-example-input
esp32c3supermini-example-bleled
;
; common options for all variants of iotsa
;
Expand Down Expand Up @@ -123,6 +123,13 @@ board_build.mcu = esp32c3
board_build.partitions = bare_minimum_2MB.csv
board_upload.flash_size = 2MB

[esp32c3supermini]
extends = esp32c3
board = esp32-c3-devkitm-1
board_build.mcu = esp32c3
board_build.partitions = min_spiffs.csv
board_upload.flash_size = 4MB

[example-hello]
build_src_filter = +<*> +<../examples/Hello>

Expand Down Expand Up @@ -240,6 +247,10 @@ build_flags = -DIOTSA_BLE_DEBUG -DIOTSA_WITH_BLE -DNEOPIXEL_PIN=2 -DWITHOUT_VOLT
extends = esp32c3lcd, example-bleled
build_flags = -DIOTSA_BLE_DEBUG -DIOTSA_WITH_BLE -DNEOPIXEL_PIN=2 -DWITHOUT_VOLTAGE ${esp32c3lcd.build_flags}

[env:esp32c3supermini-example-bleled]
extends = esp32c3supermini, example-bleled
build_flags = -DIOTSA_BLE_DEBUG -DIOTSA_WITH_BLE -DNEOPIXEL_PIN=2 -DWITHOUT_VOLTAGE ${esp32c3supermini.build_flags} -DIOTSA_DELAY_ON_BOOT=3 -DCONFIG_NIMBLE_CPP_DEBUG_LEVEL=4 -DCORE_DEBUG_LEVEL=6 -DIOTSA_BLE_DEBUG=1

[env:esp32thing-example-nonimbleled]
extends = esp32thing, example-bleled
build_flags = -DIOTSA_WITH_BLE -DIOTSA_WITHOUT_NIMBLE
Expand Down
10 changes: 3 additions & 7 deletions src/iotsaBLEServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,22 @@ class IotsaBLEServerCallbacks : public BLEServerCallbacks {
}
};

class IotsaBLECharacteristicCallbacks : public BLECharacteristicCallbacks {
class IotsaBLECharacteristicCallbacks : public NimBLECharacteristicCallbacks {
public:
IotsaBLECharacteristicCallbacks(UUIDstring _charUUID, IotsaBLEApiProvider *_api)
: charUUID(_charUUID),
api(_api)
{}

void onRead(BLECharacteristic* pCharacteristic) {
void onRead(BLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo) override {
IFBLEDEBUG IotsaSerial.printf("BLE char onRead %s\n", pCharacteristic->getUUID().toString().c_str());
iotsaConfig.postponeSleep(0);
api->bleGetHandler(charUUID);
}
void onWrite(BLECharacteristic* pCharacteristic) {
void onWrite(BLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo) override {
IFBLEDEBUG IotsaSerial.printf("BLE char onWrite %s\n", pCharacteristic->getUUID().toString().c_str());
iotsaConfig.postponeSleep(0);
api->blePutHandler(charUUID);
}
void onNotify(BLECharacteristic* pCharacteristic) {
IFBLEDEBUG IotsaSerial.printf("BLE char onNotify %s\n", pCharacteristic->getUUID().toString().c_str());
iotsaConfig.postponeSleep(0);
}
void onStatus(BLECharacteristic* pCharacteristic, uint32_t code) {
iotsaConfig.postponeSleep(0);
Expand Down

0 comments on commit 8d1b062

Please sign in to comment.