diff --git a/platformio.ini b/platformio.ini index bcca900..3c57c5d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -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 ; @@ -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> @@ -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 diff --git a/src/iotsaBLEServer.cpp b/src/iotsaBLEServer.cpp index ae85a3d..e4242ff 100644 --- a/src/iotsaBLEServer.cpp +++ b/src/iotsaBLEServer.cpp @@ -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);