From 6bfcd6d9a9a7ecd07d656a7a88673c93e7d4d537 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:16:55 -0300 Subject: [PATCH] refactor(style): Change some style options (#9526) * refactor(style): Change some style options * refactor(style): Apply style changes --- .clang-format | 188 +- .pre-commit-config.yaml | 2 +- cores/esp32/Arduino.h | 138 +- cores/esp32/Client.h | 1 + cores/esp32/Esp.cpp | 52 +- cores/esp32/Esp.h | 1 - cores/esp32/FirmwareMSC.cpp | 6 +- cores/esp32/FunctionalInterrupt.cpp | 16 +- cores/esp32/HEXBuilder.cpp | 20 +- cores/esp32/HEXBuilder.h | 8 +- cores/esp32/HWCDC.cpp | 52 +- cores/esp32/HardwareSerial.cpp | 59 +- cores/esp32/HardwareSerial.h | 6 +- cores/esp32/HashBuilder.h | 14 +- cores/esp32/IPAddress.cpp | 70 +- cores/esp32/IPAddress.h | 49 +- cores/esp32/MD5Builder.cpp | 14 +- cores/esp32/MD5Builder.h | 11 +- cores/esp32/MacAddress.cpp | 27 +- cores/esp32/MacAddress.h | 6 +- cores/esp32/Print.h | 9 +- cores/esp32/Printable.h | 2 +- cores/esp32/SHA1Builder.cpp | 66 +- cores/esp32/SHA1Builder.h | 12 +- cores/esp32/Stream.cpp | 26 +- cores/esp32/Stream.h | 3 +- cores/esp32/StreamString.cpp | 3 +- cores/esp32/StreamString.h | 1 - cores/esp32/Tone.cpp | 6 +- cores/esp32/USB.cpp | 12 +- cores/esp32/USB.h | 17 +- cores/esp32/USBCDC.cpp | 25 +- cores/esp32/USBCDC.h | 1 - cores/esp32/USBMSC.cpp | 35 +- cores/esp32/USBMSC.h | 11 +- cores/esp32/Udp.h | 13 +- cores/esp32/WCharacter.h | 2 +- cores/esp32/WString.cpp | 234 +- cores/esp32/WString.h | 82 +- cores/esp32/base64.h | 6 +- cores/esp32/cbuf.cpp | 40 +- cores/esp32/cbuf.h | 6 +- cores/esp32/chip-debug-report.cpp | 58 +- cores/esp32/esp32-hal-adc.c | 11 +- cores/esp32/esp32-hal-adc.h | 81 +- cores/esp32/esp32-hal-bt.c | 19 +- cores/esp32/esp32-hal-bt.h | 18 +- cores/esp32/esp32-hal-cpu.c | 60 +- cores/esp32/esp32-hal-cpu.h | 30 +- cores/esp32/esp32-hal-dac.c | 4 +- cores/esp32/esp32-hal-dac.h | 4 +- cores/esp32/esp32-hal-gpio.c | 26 +- cores/esp32/esp32-hal-gpio.h | 68 +- cores/esp32/esp32-hal-i2c-slave.c | 47 +- cores/esp32/esp32-hal-i2c-slave.h | 12 +- cores/esp32/esp32-hal-i2c.c | 19 +- cores/esp32/esp32-hal-i2c.h | 18 +- cores/esp32/esp32-hal-ledc.c | 47 +- cores/esp32/esp32-hal-ledc.h | 104 +- cores/esp32/esp32-hal-log.h | 270 +- cores/esp32/esp32-hal-matrix.c | 3 +- cores/esp32/esp32-hal-matrix.h | 9 +- cores/esp32/esp32-hal-misc.c | 13 +- cores/esp32/esp32-hal-periman.c | 88 +- cores/esp32/esp32-hal-periman.h | 166 +- cores/esp32/esp32-hal-psram.c | 1 - cores/esp32/esp32-hal-psram.h | 10 +- cores/esp32/esp32-hal-rgb-led.c | 3 +- cores/esp32/esp32-hal-rgb-led.h | 2 +- cores/esp32/esp32-hal-rmt.c | 31 +- cores/esp32/esp32-hal-rmt.h | 102 +- cores/esp32/esp32-hal-sigmadelta.c | 9 +- cores/esp32/esp32-hal-sigmadelta.h | 8 +- cores/esp32/esp32-hal-spi.c | 271 +- cores/esp32/esp32-hal-spi.h | 137 +- cores/esp32/esp32-hal-time.c | 22 +- cores/esp32/esp32-hal-timer.c | 4 +- cores/esp32/esp32-hal-timer.h | 34 +- cores/esp32/esp32-hal-tinyusb.c | 49 +- cores/esp32/esp32-hal-tinyusb.h | 112 +- cores/esp32/esp32-hal-touch.c | 5 +- cores/esp32/esp32-hal-touch.h | 33 +- cores/esp32/esp32-hal-uart.c | 277 +- cores/esp32/esp32-hal-uart.h | 124 +- cores/esp32/esp32-hal.h | 99 +- cores/esp32/esp8266-compat.h | 1 - cores/esp32/esp_arduino_version.h | 8 +- cores/esp32/extra_attr.h | 2 +- cores/esp32/firmware_msc_fat.c | 10 +- cores/esp32/firmware_msc_fat.h | 184 +- cores/esp32/io_pin_remap.h | 114 +- cores/esp32/libb64/cdecode.c | 32 +- cores/esp32/libb64/cdecode.h | 28 +- cores/esp32/libb64/cencode.c | 21 +- cores/esp32/libb64/cencode.h | 30 +- cores/esp32/main.cpp | 4 +- cores/esp32/pgmspace.h | 94 +- cores/esp32/stdlib_noniso.c | 43 +- cores/esp32/stdlib_noniso.h | 21 +- cores/esp32/wiring_private.h | 4 +- cores/esp32/wiring_pulse.c | 8 +- cores/esp32/wiring_shift.c | 10 +- .../ArduinoOTA/examples/BasicOTA/BasicOTA.ino | 25 +- libraries/ArduinoOTA/src/ArduinoOTA.cpp | 41 +- libraries/ArduinoOTA/src/ArduinoOTA.h | 22 +- .../AsyncUDPClient/AsyncUDPClient.ino | 7 +- .../AsyncUDPMulticastServer.ino | 7 +- .../AsyncUDPServer/AsyncUDPServer.ino | 7 +- libraries/AsyncUDP/src/AsyncUDP.cpp | 12 +- libraries/AsyncUDP/src/AsyncUDP.h | 2 + .../BLE5_extended_scan/BLE5_extended_scan.ino | 2 +- .../BLE5_multi_advertising.ino | 56 +- .../BLE5_periodic_advertising.ino | 23 +- .../BLE5_periodic_sync/BLE5_periodic_sync.ino | 14 +- .../Beacon_Scanner/Beacon_Scanner.ino | 5 +- libraries/BLE/examples/Client/Client.ino | 31 +- .../EddystoneTLM_Beacon.ino | 5 +- .../EddystoneURL_Beacon.ino | 7 +- libraries/BLE/examples/Notify/Notify.ino | 22 +- libraries/BLE/examples/Scan/Scan.ino | 4 +- libraries/BLE/examples/Server/Server.ino | 7 +- .../Server_multiconnect.ino | 22 +- libraries/BLE/examples/UART/UART.ino | 15 +- libraries/BLE/examples/Write/Write.ino | 11 +- libraries/BLE/examples/iBeacon/iBeacon.ino | 31 +- libraries/BLE/src/BLE2902.cpp | 23 +- libraries/BLE/src/BLE2904.cpp | 21 +- libraries/BLE/src/BLEAddress.cpp | 24 +- libraries/BLE/src/BLEAddress.h | 15 +- libraries/BLE/src/BLEAdvertisedDevice.cpp | 224 +- libraries/BLE/src/BLEAdvertisedDevice.h | 23 +- libraries/BLE/src/BLEAdvertising.cpp | 295 +- libraries/BLE/src/BLEAdvertising.h | 29 +- libraries/BLE/src/BLEBeacon.cpp | 6 +- libraries/BLE/src/BLEBeacon.h | 1 + libraries/BLE/src/BLECharacteristic.cpp | 467 ++- libraries/BLE/src/BLECharacteristic.h | 79 +- libraries/BLE/src/BLECharacteristicMap.cpp | 52 +- libraries/BLE/src/BLEClient.cpp | 241 +- libraries/BLE/src/BLEClient.h | 43 +- libraries/BLE/src/BLEDescriptor.cpp | 104 +- libraries/BLE/src/BLEDescriptor.h | 24 +- libraries/BLE/src/BLEDescriptorMap.cpp | 73 +- libraries/BLE/src/BLEDevice.cpp | 163 +- libraries/BLE/src/BLEDevice.h | 63 +- libraries/BLE/src/BLEEddystoneTLM.cpp | 9 +- libraries/BLE/src/BLEEddystoneTLM.h | 10 +- libraries/BLE/src/BLEEddystoneURL.cpp | 13 +- libraries/BLE/src/BLEEddystoneURL.h | 3 +- libraries/BLE/src/BLEExceptions.h | 5 +- libraries/BLE/src/BLEHIDDevice.cpp | 81 +- libraries/BLE/src/BLEHIDDevice.h | 65 +- libraries/BLE/src/BLERemoteCharacteristic.cpp | 227 +- libraries/BLE/src/BLERemoteCharacteristic.h | 22 +- libraries/BLE/src/BLERemoteDescriptor.cpp | 50 +- libraries/BLE/src/BLERemoteDescriptor.h | 13 +- libraries/BLE/src/BLERemoteService.cpp | 72 +- libraries/BLE/src/BLERemoteService.h | 32 +- libraries/BLE/src/BLEScan.cpp | 245 +- libraries/BLE/src/BLEScan.h | 29 +- libraries/BLE/src/BLESecurity.cpp | 53 +- libraries/BLE/src/BLESecurity.h | 3 +- libraries/BLE/src/BLEServer.cpp | 159 +- libraries/BLE/src/BLEServer.h | 65 +- libraries/BLE/src/BLEService.cpp | 137 +- libraries/BLE/src/BLEService.h | 50 +- libraries/BLE/src/BLEServiceMap.cpp | 48 +- libraries/BLE/src/BLEUUID.cpp | 98 +- libraries/BLE/src/BLEUUID.h | 6 +- libraries/BLE/src/BLEUtils.cpp | 2315 +++++++-------- libraries/BLE/src/BLEUtils.h | 40 +- libraries/BLE/src/BLEValue.cpp | 28 +- libraries/BLE/src/BLEValue.h | 6 +- libraries/BLE/src/FreeRTOS.cpp | 27 +- libraries/BLE/src/GeneralUtils.cpp | 255 +- libraries/BLE/src/GeneralUtils.h | 16 +- libraries/BLE/src/HIDKeyboardTypes.h | 615 ++-- libraries/BLE/src/HIDTypes.h | 54 +- libraries/BLE/src/RTOS.h | 11 +- .../DiscoverConnect/DiscoverConnect.ino | 12 +- .../examples/GetLocalMAC/GetLocalMAC.ino | 3 +- .../SerialToSerialBTM/SerialToSerialBTM.ino | 4 +- .../SerialToSerialBT_Legacy.ino | 2 +- .../SerialToSerialBT_SSP.ino | 13 +- .../bt_classic_device_discovery.ino | 13 +- .../bt_remove_paired_devices.ino | 13 +- libraries/BluetoothSerial/src/BTAddress.cpp | 10 +- libraries/BluetoothSerial/src/BTAddress.h | 3 +- .../BluetoothSerial/src/BTAdvertisedDevice.h | 6 +- .../src/BTAdvertisedDeviceSet.cpp | 3 - libraries/BluetoothSerial/src/BTScan.h | 9 +- .../BluetoothSerial/src/BTScanResultsSet.cpp | 34 +- .../BluetoothSerial/src/BluetoothSerial.cpp | 225 +- .../BluetoothSerial/src/BluetoothSerial.h | 12 +- .../examples/CaptivePortal/CaptivePortal.ino | 1 - libraries/DNSServer/src/DNSServer.cpp | 80 +- libraries/DNSServer/src/DNSServer.h | 58 +- .../examples/eeprom_class/eeprom_class.ino | 2 +- libraries/EEPROM/src/EEPROM.cpp | 126 +- libraries/EEPROM/src/EEPROM.h | 38 +- .../examples/AnalogOut/LEDCFade/LEDCFade.ino | 8 +- .../AnalogOut/ledcFrequency/ledcFrequency.ino | 11 +- .../AnalogOut/ledcWrite_RGB/ledcWrite_RGB.ino | 7 +- .../AnalogReadContinuous.ino | 6 +- .../ArduinoStackSize/ArduinoStackSize.ino | 1 - .../CameraWebServer/CameraWebServer.ino | 6 +- .../Camera/CameraWebServer/app_httpd.cpp | 131 +- .../Camera/CameraWebServer/camera_index.h | 2509 +++++++---------- .../Camera/CameraWebServer/camera_pins.h | 382 +-- .../ExternalWakeUp/ExternalWakeUp.ino | 10 +- .../SmoothBlink_ULP_Code.ino | 7 +- .../DeepSleep/TimerWakeUp/TimerWakeUp.ino | 12 +- .../DeepSleep/TouchWakeUp/TouchWakeUp.ino | 30 +- .../ESP32/examples/FreeRTOS/Mutex/Mutex.ino | 11 +- .../ESP32/examples/FreeRTOS/Queue/Queue.ino | 22 +- .../examples/FreeRTOS/Semaphore/Semaphore.ino | 4 +- .../FunctionalInterrupt.ino | 8 +- .../FunctionalInterruptStruct.ino | 14 +- .../GPIO/GPIOInterrupt/GPIOInterrupt.ino | 8 +- .../examples/HWCDC_Events/HWCDC_Events.ino | 33 +- .../GetMacAddress/GetMacAddress.ino | 11 +- .../examples/RMT/RMTCallback/RMTCallback.ino | 7 +- .../examples/RMT/RMTLoopback/RMTLoopback.ino | 9 +- .../examples/RMT/RMTReadXJT/RMTReadXJT.ino | 6 +- .../RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino | 4 +- .../RMT/RMT_CPUFreq_Test/RMT_CPUFreq_Test.ino | 3 +- .../RMT_EndOfTransmissionState.ino | 6 +- .../RMT/RMT_LED_Blink/RMT_LED_Blink.ino | 18 +- .../ResetReason/ResetReason/ResetReason.ino | 32 +- .../ResetReason/ResetReason2/ResetReason2.ino | 26 +- .../BaudRateDetect_Demo.ino | 3 +- .../OnReceiveError_BREAK_Demo.ino | 26 +- .../Serial/OnReceive_Demo/OnReceive_Demo.ino | 17 +- .../RS485_Echo_Demo/RS485_Echo_Demo.ino | 12 +- .../RxFIFOFull_Demo/RxFIFOFull_Demo.ino | 27 +- .../Serial/RxTimeout_Demo/RxTimeout_Demo.ino | 19 +- .../Serial_All_CPU_Freqs.ino | 2 +- .../Serial_STD_Func_OnReceive.ino | 8 +- .../onReceiveExample/onReceiveExample.ino | 1 - .../examples/TWAI/TWAIreceive/TWAIreceive.ino | 2 +- .../TWAI/TWAItransmit/TWAItransmit.ino | 1 - .../ExampleTemplate/ExampleTemplate.ino | 6 +- .../examples/Time/SimpleTime/SimpleTime.ino | 12 +- .../Timer/RepeatTimer/RepeatTimer.ino | 2 +- .../Timer/WatchdogTimer/WatchdogTimer.ino | 2 +- .../Utilities/HEXBuilder/HEXBuilder.ino | 30 +- .../Utilities/MD5Builder/MD5Builder.ino | 27 +- .../Utilities/SHA1Builder/SHA1Builder.ino | 27 +- .../Zigbee_Light_Bulb/Zigbee_Light_Bulb.ino | 64 +- .../Zigbee_Light_Switch.ino | 65 +- .../examples/ES8388_loopback/ES8388.cpp | 229 +- .../ESP_I2S/examples/ES8388_loopback/ES8388.h | 826 +++--- .../ES8388_loopback/ES8388_loopback.ino | 4 +- .../examples/Record_to_WAV/Record_to_WAV.ino | 4 +- .../examples/Simple_tone/Simple_tone.ino | 3 +- libraries/ESP_I2S/src/ESP_I2S.cpp | 581 ++-- libraries/ESP_I2S/src/ESP_I2S.h | 1 - libraries/ESP_I2S/src/wav_header.h | 43 +- .../ESP_NOW_Broadcast_Master.ino | 11 +- .../ESP_NOW_Broadcast_Slave.ino | 14 +- .../ESP_NOW_Network/ESP_NOW_Network.ino | 12 +- .../ESP_NOW_Serial/ESP_NOW_Serial.ino | 18 +- libraries/ESP_NOW/src/ESP32_NOW.h | 2 +- libraries/ESP_NOW/src/ESP32_NOW_Serial.h | 1 + libraries/ESP_SR/examples/Basic/Basic.ino | 50 +- libraries/ESP_SR/src/ESP_SR.cpp | 4 +- libraries/ESP_SR/src/ESP_SR.h | 2 +- libraries/ESP_SR/src/esp32-hal-sr.c | 49 +- libraries/ESP_SR/src/esp32-hal-sr.h | 92 +- .../mDNS-SD_Extended/mDNS-SD_Extended.ino | 6 +- .../mDNS_Web_Server/mDNS_Web_Server.ino | 5 +- libraries/ESPmDNS/src/ESPmDNS.cpp | 50 +- .../examples/ETH_LAN8720/ETH_LAN8720.ino | 22 +- .../examples/ETH_TLK110/ETH_TLK110.ino | 23 +- .../ETH_W5500_Arduino_SPI.ino | 31 +- .../ETH_W5500_IDF_SPI/ETH_W5500_IDF_SPI.ino | 35 +- libraries/Ethernet/src/ETH.cpp | 191 +- libraries/Ethernet/src/ETH.h | 36 +- .../FFat/examples/FFat_Test/FFat_Test.ino | 7 +- .../FFat/examples/FFat_time/FFat_time.ino | 18 +- libraries/FFat/src/FFat.cpp | 41 +- libraries/FFat/src/FFat.h | 14 +- libraries/FS/src/FS.cpp | 44 +- libraries/FS/src/FS.h | 59 +- libraries/FS/src/FSImpl.h | 34 +- libraries/FS/src/vfs_api.cpp | 7 +- libraries/FS/src/vfs_api.h | 34 +- .../examples/Authorization/Authorization.ino | 2 - .../BasicHttpsClient/BasicHttpsClient.ino | 72 +- .../HTTPClientEnterprise.ino | 45 +- .../ReuseConnection/ReuseConnection.ino | 1 - .../StreamHttpClient/StreamHttpClient.ino | 4 +- libraries/HTTPClient/src/HTTPClient.cpp | 248 +- libraries/HTTPClient/src/HTTPClient.h | 89 +- .../examples/httpUpdate/httpUpdate.ino | 12 +- .../httpUpdateSPIFFS/httpUpdateSPIFFS.ino | 12 +- .../httpUpdateSecure/httpUpdateSecure.ino | 70 +- libraries/HTTPUpdate/src/HTTPUpdate.cpp | 67 +- libraries/HTTPUpdate/src/HTTPUpdate.h | 44 +- .../examples/WebUpdater/WebUpdater.ino | 9 +- .../HTTPUpdateServer/src/HTTPUpdateServer.h | 64 +- .../DiagnosticsSmokeTest.ino | 6 +- .../MinimalDiagnostics/MinimalDiagnostics.ino | 2 +- libraries/Insights/src/Insights.cpp | 45 +- libraries/Insights/src/Insights.h | 8 +- .../examples/LITTLEFS_PlatformIO/src/main.cpp | 13 +- .../examples/LITTLEFS_test/LITTLEFS_test.ino | 3 +- .../examples/LITTLEFS_time/LITTLEFS_time.ino | 18 +- libraries/LittleFS/src/LittleFS.cpp | 15 +- libraries/LittleFS/src/LittleFS.h | 7 +- .../NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino | 7 +- libraries/NetBIOS/src/NetBIOS.cpp | 15 +- libraries/NetBIOS/src/NetBIOS.h | 4 +- libraries/Network/src/NetworkClient.cpp | 38 +- libraries/Network/src/NetworkClient.h | 1 - libraries/Network/src/NetworkEvents.cpp | 104 +- libraries/Network/src/NetworkEvents.h | 1 + libraries/Network/src/NetworkInterface.cpp | 176 +- libraries/Network/src/NetworkInterface.h | 25 +- libraries/Network/src/NetworkManager.cpp | 6 +- libraries/Network/src/NetworkServer.cpp | 21 +- libraries/Network/src/NetworkServer.h | 2 +- libraries/Network/src/NetworkUdp.cpp | 48 +- libraries/Network/src/NetworkUdp.h | 13 +- .../WiFiClientInsecure/WiFiClientInsecure.ino | 10 +- .../examples/WiFiClientPSK/WiFiClientPSK.ino | 12 +- .../WiFiClientSecure/WiFiClientSecure.ino | 52 +- .../WiFiClientSecureEnterprise.ino | 77 +- .../WiFiClientSecureProtocolUpgrade.ino | 40 +- .../WiFiClientShowPeerCredentials.ino | 7 +- .../WiFiClientTrustOnFirstUse.ino | 33 +- .../src/NetworkClientSecure.cpp | 46 +- .../NetworkClientSecure/src/ssl_client.cpp | 85 +- .../NetworkClientSecure/src/ssl_client.h | 6 +- .../PPP/examples/PPP_Basic/PPP_Basic.ino | 46 +- libraries/PPP/src/PPP.cpp | 119 +- libraries/PPP/src/PPP.h | 22 +- .../examples/Prefs2Struct/Prefs2Struct.ino | 16 +- libraries/Preferences/src/Preferences.cpp | 130 +- libraries/Preferences/src/Preferences.h | 75 +- .../examples/RMakerCustom/RMakerCustom.ino | 12 +- .../RMakerCustomAirCooler.ino | 18 +- .../RMakerSonoffDualR3/RMakerSonoffDualR3.ino | 16 +- .../examples/RMakerSwitch/RMakerSwitch.ino | 37 +- libraries/RainMaker/src/AppInsights.cpp | 7 +- libraries/RainMaker/src/RMaker.cpp | 59 +- libraries/RainMaker/src/RMaker.h | 3 +- libraries/RainMaker/src/RMakerDevice.h | 2 + libraries/RainMaker/src/RMakerQR.cpp | 11 +- libraries/RainMaker/src/RMakerType.cpp | 4 +- libraries/RainMaker/src/RMakerType.h | 6 +- libraries/SD/examples/SD_Test/SD_Test.ino | 8 +- libraries/SD/examples/SD_time/SD_time.ino | 18 +- libraries/SD/src/SD.cpp | 26 +- libraries/SD/src/SD.h | 10 +- libraries/SD/src/sd_diskio.cpp | 162 +- libraries/SD/src/sd_diskio.h | 8 +- libraries/SD/src/sd_diskio_crc.c | 96 +- .../SD_MMC/examples/SDMMC_Test/SDMMC_Test.ino | 4 +- .../SD_MMC/examples/SDMMC_time/SDMMC_time.ino | 18 +- libraries/SD_MMC/src/SD_MMC.cpp | 71 +- libraries/SD_MMC/src/SD_MMC.h | 11 +- .../SPI_Multiple_Buses/SPI_Multiple_Buses.ino | 8 +- libraries/SPI/src/SPI.cpp | 14 +- libraries/SPI/src/SPI.h | 24 +- .../examples/SPIFFS_Test/SPIFFS_Test.ino | 3 +- .../examples/SPIFFS_time/SPIFFS_time.ino | 18 +- libraries/SPIFFS/src/SPIFFS.cpp | 20 +- libraries/SPIFFS/src/SPIFFS.h | 7 +- .../SimpleBleDevice/SimpleBleDevice.ino | 4 +- libraries/SimpleBLE/src/SimpleBLE.cpp | 7 +- libraries/SimpleBLE/src/SimpleBLE.h | 2 +- .../examples/hello_world/hello_world.ino | 27 +- .../examples/hello_world/model.cpp | 304 +- .../examples/hello_world/output_handler.cpp | 3 +- .../examples/micro_speech/audio_provider.cpp | 38 +- .../examples/micro_speech/audio_provider.h | 3 +- .../micro_speech/command_responder.cpp | 3 +- .../examples/micro_speech/command_responder.h | 3 +- .../micro_speech/feature_provider.cpp | 35 +- .../examples/micro_speech/feature_provider.h | 7 +- .../micro_speech/micro_features_generator.cpp | 17 +- .../micro_speech/micro_features_generator.h | 4 +- .../micro_speech/micro_model_settings.cpp | 2 +- .../micro_speech/micro_model_settings.h | 2 +- .../examples/micro_speech/micro_speech.ino | 39 +- .../examples/micro_speech/model.cpp | 2280 +++++---------- .../micro_speech/recognize_commands.cpp | 36 +- .../micro_speech/recognize_commands.h | 32 +- .../examples/micro_speech/ringbuf.c | 43 +- .../examples/micro_speech/ringbuf.h | 71 +- libraries/Ticker/examples/Blinker/Blinker.ino | 3 +- .../examples/TickerBasic/TickerBasic.ino | 3 +- .../TickerParameter/TickerParameter.ino | 3 +- libraries/Ticker/src/Ticker.cpp | 18 +- libraries/Ticker/src/Ticker.h | 49 +- .../CompositeDevice/CompositeDevice.ino | 97 +- .../CustomHIDDevice/CustomHIDDevice.ino | 4 +- .../USB/examples/FirmwareMSC/FirmwareMSC.ino | 40 +- .../USB/examples/HIDVendor/HIDVendor.ino | 11 +- .../KeyboardLogout/KeyboardLogout.ino | 8 +- .../KeyboardReprogram/KeyboardReprogram.ino | 5 +- .../MIDI/MidiController/MidiController.ino | 23 +- .../MIDI/MidiInterface/MidiInterface.ino | 4 +- .../MIDI/MidiMusicBox/MidiMusicBox.ino | 2 +- .../examples/MIDI/ReceiveMidi/ReceiveMidi.ino | 52 +- .../ButtonMouseControl/ButtonMouseControl.ino | 2 - libraries/USB/examples/USBMSC/USBMSC.ino | 158 +- .../USB/examples/USBSerial/USBSerial.ino | 49 +- .../USB/examples/USBVendor/USBVendor.ino | 67 +- libraries/USB/src/USBHID.cpp | 78 +- libraries/USB/src/USBHID.h | 12 +- libraries/USB/src/USBHIDConsumerControl.cpp | 13 +- libraries/USB/src/USBHIDConsumerControl.h | 47 +- libraries/USB/src/USBHIDGamepad.cpp | 23 +- libraries/USB/src/USBHIDGamepad.h | 47 +- libraries/USB/src/USBHIDKeyboard.cpp | 29 +- libraries/USB/src/USBHIDKeyboard.h | 132 +- libraries/USB/src/USBHIDMouse.cpp | 41 +- libraries/USB/src/USBHIDMouse.h | 30 +- libraries/USB/src/USBHIDSystemControl.cpp | 12 +- libraries/USB/src/USBHIDSystemControl.h | 7 +- libraries/USB/src/USBHIDVendor.cpp | 68 +- libraries/USB/src/USBHIDVendor.h | 15 +- libraries/USB/src/USBMIDI.cpp | 26 +- libraries/USB/src/USBMIDI.h | 4 +- libraries/USB/src/USBVendor.cpp | 17 +- libraries/USB/src/USBVendor.h | 33 +- libraries/USB/src/tusb_hid_mouse.h | 93 +- .../AWS_S3_OTA_Update/AWS_S3_OTA_Update.ino | 4 +- .../HTTPS_OTA_Update/HTTPS_OTA_Update.ino | 31 +- .../HTTP_Client_AES_OTA_Update.ino | 51 +- .../HTTP_Server_AES_OTA_Update.ino | 22 +- .../examples/OTAWebUpdater/OTAWebUpdater.ino | 21 +- .../Update/examples/OTAWebUpdater/html.h | 103 +- .../Update/examples/SD_Update/SD_Update.ino | 3 +- libraries/Update/src/Update.h | 55 +- libraries/Update/src/Updater.cpp | 52 +- .../AdvancedWebServer/AdvancedWebServer.ino | 8 +- .../examples/FSBrowser/FSBrowser.ino | 23 +- .../examples/HelloServer/HelloServer.ino | 4 +- .../HttpAdvancedAuth/HttpAdvancedAuth.ino | 10 +- .../HttpAuthCallback/HttpAuthCallback.ino | 19 +- .../HttpAuthCallbackInline.ino | 25 +- .../examples/HttpBasicAuth/HttpBasicAuth.ino | 8 +- .../HttpBasicAuthSHA1/HttpBasicAuthSHA1.ino | 20 +- .../HttpBasicAuthSHA1orBearerToken.ino | 19 +- .../MultiHomedServers/MultiHomedServers.ino | 4 +- .../examples/SDWebServer/SDWebServer.ino | 8 +- .../SimpleAuthentification.ino | 9 +- .../UploadHugeFile/UploadHugeFile.ino | 14 +- .../examples/WebServer/WebServer.ino | 37 +- .../examples/WebUpdate/WebUpdate.ino | 17 +- libraries/WebServer/src/Parsing.cpp | 115 +- libraries/WebServer/src/Uri.h | 9 +- libraries/WebServer/src/WebServer.cpp | 186 +- libraries/WebServer/src/WebServer.h | 134 +- .../WebServer/src/detail/RequestHandler.h | 14 +- .../src/detail/RequestHandlersImpl.h | 64 +- libraries/WebServer/src/detail/mimetable.cpp | 48 +- libraries/WebServer/src/detail/mimetable.h | 5 +- libraries/WebServer/src/uri/UriBraces.h | 18 +- libraries/WebServer/src/uri/UriGlob.h | 6 +- libraries/WebServer/src/uri/UriRegex.h | 11 +- .../FTM/FTM_Initiator/FTM_Initiator.ino | 5 +- .../FTM/FTM_Responder/FTM_Responder.ino | 4 +- .../SimpleWiFiServer/SimpleWiFiServer.ino | 4 +- libraries/WiFi/examples/WPS/WPS.ino | 17 +- .../WiFiAccessPoint/WiFiAccessPoint.ino | 4 +- .../WiFiBlueToothSwitch.ino | 42 +- .../WiFi/examples/WiFiClient/WiFiClient.ino | 15 +- .../WiFiClientBasic/WiFiClientBasic.ino | 3 +- .../WiFiClientConnect/WiFiClientConnect.ino | 20 +- .../WiFiClientEnterprise.ino | 5 +- .../WiFiClientEvents/WiFiClientEvents.ino | 122 +- .../WiFiClientStaticIP/WiFiClientStaticIP.ino | 8 +- libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino | 15 +- .../WiFiMultiAdvanced/WiFiMultiAdvanced.ino | 8 +- libraries/WiFi/examples/WiFiScan/WiFiScan.ino | 39 +- .../examples/WiFiScanAsync/WiFiScanAsync.ino | 39 +- .../WiFiTelnetToSerial/WiFiTelnetToSerial.ino | 20 +- .../examples/WiFiUDPClient/WiFiUDPClient.ino | 8 +- .../WiFi/examples/WiFiUDPClient/udp_server.py | 16 +- libraries/WiFi/src/AP.cpp | 42 +- libraries/WiFi/src/STA.cpp | 253 +- libraries/WiFi/src/WiFi.cpp | 10 +- libraries/WiFi/src/WiFi.h | 14 +- libraries/WiFi/src/WiFiAP.cpp | 11 +- libraries/WiFi/src/WiFiAP.h | 28 +- libraries/WiFi/src/WiFiGeneric.cpp | 64 +- libraries/WiFi/src/WiFiGeneric.h | 4 +- libraries/WiFi/src/WiFiMulti.cpp | 39 +- libraries/WiFi/src/WiFiMulti.h | 6 +- libraries/WiFi/src/WiFiSTA.cpp | 15 +- libraries/WiFi/src/WiFiSTA.h | 44 +- libraries/WiFi/src/WiFiScan.cpp | 51 +- libraries/WiFi/src/WiFiScan.h | 9 +- libraries/WiFi/src/WiFiType.h | 15 +- .../WiFiProv/examples/WiFiProv/WiFiProv.ino | 58 +- libraries/WiFiProv/src/WiFiProv.cpp | 44 +- libraries/WiFiProv/src/WiFiProv.h | 9 +- .../Wire/examples/WireSlave/WireSlave.ino | 3 +- libraries/Wire/src/Wire.cpp | 14 +- tests/democfg/democfg.ino | 3 +- tests/hello_world/hello_world.ino | 3 +- tests/periman/periman.ino | 12 +- tests/timer/timer.ino | 7 +- tests/touch/touch.ino | 49 +- tests/uart/uart.ino | 13 +- tests/unity/unity.ino | 11 +- variants/Aventen_S3_Sync/pins_arduino.h | 8 +- variants/Bee_Data_Logger/pins_arduino.h | 12 +- variants/Bee_Motion/pins_arduino.h | 10 +- variants/Bee_Motion_S3/pins_arduino.h | 11 +- variants/Bee_S3/pins_arduino.h | 14 +- variants/ET-Board/pins_arduino.h | 1 - variants/Microduino-esp32/pins_arduino.h | 1 - variants/Nebula_S3/pins_arduino.h | 7 +- variants/S_ODI_Ultra_v1/pins_arduino.h | 4 +- .../VALTRACK_V4_MFW_ESP32_C3/pins_arduino.h | 1 - .../VALTRACK_V4_VTS_ESP32_C3/pins_arduino.h | 1 - variants/XIAO_ESP32C6/pins_arduino.h | 8 +- .../adafruit_camera_esp32s3/pins_arduino.h | 57 +- variants/adafruit_camera_esp32s3/variant.cpp | 27 +- .../adafruit_feather_esp32_v2/pins_arduino.h | 2 +- .../adafruit_feather_esp32_v2/variant.cpp | 15 +- .../adafruit_feather_esp32s2/pins_arduino.h | 19 +- variants/adafruit_feather_esp32s2/variant.cpp | 27 +- .../pins_arduino.h | 22 +- .../variant.cpp | 19 +- .../pins_arduino.h | 22 +- .../adafruit_feather_esp32s2_tft/variant.cpp | 19 +- .../adafruit_feather_esp32s3/pins_arduino.h | 19 +- variants/adafruit_feather_esp32s3/variant.cpp | 21 +- .../pins_arduino.h | 19 +- .../variant.cpp | 21 +- .../pins_arduino.h | 22 +- .../variant.cpp | 19 +- .../pins_arduino.h | 22 +- .../adafruit_feather_esp32s3_tft/variant.cpp | 19 +- .../adafruit_funhouse_esp32s2/pins_arduino.h | 13 +- .../adafruit_funhouse_esp32s2/variant.cpp | 6 +- .../adafruit_itsybitsy_esp32/pins_arduino.h | 2 +- variants/adafruit_itsybitsy_esp32/variant.cpp | 15 +- .../adafruit_magtag29_esp32s2/pins_arduino.h | 21 +- .../adafruit_magtag29_esp32s2/variant.cpp | 6 +- .../pins_arduino.h | 14 +- .../adafruit_metro_esp32s2/pins_arduino.h | 11 +- variants/adafruit_metro_esp32s2/variant.cpp | 6 +- .../adafruit_metro_esp32s3/pins_arduino.h | 10 +- variants/adafruit_metro_esp32s3/variant.cpp | 13 +- variants/adafruit_qtpy_esp32/pins_arduino.h | 2 +- variants/adafruit_qtpy_esp32/variant.cpp | 15 +- variants/adafruit_qtpy_esp32c3/pins_arduino.h | 2 +- variants/adafruit_qtpy_esp32s2/pins_arduino.h | 14 +- variants/adafruit_qtpy_esp32s2/variant.cpp | 15 +- .../adafruit_qtpy_esp32s3_n4r2/pins_arduino.h | 16 +- .../adafruit_qtpy_esp32s3_n4r2/variant.cpp | 15 +- .../pins_arduino.h | 16 +- .../adafruit_qtpy_esp32s3_nopsram/variant.cpp | 15 +- .../adafruit_qualia_s3_rgb666/pins_arduino.h | 5 +- .../adafruit_qualia_s3_rgb666/variant.cpp | 11 +- variants/arduino_nano_nora/dfu_callbacks.cpp | 10 +- variants/arduino_nano_nora/double_tap.c | 1 - variants/arduino_nano_nora/double_tap.h | 8 +- .../extra/nora_recovery/nora_recovery.ino | 9 +- variants/arduino_nano_nora/io_pin_remap.cpp | 9 +- variants/arduino_nano_nora/pins_arduino.h | 8 +- variants/arduino_nano_nora/variant.cpp | 10 +- variants/atd147_s3/pins_arduino.h | 2 +- variants/atmegazero_esp32s2/pins_arduino.h | 10 +- variants/bpi-bit/pins_arduino.h | 2 +- variants/bpi_leaf_s3/pins_arduino.h | 10 +- variants/ch_denky/pins_arduino.h | 15 +- variants/connaxio_espoir/pins_arduino.h | 18 +- variants/crabik_slot_esp32_s3/pins_arduino.h | 8 +- .../pins_arduino.h | 27 +- .../cytron_maker_feather_aiot_s3/variant.cpp | 13 +- variants/d1_mini32/pins_arduino.h | 4 +- variants/d1_uno32/pins_arduino.h | 4 +- variants/d32_pro/pins_arduino.h | 8 +- variants/deneyapkart/pins_arduino.h | 8 +- variants/deneyapkart1A/pins_arduino.h | 10 +- variants/deneyapkart1Av2/pins_arduino.h | 16 +- variants/deneyapkartg/pins_arduino.h | 18 +- variants/deneyapmini/pins_arduino.h | 16 +- variants/deneyapminiv2/pins_arduino.h | 16 +- .../pins_arduino.h | 21 +- .../variant.cpp | 15 +- .../dfrobot_beetle_esp32c3/pins_arduino.h | 24 +- .../dfrobot_beetle_esp32c6/pins_arduino.h | 2 - .../pins_arduino.h | 23 +- .../pins_arduino.h | 32 +- variants/dfrobot_romeo_esp32s3/pins_arduino.h | 47 +- variants/doitESPduino32/pins_arduino.h | 5 +- variants/esp32-gateway/pins_arduino.h | 10 +- variants/esp32-poe-iso/pins_arduino.h | 9 +- variants/esp32-poe/pins_arduino.h | 9 +- .../pins_arduino.h | 10 +- .../pins_arduino.h | 10 +- .../esp32-trueverit-iot-driver/pins_arduino.h | 10 +- variants/esp32_s3r8n16/pins_arduino.h | 6 +- variants/esp32c2/pins_arduino.h | 1 - variants/esp32c3/pins_arduino.h | 2 +- variants/esp32c6/pins_arduino.h | 2 +- variants/esp32h2-devkit-lipo/pins_arduino.h | 3 +- variants/esp32h2/pins_arduino.h | 2 +- variants/esp32micromod/pins_arduino.h | 3 - .../esp32s2-devkit-lipo-usb/pins_arduino.h | 4 +- variants/esp32s2-devkit-lipo/pins_arduino.h | 4 +- variants/esp32s2/pins_arduino.h | 2 +- variants/esp32s2thing_plus/pins_arduino.h | 8 +- variants/esp32s2usb/pins_arduino.h | 22 +- variants/esp32s3/pins_arduino.h | 3 +- variants/esp32s3_powerfeather/pins_arduino.h | 8 +- variants/esp32s3box/pins_arduino.h | 22 +- variants/esp32s3camlcd/pins_arduino.h | 60 +- variants/esp32s3usbotg/pins_arduino.h | 55 +- variants/esp32thing_plus/pins_arduino.h | 1 - variants/esp32thing_plus_c/pins_arduino.h | 3 +- variants/esp32vn-iot-uno/pins_arduino.h | 1 - variants/feather_esp32/pins_arduino.h | 1 - .../franzininho_wifi_esp32s2/pins_arduino.h | 12 +- .../pins_arduino.h | 22 +- variants/gpy/pins_arduino.h | 10 +- .../heltec_capsule_sensor_v3/pins_arduino.h | 8 +- variants/heltec_ht_de01/pins_arduino.h | 1 - variants/heltec_wifi_kit_32/pins_arduino.h | 4 +- variants/heltec_wifi_kit_32_V3/pins_arduino.h | 2 +- variants/heltec_wifi_lora_32/pins_arduino.h | 5 +- .../heltec_wifi_lora_32_V2/pins_arduino.h | 5 +- .../heltec_wifi_lora_32_V3/pins_arduino.h | 4 +- .../heltec_wireless_bridge/pins_arduino.h | 1 - .../heltec_wireless_mini_shell/pins_arduino.h | 7 +- variants/heltec_wireless_paper/pins_arduino.h | 3 +- .../heltec_wireless_shell_v3/pins_arduino.h | 4 +- variants/heltec_wireless_stick/pins_arduino.h | 2 +- .../heltec_wireless_stick_V1/pins_arduino.h | 2 +- .../heltec_wireless_stick_lite/pins_arduino.h | 4 +- .../pins_arduino.h | 4 +- .../heltec_wireless_stick_v3/pins_arduino.h | 9 +- .../heltec_wireless_tracker/pins_arduino.h | 6 +- variants/hornbill32minima/pins_arduino.h | 8 - variants/imbrios-logsens-v1p1/pins_arduino.h | 14 +- variants/lilygo_t_display/pins_arduino.h | 8 +- variants/lilygo_t_display_s3/pins_arduino.h | 1 - variants/lionbit/pins_arduino.h | 12 +- variants/lionbits3/pins_arduino.h | 2 - variants/lolin_s2_mini/pins_arduino.h | 19 +- variants/lolin_s2_pico/pins_arduino.h | 19 +- variants/lolin_s3/pins_arduino.h | 6 +- variants/lolin_s3_mini/pins_arduino.h | 6 +- variants/lolin_s3_pro/pins_arduino.h | 6 +- variants/lopy/pins_arduino.h | 20 +- variants/lopy4/pins_arduino.h | 20 +- variants/m5stack_atom/pins_arduino.h | 1 - variants/m5stack_atoms3/pins_arduino.h | 6 +- variants/m5stack_cardputer/pins_arduino.h | 2 - variants/m5stack_cores3/pins_arduino.h | 6 +- variants/m5stack_dial/pins_arduino.h | 2 - variants/mgbot-iotik32b/pins_arduino.h | 2 +- variants/micro_s2/pins_arduino.h | 10 +- variants/mpython/pins_arduino.h | 2 - variants/namino_bianco/pins_arduino.h | 1 - variants/nologo_esp32s3_pico/pins_arduino.h | 6 +- variants/openkb/pins_arduino.h | 1 - variants/oroca_edubot/pins_arduino.h | 2 - variants/redpill_esp32s3/pins_arduino.h | 6 +- variants/roboheart_hercules/pins_arduino.h | 18 +- variants/sensebox_mcu_esp32s2/pins_arduino.h | 84 +- variants/sensebox_mcu_esp32s2/variant.cpp | 37 +- .../pins_arduino.h | 2 +- .../pins_arduino.h | 2 +- .../sparkfun_pro_micro_esp32c3/pins_arduino.h | 8 +- variants/tamc_termod_s3/pins_arduino.h | 8 +- variants/tbeam/pins_arduino.h | 18 +- .../pins_arduino.h | 2 +- variants/ttgo-lora32-v1/pins_arduino.h | 8 +- variants/ttgo-lora32-v2/pins_arduino.h | 12 +- variants/ttgo-lora32-v21new/pins_arduino.h | 16 +- variants/twatch/pins_arduino.h | 4 +- variants/uPesy_edu_esp32/pins_arduino.h | 5 +- variants/uPesy_esp32c3_basic/pins_arduino.h | 8 +- variants/uPesy_esp32c3_mini/pins_arduino.h | 8 +- variants/uPesy_esp32s3_basic/pins_arduino.h | 13 +- variants/um_bling/pins_arduino.h | 10 +- variants/um_feathers2/pins_arduino.h | 8 +- variants/um_feathers2neo/pins_arduino.h | 11 +- variants/um_feathers3/pins_arduino.h | 10 +- variants/um_nanos3/pins_arduino.h | 10 +- variants/um_pros3/pins_arduino.h | 10 +- variants/um_rmp/pins_arduino.h | 10 +- variants/um_tinyc6/pins_arduino.h | 10 +- variants/um_tinys2/pins_arduino.h | 10 +- variants/um_tinys3/pins_arduino.h | 10 +- variants/watchy/pins_arduino.h | 10 +- .../pins_arduino.h | 12 +- variants/wesp32/pins_arduino.h | 10 +- variants/wifiduino32/pins_arduino.h | 1 - variants/wipy3/pins_arduino.h | 2 +- variants/wt32-eth01/pins_arduino.h | 10 +- variants/wt32-sc01-plus/pins_arduino.h | 9 +- 702 files changed, 13853 insertions(+), 16400 deletions(-) diff --git a/.clang-format b/.clang-format index e608f4ed0..8f4734879 100644 --- a/.clang-format +++ b/.clang-format @@ -1,37 +1,69 @@ -# Source: https://github.com/arduino/tooling-project-assets/tree/main/other/clang-format-configuration +# Clang format version: 18.1.3 --- +BasedOnStyle: LLVM AccessModifierOffset: -2 -AlignAfterOpenBracket: Align +AlignAfterOpenBracket: BlockIndent AlignArrayOfStructures: None -AlignConsecutiveAssignments: None -AlignConsecutiveBitFields: None -AlignConsecutiveDeclarations: None -AlignConsecutiveMacros: None -AlignEscapedNewlines: DontAlign +AlignConsecutiveAssignments: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveBitFields: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveDeclarations: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveMacros: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveShortCaseStatements: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCaseColons: false +AlignEscapedNewlines: Left AlignOperands: Align -AlignTrailingComments: true +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 AllowAllArgumentsOnNextLine: true -AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: Always +AllowBreakBeforeNoexceptSpecifier: Never +AllowShortBlocksOnASingleLine: Empty AllowShortCaseLabelsOnASingleLine: true -AllowShortEnumsOnASingleLine: true +AllowShortCompoundRequirementOnASingleLine: true +AllowShortEnumsOnASingleLine: false AllowShortFunctionsOnASingleLine: Empty -AllowShortIfStatementsOnASingleLine: AllIfsAndElse +AllowShortIfStatementsOnASingleLine: Never AllowShortLambdasOnASingleLine: Empty AllowShortLoopsOnASingleLine: true AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: No +AlwaysBreakTemplateDeclarations: MultiLine AttributeMacros: - __capability -BasedOnStyle: LLVM BinPackArguments: true BinPackParameters: true BitFieldColonSpacing: Both BraceWrapping: - AfterCaseLabel: false + AfterCaseLabel: true AfterClass: false AfterControlStatement: Never AfterEnum: false @@ -46,33 +78,33 @@ BraceWrapping: BeforeLambdaBody: false BeforeWhile: false IndentBraces: false - SplitEmptyFunction: true + SplitEmptyFunction: false SplitEmptyRecord: true SplitEmptyNamespace: true +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Always BreakAfterJavaFieldAnnotations: false +BreakArrays: false BreakBeforeBinaryOperators: NonAssignment -BreakBeforeBraces: Attach -BreakBeforeConceptDeclarations: false -BreakBeforeInheritanceComma: false +BreakBeforeBraces: Custom +BreakBeforeConceptDeclarations: Always +BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeColon -BreakConstructorInitializersBeforeComma: false BreakInheritanceList: BeforeColon -BreakStringLiterals: false -ColumnLimit: 0 -CommentPragmas: '' +BreakStringLiterals: true +ColumnLimit: 160 +CommentPragmas: "" CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 2 ContinuationIndentWidth: 2 -Cpp11BracedListStyle: false -DeriveLineEnding: true -DerivePointerAlignment: true +Cpp11BracedListStyle: true +DerivePointerAlignment: false DisableFormat: false -EmptyLineAfterAccessModifier: Leave -EmptyLineBeforeAccessModifier: Leave +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false -FixNamespaceComments: false +FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH @@ -81,38 +113,49 @@ IfMacros: - KJ_IF_MAYBE IncludeBlocks: Preserve IncludeCategories: - - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + - Regex: ^"(llvm|llvm-c|clang|clang-c)/ Priority: 2 SortPriority: 0 CaseSensitive: false - - Regex: '^(<|"(gtest|gmock|isl|json)/)' + - Regex: ^(<|"(gtest|gmock|isl|json)/) Priority: 3 SortPriority: 0 CaseSensitive: false - - Regex: '.*' + - Regex: .* Priority: 1 SortPriority: 0 CaseSensitive: false -IncludeIsMainRegex: '' -IncludeIsMainSourceRegex: '' +IncludeIsMainRegex: "" +IncludeIsMainSourceRegex: "" IndentAccessModifiers: false -IndentCaseBlocks: true +IndentCaseBlocks: false IndentCaseLabels: true -IndentExternBlock: Indent +IndentExternBlock: NoIndent IndentGotoLabels: false IndentPPDirectives: None -IndentRequires: true +IndentRequiresClause: false IndentWidth: 2 -IndentWrappedFunctionNames: false +IndentWrappedFunctionNames: true +InsertBraces: true +InsertNewlineAtEOF: true InsertTrailingCommas: None +IntegerLiteralSeparator: + Binary: 0 + BinaryMinDigits: 0 + Decimal: 0 + DecimalMinDigits: 0 + Hex: 0 + HexMinDigits: 0 JavaScriptQuotes: Leave JavaScriptWrapImports: true +KeepEmptyLinesAtEOF: false KeepEmptyLinesAtTheStartOfBlocks: true LambdaBodyIndentation: Signature Language: Cpp -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 100000 +LineEnding: LF +MacroBlockBegin: "" +MacroBlockEnd: "" +MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBinPackProtocolList: Auto ObjCBlockIndentWidth: 2 @@ -121,26 +164,32 @@ ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PPIndentWidth: -1 PackConstructorInitializers: BinPack -PenaltyBreakAssignment: 1 -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 1 -PenaltyBreakFirstLessLess: 1 -PenaltyBreakOpenParenthesis: 1 -PenaltyBreakString: 1 -PenaltyBreakTemplateDeclaration: 1 -PenaltyExcessCharacter: 1 -PenaltyIndentedWhitespace: 1 -PenaltyReturnTypeOnItsOwnLine: 1 +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakOpenParenthesis: 0 +PenaltyBreakScopeResolution: 500 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyIndentedWhitespace: 0 +PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right QualifierAlignment: Leave ReferenceAlignment: Pointer ReflowComments: false RemoveBracesLLVM: false +RemoveParentheses: Leave +RemoveSemicolon: false +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope SeparateDefinitionBlocks: Leave -ShortNamespaceLines: 0 +ShortNamespaceLines: 1 +SkipMacroDefinitionBody: false SortIncludes: Never SortJavaStaticImport: Before -SortUsingDeclarations: false +SortUsingDeclarations: LexicographicNumeric SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: false @@ -150,28 +199,34 @@ SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true +SpaceBeforeJsonColon: false SpaceBeforeParens: ControlStatements SpaceBeforeParensOptions: AfterControlStatements: true AfterForeachMacros: true - AfterFunctionDefinitionName: false AfterFunctionDeclarationName: false + AfterFunctionDefinitionName: false AfterIfMacros: true - AfterOverloadedOperator: false + AfterOverloadedOperator: true + AfterPlacementOperator: true + AfterRequiresInClause: false + AfterRequiresInExpression: false BeforeNonEmptyParentheses: false SpaceBeforeRangeBasedForLoopColon: true SpaceBeforeSquareBrackets: false SpaceInEmptyBlock: false -SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 2 -SpacesInAngles: Leave -SpacesInCStyleCastParentheses: false -SpacesInConditionalStatement: false +SpacesInAngles: Never SpacesInContainerLiterals: false SpacesInLineCommentPrefix: - Minimum: 0 + Minimum: 1 Maximum: -1 -SpacesInParentheses: false +SpacesInParens: Never +SpacesInParensOptions: + InConditionalStatements: false + InCStyleCasts: false + InEmptyParentheses: false + Other: false SpacesInSquareBrackets: false Standard: Auto StatementAttributeLikeMacros: @@ -180,11 +235,12 @@ StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION TabWidth: 2 -UseCRLF: false UseTab: Never +VerilogBreakBetweenInstancePorts: true WhitespaceSensitiveMacros: - - STRINGIZE - - PP_STRINGIZE - BOOST_PP_STRINGIZE - - NS_SWIFT_NAME - CF_SWIFT_NAME + - NS_SWIFT_NAME + - PP_STRINGIZE + - STRINGIZE +BracedInitializerIndentWidth: 2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc1874820..3fa63413a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: exclude: ^.*\.(svd|SVD)$ stages: [manual] - repo: https://github.com/pre-commit/mirrors-clang-format - rev: "v15.0.7" + rev: "v18.1.3" hooks: - id: clang-format types_or: [c, c++] diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index 88c84047e..2f2c53af4 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -41,29 +41,29 @@ #include "binary.h" #include "extra_attr.h" -#define PI 3.1415926535897932384626433832795 -#define HALF_PI 1.5707963267948966192313216916398 -#define TWO_PI 6.283185307179586476925286766559 +#define PI 3.1415926535897932384626433832795 +#define HALF_PI 1.5707963267948966192313216916398 +#define TWO_PI 6.283185307179586476925286766559 #define DEG_TO_RAD 0.017453292519943295769236907684886 #define RAD_TO_DEG 57.295779513082320876798154814105 -#define EULER 2.718281828459045235360287471352 +#define EULER 2.718281828459045235360287471352 -#define SERIAL 0x0 +#define SERIAL 0x0 #define DISPLAY 0x1 #define LSBFIRST 0 #define MSBFIRST 1 //Interrupt Modes -#define RISING 0x01 -#define FALLING 0x02 -#define CHANGE 0x03 -#define ONLOW 0x04 -#define ONHIGH 0x05 -#define ONLOW_WE 0x0C +#define RISING 0x01 +#define FALLING 0x02 +#define CHANGE 0x03 +#define ONLOW 0x04 +#define ONHIGH 0x05 +#define ONLOW_WE 0x0C #define ONHIGH_WE 0x0D -#define DEFAULT 1 +#define DEFAULT 1 #define EXTERNAL 0 #ifndef __STRINGIFY @@ -71,65 +71,67 @@ #endif // can't define max() / min() because of conflicts with C++ -#define _min(a, b) ((a) < (b) ? (a) : (b)) -#define _max(a, b) ((a) > (b) ? (a) : (b)) -#define _abs(x) ((x) > 0 ? (x) : -(x)) // abs() comes from STL +#define _min(a, b) ((a) < (b) ? (a) : (b)) +#define _max(a, b) ((a) > (b) ? (a) : (b)) +#define _abs(x) ((x) > 0 ? (x) : -(x)) // abs() comes from STL #define constrain(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) -#define _round(x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5)) // round() comes from STL -#define radians(deg) ((deg)*DEG_TO_RAD) -#define degrees(rad) ((rad)*RAD_TO_DEG) -#define sq(x) ((x) * (x)) +#define _round(x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x) - 0.5)) // round() comes from STL +#define radians(deg) ((deg) * DEG_TO_RAD) +#define degrees(rad) ((rad) * RAD_TO_DEG) +#define sq(x) ((x) * (x)) // ESP32xx runs FreeRTOS... disabling interrupts can lead to issues, such as Watchdog Timeout -#define sei() portENABLE_INTERRUPTS() -#define cli() portDISABLE_INTERRUPTS() -#define interrupts() sei() +#define sei() portENABLE_INTERRUPTS() +#define cli() portDISABLE_INTERRUPTS() +#define interrupts() sei() #define noInterrupts() cli() -#define clockCyclesPerMicrosecond() ((long int)getCpuFrequencyMhz()) +#define clockCyclesPerMicrosecond() ((long int)getCpuFrequencyMhz()) #define clockCyclesToMicroseconds(a) ((a) / clockCyclesPerMicrosecond()) -#define microsecondsToClockCycles(a) ((a)*clockCyclesPerMicrosecond()) +#define microsecondsToClockCycles(a) ((a) * clockCyclesPerMicrosecond()) -#define lowByte(w) ((uint8_t)((w)&0xff)) +#define lowByte(w) ((uint8_t)((w) & 0xff)) #define highByte(w) ((uint8_t)((w) >> 8)) -#define bitRead(value, bit) (((value) >> (bit)) & 0x01) -#define bitSet(value, bit) ((value) |= (1UL << (bit))) -#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) -#define bitToggle(value, bit) ((value) ^= (1UL << (bit))) +#define bitRead(value, bit) (((value) >> (bit)) & 0x01) +#define bitSet(value, bit) ((value) |= (1UL << (bit))) +#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) +#define bitToggle(value, bit) ((value) ^= (1UL << (bit))) #define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet(value, bit) : bitClear(value, bit)) // avr-libc defines _NOP() since 1.6.2 #ifndef _NOP -#define _NOP() \ - do { __asm__ volatile("nop"); } while (0) +#define _NOP() \ + do { \ + __asm__ volatile("nop"); \ + } while (0) #endif #define bit(b) (1UL << (b)) #define _BV(b) (1UL << (b)) #define digitalPinToTimer(pin) (0) -#define analogInPinToBit(P) (P) +#define analogInPinToBit(P) (P) #if SOC_GPIO_PIN_COUNT <= 32 -#define digitalPinToPort(pin) (0) +#define digitalPinToPort(pin) (0) #define digitalPinToBitMask(pin) (1UL << digitalPinToGPIONumber(pin)) -#define portOutputRegister(port) ((volatile uint32_t*)GPIO_OUT_REG) -#define portInputRegister(port) ((volatile uint32_t*)GPIO_IN_REG) -#define portModeRegister(port) ((volatile uint32_t*)GPIO_ENABLE_REG) +#define portOutputRegister(port) ((volatile uint32_t *)GPIO_OUT_REG) +#define portInputRegister(port) ((volatile uint32_t *)GPIO_IN_REG) +#define portModeRegister(port) ((volatile uint32_t *)GPIO_ENABLE_REG) #elif SOC_GPIO_PIN_COUNT <= 64 -#define digitalPinToPort(pin) ((digitalPinToGPIONumber(pin) > 31) ? 1 : 0) +#define digitalPinToPort(pin) ((digitalPinToGPIONumber(pin) > 31) ? 1 : 0) #define digitalPinToBitMask(pin) (1UL << (digitalPinToGPIONumber(pin) & 31)) -#define portOutputRegister(port) ((volatile uint32_t*)((port) ? GPIO_OUT1_REG : GPIO_OUT_REG)) -#define portInputRegister(port) ((volatile uint32_t*)((port) ? GPIO_IN1_REG : GPIO_IN_REG)) -#define portModeRegister(port) ((volatile uint32_t*)((port) ? GPIO_ENABLE1_REG : GPIO_ENABLE_REG)) +#define portOutputRegister(port) ((volatile uint32_t *)((port) ? GPIO_OUT1_REG : GPIO_OUT_REG)) +#define portInputRegister(port) ((volatile uint32_t *)((port) ? GPIO_IN1_REG : GPIO_IN_REG)) +#define portModeRegister(port) ((volatile uint32_t *)((port) ? GPIO_ENABLE1_REG : GPIO_ENABLE_REG)) #else #error SOC_GPIO_PIN_COUNT > 64 not implemented #endif -#define NOT_A_PIN -1 -#define NOT_A_PORT -1 +#define NOT_A_PIN -1 +#define NOT_A_PORT -1 #define NOT_AN_INTERRUPT -1 -#define NOT_ON_TIMER 0 +#define NOT_ON_TIMER 0 // some defines generic for all SoC moved from variants/board_name/pins_arduino.h #define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // All GPIOs @@ -138,10 +140,10 @@ #elif SOC_ADC_PERIPH_NUM == 2 #define NUM_ANALOG_INPUTS (SOC_ADC_CHANNEL_NUM(0) + SOC_ADC_CHANNEL_NUM(1)) // Depends on the SoC (ESP32, ESP32S2, ESP32S3, ESP32C3) #endif -#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs +#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs #define analogInputToDigitalPin(p) (((p) < NUM_ANALOG_INPUTS) ? (analogChannelToDigitalPin(p)) : -1) -#define digitalPinToInterrupt(p) ((((uint8_t)digitalPinToGPIONumber(p)) < NUM_DIGITAL_PINS) ? digitalPinToGPIONumber(p) : NOT_AN_INTERRUPT) -#define digitalPinHasPWM(p) (((uint8_t)digitalPinToGPIONumber(p)) < NUM_DIGITAL_PINS) +#define digitalPinToInterrupt(p) ((((uint8_t)digitalPinToGPIONumber(p)) < NUM_DIGITAL_PINS) ? digitalPinToGPIONumber(p) : NOT_AN_INTERRUPT) +#define digitalPinHasPWM(p) (((uint8_t)digitalPinToGPIONumber(p)) < NUM_DIGITAL_PINS) typedef bool boolean; typedef uint8_t byte; @@ -170,15 +172,15 @@ long map(long, long, long, long, long); extern "C" { #endif - void init(void); - void initVariant(void); - void initArduino(void); +void init(void); +void initVariant(void); +void initArduino(void); - unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout); - unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout); +unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout); +unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout); - uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder); - void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val); +uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder); +void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val); #ifdef __cplusplus } @@ -212,29 +214,33 @@ uint16_t makeWord(uint8_t h, uint8_t l); #define word(...) makeWord(__VA_ARGS__) size_t getArduinoLoopTaskStackSize(void); -#define SET_LOOP_TASK_STACK_SIZE(sz) \ - size_t getArduinoLoopTaskStackSize() { return sz; } +#define SET_LOOP_TASK_STACK_SIZE(sz) \ + size_t getArduinoLoopTaskStackSize() { \ + return sz; \ + } bool shouldPrintChipDebugReport(void); -#define ENABLE_CHIP_DEBUG_REPORT \ - bool shouldPrintChipDebugReport(void) { return true; } +#define ENABLE_CHIP_DEBUG_REPORT \ + bool shouldPrintChipDebugReport(void) { \ + return true; \ + } // allows user to bypass esp_spiram_test() bool esp_psram_extram_test(void); -#define BYPASS_SPIRAM_TEST(bypass) \ - bool testSPIRAM(void) { \ - if (bypass) return true; \ - else return esp_psram_extram_test(); \ +#define BYPASS_SPIRAM_TEST(bypass) \ + bool testSPIRAM(void) { \ + if (bypass) \ + return true; \ + else \ + return esp_psram_extram_test(); \ } unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L); unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L); -extern "C" bool getLocalTime(struct tm* info, uint32_t ms = 5000); -extern "C" void configTime(long gmtOffset_sec, int daylightOffset_sec, - const char* server1, const char* server2 = nullptr, const char* server3 = nullptr); -extern "C" void configTzTime(const char* tz, - const char* server1, const char* server2 = nullptr, const char* server3 = nullptr); +extern "C" bool getLocalTime(struct tm *info, uint32_t ms = 5000); +extern "C" void configTime(long gmtOffset_sec, int daylightOffset_sec, const char *server1, const char *server2 = nullptr, const char *server3 = nullptr); +extern "C" void configTzTime(const char *tz, const char *server1, const char *server2 = nullptr, const char *server3 = nullptr); void setToneChannel(uint8_t channel = 0); void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0); diff --git a/cores/esp32/Client.h b/cores/esp32/Client.h index c20572f90..ab0136124 100644 --- a/cores/esp32/Client.h +++ b/cores/esp32/Client.h @@ -37,6 +37,7 @@ public: virtual void stop() = 0; virtual uint8_t connected() = 0; virtual operator bool() = 0; + protected: uint8_t *rawIPAddress(IPAddress &addr) { return addr.raw_address(); diff --git a/cores/esp32/Esp.cpp b/cores/esp32/Esp.cpp index a2787c3c4..efe100b34 100644 --- a/cores/esp32/Esp.cpp +++ b/cores/esp32/Esp.cpp @@ -72,7 +72,7 @@ extern "C" { #if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 #ifndef REG_SPI_BASE -#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i)*0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000))) +#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i) * 0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000))) #endif // REG_SPI_BASE #endif // TARGET @@ -119,7 +119,6 @@ unsigned long long operator"" _GB(unsigned long long x) { return x * 1024 * 1024 * 1024; } - EspClass ESP; void EspClass::deepSleep(uint64_t time_us) { @@ -177,7 +176,9 @@ uint32_t EspClass::getMaxAllocPsram(void) { static uint32_t sketchSize(sketchSize_t response) { esp_image_metadata_t data; const esp_partition_t *running = esp_ota_get_running_partition(); - if (!running) return 0; + if (!running) { + return 0; + } const esp_partition_pos_t running_pos = { .offset = running->address, .size = running->size, @@ -260,39 +261,31 @@ const char *EspClass::getChipModel(void) { uint32_t pkg_ver = chip_ver & 0x7; switch (pkg_ver) { case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ6: - if (getChipRevision() == 3) + if (getChipRevision() == 3) { return "ESP32-D0WDQ6-V3"; - else + } else { return "ESP32-D0WDQ6"; + } case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ5: - if (getChipRevision() == 3) + if (getChipRevision() == 3) { return "ESP32-D0WD-V3"; - else + } else { return "ESP32-D0WD"; - case EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5: - return "ESP32-D2WD"; - case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2: - return "ESP32-PICO-D2"; - case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4: - return "ESP32-PICO-D4"; - case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302: - return "ESP32-PICO-V3-02"; - case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDR2V3: - return "ESP32-D0WDR2-V3"; - default: - return "Unknown"; + } + case EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5: return "ESP32-D2WD"; + case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2: return "ESP32-PICO-D2"; + case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4: return "ESP32-PICO-D4"; + case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302: return "ESP32-PICO-V3-02"; + case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDR2V3: return "ESP32-D0WDR2-V3"; + default: return "Unknown"; } #elif CONFIG_IDF_TARGET_ESP32S2 uint32_t pkg_ver = REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_PKG_VERSION); switch (pkg_ver) { - case 0: - return "ESP32-S2"; - case 1: - return "ESP32-S2FH16"; - case 2: - return "ESP32-S2FH32"; - default: - return "ESP32-S2 (Unknown)"; + case 0: return "ESP32-S2"; + case 1: return "ESP32-S2FH16"; + case 2: return "ESP32-S2FH32"; + default: return "ESP32-S2 (Unknown)"; } #else esp_chip_info_t chip_info; @@ -303,7 +296,7 @@ const char *EspClass::getChipModel(void) { case CHIP_ESP32C2: return "ESP32-C2"; case CHIP_ESP32C6: return "ESP32-C6"; case CHIP_ESP32H2: return "ESP32-H2"; - default: return "UNKNOWN"; + default: return "UNKNOWN"; } #endif } @@ -414,7 +407,6 @@ uint32_t EspClass::magicFlashChipSpeed(uint8_t byte) { return 0; } - #elif CONFIG_IDF_TARGET_ESP32C6 /* FLASH_FREQUENCY = { @@ -449,7 +441,6 @@ uint32_t EspClass::magicFlashChipSpeed(uint8_t byte) { return 0; } - #else /* FLASH_FREQUENCY = { @@ -470,7 +461,6 @@ uint32_t EspClass::magicFlashChipSpeed(uint8_t byte) { #endif } - FlashMode_t EspClass::magicFlashChipMode(uint8_t byte) { FlashMode_t mode = (FlashMode_t)byte; if (mode > FM_SLOW_READ) { diff --git a/cores/esp32/Esp.h b/cores/esp32/Esp.h index 58e428c91..41068fb9e 100644 --- a/cores/esp32/Esp.h +++ b/cores/esp32/Esp.h @@ -42,7 +42,6 @@ typedef enum { WDTO_8S = 8000 //!< WDTO_8S } WDTO_t; - typedef enum { FM_QIO = 0x00, FM_QOUT = 0x01, diff --git a/cores/esp32/FirmwareMSC.cpp b/cores/esp32/FirmwareMSC.cpp index 5ba683a84..c408f52fc 100644 --- a/cores/esp32/FirmwareMSC.cpp +++ b/cores/esp32/FirmwareMSC.cpp @@ -310,7 +310,8 @@ static int32_t msc_write(uint32_t lba, uint32_t offset, uint8_t *buffer, uint32_ return 0; } } else if (msc_update_state == MSC_UPDATE_RUNNING) { - if (msc_update_entry && msc_update_entry->file_size && msc_update_bytes_written < msc_update_entry->file_size && (msc_update_bytes_written + bufsize) >= msc_update_entry->file_size) { + if (msc_update_entry && msc_update_entry->file_size && msc_update_bytes_written < msc_update_entry->file_size + && (msc_update_bytes_written + bufsize) >= msc_update_entry->file_size) { bufsize = msc_update_entry->file_size - msc_update_bytes_written; } if (msc_update_write(msc_ota_partition, ((lba - msc_update_start_sector) * DISK_SECTOR_SIZE) + offset, buffer, bufsize) == ESP_OK) { @@ -369,8 +370,7 @@ static void msc_task(void *pvParameters) { vTaskDelete(NULL); } -FirmwareMSC::FirmwareMSC() - : msc() {} +FirmwareMSC::FirmwareMSC() : msc() {} FirmwareMSC::~FirmwareMSC() { end(); diff --git a/cores/esp32/FunctionalInterrupt.cpp b/cores/esp32/FunctionalInterrupt.cpp index 76d93e116..bc3fdf167 100644 --- a/cores/esp32/FunctionalInterrupt.cpp +++ b/cores/esp32/FunctionalInterrupt.cpp @@ -9,14 +9,14 @@ #include "Arduino.h" typedef void (*voidFuncPtr)(void); -typedef void (*voidFuncPtrArg)(void*); +typedef void (*voidFuncPtrArg)(void *); extern "C" { - extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, void* arg, int intr_type, bool functional); +extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, void *arg, int intr_type, bool functional); } -void ARDUINO_ISR_ATTR interruptFunctional(void* arg) { - InterruptArgStructure* localArg = (InterruptArgStructure*)arg; +void ARDUINO_ISR_ATTR interruptFunctional(void *arg) { + InterruptArgStructure *localArg = (InterruptArgStructure *)arg; if (localArg->interruptFunction) { localArg->interruptFunction(); } @@ -24,11 +24,11 @@ void ARDUINO_ISR_ATTR interruptFunctional(void* arg) { void attachInterrupt(uint8_t pin, std::function intRoutine, int mode) { // use the local interrupt routine which takes the ArgStructure as argument - __attachInterruptFunctionalArg(pin, (voidFuncPtrArg)interruptFunctional, new InterruptArgStructure{ intRoutine }, mode, true); + __attachInterruptFunctionalArg(pin, (voidFuncPtrArg)interruptFunctional, new InterruptArgStructure{intRoutine}, mode, true); } extern "C" { - void cleanupFunctional(void* arg) { - delete (InterruptArgStructure*)arg; - } +void cleanupFunctional(void *arg) { + delete (InterruptArgStructure *)arg; +} } diff --git a/cores/esp32/HEXBuilder.cpp b/cores/esp32/HEXBuilder.cpp index 7befe1673..6154f58b3 100644 --- a/cores/esp32/HEXBuilder.cpp +++ b/cores/esp32/HEXBuilder.cpp @@ -21,9 +21,10 @@ #include static uint8_t hex_char_to_byte(uint8_t c) { - return (c >= 'a' && c <= 'f') ? (c - ((uint8_t)'a' - 0xa)) : (c >= 'A' && c <= 'F') ? (c - ((uint8_t)'A' - 0xA)) - : (c >= '0' && c <= '9') ? (c - (uint8_t)'0') - : 0x10; // unknown char is 16 + return (c >= 'a' && c <= 'f') ? (c - ((uint8_t)'a' - 0xa)) + : (c >= 'A' && c <= 'F') ? (c - ((uint8_t)'A' - 0xA)) + : (c >= '0' && c <= '9') ? (c - (uint8_t)'0') + : 0x10; // unknown char is 16 } size_t HEXBuilder::hex2bytes(unsigned char *out, size_t maxlen, String &in) { @@ -35,15 +36,18 @@ size_t HEXBuilder::hex2bytes(unsigned char *out, size_t maxlen, const char *in) for (; *in; in++) { uint8_t c = hex_char_to_byte(*in); // Silently skip anything unknown. - if (c > 15) + if (c > 15) { continue; + } if (len & 1) { - if (len / 2 < maxlen) + if (len / 2 < maxlen) { out[len / 2] |= c; + } } else { - if (len / 2 < maxlen) + if (len / 2 < maxlen) { out[len / 2] = c << 4; + } } len++; } @@ -62,7 +66,9 @@ size_t HEXBuilder::bytes2hex(char *out, size_t maxlen, const unsigned char *in, String HEXBuilder::bytes2hex(const unsigned char *in, size_t len) { size_t maxlen = len * 2 + 1; char *out = (char *)malloc(maxlen); - if (!out) return String(); + if (!out) { + return String(); + } bytes2hex(out, maxlen, in, len); String ret = String(out); free(out); diff --git a/cores/esp32/HEXBuilder.h b/cores/esp32/HEXBuilder.h index 99335a60d..0c35fbc1a 100644 --- a/cores/esp32/HEXBuilder.h +++ b/cores/esp32/HEXBuilder.h @@ -25,10 +25,10 @@ class HEXBuilder { public: - static size_t hex2bytes(unsigned char* out, size_t maxlen, String& in); - static size_t hex2bytes(unsigned char* out, size_t maxlen, const char* in); + static size_t hex2bytes(unsigned char *out, size_t maxlen, String &in); + static size_t hex2bytes(unsigned char *out, size_t maxlen, const char *in); - static String bytes2hex(const unsigned char* in, size_t len); - static size_t bytes2hex(char* out, size_t maxlen, const unsigned char* in, size_t len); + static String bytes2hex(const unsigned char *in, size_t len); + static size_t bytes2hex(char *out, size_t maxlen, const unsigned char *in, size_t len); }; #endif diff --git a/cores/esp32/HWCDC.cpp b/cores/esp32/HWCDC.cpp index f49867e95..0b54b82d6 100644 --- a/cores/esp32/HWCDC.cpp +++ b/cores/esp32/HWCDC.cpp @@ -35,7 +35,7 @@ ESP_EVENT_DEFINE_BASE(ARDUINO_HW_CDC_EVENTS); static RingbufHandle_t tx_ring_buf = NULL; static QueueHandle_t rx_queue = NULL; -static uint8_t rx_data_buf[64] = { 0 }; +static uint8_t rx_data_buf[64] = {0}; static intr_handle_t intr_handle = NULL; static SemaphoreHandle_t tx_lock = NULL; static volatile bool connected = false; @@ -45,21 +45,19 @@ static uint32_t requested_tx_timeout_ms = 100; static esp_event_loop_handle_t arduino_hw_cdc_event_loop_handle = NULL; -static esp_err_t arduino_hw_cdc_event_post(esp_event_base_t event_base, int32_t event_id, void *event_data, size_t event_data_size, BaseType_t *task_unblocked) { +static esp_err_t + arduino_hw_cdc_event_post(esp_event_base_t event_base, int32_t event_id, void *event_data, size_t event_data_size, BaseType_t *task_unblocked) { if (arduino_hw_cdc_event_loop_handle == NULL) { return ESP_FAIL; } return esp_event_isr_post_to(arduino_hw_cdc_event_loop_handle, event_base, event_id, event_data, event_data_size, task_unblocked); } -static esp_err_t arduino_hw_cdc_event_handler_register_with(esp_event_base_t event_base, int32_t event_id, esp_event_handler_t event_handler, void *event_handler_arg) { +static esp_err_t + arduino_hw_cdc_event_handler_register_with(esp_event_base_t event_base, int32_t event_id, esp_event_handler_t event_handler, void *event_handler_arg) { if (!arduino_hw_cdc_event_loop_handle) { esp_event_loop_args_t event_task_args = { - .queue_size = 5, - .task_name = "arduino_hw_cdc_events", - .task_priority = 5, - .task_stack_size = 2048, - .task_core_id = tskNO_AFFINITY + .queue_size = 5, .task_name = "arduino_hw_cdc_events", .task_priority = 5, .task_stack_size = 2048, .task_core_id = tskNO_AFFINITY }; if (esp_event_loop_create(&event_task_args, &arduino_hw_cdc_event_loop_handle) != ESP_OK) { log_e("esp_event_loop_create failed"); @@ -74,7 +72,7 @@ static esp_err_t arduino_hw_cdc_event_handler_register_with(esp_event_base_t eve static void hw_cdc_isr_handler(void *arg) { portBASE_TYPE xTaskWoken = 0; uint32_t usbjtag_intr_status = 0; - arduino_hw_cdc_event_data_t event = { 0 }; + arduino_hw_cdc_event_data_t event = {0}; usbjtag_intr_status = usb_serial_jtag_ll_get_intsts_mask(); if (usbjtag_intr_status & USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY) { @@ -99,7 +97,9 @@ static void hw_cdc_isr_handler(void *arg) { usb_serial_jtag_ll_write_txfifo(queued_buff, queued_size); usb_serial_jtag_ll_txfifo_flush(); vRingbufferReturnItemFromISR(tx_ring_buf, queued_buff, &xTaskWoken); - if (connected) usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY); + if (connected) { + usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY); + } //send event? //ets_printf("TX:%u\n", queued_size); event.tx.len = queued_size; @@ -204,7 +204,9 @@ void HWCDC::onEvent(arduino_hw_cdc_event_t event, esp_event_handler_t callback) bool HWCDC::deinit(void *busptr) { // avoid any recursion issue with Peripheral Manager perimanSetPinBus() call static bool running = false; - if (running) return true; + if (running) { + return true; + } running = true; // Setting USB D+ D- pins bool retCode = true; @@ -245,9 +247,13 @@ void HWCDC::begin(unsigned long baud) { // Peripheral Manager setting for USB D+ D- pins uint8_t pin = USB_DM_GPIO_NUM; - if (!perimanSetPinBus(pin, ESP32_BUS_TYPE_USB_DM, (void *)this, -1, -1)) goto err; + if (!perimanSetPinBus(pin, ESP32_BUS_TYPE_USB_DM, (void *)this, -1, -1)) { + goto err; + } pin = USB_DP_GPIO_NUM; - if (!perimanSetPinBus(pin, ESP32_BUS_TYPE_USB_DP, (void *)this, -1, -1)) goto err; + if (!perimanSetPinBus(pin, ESP32_BUS_TYPE_USB_DP, (void *)this, -1, -1)) { + goto err; + } // Configure PHY // USB_Serial_JTAG use internal PHY @@ -333,7 +339,9 @@ int HWCDC::availableForWrite(void) { } static void flushTXBuffer() { - if (!tx_ring_buf) return; + if (!tx_ring_buf) { + return; + } UBaseType_t uxItemsWaiting = 0; vRingbufferGetInfo(tx_ring_buf, NULL, NULL, NULL, NULL, &uxItemsWaiting); @@ -373,7 +381,9 @@ size_t HWCDC::write(const uint8_t *buffer, size_t size) { so_far += space; // Now trigger the ISR to read data from the ring buffer. usb_serial_jtag_ll_txfifo_flush(); - if (connected) usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY); + if (connected) { + usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY); + } while (to_send) { space = xRingbufferGetCurFreeSize(tx_ring_buf); @@ -389,7 +399,9 @@ size_t HWCDC::write(const uint8_t *buffer, size_t size) { to_send -= space; // Now trigger the ISR to read data from the ring buffer. usb_serial_jtag_ll_txfifo_flush(); - if (connected) usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY); + if (connected) { + usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY); + } } } // CDC is disconnected ==> flush all data from TX buffer @@ -423,14 +435,18 @@ void HWCDC::flush(void) { if (uxItemsWaiting) { // Now trigger the ISR to read data from the ring buffer. usb_serial_jtag_ll_txfifo_flush(); - if (connected) usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY); + if (connected) { + usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY); + } } uint8_t tries = 3; while (tries && uxItemsWaiting) { delay(5); UBaseType_t lastUxItemsWaiting = uxItemsWaiting; vRingbufferGetInfo(tx_ring_buf, NULL, NULL, NULL, NULL, &uxItemsWaiting); - if (lastUxItemsWaiting == uxItemsWaiting) tries--; + if (lastUxItemsWaiting == uxItemsWaiting) { + tries--; + } } if (tries == 0) { // CDC isn't connected anymore... connected = false; diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp index 1e4e3dfd1..1fcb15316 100644 --- a/cores/esp32/HardwareSerial.cpp +++ b/cores/esp32/HardwareSerial.cpp @@ -59,25 +59,35 @@ void USBSerialEvent(void) {} void serialEventRun(void) { #if HWCDC_SERIAL_IS_DEFINED == 1 // Hardware JTAG CDC Event - if (HWCDCSerial.available()) HWCDCSerialEvent(); + if (HWCDCSerial.available()) { + HWCDCSerialEvent(); + } #endif #if USB_SERIAL_IS_DEFINED == 1 // Native USB CDC Event - if (USBSerial.available()) USBSerialEvent(); + if (USBSerial.available()) { + USBSerialEvent(); + } #endif // UART0 is default serialEvent() - if (Serial0.available()) serialEvent(); + if (Serial0.available()) { + serialEvent(); + } #if SOC_UART_NUM > 1 - if (Serial1.available()) serialEvent1(); + if (Serial1.available()) { + serialEvent1(); + } #endif #if SOC_UART_NUM > 2 - if (Serial2.available()) serialEvent2(); + if (Serial2.available()) { + serialEvent2(); + } #endif } #endif #if !CONFIG_DISABLE_HAL_LOCKS #define HSERIAL_MUTEX_LOCK() \ - do { \ + do { \ } while (xSemaphoreTake(_lock, portMAX_DELAY) != pdPASS) #define HSERIAL_MUTEX_UNLOCK() xSemaphoreGive(_lock) #else @@ -86,16 +96,8 @@ void serialEventRun(void) { #endif HardwareSerial::HardwareSerial(uint8_t uart_nr) - : _uart_nr(uart_nr), - _uart(NULL), - _rxBufferSize(256), - _txBufferSize(0), - _onReceiveCB(NULL), - _onReceiveErrorCB(NULL), - _onReceiveTimeout(false), - _rxTimeout(2), - _rxFIFOFull(0), - _eventTask(NULL) + : _uart_nr(uart_nr), _uart(NULL), _rxBufferSize(256), _txBufferSize(0), _onReceiveCB(NULL), _onReceiveErrorCB(NULL), _onReceiveTimeout(false), _rxTimeout(2), + _rxFIFOFull(0), _eventTask(NULL) #if !CONFIG_DISABLE_HAL_LOCKS , _lock(NULL) @@ -123,10 +125,12 @@ HardwareSerial::~HardwareSerial() { #endif } - void HardwareSerial::_createEventTask(void *args) { // Creating UART event Task - xTaskCreateUniversal(_uartEventTask, "uart_event_task", ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE, this, ARDUINO_SERIAL_EVENT_TASK_PRIORITY, &_eventTask, ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE); + xTaskCreateUniversal( + _uartEventTask, "uart_event_task", ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE, this, ARDUINO_SERIAL_EVENT_TASK_PRIORITY, &_eventTask, + ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE + ); if (_eventTask == NULL) { log_e(" -- UART%d Event Task not Created!", _uart_nr); } @@ -189,7 +193,9 @@ bool HardwareSerial::setRxFIFOFull(uint8_t fifoBytes) { log_w("OnReceive is set to Timeout only, thus FIFO Full is now 120 bytes."); } bool retCode = uartSetRxFIFOFull(_uart, fifoBytes); // Set new timeout - if (fifoBytes > 0 && fifoBytes < SOC_UART_FIFO_LEN - 1) _rxFIFOFull = fifoBytes; + if (fifoBytes > 0 && fifoBytes < SOC_UART_FIFO_LEN - 1) { + _rxFIFOFull = fifoBytes; + } HSERIAL_MUTEX_UNLOCK(); return retCode; } @@ -202,7 +208,9 @@ bool HardwareSerial::setRxTimeout(uint8_t symbols_timeout) { // Zero disables timeout, thus, onReceive callback will only be called when RX FIFO reaches 120 bytes // Any non-zero value will activate onReceive callback based on UART baudrate with about 11 bits per symbol _rxTimeout = symbols_timeout; - if (!symbols_timeout) _onReceiveTimeout = false; // only when RX timeout is disabled, we also must disable this flag + if (!symbols_timeout) { + _onReceiveTimeout = false; // only when RX timeout is disabled, we also must disable this flag + } bool retCode = uartSetRxTimeout(_uart, _rxTimeout); // Set new timeout @@ -233,8 +241,9 @@ void HardwareSerial::_uartEventTask(void *args) { hardwareSerial_error_t currentErr = UART_NO_ERROR; switch (event.type) { case UART_DATA: - if (uart->_onReceiveCB && uart->available() > 0 && ((uart->_onReceiveTimeout && event.timeout_flag) || !uart->_onReceiveTimeout)) + if (uart->_onReceiveCB && uart->available() > 0 && ((uart->_onReceiveTimeout && event.timeout_flag) || !uart->_onReceiveTimeout)) { uart->_onReceiveCB(); + } break; case UART_FIFO_OVF: log_w("UART%d FIFO Overflow. Consider adding Hardware Flow Control to your Application.", uart->_uart_nr); @@ -256,12 +265,12 @@ void HardwareSerial::_uartEventTask(void *args) { log_w("UART%d frame error.", uart->_uart_nr); currentErr = UART_FRAME_ERROR; break; - default: - log_w("UART%d unknown event type %d.", uart->_uart_nr, event.type); - break; + default: log_w("UART%d unknown event type %d.", uart->_uart_nr, event.type); break; } if (currentErr != UART_NO_ERROR) { - if (uart->_onReceiveErrorCB) uart->_onReceiveErrorCB(currentErr); + if (uart->_onReceiveErrorCB) { + uart->_onReceiveErrorCB(currentErr); + } } } } diff --git a/cores/esp32/HardwareSerial.h b/cores/esp32/HardwareSerial.h index 766d0cf2b..3fd5e7dc9 100644 --- a/cores/esp32/HardwareSerial.h +++ b/cores/esp32/HardwareSerial.h @@ -96,7 +96,6 @@ typedef enum { UART_PARITY_ERROR } hardwareSerial_error_t; - #ifndef ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE #define ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE 2048 #endif @@ -250,7 +249,10 @@ public: // timeout_ms is used in baudrate detection (ESP32, ESP32S2 only) // invert will invert RX/TX polarity // rxfifo_full_thrhd if the UART Flow Control Threshold in the UART FIFO (max 127) - void begin(unsigned long baud, uint32_t config = SERIAL_8N1, int8_t rxPin = -1, int8_t txPin = -1, bool invert = false, unsigned long timeout_ms = 20000UL, uint8_t rxfifo_full_thrhd = 112); + void begin( + unsigned long baud, uint32_t config = SERIAL_8N1, int8_t rxPin = -1, int8_t txPin = -1, bool invert = false, unsigned long timeout_ms = 20000UL, + uint8_t rxfifo_full_thrhd = 112 + ); void end(void); void updateBaudRate(unsigned long baud); int available(void); diff --git a/cores/esp32/HashBuilder.h b/cores/esp32/HashBuilder.h index 12b3cfb88..77d1c71db 100644 --- a/cores/esp32/HashBuilder.h +++ b/cores/esp32/HashBuilder.h @@ -25,23 +25,23 @@ public: virtual ~HashBuilder() {} virtual void begin() = 0; - virtual void add(const uint8_t* data, size_t len) = 0; - virtual void add(const char* data) { - add((const uint8_t*)data, strlen(data)); + virtual void add(const uint8_t *data, size_t len) = 0; + virtual void add(const char *data) { + add((const uint8_t *)data, strlen(data)); } virtual void add(String data) { add(data.c_str()); } - virtual void addHexString(const char* data) = 0; + virtual void addHexString(const char *data) = 0; virtual void addHexString(String data) { addHexString(data.c_str()); } - virtual bool addStream(Stream& stream, const size_t maxLen) = 0; + virtual bool addStream(Stream &stream, const size_t maxLen) = 0; virtual void calculate() = 0; - virtual void getBytes(uint8_t* output) = 0; - virtual void getChars(char* output) = 0; + virtual void getBytes(uint8_t *output) = 0; + virtual void getChars(char *output) = 0; virtual String toString() = 0; }; diff --git a/cores/esp32/IPAddress.cpp b/cores/esp32/IPAddress.cpp index f0342f2fb..1db800a4b 100644 --- a/cores/esp32/IPAddress.cpp +++ b/cores/esp32/IPAddress.cpp @@ -22,8 +22,7 @@ #include "lwip/netif.h" #include "StreamString.h" -IPAddress::IPAddress() - : IPAddress(IPv4) {} +IPAddress::IPAddress() : IPAddress(IPv4) {} IPAddress::IPAddress(IPType ip_type) { _type = ip_type; @@ -41,7 +40,10 @@ IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_oc _address.bytes[IPADDRESS_V4_BYTES_INDEX + 3] = fourth_octet; } -IPAddress::IPAddress(uint8_t o1, uint8_t o2, uint8_t o3, uint8_t o4, uint8_t o5, uint8_t o6, uint8_t o7, uint8_t o8, uint8_t o9, uint8_t o10, uint8_t o11, uint8_t o12, uint8_t o13, uint8_t o14, uint8_t o15, uint8_t o16, uint8_t z) { +IPAddress::IPAddress( + uint8_t o1, uint8_t o2, uint8_t o3, uint8_t o4, uint8_t o5, uint8_t o6, uint8_t o7, uint8_t o8, uint8_t o9, uint8_t o10, uint8_t o11, uint8_t o12, + uint8_t o13, uint8_t o14, uint8_t o15, uint8_t o16, uint8_t z +) { _type = IPv6; _address.bytes[0] = o1; _address.bytes[1] = o2; @@ -78,10 +80,9 @@ IPAddress::IPAddress(uint32_t address) { // in that order, will form the integer (uint32_t) 3460758158 . } -IPAddress::IPAddress(const uint8_t* address) - : IPAddress(IPv4, address) {} +IPAddress::IPAddress(const uint8_t *address) : IPAddress(IPv4, address) {} -IPAddress::IPAddress(IPType ip_type, const uint8_t* address, uint8_t z) { +IPAddress::IPAddress(IPType ip_type, const uint8_t *address, uint8_t z) { _type = ip_type; if (ip_type == IPv4) { memset(_address.bytes, 0, sizeof(_address.bytes)); @@ -93,11 +94,11 @@ IPAddress::IPAddress(IPType ip_type, const uint8_t* address, uint8_t z) { } } -IPAddress::IPAddress(const char* address) { +IPAddress::IPAddress(const char *address) { fromString(address); } -IPAddress::IPAddress(const IPAddress& address) { +IPAddress::IPAddress(const IPAddress &address) { *this = address; } @@ -107,14 +108,14 @@ String IPAddress::toString(bool includeZone) const { return String(s); } -bool IPAddress::fromString(const char* address) { +bool IPAddress::fromString(const char *address) { if (!fromString4(address)) { return fromString6(address); } return true; } -bool IPAddress::fromString4(const char* address) { +bool IPAddress::fromString4(const char *address) { // TODO: add support for "a", "a.b", "a.b.c" formats int16_t acc = -1; // Accumulator @@ -159,19 +160,21 @@ bool IPAddress::fromString4(const char* address) { return true; } -bool IPAddress::fromString6(const char* address) { +bool IPAddress::fromString6(const char *address) { uint32_t acc = 0; // Accumulator int colons = 0, double_colons = -1; while (*address) { char c = tolower(*address++); if (isalnum(c) && c <= 'f') { - if (c >= 'a') + if (c >= 'a') { c -= 'a' - '0' - 10; + } acc = acc * 16 + (c - '0'); - if (acc > 0xffff) + if (acc > 0xffff) { // Value out of range return false; + } } else if (c == ':') { if (*address == ':') { if (double_colons >= 0) { @@ -189,9 +192,10 @@ bool IPAddress::fromString6(const char* address) { // can't end with a single colon return false; } - if (colons == 7) + if (colons == 7) { // too many separators return false; + } _address.bytes[colons * 2] = acc >> 8; _address.bytes[colons * 2 + 1] = acc & 0xff; colons++; @@ -201,9 +205,10 @@ bool IPAddress::fromString6(const char* address) { while (*address != '\0') { address++; } - } else + } else { // Invalid char return false; + } } if (double_colons == -1 && colons != 7) { @@ -219,17 +224,19 @@ bool IPAddress::fromString6(const char* address) { colons++; if (double_colons != -1) { - for (int i = colons * 2 - double_colons * 2 - 1; i >= 0; i--) + for (int i = colons * 2 - double_colons * 2 - 1; i >= 0; i--) { _address.bytes[16 - colons * 2 + double_colons * 2 + i] = _address.bytes[double_colons * 2 + i]; - for (int i = double_colons * 2; i < 16 - colons * 2 + double_colons * 2; i++) + } + for (int i = double_colons * 2; i < 16 - colons * 2 + double_colons * 2; i++) { _address.bytes[i] = 0; + } } _type = IPv6; return true; } -IPAddress& IPAddress::operator=(const uint8_t* address) { +IPAddress &IPAddress::operator=(const uint8_t *address) { // IPv4 only conversion from byte pointer _type = IPv4; memset(_address.bytes, 0, sizeof(_address.bytes)); @@ -237,12 +244,12 @@ IPAddress& IPAddress::operator=(const uint8_t* address) { return *this; } -IPAddress& IPAddress::operator=(const char* address) { +IPAddress &IPAddress::operator=(const char *address) { fromString(address); return *this; } -IPAddress& IPAddress::operator=(uint32_t address) { +IPAddress &IPAddress::operator=(uint32_t address) { // IPv4 conversion // See note on conversion/comparison and uint32_t _type = IPv4; @@ -251,19 +258,18 @@ IPAddress& IPAddress::operator=(uint32_t address) { return *this; } -IPAddress& IPAddress::operator=(const IPAddress& address) { +IPAddress &IPAddress::operator=(const IPAddress &address) { _type = address.type(); _zone = address.zone(); memcpy(_address.bytes, address._address.bytes, sizeof(_address.bytes)); return *this; } -bool IPAddress::operator==(const IPAddress& addr) const { - return (addr._type == _type) - && (memcmp(addr._address.bytes, _address.bytes, sizeof(_address.bytes)) == 0); +bool IPAddress::operator==(const IPAddress &addr) const { + return (addr._type == _type) && (memcmp(addr._address.bytes, _address.bytes, sizeof(_address.bytes)) == 0); } -bool IPAddress::operator==(const uint8_t* addr) const { +bool IPAddress::operator==(const uint8_t *addr) const { // IPv4 only comparison to byte pointer // Can't support IPv6 as we know our type, but not the length of the pointer return _type == IPv4 && memcmp(addr, &_address.bytes[IPADDRESS_V4_BYTES_INDEX], sizeof(uint32_t)) == 0; @@ -276,18 +282,18 @@ uint8_t IPAddress::operator[](int index) const { return _address.bytes[index]; } -uint8_t& IPAddress::operator[](int index) { +uint8_t &IPAddress::operator[](int index) { if (_type == IPv4) { return _address.bytes[IPADDRESS_V4_BYTES_INDEX + index]; } return _address.bytes[index]; } -size_t IPAddress::printTo(Print& p) const { +size_t IPAddress::printTo(Print &p) const { return printTo(p, false); } -size_t IPAddress::printTo(Print& p, bool includeZone) const { +size_t IPAddress::printTo(Print &p, bool includeZone) const { size_t n = 0; if (_type == IPv6) { @@ -357,11 +363,11 @@ size_t IPAddress::printTo(Print& p, bool includeZone) const { return n; } -IPAddress::IPAddress(const ip_addr_t* addr) { +IPAddress::IPAddress(const ip_addr_t *addr) { from_ip_addr_t(addr); } -void IPAddress::to_ip_addr_t(ip_addr_t* addr) const { +void IPAddress::to_ip_addr_t(ip_addr_t *addr) const { if (_type == IPv6) { addr->type = IPADDR_TYPE_V6; addr->u_addr.ip6.addr[0] = _address.dword[0]; @@ -377,7 +383,7 @@ void IPAddress::to_ip_addr_t(ip_addr_t* addr) const { } } -IPAddress& IPAddress::from_ip_addr_t(const ip_addr_t* addr) { +IPAddress &IPAddress::from_ip_addr_t(const ip_addr_t *addr) { if (addr->type == IPADDR_TYPE_V6) { _type = IPv6; _address.dword[0] = addr->u_addr.ip6.addr[0]; @@ -400,7 +406,7 @@ esp_ip6_addr_type_t IPAddress::addr_type() const { } ip_addr_t addr; to_ip_addr_t(&addr); - return esp_netif_ip6_get_addr_type((esp_ip6_addr_t*)(&(addr.u_addr.ip6))); + return esp_netif_ip6_get_addr_type((esp_ip6_addr_t *)(&(addr.u_addr.ip6))); } const IPAddress IN6ADDR_ANY(IPv6); diff --git a/cores/esp32/IPAddress.h b/cores/esp32/IPAddress.h index 0a5a15fba..a24271cd5 100644 --- a/cores/esp32/IPAddress.h +++ b/cores/esp32/IPAddress.h @@ -48,7 +48,7 @@ private: // to the internal structure rather than a copy of the address this function should only // be used when you know that the usage of the returned uint8_t* will be transient and not // stored. - uint8_t* raw_address() { + uint8_t *raw_address() { return _type == IPv4 ? &_address.bytes[IPADDRESS_V4_BYTES_INDEX] : _address.bytes; } @@ -59,18 +59,21 @@ public: IPAddress(); IPAddress(IPType ip_type); IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); - IPAddress(uint8_t o1, uint8_t o2, uint8_t o3, uint8_t o4, uint8_t o5, uint8_t o6, uint8_t o7, uint8_t o8, uint8_t o9, uint8_t o10, uint8_t o11, uint8_t o12, uint8_t o13, uint8_t o14, uint8_t o15, uint8_t o16, uint8_t z = 0); + IPAddress( + uint8_t o1, uint8_t o2, uint8_t o3, uint8_t o4, uint8_t o5, uint8_t o6, uint8_t o7, uint8_t o8, uint8_t o9, uint8_t o10, uint8_t o11, uint8_t o12, + uint8_t o13, uint8_t o14, uint8_t o15, uint8_t o16, uint8_t z = 0 + ); // IPv4; see implementation note IPAddress(uint32_t address); // Default IPv4 - IPAddress(const uint8_t* address); - IPAddress(IPType ip_type, const uint8_t* address, uint8_t z = 0); + IPAddress(const uint8_t *address); + IPAddress(IPType ip_type, const uint8_t *address, uint8_t z = 0); // If IPv4 fails tries IPv6 see fromString function - IPAddress(const char* address); - IPAddress(const IPAddress& address); + IPAddress(const char *address); + IPAddress(const IPAddress &address); - bool fromString(const char* address); - bool fromString(const String& address) { + bool fromString(const char *address); + bool fromString(const String &address) { return fromString(address.c_str()); } @@ -80,28 +83,28 @@ public: return _type == IPv4 ? _address.dword[IPADDRESS_V4_DWORD_INDEX] : 0; }; - bool operator==(const IPAddress& addr) const; - bool operator!=(const IPAddress& addr) const { + bool operator==(const IPAddress &addr) const; + bool operator!=(const IPAddress &addr) const { return !(*this == addr); }; // NOTE: IPv4 only; we don't know the length of the pointer - bool operator==(const uint8_t* addr) const; + bool operator==(const uint8_t *addr) const; // Overloaded index operator to allow getting and setting individual octets of the address uint8_t operator[](int index) const; - uint8_t& operator[](int index); + uint8_t &operator[](int index); // Overloaded copy operators to allow initialization of IPAddress objects from other types // NOTE: IPv4 only - IPAddress& operator=(const uint8_t* address); + IPAddress &operator=(const uint8_t *address); // NOTE: IPv4 only; see implementation note - IPAddress& operator=(uint32_t address); + IPAddress &operator=(uint32_t address); // If IPv4 fails tries IPv6 see fromString function - IPAddress& operator=(const char* address); - IPAddress& operator=(const IPAddress& address); + IPAddress &operator=(const char *address); + IPAddress &operator=(const IPAddress &address); - virtual size_t printTo(Print& p) const; + virtual size_t printTo(Print &p) const; String toString(bool includeZone = false) const; IPType type() const { @@ -109,22 +112,22 @@ public: } // Espresif LwIP conversions - IPAddress(const ip_addr_t* addr); - void to_ip_addr_t(ip_addr_t* addr) const; - IPAddress& from_ip_addr_t(const ip_addr_t* addr); + IPAddress(const ip_addr_t *addr); + void to_ip_addr_t(ip_addr_t *addr) const; + IPAddress &from_ip_addr_t(const ip_addr_t *addr); esp_ip6_addr_type_t addr_type() const; uint8_t zone() const { return (type() == IPv6) ? _zone : 0; } - size_t printTo(Print& p, bool includeZone) const; + size_t printTo(Print &p, bool includeZone) const; friend class UDP; friend class Client; friend class Server; protected: - bool fromString4(const char* address); - bool fromString6(const char* address); + bool fromString4(const char *address); + bool fromString6(const char *address); }; extern const IPAddress IN6ADDR_ANY; diff --git a/cores/esp32/MD5Builder.cpp b/cores/esp32/MD5Builder.cpp index 601565bfd..cd8aa31b6 100644 --- a/cores/esp32/MD5Builder.cpp +++ b/cores/esp32/MD5Builder.cpp @@ -26,13 +26,13 @@ void MD5Builder::begin(void) { esp_rom_md5_init(&_ctx); } -void MD5Builder::add(const uint8_t* data, size_t len) { +void MD5Builder::add(const uint8_t *data, size_t len) { esp_rom_md5_update(&_ctx, data, len); } -void MD5Builder::addHexString(const char* data) { +void MD5Builder::addHexString(const char *data) { size_t len = strlen(data); - uint8_t* tmp = (uint8_t*)malloc(len / 2); + uint8_t *tmp = (uint8_t *)malloc(len / 2); if (tmp == NULL) { return; } @@ -41,10 +41,10 @@ void MD5Builder::addHexString(const char* data) { free(tmp); } -bool MD5Builder::addStream(Stream& stream, const size_t maxLen) { +bool MD5Builder::addStream(Stream &stream, const size_t maxLen) { const int buf_size = 512; int maxLengthLeft = maxLen; - uint8_t* buf = (uint8_t*)malloc(buf_size); + uint8_t *buf = (uint8_t *)malloc(buf_size); if (!buf) { return false; @@ -84,11 +84,11 @@ void MD5Builder::calculate(void) { esp_rom_md5_final(_buf, &_ctx); } -void MD5Builder::getBytes(uint8_t* output) { +void MD5Builder::getBytes(uint8_t *output) { memcpy(output, _buf, ESP_ROM_MD5_DIGEST_LEN); } -void MD5Builder::getChars(char* output) { +void MD5Builder::getChars(char *output) { bytes2hex(output, ESP_ROM_MD5_DIGEST_LEN * 2 + 1, _buf, ESP_ROM_MD5_DIGEST_LEN); } diff --git a/cores/esp32/MD5Builder.h b/cores/esp32/MD5Builder.h index 8950eba94..5728bd3ba 100644 --- a/cores/esp32/MD5Builder.h +++ b/cores/esp32/MD5Builder.h @@ -33,19 +33,20 @@ class MD5Builder : public HashBuilder { private: md5_context_t _ctx; uint8_t _buf[ESP_ROM_MD5_DIGEST_LEN]; + public: void begin(void) override; using HashBuilder::add; - void add(const uint8_t* data, size_t len) override; + void add(const uint8_t *data, size_t len) override; using HashBuilder::addHexString; - void addHexString(const char* data) override; + void addHexString(const char *data) override; - bool addStream(Stream& stream, const size_t maxLen) override; + bool addStream(Stream &stream, const size_t maxLen) override; void calculate(void) override; - void getBytes(uint8_t* output) override; - void getChars(char* output) override; + void getBytes(uint8_t *output) override; + void getChars(char *output) override; String toString(void) override; }; diff --git a/cores/esp32/MacAddress.cpp b/cores/esp32/MacAddress.cpp index 393f636d4..718b5cfba 100644 --- a/cores/esp32/MacAddress.cpp +++ b/cores/esp32/MacAddress.cpp @@ -3,8 +3,7 @@ #include //Default constructor, blank mac address. -MacAddress::MacAddress() - : MacAddress(MAC6) {} +MacAddress::MacAddress() : MacAddress(MAC6) {} MacAddress::MacAddress(MACType mac_type) { _type = mac_type; @@ -118,14 +117,12 @@ void MacAddress::toBytes(uint8_t *buf) { //MAC: Buffer must be at least 18 chars int MacAddress::toString(char *buf) { if (_type == MAC6) { - return sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X", - _mac.bytes[0], _mac.bytes[1], _mac.bytes[2], - _mac.bytes[3], _mac.bytes[4], _mac.bytes[5]); + return sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X", _mac.bytes[0], _mac.bytes[1], _mac.bytes[2], _mac.bytes[3], _mac.bytes[4], _mac.bytes[5]); } else { - return sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", - _mac.bytes[0], _mac.bytes[1], _mac.bytes[2], - _mac.bytes[3], _mac.bytes[4], _mac.bytes[5], - _mac.bytes[6], _mac.bytes[7]); + return sprintf( + buf, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", _mac.bytes[0], _mac.bytes[1], _mac.bytes[2], _mac.bytes[3], _mac.bytes[4], _mac.bytes[5], _mac.bytes[6], + _mac.bytes[7] + ); } } @@ -133,14 +130,12 @@ String MacAddress::toString() const { uint8_t bytes = (_type == MAC6) ? 18 : 24; char buf[bytes]; if (_type == MAC6) { - snprintf(buf, sizeof(buf), "%02X:%02X:%02X:%02X:%02X:%02X", - _mac.bytes[0], _mac.bytes[1], _mac.bytes[2], - _mac.bytes[3], _mac.bytes[4], _mac.bytes[5]); + snprintf(buf, sizeof(buf), "%02X:%02X:%02X:%02X:%02X:%02X", _mac.bytes[0], _mac.bytes[1], _mac.bytes[2], _mac.bytes[3], _mac.bytes[4], _mac.bytes[5]); } else { - snprintf(buf, sizeof(buf), "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", - _mac.bytes[0], _mac.bytes[1], _mac.bytes[2], - _mac.bytes[3], _mac.bytes[4], _mac.bytes[5], - _mac.bytes[6], _mac.bytes[7]); + snprintf( + buf, sizeof(buf), "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", _mac.bytes[0], _mac.bytes[1], _mac.bytes[2], _mac.bytes[3], _mac.bytes[4], _mac.bytes[5], + _mac.bytes[6], _mac.bytes[7] + ); } return String(buf); } diff --git a/cores/esp32/MacAddress.h b/cores/esp32/MacAddress.h index 1b4aa9792..5b42649c7 100644 --- a/cores/esp32/MacAddress.h +++ b/cores/esp32/MacAddress.h @@ -50,10 +50,8 @@ public: MacAddress(MACType mac_type, const uint8_t *macbytearray); //Default MAC6 - MacAddress(uint64_t mac) - : MacAddress(MAC6, mac) {} - MacAddress(const uint8_t *macbytearray) - : MacAddress(MAC6, macbytearray) {} + MacAddress(uint64_t mac) : MacAddress(MAC6, mac) {} + MacAddress(const uint8_t *macbytearray) : MacAddress(MAC6, macbytearray) {} MacAddress(const char *macstr); MacAddress(const String &macstr); diff --git a/cores/esp32/Print.h b/cores/esp32/Print.h index 056cbb6b4..d02a8233a 100644 --- a/cores/esp32/Print.h +++ b/cores/esp32/Print.h @@ -38,14 +38,14 @@ private: size_t printNumber(unsigned long, uint8_t); size_t printNumber(unsigned long long, uint8_t); size_t printFloat(double, uint8_t); + protected: void setWriteError(int err = 1) { write_error = err; } + public: - Print() - : write_error(0) { - } + Print() : write_error(0) {} virtual ~Print() {} int getWriteError() { return write_error; @@ -112,8 +112,7 @@ public: size_t println(struct tm *timeinfo, const char *format = NULL); size_t println(void); - virtual void flush() { /* Empty implementation for backward compatibility */ - } + virtual void flush() { /* Empty implementation for backward compatibility */ } }; #endif diff --git a/cores/esp32/Printable.h b/cores/esp32/Printable.h index ae1bde9fb..3a8fe0092 100644 --- a/cores/esp32/Printable.h +++ b/cores/esp32/Printable.h @@ -33,7 +33,7 @@ class Print; class Printable { public: virtual ~Printable() {} - virtual size_t printTo(Print& p) const = 0; + virtual size_t printTo(Print &p) const = 0; }; #endif diff --git a/cores/esp32/SHA1Builder.cpp b/cores/esp32/SHA1Builder.cpp index 84e28bdb2..6bbe3ca83 100644 --- a/cores/esp32/SHA1Builder.cpp +++ b/cores/esp32/SHA1Builder.cpp @@ -27,36 +27,27 @@ #ifndef GET_UINT32_BE #define GET_UINT32_BE(n, b, i) \ - { \ - (n) = ((uint32_t)(b)[(i)] << 24) \ - | ((uint32_t)(b)[(i) + 1] << 16) \ - | ((uint32_t)(b)[(i) + 2] << 8) \ - | ((uint32_t)(b)[(i) + 3]); \ - } + { (n) = ((uint32_t)(b)[(i)] << 24) | ((uint32_t)(b)[(i) + 1] << 16) | ((uint32_t)(b)[(i) + 2] << 8) | ((uint32_t)(b)[(i) + 3]); } #endif #ifndef PUT_UINT32_BE -#define PUT_UINT32_BE(n, b, i) \ - { \ - (b)[(i)] = (uint8_t)((n) >> 24); \ +#define PUT_UINT32_BE(n, b, i) \ + { \ + (b)[(i)] = (uint8_t)((n) >> 24); \ (b)[(i) + 1] = (uint8_t)((n) >> 16); \ - (b)[(i) + 2] = (uint8_t)((n) >> 8); \ - (b)[(i) + 3] = (uint8_t)((n)); \ + (b)[(i) + 2] = (uint8_t)((n) >> 8); \ + (b)[(i) + 3] = (uint8_t)((n)); \ } #endif // Constants -static const uint8_t sha1_padding[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; +static const uint8_t sha1_padding[64] = {0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Private methods -void SHA1Builder::process(const uint8_t* data) { +void SHA1Builder::process(const uint8_t *data) { uint32_t temp, W[16], A, B, C, D, E; GET_UINT32_BE(W[0], data, 0); @@ -78,15 +69,12 @@ void SHA1Builder::process(const uint8_t* data) { #define sha1_S(x, n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) -#define sha1_R(t) \ - ( \ - temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ W[(t - 14) & 0x0F] ^ W[t & 0x0F], \ - (W[t & 0x0F] = sha1_S(temp, 1))) +#define sha1_R(t) (temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ W[(t - 14) & 0x0F] ^ W[t & 0x0F], (W[t & 0x0F] = sha1_S(temp, 1))) -#define sha1_P(a, b, c, d, e, x) \ - { \ +#define sha1_P(a, b, c, d, e, x) \ + { \ e += sha1_S(a, 5) + sha1_F(b, c, d) + sha1_K + x; \ - b = sha1_S(b, 30); \ + b = sha1_S(b, 30); \ } A = state[0]; @@ -96,7 +84,7 @@ void SHA1Builder::process(const uint8_t* data) { E = state[4]; #define sha1_F(x, y, z) (z ^ (x & (y ^ z))) -#define sha1_K 0x5A827999 +#define sha1_K 0x5A827999 sha1_P(A, B, C, D, E, W[0]); sha1_P(E, A, B, C, D, W[1]); @@ -123,7 +111,7 @@ void SHA1Builder::process(const uint8_t* data) { #undef sha1_F #define sha1_F(x, y, z) (x ^ y ^ z) -#define sha1_K 0x6ED9EBA1 +#define sha1_K 0x6ED9EBA1 sha1_P(A, B, C, D, E, sha1_R(20)); sha1_P(E, A, B, C, D, sha1_R(21)); @@ -150,7 +138,7 @@ void SHA1Builder::process(const uint8_t* data) { #undef sha1_F #define sha1_F(x, y, z) ((x & y) | (z & (x | y))) -#define sha1_K 0x8F1BBCDC +#define sha1_K 0x8F1BBCDC sha1_P(A, B, C, D, E, sha1_R(40)); sha1_P(E, A, B, C, D, sha1_R(41)); @@ -177,7 +165,7 @@ void SHA1Builder::process(const uint8_t* data) { #undef sha1_F #define sha1_F(x, y, z) (x ^ y ^ z) -#define sha1_K 0xCA62C1D6 +#define sha1_K 0xCA62C1D6 sha1_P(A, B, C, D, E, sha1_R(60)); sha1_P(E, A, B, C, D, sha1_R(61)); @@ -226,7 +214,7 @@ void SHA1Builder::begin(void) { memset(hash, 0x00, sizeof(hash)); } -void SHA1Builder::add(const uint8_t* data, size_t len) { +void SHA1Builder::add(const uint8_t *data, size_t len) { size_t fill; uint32_t left; @@ -245,7 +233,7 @@ void SHA1Builder::add(const uint8_t* data, size_t len) { } if (left && len >= fill) { - memcpy((void*)(buffer + left), data, fill); + memcpy((void *)(buffer + left), data, fill); process(buffer); data += fill; len -= fill; @@ -259,13 +247,13 @@ void SHA1Builder::add(const uint8_t* data, size_t len) { } if (len > 0) { - memcpy((void*)(buffer + left), data, len); + memcpy((void *)(buffer + left), data, len); } } -void SHA1Builder::addHexString(const char* data) { +void SHA1Builder::addHexString(const char *data) { uint16_t len = strlen(data); - uint8_t* tmp = (uint8_t*)malloc(len / 2); + uint8_t *tmp = (uint8_t *)malloc(len / 2); if (tmp == NULL) { return; } @@ -274,10 +262,10 @@ void SHA1Builder::addHexString(const char* data) { free(tmp); } -bool SHA1Builder::addStream(Stream& stream, const size_t maxLen) { +bool SHA1Builder::addStream(Stream &stream, const size_t maxLen) { const int buf_size = 512; int maxLengthLeft = maxLen; - uint8_t* buf = (uint8_t*)malloc(buf_size); + uint8_t *buf = (uint8_t *)malloc(buf_size); if (!buf) { return false; @@ -327,7 +315,7 @@ void SHA1Builder::calculate(void) { last = total[0] & 0x3F; padn = (last < 56) ? (56 - last) : (120 - last); - add((uint8_t*)sha1_padding, padn); + add((uint8_t *)sha1_padding, padn); add(msglen, 8); PUT_UINT32_BE(state[0], hash, 0); @@ -337,11 +325,11 @@ void SHA1Builder::calculate(void) { PUT_UINT32_BE(state[4], hash, 16); } -void SHA1Builder::getBytes(uint8_t* output) { +void SHA1Builder::getBytes(uint8_t *output) { memcpy(output, hash, SHA1_HASH_SIZE); } -void SHA1Builder::getChars(char* output) { +void SHA1Builder::getChars(char *output) { bytes2hex(output, SHA1_HASH_SIZE * 2 + 1, hash, SHA1_HASH_SIZE); } diff --git a/cores/esp32/SHA1Builder.h b/cores/esp32/SHA1Builder.h index 3b83f48e5..b587e4fdc 100644 --- a/cores/esp32/SHA1Builder.h +++ b/cores/esp32/SHA1Builder.h @@ -29,21 +29,21 @@ private: unsigned char buffer[64]; /* data block being processed */ uint8_t hash[SHA1_HASH_SIZE]; /* SHA-1 result */ - void process(const uint8_t* data); + void process(const uint8_t *data); public: void begin() override; using HashBuilder::add; - void add(const uint8_t* data, size_t len) override; + void add(const uint8_t *data, size_t len) override; using HashBuilder::addHexString; - void addHexString(const char* data) override; + void addHexString(const char *data) override; - bool addStream(Stream& stream, const size_t maxLen) override; + bool addStream(Stream &stream, const size_t maxLen) override; void calculate() override; - void getBytes(uint8_t* output) override; - void getChars(char* output) override; + void getBytes(uint8_t *output) override; + void getChars(char *output) override; String toString() override; }; diff --git a/cores/esp32/Stream.cpp b/cores/esp32/Stream.cpp index 18ffd05ef..1eb8e512a 100644 --- a/cores/esp32/Stream.cpp +++ b/cores/esp32/Stream.cpp @@ -25,7 +25,7 @@ #include "esp32-hal.h" #define PARSE_TIMEOUT 1000 // default number of milli-seconds to wait -#define NO_SKIP_CHAR 1 // a magic char not found in a valid ASCII numeric field +#define NO_SKIP_CHAR 1 // a magic char not found in a valid ASCII numeric field // private method to read stream with timeout int Stream::timedRead() { @@ -104,10 +104,10 @@ bool Stream::findUntil(const char *target, const char *terminator) { // returns true if target string is found, false if terminated or timed out bool Stream::findUntil(const char *target, size_t targetLen, const char *terminator, size_t termLen) { if (terminator == NULL) { - MultiTarget t[1] = { { target, targetLen, 0 } }; + MultiTarget t[1] = {{target, targetLen, 0}}; return findMulti(t, 1) == 0 ? true : false; } else { - MultiTarget t[2] = { { target, targetLen, 0 }, { terminator, termLen, 0 } }; + MultiTarget t[2] = {{target, targetLen, 0}, {terminator, termLen, 0}}; return findMulti(t, 2) == 0 ? true : false; } } @@ -116,37 +116,42 @@ int Stream::findMulti(struct Stream::MultiTarget *targets, int tCount) { // any zero length target string automatically matches and would make // a mess of the rest of the algorithm. for (struct MultiTarget *t = targets; t < targets + tCount; ++t) { - if (t->len <= 0) + if (t->len <= 0) { return t - targets; + } } while (1) { int c = timedRead(); - if (c < 0) + if (c < 0) { return -1; + } for (struct MultiTarget *t = targets; t < targets + tCount; ++t) { // the simple case is if we match, deal with that first. if (c == t->str[t->index]) { - if (++t->index == t->len) + if (++t->index == t->len) { return t - targets; - else + } else { continue; + } } // if not we need to walk back and see if we could have matched further // down the stream (ie '1112' doesn't match the first position in '11112' // but it will match the second position so we can't just reset the current // index to 0 when we find a mismatch. - if (t->index == 0) + if (t->index == 0) { continue; + } int origIndex = t->index; do { --t->index; // first check if current char works against the new current index - if (c != t->str[t->index]) + if (c != t->str[t->index]) { continue; + } // if it's the only char then we're good, nothing more to check if (t->index == 0) { @@ -158,8 +163,9 @@ int Stream::findMulti(struct Stream::MultiTarget *targets, int tCount) { int diff = origIndex - t->index; size_t i; for (i = 0; i < t->index; ++i) { - if (t->str[i] != t->str[i + diff]) + if (t->str[i] != t->str[i + diff]) { break; + } } // if we successfully got through the previous loop then our current diff --git a/cores/esp32/Stream.h b/cores/esp32/Stream.h index 576a90181..5a83747a5 100644 --- a/cores/esp32/Stream.h +++ b/cores/esp32/Stream.h @@ -48,8 +48,7 @@ public: virtual int read() = 0; virtual int peek() = 0; - Stream() - : _startMillis(0) { + Stream() : _startMillis(0) { _timeout = 1000; } virtual ~Stream() {} diff --git a/cores/esp32/StreamString.cpp b/cores/esp32/StreamString.cpp index 022353359..d0117c399 100644 --- a/cores/esp32/StreamString.cpp +++ b/cores/esp32/StreamString.cpp @@ -61,5 +61,4 @@ int StreamString::peek() { return -1; } -void StreamString::flush() { -} +void StreamString::flush() {} diff --git a/cores/esp32/StreamString.h b/cores/esp32/StreamString.h index e31e177e6..b4f201472 100644 --- a/cores/esp32/StreamString.h +++ b/cores/esp32/StreamString.h @@ -35,5 +35,4 @@ public: void flush() override; }; - #endif /* STREAMSTRING_H_ */ diff --git a/cores/esp32/Tone.cpp b/cores/esp32/Tone.cpp index 03a41c6d5..bb1e8d745 100644 --- a/cores/esp32/Tone.cpp +++ b/cores/esp32/Tone.cpp @@ -20,7 +20,7 @@ typedef struct { unsigned long duration; } tone_msg_t; -static void tone_task(void*) { +static void tone_task(void *) { tone_msg_t tone_msg; while (1) { xQueueReceive(_tone_queue, &tone_msg, portMAX_DELAY); @@ -51,8 +51,8 @@ static void tone_task(void*) { break; default:; // do nothing - } // switch - } // infinite loop + } // switch + } // infinite loop } static int tone_init() { diff --git a/cores/esp32/USB.cpp b/cores/esp32/USB.cpp index 48f9c8c85..8fdd7a3ab 100644 --- a/cores/esp32/USB.cpp +++ b/cores/esp32/USB.cpp @@ -60,9 +60,8 @@ static uint16_t load_dfu_descriptor(uint8_t *dst, uint8_t *itf) { #define DFU_ATTRS (DFU_ATTR_CAN_DOWNLOAD | DFU_ATTR_CAN_UPLOAD | DFU_ATTR_MANIFESTATION_TOLERANT) uint8_t str_index = tinyusb_add_string_descriptor("TinyUSB DFU_RT"); - uint8_t descriptor[TUD_DFU_RT_DESC_LEN] = { - // Interface number, string index, attributes, detach timeout, transfer size */ - TUD_DFU_RT_DESCRIPTOR(*itf, str_index, DFU_ATTRS, 700, 64) + uint8_t descriptor[TUD_DFU_RT_DESC_LEN] = {// Interface number, string index, attributes, detach timeout, transfer size */ + TUD_DFU_RT_DESCRIPTOR(*itf, str_index, DFU_ATTRS, 700, 64) }; *itf += 1; memcpy(dst, descriptor, TUD_DFU_RT_DESC_LEN); @@ -128,9 +127,12 @@ void tud_resume_cb(void) { } ESPUSB::ESPUSB(size_t task_stack_size, uint8_t event_task_priority) - : vid(USB_VID), pid(USB_PID), product_name(USB_PRODUCT), manufacturer_name(USB_MANUFACTURER), serial_number(USB_SERIAL), fw_version(0x0100), usb_version(0x0200) // at least 2.1 or 3.x for BOS & webUSB + : vid(USB_VID), pid(USB_PID), product_name(USB_PRODUCT), manufacturer_name(USB_MANUFACTURER), serial_number(USB_SERIAL), fw_version(0x0100), + usb_version(0x0200) // at least 2.1 or 3.x for BOS & webUSB , - usb_class(TUSB_CLASS_MISC), usb_subclass(MISC_SUBCLASS_COMMON), usb_protocol(MISC_PROTOCOL_IAD), usb_attributes(TUSB_DESC_CONFIG_ATT_SELF_POWERED), usb_power_ma(500), webusb_enabled(USB_WEBUSB_ENABLED), webusb_url(USB_WEBUSB_URL), _started(false), _task_stack_size(task_stack_size), _event_task_priority(event_task_priority) { + usb_class(TUSB_CLASS_MISC), usb_subclass(MISC_SUBCLASS_COMMON), usb_protocol(MISC_PROTOCOL_IAD), usb_attributes(TUSB_DESC_CONFIG_ATT_SELF_POWERED), + usb_power_ma(500), webusb_enabled(USB_WEBUSB_ENABLED), webusb_url(USB_WEBUSB_URL), _started(false), _task_stack_size(task_stack_size), + _event_task_priority(event_task_priority) { if (!arduino_usb_event_loop_handle) { esp_event_loop_args_t event_task_args = { .queue_size = 5, diff --git a/cores/esp32/USB.h b/cores/esp32/USB.h index 5023cea69..6d284937e 100644 --- a/cores/esp32/USB.h +++ b/cores/esp32/USB.h @@ -79,17 +79,17 @@ public: bool webUSB(bool enabled); bool webUSB(void); - bool productName(const char* name); - const char* productName(void); + bool productName(const char *name); + const char *productName(void); - bool manufacturerName(const char* name); - const char* manufacturerName(void); + bool manufacturerName(const char *name); + const char *manufacturerName(void); - bool serialNumber(const char* name); - const char* serialNumber(void); + bool serialNumber(const char *name); + const char *serialNumber(void); - bool webUSBURL(const char* name); - const char* webUSBURL(void); + bool webUSBURL(const char *name); + const char *webUSBURL(void); bool enableDFU(); bool begin(); @@ -118,6 +118,5 @@ private: extern ESPUSB USB; - #endif /* CONFIG_TINYUSB_ENABLED */ #endif /* SOC_USB_OTG_SUPPORTED */ diff --git a/cores/esp32/USBCDC.cpp b/cores/esp32/USBCDC.cpp index ed96ce67d..6252b8c1d 100644 --- a/cores/esp32/USBCDC.cpp +++ b/cores/esp32/USBCDC.cpp @@ -18,7 +18,6 @@ #include "USB.h" #if CONFIG_TINYUSB_CDC_ENABLED - #include "esp32-hal-tinyusb.h" #include "rom/ets_sys.h" @@ -27,13 +26,12 @@ esp_err_t arduino_usb_event_post(esp_event_base_t event_base, int32_t event_id, esp_err_t arduino_usb_event_handler_register_with(esp_event_base_t event_base, int32_t event_id, esp_event_handler_t event_handler, void *event_handler_arg); #define MAX_USB_CDC_DEVICES 2 -USBCDC *devices[MAX_USB_CDC_DEVICES] = { NULL, NULL }; +USBCDC *devices[MAX_USB_CDC_DEVICES] = {NULL, NULL}; static uint16_t load_cdc_descriptor(uint8_t *dst, uint8_t *itf) { uint8_t str_index = tinyusb_add_string_descriptor("TinyUSB CDC"); - uint8_t descriptor[TUD_CDC_DESC_LEN] = { - // Interface number, string index, EP notification address and size, EP data address (out, in) and size. - TUD_CDC_DESCRIPTOR(*itf, str_index, 0x85, 64, 0x03, 0x84, 64) + uint8_t descriptor[TUD_CDC_DESC_LEN] = {// Interface number, string index, EP notification address and size, EP data address (out, in) and size. + TUD_CDC_DESCRIPTOR(*itf, str_index, 0x85, 64, 0x03, 0x84, 64) }; *itf += 2; memcpy(dst, descriptor, TUD_CDC_DESC_LEN); @@ -84,7 +82,8 @@ static void usb_unplugged_cb(void *arg, esp_event_base_t event_base, int32_t eve } USBCDC::USBCDC(uint8_t itfn) - : itf(itfn), bit_rate(0), stop_bits(0), parity(0), data_bits(0), dtr(false), rts(false), connected(false), reboot_enable(true), rx_queue(NULL), tx_lock(NULL), tx_timeout_ms(250) { + : itf(itfn), bit_rate(0), stop_bits(0), parity(0), data_bits(0), dtr(false), rts(false), connected(false), reboot_enable(true), rx_queue(NULL), tx_lock(NULL), + tx_timeout_ms(250) { tinyusb_enable_interface(USB_INTERFACE_CDC, TUD_CDC_DESC_LEN, load_cdc_descriptor); if (itf < MAX_USB_CDC_DEVICES) { arduino_usb_event_handler_register_with(ARDUINO_USB_EVENTS, ARDUINO_USB_STOPPED_EVENT, usb_unplugged_cb, this); @@ -147,7 +146,9 @@ void USBCDC::begin(unsigned long baud) { tx_lock = xSemaphoreCreateMutex(); } // if rx_queue was set before begin(), keep it - if (!rx_queue) setRxBufferSize(256); //default if not preset + if (!rx_queue) { + setRxBufferSize(256); //default if not preset + } devices[itf] = this; } @@ -175,10 +176,12 @@ void USBCDC::_onUnplugged(void) { } } -enum { CDC_LINE_IDLE, - CDC_LINE_1, - CDC_LINE_2, - CDC_LINE_3 }; +enum { + CDC_LINE_IDLE, + CDC_LINE_1, + CDC_LINE_2, + CDC_LINE_3 +}; void USBCDC::_onLineState(bool _dtr, bool _rts) { static uint8_t lineState = CDC_LINE_IDLE; diff --git a/cores/esp32/USBCDC.h b/cores/esp32/USBCDC.h index 17fd0cf6b..4221c37c3 100644 --- a/cores/esp32/USBCDC.h +++ b/cores/esp32/USBCDC.h @@ -140,6 +140,5 @@ protected: extern USBCDC USBSerial; #endif - #endif /* CONFIG_TINYUSB_CDC_ENABLED */ #endif /* SOC_USB_OTG_SUPPORTED */ diff --git a/cores/esp32/USBMSC.cpp b/cores/esp32/USBMSC.cpp index ab348585e..6d36117b8 100644 --- a/cores/esp32/USBMSC.cpp +++ b/cores/esp32/USBMSC.cpp @@ -19,13 +19,12 @@ #include "esp32-hal-tinyusb.h" -extern "C" uint16_t tusb_msc_load_descriptor(uint8_t* dst, uint8_t* itf) { +extern "C" uint16_t tusb_msc_load_descriptor(uint8_t *dst, uint8_t *itf) { uint8_t str_index = tinyusb_add_string_descriptor("TinyUSB MSC"); uint8_t ep_num = tinyusb_get_free_duplex_endpoint(); TU_VERIFY(ep_num != 0); - uint8_t descriptor[TUD_MSC_DESC_LEN] = { - // Interface number, string index, EP Out & EP In address, EP size - TUD_MSC_DESCRIPTOR(*itf, str_index, ep_num, (uint8_t)(0x80 | ep_num), 64) + uint8_t descriptor[TUD_MSC_DESC_LEN] = {// Interface number, string index, EP Out & EP In address, EP size + TUD_MSC_DESCRIPTOR(*itf, str_index, ep_num, (uint8_t)(0x80 | ep_num), 64) }; *itf += 1; memcpy(dst, descriptor, TUD_MSC_DESC_LEN); @@ -40,19 +39,19 @@ typedef struct { uint16_t block_size; uint32_t block_count; bool (*start_stop)(uint8_t power_condition, bool start, bool load_eject); - int32_t (*read)(uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize); - int32_t (*write)(uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize); + int32_t (*read)(uint32_t lba, uint32_t offset, void *buffer, uint32_t bufsize); + int32_t (*write)(uint32_t lba, uint32_t offset, uint8_t *buffer, uint32_t bufsize); } msc_lun_t; static const uint8_t MSC_MAX_LUN = 3; static uint8_t MSC_ACTIVE_LUN = 0; static msc_lun_t msc_luns[MSC_MAX_LUN]; -static void cplstr(void* dst, const void* src, size_t max_len) { +static void cplstr(void *dst, const void *src, size_t max_len) { if (!src || !dst || !max_len) { return; } - size_t l = strlen((const char*)src); + size_t l = strlen((const char *)src); if (l > max_len) { l = max_len; } @@ -83,7 +82,7 @@ bool tud_msc_test_unit_ready_cb(uint8_t lun) { // Invoked when received SCSI_CMD_READ_CAPACITY_10 and SCSI_CMD_READ_FORMAT_CAPACITY to determine the disk size // Application update block count and block size -void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size) { +void tud_msc_capacity_cb(uint8_t lun, uint32_t *block_count, uint16_t *block_size) { log_v("[%u]", lun); if (!msc_luns[lun].media_present) { *block_count = 0; @@ -108,7 +107,7 @@ bool tud_msc_start_stop_cb(uint8_t lun, uint8_t power_condition, bool start, boo // Callback invoked when received READ10 command. // Copy disk's data to buffer (up to bufsize) and return number of copied bytes. -int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize) { +int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void *buffer, uint32_t bufsize) { log_v("[%u], lba: %u, offset: %u, bufsize: %u", lun, lba, offset, bufsize); if (!msc_luns[lun].media_present) { return 0; @@ -121,7 +120,7 @@ int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buff // Callback invoked when received WRITE10 command. // Process data in buffer to disk's storage and return number of written bytes -int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize) { +int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t *buffer, uint32_t bufsize) { log_v("[%u], lba: %u, offset: %u, bufsize: %u", lun, lba, offset, bufsize); if (!msc_luns[lun].media_present) { return 0; @@ -135,11 +134,11 @@ int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* // Callback invoked when received an SCSI command not in built-in list below // - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE // - READ10 and WRITE10 has their own callbacks -int32_t tud_msc_scsi_cb(uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize) { +int32_t tud_msc_scsi_cb(uint8_t lun, uint8_t const scsi_cmd[16], void *buffer, uint16_t bufsize) { // read10 & write10 has their own callback and MUST not be handled here log_v("[%u] cmd: %u, bufsize: %u", lun, scsi_cmd[0], bufsize); - void const* response = NULL; + void const *response = NULL; uint16_t resplen = 0; // most scsi handled is input @@ -165,7 +164,9 @@ int32_t tud_msc_scsi_cb(uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, u } // return resplen must not larger than bufsize - if (resplen > bufsize) resplen = bufsize; + if (resplen > bufsize) { + resplen = bufsize; + } if (response && (resplen > 0)) { if (in_xfer) { @@ -222,15 +223,15 @@ void USBMSC::end() { msc_luns[_lun].write = NULL; } -void USBMSC::vendorID(const char* vid) { +void USBMSC::vendorID(const char *vid) { cplstr(msc_luns[_lun].vendor_id, vid, 8); } -void USBMSC::productID(const char* pid) { +void USBMSC::productID(const char *pid) { cplstr(msc_luns[_lun].product_id, pid, 16); } -void USBMSC::productRevision(const char* rev) { +void USBMSC::productRevision(const char *rev) { cplstr(msc_luns[_lun].product_rev, rev, 4); } diff --git a/cores/esp32/USBMSC.h b/cores/esp32/USBMSC.h index 55f37867f..e9d41e0b7 100644 --- a/cores/esp32/USBMSC.h +++ b/cores/esp32/USBMSC.h @@ -29,10 +29,10 @@ typedef bool (*msc_start_stop_cb)(uint8_t power_condition, bool start, bool load_eject); // Copy disk's data to buffer (up to bufsize) and return number of copied bytes. -typedef int32_t (*msc_read_cb)(uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize); +typedef int32_t (*msc_read_cb)(uint32_t lba, uint32_t offset, void *buffer, uint32_t bufsize); // Process data in buffer to disk's storage and return number of written bytes -typedef int32_t (*msc_write_cb)(uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize); +typedef int32_t (*msc_write_cb)(uint32_t lba, uint32_t offset, uint8_t *buffer, uint32_t bufsize); class USBMSC { public: @@ -40,13 +40,14 @@ public: ~USBMSC(); bool begin(uint32_t block_count, uint16_t block_size); void end(); - void vendorID(const char* vid); //max 8 chars - void productID(const char* pid); //max 16 chars - void productRevision(const char* ver); //max 4 chars + void vendorID(const char *vid); //max 8 chars + void productID(const char *pid); //max 16 chars + void productRevision(const char *ver); //max 4 chars void mediaPresent(bool media_present); void onStartStop(msc_start_stop_cb cb); void onRead(msc_read_cb cb); void onWrite(msc_write_cb cb); + private: uint8_t _lun; }; diff --git a/cores/esp32/Udp.h b/cores/esp32/Udp.h index c80628919..3d3daef3b 100644 --- a/cores/esp32/Udp.h +++ b/cores/esp32/Udp.h @@ -44,7 +44,7 @@ public: virtual uint8_t begin(uint16_t) = 0; // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use virtual uint8_t beginMulticast(IPAddress, uint16_t) { return 0; - } // initialize, start listening on specified multicast IP address and port. Returns 1 if successful, 0 on failure + } // initialize, start listening on specified multicast IP address and port. Returns 1 if successful, 0 on failure virtual void stop() = 0; // Finish with the UDP socket // Sending UDP packets @@ -54,14 +54,14 @@ public: virtual int beginPacket(IPAddress ip, uint16_t port) = 0; // Start building up a packet to send to the remote host specific in host and port // Returns 1 if successful, 0 if there was a problem resolving the hostname or port - virtual int beginPacket(const char* host, uint16_t port) = 0; + virtual int beginPacket(const char *host, uint16_t port) = 0; // Finish off this packet and send it // Returns 1 if the packet was sent successfully, 0 if there was an error virtual int endPacket() = 0; // Write a single byte into the packet virtual size_t write(uint8_t) = 0; // Write size bytes from buffer into the packet - virtual size_t write(const uint8_t* buffer, size_t size) = 0; + virtual size_t write(const uint8_t *buffer, size_t size) = 0; // Start processing the next available incoming packet // Returns the size of the packet in bytes, or 0 if no packets are available @@ -72,10 +72,10 @@ public: virtual int read() = 0; // Read up to len bytes from the current packet and place them into buffer // Returns the number of bytes read, or 0 if none are available - virtual int read(unsigned char* buffer, size_t len) = 0; + virtual int read(unsigned char *buffer, size_t len) = 0; // Read up to len characters from the current packet and place them into buffer // Returns the number of characters read, or 0 if none are available - virtual int read(char* buffer, size_t len) = 0; + virtual int read(char *buffer, size_t len) = 0; // Return the next byte from the current packet without moving on to the next byte virtual int peek() = 0; virtual void flush() = 0; // Finish reading the current packet @@ -84,8 +84,9 @@ public: virtual IPAddress remoteIP() = 0; // Return the port of the host who sent the current incoming packet virtual uint16_t remotePort() = 0; + protected: - uint8_t* rawIPAddress(IPAddress& addr) { + uint8_t *rawIPAddress(IPAddress &addr) { return addr.raw_address(); } }; diff --git a/cores/esp32/WCharacter.h b/cores/esp32/WCharacter.h index e75e1f0a6..611d943e6 100644 --- a/cores/esp32/WCharacter.h +++ b/cores/esp32/WCharacter.h @@ -22,7 +22,7 @@ #include #define isascii(__c) ((unsigned)(__c) <= 0177) -#define toascii(__c) ((__c)&0177) +#define toascii(__c) ((__c) & 0177) // WCharacter.h prototypes inline boolean isAlphaNumeric(int c) __attribute__((always_inline)); diff --git a/cores/esp32/WString.cpp b/cores/esp32/WString.cpp index a236a5f73..71183213a 100644 --- a/cores/esp32/WString.cpp +++ b/cores/esp32/WString.cpp @@ -32,14 +32,16 @@ String::String(const char *cstr) { init(); - if (cstr) + if (cstr) { copy(cstr, strlen(cstr)); + } } String::String(const char *cstr, unsigned int length) { init(); - if (cstr) + if (cstr) { copy(cstr, length); + } } String::String(const String &value) { @@ -61,7 +63,7 @@ String::String(StringSumHelper &&rval) { String::String(char c) { init(); - char buf[] = { c, '\0' }; + char buf[] = {c, '\0'}; *this = buf; } @@ -154,17 +156,20 @@ inline void String::init(void) { } void String::invalidate(void) { - if (!isSSO() && wbuffer()) + if (!isSSO() && wbuffer()) { free(wbuffer()); + } init(); } bool String::reserve(unsigned int size) { - if (buffer() && capacity() >= size) + if (buffer() && capacity() >= size) { return true; + } if (changeBuffer(size)) { - if (len() == 0) + if (len() == 0) { wbuffer()[0] = 0; + } return true; } return false; @@ -262,34 +267,39 @@ void String::move(String &rhs) { #endif String &String::operator=(const String &rhs) { - if (this == &rhs) + if (this == &rhs) { return *this; - if (rhs.buffer()) + } + if (rhs.buffer()) { copy(rhs.buffer(), rhs.len()); - else + } else { invalidate(); + } return *this; } #ifdef __GXX_EXPERIMENTAL_CXX0X__ String &String::operator=(String &&rval) { - if (this != &rval) + if (this != &rval) { move(rval); + } return *this; } String &String::operator=(StringSumHelper &&rval) { - if (this != &rval) + if (this != &rval) { move(rval); + } return *this; } #endif String &String::operator=(const char *cstr) { - if (cstr) + if (cstr) { copy(cstr, strlen(cstr)); - else + } else { invalidate(); + } return *this; } @@ -302,12 +312,15 @@ bool String::concat(const String &s) { // realloc'ing the buffer and moving s.buffer in the method called if (&s == this) { unsigned int newlen = 2 * len(); - if (!s.buffer()) + if (!s.buffer()) { return false; - if (s.len() == 0) + } + if (s.len() == 0) { return true; - if (!reserve(newlen)) + } + if (!reserve(newlen)) { return false; + } memmove(wbuffer() + len(), buffer(), len()); setLen(newlen); wbuffer()[len()] = 0; @@ -319,30 +332,35 @@ bool String::concat(const String &s) { bool String::concat(const char *cstr, unsigned int length) { unsigned int newlen = len() + length; - if (!cstr) + if (!cstr) { return false; - if (length == 0) + } + if (length == 0) { return true; - if (!reserve(newlen)) + } + if (!reserve(newlen)) { return false; - if (cstr >= wbuffer() && cstr < wbuffer() + len()) + } + if (cstr >= wbuffer() && cstr < wbuffer() + len()) { // compatible with SSO in ram #6155 (case "x += x.c_str()") memmove(wbuffer() + len(), cstr, length + 1); - else + } else { // compatible with source in flash #6367 memcpy_P(wbuffer() + len(), cstr, length + 1); + } setLen(newlen); return true; } bool String::concat(const char *cstr) { - if (!cstr) + if (!cstr) { return false; + } return concat(cstr, strlen(cstr)); } bool String::concat(char c) { - char buf[] = { c, '\0' }; + char buf[] = {c, '\0'}; return concat(buf, 1); } @@ -406,85 +424,97 @@ bool String::concat(double num) { StringSumHelper &operator+(const StringSumHelper &lhs, const String &rhs) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(rhs.buffer(), rhs.len())) + if (!a.concat(rhs.buffer(), rhs.len())) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, const char *cstr) { StringSumHelper &a = const_cast(lhs); - if (!cstr || !a.concat(cstr, strlen(cstr))) + if (!cstr || !a.concat(cstr, strlen(cstr))) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, char c) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(c)) + if (!a.concat(c)) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, unsigned char num) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(num)) + if (!a.concat(num)) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, int num) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(num)) + if (!a.concat(num)) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, unsigned int num) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(num)) + if (!a.concat(num)) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, long num) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(num)) + if (!a.concat(num)) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, unsigned long num) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(num)) + if (!a.concat(num)) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, float num) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(num)) + if (!a.concat(num)) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, double num) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(num)) + if (!a.concat(num)) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, long long num) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(num)) + if (!a.concat(num)) { a.invalidate(); + } return a; } StringSumHelper &operator+(const StringSumHelper &lhs, unsigned long long num) { StringSumHelper &a = const_cast(lhs); - if (!a.concat(num)) + if (!a.concat(num)) { a.invalidate(); + } return a; } @@ -494,10 +524,12 @@ StringSumHelper &operator+(const StringSumHelper &lhs, unsigned long long num) { int String::compareTo(const String &s) const { if (!buffer() || !s.buffer()) { - if (s.buffer() && s.len() > 0) + if (s.buffer() && s.len() > 0) { return 0 - *(unsigned char *)s.buffer(); - if (buffer() && len() > 0) + } + if (buffer() && len() > 0) { return *(unsigned char *)buffer(); + } return 0; } return strcmp(buffer(), s.buffer()); @@ -508,10 +540,12 @@ bool String::equals(const String &s2) const { } bool String::equals(const char *cstr) const { - if (len() == 0) + if (len() == 0) { return (cstr == NULL || *cstr == 0); - if (cstr == NULL) + } + if (cstr == NULL) { return buffer()[0] == 0; + } return strcmp(buffer(), cstr) == 0; } @@ -532,17 +566,21 @@ bool String::operator>=(const String &rhs) const { } bool String::equalsIgnoreCase(const String &s2) const { - if (this == &s2) + if (this == &s2) { return true; - if (len() != s2.len()) + } + if (len() != s2.len()) { return false; - if (len() == 0) + } + if (len() == 0) { return true; + } const char *p1 = buffer(); const char *p2 = s2.buffer(); while (*p1) { - if (tolower(*p1++) != tolower(*p2++)) + if (tolower(*p1++) != tolower(*p2++)) { return false; + } } return true; } @@ -550,21 +588,24 @@ bool String::equalsIgnoreCase(const String &s2) const { unsigned char String::equalsConstantTime(const String &s2) const { // To avoid possible time-based attacks present function // compares given strings in a constant time. - if (len() != s2.len()) + if (len() != s2.len()) { return 0; + } //at this point lengths are the same - if (len() == 0) + if (len() == 0) { return 1; + } //at this point lengths are the same and non-zero const char *p1 = buffer(); const char *p2 = s2.buffer(); unsigned int equalchars = 0; unsigned int diffchars = 0; while (*p1) { - if (*p1 == *p2) + if (*p1 == *p2) { ++equalchars; - else + } else { ++diffchars; + } ++p1; ++p2; } @@ -575,20 +616,23 @@ unsigned char String::equalsConstantTime(const String &s2) const { } bool String::startsWith(const String &s2) const { - if (len() < s2.len()) + if (len() < s2.len()) { return false; + } return startsWith(s2, 0); } bool String::startsWith(const String &s2, unsigned int offset) const { - if (offset > (unsigned)(len() - s2.len()) || !buffer() || !s2.buffer()) + if (offset > (unsigned)(len() - s2.len()) || !buffer() || !s2.buffer()) { return false; + } return strncmp(&buffer()[offset], s2.buffer(), s2.len()) == 0; } bool String::endsWith(const String &s2) const { - if (len() < s2.len() || !buffer() || !s2.buffer()) + if (len() < s2.len() || !buffer() || !s2.buffer()) { return false; + } return strcmp(&buffer()[len() - s2.len()], s2.buffer()) == 0; } @@ -601,8 +645,9 @@ char String::charAt(unsigned int loc) const { } void String::setCharAt(unsigned int loc, char c) { - if (loc < len()) + if (loc < len()) { wbuffer()[loc] = c; + } } char &String::operator[](unsigned int index) { @@ -615,21 +660,24 @@ char &String::operator[](unsigned int index) { } char String::operator[](unsigned int index) const { - if (index >= len() || !buffer()) + if (index >= len() || !buffer()) { return 0; + } return buffer()[index]; } void String::getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index) const { - if (!bufsize || !buf) + if (!bufsize || !buf) { return; + } if (index >= len()) { buf[0] = 0; return; } unsigned int n = bufsize - 1; - if (n > len() - index) + if (n > len() - index) { n = len() - index; + } strncpy((char *)buf, buffer() + index, n); buf[n] = 0; } @@ -643,11 +691,13 @@ int String::indexOf(char c) const { } int String::indexOf(char ch, unsigned int fromIndex) const { - if (fromIndex >= len()) + if (fromIndex >= len()) { return -1; + } const char *temp = strchr(buffer() + fromIndex, ch); - if (temp == NULL) + if (temp == NULL) { return -1; + } return temp - buffer(); } @@ -656,11 +706,13 @@ int String::indexOf(const String &s2) const { } int String::indexOf(const String &s2, unsigned int fromIndex) const { - if (fromIndex >= len()) + if (fromIndex >= len()) { return -1; + } const char *found = strstr(buffer() + fromIndex, s2.buffer()); - if (found == NULL) + if (found == NULL) { return -1; + } return found - buffer(); } @@ -669,17 +721,20 @@ int String::lastIndexOf(char theChar) const { } int String::lastIndexOf(char ch, unsigned int fromIndex) const { - if (fromIndex >= len()) + if (fromIndex >= len()) { return -1; + } char tempchar = buffer()[fromIndex + 1]; wbuffer()[fromIndex + 1] = '\0'; char *temp = strrchr(wbuffer(), ch); wbuffer()[fromIndex + 1] = tempchar; - if (temp == NULL) + if (temp == NULL) { return -1; + } const int rv = temp - buffer(); - if (rv >= len()) + if (rv >= len()) { return -1; + } return rv; } @@ -688,17 +743,21 @@ int String::lastIndexOf(const String &s2) const { } int String::lastIndexOf(const String &s2, unsigned int fromIndex) const { - if (s2.len() == 0 || len() == 0 || s2.len() > len()) + if (s2.len() == 0 || len() == 0 || s2.len() > len()) { return -1; - if (fromIndex >= len()) + } + if (fromIndex >= len()) { fromIndex = len() - 1; + } int found = -1; for (char *p = wbuffer(); p <= wbuffer() + fromIndex; p++) { p = strstr(p, s2.buffer()); - if (!p) + if (!p) { break; - if ((unsigned int)(p - wbuffer()) <= fromIndex) + } + if ((unsigned int)(p - wbuffer()) <= fromIndex) { found = p - buffer(); + } } return found; } @@ -710,10 +769,12 @@ String String::substring(unsigned int left, unsigned int right) const { left = temp; } String out; - if (left >= len()) + if (left >= len()) { return out; - if (right > len()) + } + if (right > len()) { right = len(); + } out.copy(buffer() + left, right - left); return out; } @@ -723,17 +784,20 @@ String String::substring(unsigned int left, unsigned int right) const { /*********************************************/ void String::replace(char find, char replace) { - if (!buffer()) + if (!buffer()) { return; + } for (char *p = wbuffer(); *p; p++) { - if (*p == find) + if (*p == find) { *p = replace; + } } } void String::replace(const String &find, const String &replace) { - if (len() == 0 || find.len() == 0) + if (len() == 0 || find.len() == 0) { return; + } int diff = replace.len() - find.len(); char *readFrom = wbuffer(); char *foundAt; @@ -762,8 +826,9 @@ void String::replace(const String &find, const String &replace) { readFrom = foundAt + find.len(); size += diff; } - if (size == len()) + if (size == len()) { return; + } if (size > capacity() && !changeBuffer(size)) { log_w("String.Replace() Insufficient space to replace string"); return; @@ -806,33 +871,39 @@ void String::remove(unsigned int index, unsigned int count) { } void String::toLowerCase(void) { - if (!buffer()) + if (!buffer()) { return; + } for (char *p = wbuffer(); *p; p++) { *p = tolower(*p); } } void String::toUpperCase(void) { - if (!buffer()) + if (!buffer()) { return; + } for (char *p = wbuffer(); *p; p++) { *p = toupper(*p); } } void String::trim(void) { - if (!buffer() || len() == 0) + if (!buffer() || len() == 0) { return; + } char *begin = wbuffer(); - while (isspace(*begin)) + while (isspace(*begin)) { begin++; + } char *end = wbuffer() + len() - 1; - while (isspace(*end) && end >= begin) + while (isspace(*end) && end >= begin) { end--; + } unsigned int newlen = end + 1 - begin; - if (begin > buffer()) + if (begin > buffer()) { memmove(wbuffer(), begin, newlen); + } setLen(newlen); wbuffer()[newlen] = 0; } @@ -842,20 +913,23 @@ void String::trim(void) { /*********************************************/ long String::toInt(void) const { - if (buffer()) + if (buffer()) { return atol(buffer()); + } return 0; } float String::toFloat(void) const { - if (buffer()) + if (buffer()) { return atof(buffer()); + } return 0; } double String::toDouble(void) const { - if (buffer()) + if (buffer()) { return atof(buffer()); + } return 0.0; } diff --git a/cores/esp32/WString.h b/cores/esp32/WString.h index d379bc460..a8327f40d 100644 --- a/cores/esp32/WString.h +++ b/cores/esp32/WString.h @@ -30,12 +30,11 @@ #include #include - // A pure abstract class forward used as a means to proide a unique pointer type // but really is never defined. class __FlashStringHelper; #define FPSTR(str_pointer) (reinterpret_cast(str_pointer)) -#define F(string_literal) (FPSTR(PSTR(string_literal))) +#define F(string_literal) (FPSTR(PSTR(string_literal))) // An inherited class for holding the result of a concatenation. These // result objects are assumed to be writable by subsequent concatenations. @@ -47,8 +46,7 @@ class String { // complications of an operator bool(). for more information, see: // http://www.artima.com/cppsource/safebool.html typedef void (String::*StringIfHelperType)() const; - void StringIfHelper() const { - } + void StringIfHelper() const {} public: // constructors @@ -59,12 +57,10 @@ public: String(const char *cstr = ""); String(const char *cstr, unsigned int length); #ifdef __GXX_EXPERIMENTAL_CXX0X__ - String(const uint8_t *cstr, unsigned int length) - : String(reinterpret_cast(cstr), length) {} + String(const uint8_t *cstr, unsigned int length) : String(reinterpret_cast(cstr), length) {} #endif String(const String &str); - String(const __FlashStringHelper *str) - : String(reinterpret_cast(str)) {} + String(const __FlashStringHelper *str) : String(reinterpret_cast(str)) {} #ifdef __GXX_EXPERIMENTAL_CXX0X__ String(String &&rval); String(StringSumHelper &&rval); @@ -322,16 +318,22 @@ protected: uint32_t len; }; // This allows strings up up to 11 (10 + \0 termination) without any extra space. - enum { SSOSIZE = sizeof(struct _ptr) + 4 - 1 }; // Characters to allocate space for SSO, must be 12 or more + enum { + SSOSIZE = sizeof(struct _ptr) + 4 - 1 + }; // Characters to allocate space for SSO, must be 12 or more struct _sso { char buff[SSOSIZE]; - unsigned char len : 7; // Ensure only one byte is allocated by GCC for the bitfields + unsigned char len : 7; // Ensure only one byte is allocated by GCC for the bitfields unsigned char isSSO : 1; } __attribute__((packed)); // Ensure that GCC doesn't expand the flag byte to a 32-bit word for alignment issues #ifdef BOARD_HAS_PSRAM - enum { CAPACITY_MAX = 3145728 }; + enum { + CAPACITY_MAX = 3145728 + }; #else - enum { CAPACITY_MAX = 65535 }; + enum { + CAPACITY_MAX = 65535 + }; #endif union { struct _ptr ptr; @@ -362,10 +364,14 @@ protected: } } inline void setCapacity(int cap) { - if (!isSSO()) ptr.cap = cap; + if (!isSSO()) { + ptr.cap = cap; + } } inline void setBuffer(char *buff) { - if (!isSSO()) ptr.buff = buff; + if (!isSSO()) { + ptr.buff = buff; + } } // Buffer accessor functions inline const char *buffer() const { @@ -392,42 +398,18 @@ protected: class StringSumHelper : public String { public: - StringSumHelper(const String &s) - : String(s) { - } - StringSumHelper(const char *p) - : String(p) { - } - StringSumHelper(char c) - : String(c) { - } - StringSumHelper(unsigned char num) - : String(num) { - } - StringSumHelper(int num) - : String(num) { - } - StringSumHelper(unsigned int num) - : String(num) { - } - StringSumHelper(long num) - : String(num) { - } - StringSumHelper(unsigned long num) - : String(num) { - } - StringSumHelper(float num) - : String(num) { - } - StringSumHelper(double num) - : String(num) { - } - StringSumHelper(long long num) - : String(num) { - } - StringSumHelper(unsigned long long num) - : String(num) { - } + StringSumHelper(const String &s) : String(s) {} + StringSumHelper(const char *p) : String(p) {} + StringSumHelper(char c) : String(c) {} + StringSumHelper(unsigned char num) : String(num) {} + StringSumHelper(int num) : String(num) {} + StringSumHelper(unsigned int num) : String(num) {} + StringSumHelper(long num) : String(num) {} + StringSumHelper(unsigned long num) : String(num) {} + StringSumHelper(float num) : String(num) {} + StringSumHelper(double num) : String(num) {} + StringSumHelper(long long num) : String(num) {} + StringSumHelper(unsigned long long num) : String(num) {} }; inline StringSumHelper &operator+(const StringSumHelper &lhs, const __FlashStringHelper *rhs) { diff --git a/cores/esp32/base64.h b/cores/esp32/base64.h index 2bdd3cc8d..63a0e2153 100644 --- a/cores/esp32/base64.h +++ b/cores/esp32/base64.h @@ -3,10 +3,10 @@ class base64 { public: - static String encode(const uint8_t* data, size_t length); - static String encode(const String& text); + static String encode(const uint8_t *data, size_t length); + static String encode(const String &text); + private: }; - #endif /* CORE_BASE64_H_ */ diff --git a/cores/esp32/cbuf.cpp b/cores/esp32/cbuf.cpp index 26b26d081..2f942d5bf 100644 --- a/cores/esp32/cbuf.cpp +++ b/cores/esp32/cbuf.cpp @@ -27,28 +27,30 @@ #define CBUF_MUTEX_UNLOCK() #define CBUF_MUTEX_DELETE() #else -#define CBUF_MUTEX_CREATE() \ - if (_lock == NULL) { \ - _lock = xSemaphoreCreateMutex(); \ - if (_lock == NULL) { log_e("failed to create mutex"); } \ +#define CBUF_MUTEX_CREATE() \ + if (_lock == NULL) { \ + _lock = xSemaphoreCreateMutex(); \ + if (_lock == NULL) { \ + log_e("failed to create mutex"); \ + } \ } -#define CBUF_MUTEX_LOCK() \ - if (_lock != NULL) { xSemaphoreTakeRecursive(_lock, portMAX_DELAY); } -#define CBUF_MUTEX_UNLOCK() \ - if (_lock != NULL) { xSemaphoreGiveRecursive(_lock); } -#define CBUF_MUTEX_DELETE() \ - if (_lock != NULL) { \ +#define CBUF_MUTEX_LOCK() \ + if (_lock != NULL) { \ + xSemaphoreTakeRecursive(_lock, portMAX_DELAY); \ + } +#define CBUF_MUTEX_UNLOCK() \ + if (_lock != NULL) { \ + xSemaphoreGiveRecursive(_lock); \ + } +#define CBUF_MUTEX_DELETE() \ + if (_lock != NULL) { \ SemaphoreHandle_t l = _lock; \ - _lock = NULL; \ - vSemaphoreDelete(l); \ + _lock = NULL; \ + vSemaphoreDelete(l); \ } #endif -cbuf::cbuf(size_t size) - : next(NULL), - has_peek(false), - peek_byte(0), - _buf(xRingbufferCreate(size, RINGBUF_TYPE_BYTEBUF)) { +cbuf::cbuf(size_t size) : next(NULL), has_peek(false), peek_byte(0), _buf(xRingbufferCreate(size, RINGBUF_TYPE_BYTEBUF)) { if (_buf == NULL) { log_e("failed to allocate ring buffer"); } @@ -136,7 +138,9 @@ size_t cbuf::available() const { if (_buf != NULL) { vRingbufferGetInfo(_buf, NULL, NULL, NULL, NULL, (UBaseType_t *)&available); } - if (has_peek) available++; + if (has_peek) { + available++; + } return available; } diff --git a/cores/esp32/cbuf.h b/cores/esp32/cbuf.h index a14af35c6..3d2a173a8 100644 --- a/cores/esp32/cbuf.h +++ b/cores/esp32/cbuf.h @@ -45,15 +45,15 @@ public: int peek(); int read(); - size_t read(char* dst, size_t size); + size_t read(char *dst, size_t size); size_t write(char c); - size_t write(const char* src, size_t size); + size_t write(const char *src, size_t size); void flush(); size_t remove(size_t size); - cbuf* next; + cbuf *next; bool has_peek; uint8_t peek_byte; diff --git a/cores/esp32/chip-debug-report.cpp b/cores/esp32/chip-debug-report.cpp index 0db1b94f6..8a3b8f581 100644 --- a/cores/esp32/chip-debug-report.cpp +++ b/cores/esp32/chip-debug-report.cpp @@ -20,9 +20,9 @@ #define chip_report_printf log_printf #define printMemCapsInfo(caps) _printMemCapsInfo(MALLOC_CAP_##caps, #caps) -#define b2kb(b) ((float)b / 1024.0) -#define b2mb(b) ((float)b / (1024.0 * 1024.0)) -static void _printMemCapsInfo(uint32_t caps, const char* caps_str) { +#define b2kb(b) ((float)b / 1024.0) +#define b2mb(b) ((float)b / (1024.0 * 1024.0)) +static void _printMemCapsInfo(uint32_t caps, const char *caps_str) { multi_heap_info_t info; size_t total = heap_caps_get_total_size(caps); heap_caps_get_info(&info, caps); @@ -41,18 +41,18 @@ static void printPkgVersion(void) { uint32_t pkg_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_PACKAGE); switch (pkg_ver) { case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDR2V3: chip_report_printf("D0WD-R2-V3"); break; - case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ6: chip_report_printf("D0WD-Q6"); break; - case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ5: chip_report_printf("D0WD-Q5"); break; - case EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5: chip_report_printf("D2WD-Q5"); break; - case EFUSE_RD_CHIP_VER_PKG_ESP32U4WDH: chip_report_printf("U4WD-H"); break; - case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4: chip_report_printf("PICO-D4"); break; + case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ6: chip_report_printf("D0WD-Q6"); break; + case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ5: chip_report_printf("D0WD-Q5"); break; + case EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5: chip_report_printf("D2WD-Q5"); break; + case EFUSE_RD_CHIP_VER_PKG_ESP32U4WDH: chip_report_printf("U4WD-H"); break; + case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4: chip_report_printf("PICO-D4"); break; case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302: chip_report_printf("PICO-V3-02"); break; } #elif CONFIG_IDF_TARGET_ESP32S2 uint32_t pkg_ver = REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_PKG_VERSION); switch (pkg_ver) { - case 1: chip_report_printf("FH16"); break; - case 2: chip_report_printf("FH32"); break; + case 1: chip_report_printf("FH16"); break; + case 2: chip_report_printf("FH32"); break; default: chip_report_printf("%lu", pkg_ver); break; } #elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 @@ -77,14 +77,14 @@ static void printChipInfo(void) { chip_report_printf("------------------------------------------\n"); chip_report_printf(" Model : "); switch (info.model) { - case CHIP_ESP32: chip_report_printf("ESP32\n"); break; + case CHIP_ESP32: chip_report_printf("ESP32\n"); break; case CHIP_ESP32S2: chip_report_printf("ESP32-S2\n"); break; case CHIP_ESP32S3: chip_report_printf("ESP32-S3\n"); break; case CHIP_ESP32C2: chip_report_printf("ESP32-C2\n"); break; case CHIP_ESP32C3: chip_report_printf("ESP32-C3\n"); break; case CHIP_ESP32C6: chip_report_printf("ESP32-C6\n"); break; case CHIP_ESP32H2: chip_report_printf("ESP32-H2\n"); break; - default: chip_report_printf("Unknown %d\n", info.model); break; + default: chip_report_printf("Unknown %d\n", info.model); break; } printPkgVersion(); chip_report_printf(" Revision : "); @@ -114,7 +114,7 @@ static void printFlashInfo(void) { // REG_SPI_BASE is not defined for S3/C3 ?? #if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 #ifndef REG_SPI_BASE -#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i)*0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000))) +#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i) > 1) ? (((i) * 0x1000) + 0x20000) : (((~(i)) & 1) * 0x1000))) #endif // REG_SPI_BASE #endif // TARGET @@ -126,7 +126,7 @@ static void printFlashInfo(void) { chip_report_printf(" Sector Size : %8lu B (%6.1f KB)\n", g_rom_flashchip.sector_size, b2kb(g_rom_flashchip.sector_size)); chip_report_printf(" Page Size : %8lu B (%6.1f KB)\n", g_rom_flashchip.page_size, b2kb(g_rom_flashchip.page_size)); esp_image_header_t fhdr; - esp_flash_read(esp_flash_default_chip, (void*)&fhdr, ESP_FLASH_IMAGE_BASE, sizeof(esp_image_header_t)); + esp_flash_read(esp_flash_default_chip, (void *)&fhdr, ESP_FLASH_IMAGE_BASE, sizeof(esp_image_header_t)); if (fhdr.magic == ESP_IMAGE_HEADER_MAGIC) { uint32_t f_freq = 0; switch (fhdr.spi_speed) { @@ -165,7 +165,7 @@ static void printPartitionsInfo(void) { if (iterator != NULL) { esp_partition_iterator_t it = iterator; while (it != NULL) { - const esp_partition_t* partition = esp_partition_get(it); + const esp_partition_t *partition = esp_partition_get(it); if (partition) { chip_report_printf(" %17s : addr: 0x%08X, size: %7.1f KB", partition->label, partition->address, b2kb(partition->size)); if (partition->type == ESP_PARTITION_TYPE_APP) { @@ -183,18 +183,18 @@ static void printPartitionsInfo(void) { chip_report_printf(", type: DATA"); chip_report_printf(", subtype: "); switch (partition->subtype) { - case ESP_PARTITION_SUBTYPE_DATA_OTA: chip_report_printf("OTA"); break; - case ESP_PARTITION_SUBTYPE_DATA_PHY: chip_report_printf("PHY"); break; - case ESP_PARTITION_SUBTYPE_DATA_NVS: chip_report_printf("NVS"); break; - case ESP_PARTITION_SUBTYPE_DATA_COREDUMP: chip_report_printf("COREDUMP"); break; - case ESP_PARTITION_SUBTYPE_DATA_NVS_KEYS: chip_report_printf("NVS_KEYS"); break; - case ESP_PARTITION_SUBTYPE_DATA_EFUSE_EM: chip_report_printf("EFUSE_EM"); break; + case ESP_PARTITION_SUBTYPE_DATA_OTA: chip_report_printf("OTA"); break; + case ESP_PARTITION_SUBTYPE_DATA_PHY: chip_report_printf("PHY"); break; + case ESP_PARTITION_SUBTYPE_DATA_NVS: chip_report_printf("NVS"); break; + case ESP_PARTITION_SUBTYPE_DATA_COREDUMP: chip_report_printf("COREDUMP"); break; + case ESP_PARTITION_SUBTYPE_DATA_NVS_KEYS: chip_report_printf("NVS_KEYS"); break; + case ESP_PARTITION_SUBTYPE_DATA_EFUSE_EM: chip_report_printf("EFUSE_EM"); break; case ESP_PARTITION_SUBTYPE_DATA_UNDEFINED: chip_report_printf("UNDEFINED"); break; - case ESP_PARTITION_SUBTYPE_DATA_ESPHTTPD: chip_report_printf("ESPHTTPD"); break; - case ESP_PARTITION_SUBTYPE_DATA_FAT: chip_report_printf("FAT"); break; - case ESP_PARTITION_SUBTYPE_DATA_SPIFFS: chip_report_printf("SPIFFS"); break; - case ESP_PARTITION_SUBTYPE_DATA_LITTLEFS: chip_report_printf("LITTLEFS"); break; - default: chip_report_printf("0x%02X", partition->subtype); break; + case ESP_PARTITION_SUBTYPE_DATA_ESPHTTPD: chip_report_printf("ESPHTTPD"); break; + case ESP_PARTITION_SUBTYPE_DATA_FAT: chip_report_printf("FAT"); break; + case ESP_PARTITION_SUBTYPE_DATA_SPIFFS: chip_report_printf("SPIFFS"); break; + case ESP_PARTITION_SUBTYPE_DATA_LITTLEFS: chip_report_printf("LITTLEFS"); break; + default: chip_report_printf("0x%02X", partition->subtype); break; } } chip_report_printf("\n"); @@ -267,7 +267,7 @@ static void printPerimanInfo(void) { #else chip_report_printf(" %4u : ", i); #endif - const char* extra_type = perimanGetPinBusExtraType(i); + const char *extra_type = perimanGetPinBusExtraType(i); if (extra_type) { chip_report_printf("%s", extra_type); } else { @@ -290,7 +290,9 @@ void printBeforeSetupInfo(void) { Serial.begin(0); Serial.setDebugOutput(true); uint8_t t = 0; - while (!Serial && (t++ < 200)) delay(10); //wait up to 2 seconds for the IDE to connect + while (!Serial && (t++ < 200)) { + delay(10); //wait up to 2 seconds for the IDE to connect + } #endif chip_report_printf("=========== Before Setup Start ===========\n"); printChipInfo(); diff --git a/cores/esp32/esp32-hal-adc.c b/cores/esp32/esp32-hal-adc.c index fa5422e7b..5cb90126f 100644 --- a/cores/esp32/esp32-hal-adc.c +++ b/cores/esp32/esp32-hal-adc.c @@ -347,13 +347,13 @@ extern void analogSetWidth(uint8_t bits) __attribute__((weak, alias("__analogSet */ #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 -#define ADC_OUTPUT_TYPE ADC_DIGI_OUTPUT_FORMAT_TYPE1 +#define ADC_OUTPUT_TYPE ADC_DIGI_OUTPUT_FORMAT_TYPE1 #define ADC_GET_CHANNEL(p_data) ((p_data)->type1.channel) -#define ADC_GET_DATA(p_data) ((p_data)->type1.data) +#define ADC_GET_DATA(p_data) ((p_data)->type1.data) #else -#define ADC_OUTPUT_TYPE ADC_DIGI_OUTPUT_FORMAT_TYPE2 +#define ADC_OUTPUT_TYPE ADC_DIGI_OUTPUT_FORMAT_TYPE2 #define ADC_GET_CHANNEL(p_data) ((p_data)->type2.channel) -#define ADC_GET_DATA(p_data) ((p_data)->type2.data) +#define ADC_GET_DATA(p_data) ((p_data)->type2.data) #endif static uint8_t __adcContinuousAtten = ADC_11db; @@ -436,7 +436,7 @@ esp_err_t __analogContinuousInit(adc_channel_t *channel, uint8_t channel_num, ad .conv_mode = ADC_CONV_SINGLE_UNIT_1, .format = ADC_OUTPUT_TYPE, }; - adc_digi_pattern_config_t adc_pattern[SOC_ADC_PATT_LEN_MAX] = { 0 }; + adc_digi_pattern_config_t adc_pattern[SOC_ADC_PATT_LEN_MAX] = {0}; dig_cfg.pattern_num = channel_num; for (int i = 0; i < channel_num; i++) { adc_pattern[i].atten = __adcContinuousAtten; @@ -456,7 +456,6 @@ esp_err_t __analogContinuousInit(adc_channel_t *channel, uint8_t channel_num, ad return ESP_OK; } - bool analogContinuous(uint8_t pins[], size_t pins_count, uint32_t conversions_per_pin, uint32_t sampling_freq_hz, void (*userFunc)(void)) { adc_channel_t channel[pins_count]; adc_unit_t adc_unit; diff --git a/cores/esp32/esp32-hal-adc.h b/cores/esp32/esp32-hal-adc.h index fab27765d..636057b4f 100644 --- a/cores/esp32/esp32-hal-adc.h +++ b/cores/esp32/esp32-hal-adc.h @@ -28,104 +28,103 @@ extern "C" { #include "esp32-hal.h" - typedef enum { - ADC_0db, - ADC_2_5db, - ADC_6db, - ADC_11db, - ADC_ATTENDB_MAX - } adc_attenuation_t; +typedef enum { + ADC_0db, + ADC_2_5db, + ADC_6db, + ADC_11db, + ADC_ATTENDB_MAX +} adc_attenuation_t; - /* +/* * Get ADC value for pin * */ - uint16_t analogRead(uint8_t pin); +uint16_t analogRead(uint8_t pin); - /* +/* * Get MilliVolts value for pin * */ - uint32_t analogReadMilliVolts(uint8_t pin); +uint32_t analogReadMilliVolts(uint8_t pin); - /* +/* * Set the resolution of analogRead return values. Default is 12 bits (range from 0 to 4096). * If between 9 and 12, it will equal the set hardware resolution, else value will be shifted. * Range is 1 - 16 * * Note: compatibility with Arduino SAM */ - void analogReadResolution(uint8_t bits); +void analogReadResolution(uint8_t bits); - /* +/* * Set the attenuation for all channels * Default is 11db * */ - void analogSetAttenuation(adc_attenuation_t attenuation); +void analogSetAttenuation(adc_attenuation_t attenuation); - /* +/* * Set the attenuation for particular pin * Default is 11db * */ - void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation); +void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation); #if CONFIG_IDF_TARGET_ESP32 - /* +/* * Sets the sample bits and read resolution * Default is 12bit (0 - 4095) * Range is 9 - 12 * */ - void analogSetWidth(uint8_t bits); +void analogSetWidth(uint8_t bits); #endif - /* +/* * Analog Continuous mode * */ - typedef struct { - uint8_t pin; /*!cb(r->arg, ev_type, old_apb, new_apb); r = r->next; } - else { // run backwards through chain - while (r->next != NULL) r = r->next; // find first added + } else { // run backwards through chain + while (r->next != NULL) { + r = r->next; // find first added + } while (r != NULL) { r->cb(r->arg, ev_type, old_apb, new_apb); r = r->prev; @@ -96,9 +97,9 @@ static void triggerApbChangeCallback(apb_change_ev_t ev_type, uint32_t old_apb, xSemaphoreGive(apb_change_lock); } -bool addApbChangeCallback(void* arg, apb_change_cb_t cb) { +bool addApbChangeCallback(void *arg, apb_change_cb_t cb) { initApbChangeCallback(); - apb_change_t* c = (apb_change_t*)malloc(sizeof(apb_change_t)); + apb_change_t *c = (apb_change_t *)malloc(sizeof(apb_change_t)); if (!c) { log_e("Callback Object Malloc Failed"); return false; @@ -111,9 +112,11 @@ bool addApbChangeCallback(void* arg, apb_change_cb_t cb) { if (apb_change_callbacks == NULL) { apb_change_callbacks = c; } else { - apb_change_t* r = apb_change_callbacks; + apb_change_t *r = apb_change_callbacks; // look for duplicate callbacks - while ((r != NULL) && !((r->cb == cb) && (r->arg == arg))) r = r->next; + while ((r != NULL) && !((r->cb == cb) && (r->arg == arg))) { + r = r->next; + } if (r) { log_e("duplicate func=%8p arg=%8p", c->cb, c->arg); free(c); @@ -129,30 +132,35 @@ bool addApbChangeCallback(void* arg, apb_change_cb_t cb) { return true; } -bool removeApbChangeCallback(void* arg, apb_change_cb_t cb) { +bool removeApbChangeCallback(void *arg, apb_change_cb_t cb) { initApbChangeCallback(); xSemaphoreTake(apb_change_lock, portMAX_DELAY); - apb_change_t* r = apb_change_callbacks; + apb_change_t *r = apb_change_callbacks; // look for matching callback - while ((r != NULL) && !((r->cb == cb) && (r->arg == arg))) r = r->next; + while ((r != NULL) && !((r->cb == cb) && (r->arg == arg))) { + r = r->next; + } if (r == NULL) { log_e("not found func=%8p arg=%8p", cb, arg); xSemaphoreGive(apb_change_lock); return false; } else { // patch links - if (r->prev) r->prev->next = r->next; - else { // this is first link + if (r->prev) { + r->prev->next = r->next; + } else { // this is first link apb_change_callbacks = r->next; } - if (r->next) r->next->prev = r->prev; + if (r->next) { + r->next->prev = r->prev; + } free(r); } xSemaphoreGive(apb_change_lock); return true; } -static uint32_t calculateApb(rtc_cpu_freq_config_t* conf) { +static uint32_t calculateApb(rtc_cpu_freq_config_t *conf) { #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 return APB_CLK_FREQ; #else @@ -253,9 +261,17 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) { triggerApbChangeCallback(APB_AFTER_CHANGE, capb, apb); } #ifdef SOC_CLK_APLL_SUPPORTED - log_d("%s: %u / %u = %u Mhz, APB: %u Hz", (conf.source == RTC_CPU_FREQ_SRC_PLL) ? "PLL" : ((conf.source == RTC_CPU_FREQ_SRC_APLL) ? "APLL" : ((conf.source == RTC_CPU_FREQ_SRC_XTAL) ? "XTAL" : "8M")), conf.source_freq_mhz, conf.div, conf.freq_mhz, apb); + log_d( + "%s: %u / %u = %u Mhz, APB: %u Hz", + (conf.source == RTC_CPU_FREQ_SRC_PLL) ? "PLL" + : ((conf.source == RTC_CPU_FREQ_SRC_APLL) ? "APLL" : ((conf.source == RTC_CPU_FREQ_SRC_XTAL) ? "XTAL" : "8M")), + conf.source_freq_mhz, conf.div, conf.freq_mhz, apb + ); #else - log_d("%s: %u / %u = %u Mhz, APB: %u Hz", (conf.source == RTC_CPU_FREQ_SRC_PLL) ? "PLL" : ((conf.source == RTC_CPU_FREQ_SRC_XTAL) ? "XTAL" : "17.5M"), conf.source_freq_mhz, conf.div, conf.freq_mhz, apb); + log_d( + "%s: %u / %u = %u Mhz, APB: %u Hz", (conf.source == RTC_CPU_FREQ_SRC_PLL) ? "PLL" : ((conf.source == RTC_CPU_FREQ_SRC_XTAL) ? "XTAL" : "17.5M"), + conf.source_freq_mhz, conf.div, conf.freq_mhz, apb + ); #endif return true; } diff --git a/cores/esp32/esp32-hal-cpu.h b/cores/esp32/esp32-hal-cpu.h index ffb5524e4..59806b460 100644 --- a/cores/esp32/esp32-hal-cpu.h +++ b/cores/esp32/esp32-hal-cpu.h @@ -23,24 +23,26 @@ extern "C" { #include #include - typedef enum { APB_BEFORE_CHANGE, - APB_AFTER_CHANGE } apb_change_ev_t; +typedef enum { + APB_BEFORE_CHANGE, + APB_AFTER_CHANGE +} apb_change_ev_t; - typedef void (*apb_change_cb_t)(void* arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb); +typedef void (*apb_change_cb_t)(void *arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb); - bool addApbChangeCallback(void* arg, apb_change_cb_t cb); - bool removeApbChangeCallback(void* arg, apb_change_cb_t cb); +bool addApbChangeCallback(void *arg, apb_change_cb_t cb); +bool removeApbChangeCallback(void *arg, apb_change_cb_t cb); - //function takes the following frequencies as valid values: - // 240, 160, 80 <<< For all XTAL types - // 40, 20, 10 <<< For 40MHz XTAL - // 26, 13 <<< For 26MHz XTAL - // 24, 12 <<< For 24MHz XTAL - bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz); +//function takes the following frequencies as valid values: +// 240, 160, 80 <<< For all XTAL types +// 40, 20, 10 <<< For 40MHz XTAL +// 26, 13 <<< For 26MHz XTAL +// 24, 12 <<< For 24MHz XTAL +bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz); - uint32_t getCpuFrequencyMhz(); // In MHz - uint32_t getXtalFrequencyMhz(); // In MHz - uint32_t getApbFrequency(); // In Hz +uint32_t getCpuFrequencyMhz(); // In MHz +uint32_t getXtalFrequencyMhz(); // In MHz +uint32_t getApbFrequency(); // In Hz #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-dac.c b/cores/esp32/esp32-hal-dac.c index b6dadd98a..267f9cd46 100644 --- a/cores/esp32/esp32-hal-dac.c +++ b/cores/esp32/esp32-hal-dac.c @@ -35,9 +35,7 @@ bool __dacWrite(uint8_t pin, uint8_t value) { return false; } dac_channel_t channel = (pin == DAC_CHAN0_GPIO_NUM) ? DAC_CHAN_0 : DAC_CHAN_1; - dac_oneshot_config_t config = { - .chan_id = channel - }; + dac_oneshot_config_t config = {.chan_id = channel}; err = dac_oneshot_new_channel(&config, &bus); if (err != ESP_OK) { log_e("dac_oneshot_new_channel failed with error: %d", err); diff --git a/cores/esp32/esp32-hal-dac.h b/cores/esp32/esp32-hal-dac.h index 1c6b5063a..113354ba8 100644 --- a/cores/esp32/esp32-hal-dac.h +++ b/cores/esp32/esp32-hal-dac.h @@ -16,8 +16,8 @@ extern "C" { #include #include - bool dacWrite(uint8_t pin, uint8_t value); - bool dacDisable(uint8_t pin); +bool dacWrite(uint8_t pin, uint8_t value); +bool dacDisable(uint8_t pin); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-gpio.c b/cores/esp32/esp32-hal-gpio.c index 91cb47c67..b433adcc7 100644 --- a/cores/esp32/esp32-hal-gpio.c +++ b/cores/esp32/esp32-hal-gpio.c @@ -75,10 +75,10 @@ int8_t analogChannelToDigitalPin(uint8_t channel) { #endif typedef void (*voidFuncPtr)(void); -typedef void (*voidFuncPtrArg)(void*); +typedef void (*voidFuncPtrArg)(void *); typedef struct { voidFuncPtr fn; - void* arg; + void *arg; bool functional; } InterruptHandle_t; static InterruptHandle_t __pinInterruptHandlers[SOC_GPIO_PIN_COUNT] = { @@ -87,7 +87,7 @@ static InterruptHandle_t __pinInterruptHandlers[SOC_GPIO_PIN_COUNT] = { #include "driver/rtc_io.h" -static bool gpioDetachBus(void* bus) { +static bool gpioDetachBus(void *bus) { return true; } @@ -139,7 +139,7 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode) { return; } if (perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL) { - if (!perimanSetPinBus(pin, ESP32_BUS_TYPE_GPIO, (void*)(pin + 1), -1, -1)) { + if (!perimanSetPinBus(pin, ESP32_BUS_TYPE_GPIO, (void *)(pin + 1), -1, -1)) { //gpioDetachBus((void *)(pin+1)); return; } @@ -182,8 +182,8 @@ extern int ARDUINO_ISR_ATTR __digitalRead(uint8_t pin) { } } -static void ARDUINO_ISR_ATTR __onPinInterrupt(void* arg) { - InterruptHandle_t* isr = (InterruptHandle_t*)arg; +static void ARDUINO_ISR_ATTR __onPinInterrupt(void *arg) { + InterruptHandle_t *isr = (InterruptHandle_t *)arg; if (isr->fn) { if (isr->arg) { ((voidFuncPtrArg)isr->fn)(isr->arg); @@ -193,13 +193,15 @@ static void ARDUINO_ISR_ATTR __onPinInterrupt(void* arg) { } } -extern void cleanupFunctional(void* arg); +extern void cleanupFunctional(void *arg); -extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, void* arg, int intr_type, bool functional) { +extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, void *arg, int intr_type, bool functional) { static bool interrupt_initialized = false; // makes sure that pin -1 (255) will never work -- this follows Arduino standard - if (pin >= SOC_GPIO_PIN_COUNT) return; + if (pin >= SOC_GPIO_PIN_COUNT) { + return; + } if (!interrupt_initialized) { esp_err_t err = gpio_install_isr_service((int)ARDUINO_ISR_FLAG); @@ -224,7 +226,6 @@ extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, } gpio_isr_handler_add((gpio_num_t)pin, __onPinInterrupt, &__pinInterruptHandlers[pin]); - //FIX interrupts on peripherals outputs (eg. LEDC,...) //Enable input in GPIO register gpio_hal_context_t gpiohal; @@ -232,7 +233,7 @@ extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, gpio_hal_input_enable(&gpiohal, pin); } -extern void __attachInterruptArg(uint8_t pin, voidFuncPtrArg userFunc, void* arg, int intr_type) { +extern void __attachInterruptArg(uint8_t pin, voidFuncPtrArg userFunc, void *arg, int intr_type) { __attachInterruptFunctionalArg(pin, userFunc, arg, intr_type, false); } @@ -262,10 +263,9 @@ extern void disableInterrupt(uint8_t pin) { gpio_intr_disable((gpio_num_t)pin); } - extern void pinMode(uint8_t pin, uint8_t mode) __attribute__((weak, alias("__pinMode"))); extern void digitalWrite(uint8_t pin, uint8_t val) __attribute__((weak, alias("__digitalWrite"))); extern int digitalRead(uint8_t pin) __attribute__((weak, alias("__digitalRead"))); extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__((weak, alias("__attachInterrupt"))); -extern void attachInterruptArg(uint8_t pin, voidFuncPtrArg handler, void* arg, int mode) __attribute__((weak, alias("__attachInterruptArg"))); +extern void attachInterruptArg(uint8_t pin, voidFuncPtrArg handler, void *arg, int mode) __attribute__((weak, alias("__attachInterruptArg"))); extern void detachInterrupt(uint8_t pin) __attribute__((weak, alias("__detachInterrupt"))); diff --git a/cores/esp32/esp32-hal-gpio.h b/cores/esp32/esp32-hal-gpio.h index 7c0905de5..f92209cc2 100644 --- a/cores/esp32/esp32-hal-gpio.h +++ b/cores/esp32/esp32-hal-gpio.h @@ -30,61 +30,59 @@ extern "C" { #if (CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3) #define NUM_OUPUT_PINS 46 -#define PIN_DAC1 17 -#define PIN_DAC2 18 +#define PIN_DAC1 17 +#define PIN_DAC2 18 #else #define NUM_OUPUT_PINS 34 -#define PIN_DAC1 25 -#define PIN_DAC2 26 +#define PIN_DAC1 25 +#define PIN_DAC2 26 #endif -#define LOW 0x0 +#define LOW 0x0 #define HIGH 0x1 //GPIO FUNCTIONS #define INPUT 0x01 // Changed OUTPUT from 0x02 to behave the same as Arduino pinMode(pin,OUTPUT) // where you can read the state of pin even when it is set as OUTPUT -#define OUTPUT 0x03 -#define PULLUP 0x04 -#define INPUT_PULLUP 0x05 -#define PULLDOWN 0x08 -#define INPUT_PULLDOWN 0x09 -#define OPEN_DRAIN 0x10 +#define OUTPUT 0x03 +#define PULLUP 0x04 +#define INPUT_PULLUP 0x05 +#define PULLDOWN 0x08 +#define INPUT_PULLDOWN 0x09 +#define OPEN_DRAIN 0x10 #define OUTPUT_OPEN_DRAIN 0x13 -#define ANALOG 0xC0 +#define ANALOG 0xC0 //Interrupt Modes -#define DISABLED 0x00 -#define RISING 0x01 -#define FALLING 0x02 -#define CHANGE 0x03 -#define ONLOW 0x04 -#define ONHIGH 0x05 -#define ONLOW_WE 0x0C +#define DISABLED 0x00 +#define RISING 0x01 +#define FALLING 0x02 +#define CHANGE 0x03 +#define ONLOW 0x04 +#define ONHIGH 0x05 +#define ONLOW_WE 0x0C #define ONHIGH_WE 0x0D - -#define digitalPinIsValid(pin) GPIO_IS_VALID_GPIO(pin) +#define digitalPinIsValid(pin) GPIO_IS_VALID_GPIO(pin) #define digitalPinCanOutput(pin) GPIO_IS_VALID_OUTPUT_GPIO(pin) -#define digitalPinToRtcPin(pin) ((RTC_GPIO_IS_VALID_GPIO(pin)) ? rtc_io_number_get(pin) : -1) -#define digitalPinToDacChannel(pin) (((pin) == DAC_CHANNEL_1_GPIO_NUM) ? 0 : ((pin) == DAC_CHANNEL_2_GPIO_NUM) ? 1 \ - : -1) +#define digitalPinToRtcPin(pin) ((RTC_GPIO_IS_VALID_GPIO(pin)) ? rtc_io_number_get(pin) : -1) +#define digitalPinToDacChannel(pin) (((pin) == DAC_CHANNEL_1_GPIO_NUM) ? 0 : ((pin) == DAC_CHANNEL_2_GPIO_NUM) ? 1 : -1) - void pinMode(uint8_t pin, uint8_t mode); - void digitalWrite(uint8_t pin, uint8_t val); - int digitalRead(uint8_t pin); +void pinMode(uint8_t pin, uint8_t mode); +void digitalWrite(uint8_t pin, uint8_t val); +int digitalRead(uint8_t pin); - void attachInterrupt(uint8_t pin, void (*)(void), int mode); - void attachInterruptArg(uint8_t pin, void (*)(void*), void* arg, int mode); - void detachInterrupt(uint8_t pin); - void enableInterrupt(uint8_t pin); - void disableInterrupt(uint8_t pin); +void attachInterrupt(uint8_t pin, void (*)(void), int mode); +void attachInterruptArg(uint8_t pin, void (*)(void *), void *arg, int mode); +void detachInterrupt(uint8_t pin); +void enableInterrupt(uint8_t pin); +void disableInterrupt(uint8_t pin); - int8_t digitalPinToTouchChannel(uint8_t pin); - int8_t digitalPinToAnalogChannel(uint8_t pin); - int8_t analogChannelToDigitalPin(uint8_t channel); +int8_t digitalPinToTouchChannel(uint8_t pin); +int8_t digitalPinToAnalogChannel(uint8_t pin); +int8_t analogChannelToDigitalPin(uint8_t channel); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-i2c-slave.c b/cores/esp32/esp32-hal-i2c-slave.c index 3a2f4e56f..edae1e57c 100644 --- a/cores/esp32/esp32-hal-i2c-slave.c +++ b/cores/esp32/esp32-hal-i2c-slave.c @@ -93,24 +93,24 @@ typedef struct i2c_slave_struct_t { typedef union { struct { uint32_t event : 2; - uint32_t stop : 1; + uint32_t stop : 1; uint32_t param : 29; }; uint32_t val; } i2c_slave_queue_event_t; static i2c_slave_struct_t _i2c_bus_array[SOC_I2C_NUM] = { - { &I2C0, 0, -1, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + {&I2C0, 0, -1, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 #if !CONFIG_DISABLE_HAL_LOCKS - , - NULL + , + NULL #endif }, #if SOC_I2C_NUM > 1 - { &I2C1, 1, -1, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + {&I2C1, 1, -1, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 #if !CONFIG_DISABLE_HAL_LOCKS - , - NULL + , + NULL #endif } #endif @@ -120,10 +120,14 @@ static i2c_slave_struct_t _i2c_bus_array[SOC_I2C_NUM] = { #define I2C_SLAVE_MUTEX_LOCK() #define I2C_SLAVE_MUTEX_UNLOCK() #else -#define I2C_SLAVE_MUTEX_LOCK() \ - if (i2c->lock) { xSemaphoreTake(i2c->lock, portMAX_DELAY); } +#define I2C_SLAVE_MUTEX_LOCK() \ + if (i2c->lock) { \ + xSemaphoreTake(i2c->lock, portMAX_DELAY); \ + } #define I2C_SLAVE_MUTEX_UNLOCK() \ - if (i2c->lock) { xSemaphoreGive(i2c->lock); } + if (i2c->lock) { \ + xSemaphoreGive(i2c->lock); \ + } #endif //-------------------------------------- HAL_LL (Missing Functions) ------------------------------------------------ @@ -356,7 +360,8 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t i2c_ll_slave_enable_rx_it(i2c->dev); i2c_ll_set_stretch(i2c->dev, 0x3FF); i2c_ll_update(i2c->dev); - if (!perimanSetPinBus(sda, ESP32_BUS_TYPE_I2C_SLAVE_SDA, (void *)(i2c->num + 1), i2c->num, -1) || !perimanSetPinBus(scl, ESP32_BUS_TYPE_I2C_SLAVE_SCL, (void *)(i2c->num + 1), i2c->num, -1)) { + if (!perimanSetPinBus(sda, ESP32_BUS_TYPE_I2C_SLAVE_SDA, (void *)(i2c->num + 1), i2c->num, -1) + || !perimanSetPinBus(scl, ESP32_BUS_TYPE_I2C_SLAVE_SCL, (void *)(i2c->num + 1), i2c->num, -1)) { i2cSlaveDetachBus((void *)(i2c->num + 1)); ret = ESP_FAIL; } @@ -528,21 +533,15 @@ static void i2c_slave_delay_us(uint64_t us) { if (us) { uint64_t e = (m + us); if (m > e) { //overflow - while ((uint64_t)esp_timer_get_time() > e) - ; + while ((uint64_t)esp_timer_get_time() > e); } - while ((uint64_t)esp_timer_get_time() < e) - ; + while ((uint64_t)esp_timer_get_time() < e); } } static void i2c_slave_gpio_mode(int8_t pin, gpio_mode_t mode) { gpio_config_t conf = { - .pin_bit_mask = 1LL << pin, - .mode = mode, - .pull_up_en = GPIO_PULLUP_ENABLE, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .intr_type = GPIO_INTR_DISABLE + .pin_bit_mask = 1LL << pin, .mode = mode, .pull_up_en = GPIO_PULLUP_ENABLE, .pull_down_en = GPIO_PULLDOWN_DISABLE, .intr_type = GPIO_INTR_DISABLE }; gpio_config(&conf); } @@ -735,8 +734,7 @@ static void i2c_slave_isr_handler(void *arg) { //reset TX data i2c_ll_txfifo_rst(i2c->dev); uint8_t d; - while (xQueueReceiveFromISR(i2c->tx_queue, &d, (BaseType_t *const)&pxHigherPriorityTaskWoken) == pdTRUE) - ; //flush partial write + while (xQueueReceiveFromISR(i2c->tx_queue, &d, (BaseType_t *const)&pxHigherPriorityTaskWoken) == pdTRUE); //flush partial write #endif } } @@ -794,10 +792,7 @@ static size_t i2c_slave_read_rx(i2c_slave_struct_t *i2c, uint8_t *data, size_t l } return (data) ? len : 0; #else - size_t dlen = 0, - to_read = len, - so_far = 0, - available = 0; + size_t dlen = 0, to_read = len, so_far = 0, available = 0; uint8_t *rx_data = NULL; vRingbufferGetInfo(i2c->rx_ring_buf, NULL, NULL, NULL, NULL, &available); diff --git a/cores/esp32/esp32-hal-i2c-slave.h b/cores/esp32/esp32-hal-i2c-slave.h index 41e157ac9..787656599 100644 --- a/cores/esp32/esp32-hal-i2c-slave.h +++ b/cores/esp32/esp32-hal-i2c-slave.h @@ -25,13 +25,13 @@ extern "C" { #include "stddef.h" #include "esp_err.h" - typedef void (*i2c_slave_request_cb_t)(uint8_t num, void *arg); - typedef void (*i2c_slave_receive_cb_t)(uint8_t num, uint8_t *data, size_t len, bool stop, void *arg); - esp_err_t i2cSlaveAttachCallbacks(uint8_t num, i2c_slave_request_cb_t request_callback, i2c_slave_receive_cb_t receive_callback, void *arg); +typedef void (*i2c_slave_request_cb_t)(uint8_t num, void *arg); +typedef void (*i2c_slave_receive_cb_t)(uint8_t num, uint8_t *data, size_t len, bool stop, void *arg); +esp_err_t i2cSlaveAttachCallbacks(uint8_t num, i2c_slave_request_cb_t request_callback, i2c_slave_receive_cb_t receive_callback, void *arg); - esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t frequency, size_t rx_len, size_t tx_len); - esp_err_t i2cSlaveDeinit(uint8_t num); - size_t i2cSlaveWrite(uint8_t num, const uint8_t *buf, uint32_t len, uint32_t timeout_ms); +esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t frequency, size_t rx_len, size_t tx_len); +esp_err_t i2cSlaveDeinit(uint8_t num); +size_t i2cSlaveWrite(uint8_t num, const uint8_t *buf, uint32_t len, uint32_t timeout_ms); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-i2c.c b/cores/esp32/esp32-hal-i2c.c index 326402425..1ecef5bfb 100644 --- a/cores/esp32/esp32-hal-i2c.c +++ b/cores/esp32/esp32-hal-i2c.c @@ -131,7 +131,8 @@ esp_err_t i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t frequency) { bus[i2c_num].sda = sda; //Clock Stretching Timeout: 20b:esp32, 5b:esp32-c3, 24b:esp32-s2 i2c_set_timeout((i2c_port_t)i2c_num, I2C_LL_MAX_TIMEOUT); - if (!perimanSetPinBus(sda, ESP32_BUS_TYPE_I2C_MASTER_SDA, (void *)(i2c_num + 1), i2c_num, -1) || !perimanSetPinBus(scl, ESP32_BUS_TYPE_I2C_MASTER_SCL, (void *)(i2c_num + 1), i2c_num, -1)) { + if (!perimanSetPinBus(sda, ESP32_BUS_TYPE_I2C_MASTER_SDA, (void *)(i2c_num + 1), i2c_num, -1) + || !perimanSetPinBus(scl, ESP32_BUS_TYPE_I2C_MASTER_SCL, (void *)(i2c_num + 1), i2c_num, -1)) { i2cDetachBus((void *)(i2c_num + 1)); return false; } @@ -197,7 +198,7 @@ esp_err_t i2cWrite(uint8_t i2c_num, uint16_t address, const uint8_t *buff, size_ //ret = i2c_master_write_to_device((i2c_port_t)i2c_num, address, buff, size, timeOutMillis / portTICK_PERIOD_MS); ret = ESP_OK; - uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = { 0 }; + uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = {0}; cmd = i2c_cmd_link_create_static(cmd_buff, I2C_LINK_RECOMMENDED_SIZE(1)); ret = i2c_master_start(cmd); if (ret != ESP_OK) { @@ -259,7 +260,9 @@ esp_err_t i2cRead(uint8_t i2c_num, uint16_t address, uint8_t *buff, size_t size, return ret; } -esp_err_t i2cWriteReadNonStop(uint8_t i2c_num, uint16_t address, const uint8_t *wbuff, size_t wsize, uint8_t *rbuff, size_t rsize, uint32_t timeOutMillis, size_t *readCount) { +esp_err_t i2cWriteReadNonStop( + uint8_t i2c_num, uint16_t address, const uint8_t *wbuff, size_t wsize, uint8_t *rbuff, size_t rsize, uint32_t timeOutMillis, size_t *readCount +) { esp_err_t ret = ESP_FAIL; if (i2c_num >= SOC_I2C_NUM) { return ESP_ERR_INVALID_ARG; @@ -338,18 +341,18 @@ esp_err_t i2cSetClock(uint8_t i2c_num, uint32_t frequency) { // i2c clock characteristic, The order is the same as i2c_sclk_t. i2c_clk_alloc_t i2c_clk_alloc[I2C_SCLK_MAX] = { - { 0, 0 }, + {0, 0}, #if SOC_I2C_SUPPORT_APB - { SOC_MOD_CLK_APB, esp_clk_apb_freq() }, /*!< I2C APB clock characteristic*/ + {SOC_MOD_CLK_APB, esp_clk_apb_freq()}, /*!< I2C APB clock characteristic*/ #endif #if SOC_I2C_SUPPORT_XTAL - { SOC_MOD_CLK_XTAL, esp_clk_xtal_freq() }, /*!< I2C XTAL characteristic*/ + {SOC_MOD_CLK_XTAL, esp_clk_xtal_freq()}, /*!< I2C XTAL characteristic*/ #endif #if SOC_I2C_SUPPORT_RTC - { SOC_MOD_CLK_RC_FAST, periph_rtc_dig_clk8m_get_freq() }, /*!< I2C 20M RTC characteristic*/ + {SOC_MOD_CLK_RC_FAST, periph_rtc_dig_clk8m_get_freq()}, /*!< I2C 20M RTC characteristic*/ #endif #if SOC_I2C_SUPPORT_REF_TICK - { SOC_MOD_CLK_REF_TICK, REF_CLK_FREQ }, /*!< I2C REF_TICK characteristic*/ + {SOC_MOD_CLK_REF_TICK, REF_CLK_FREQ}, /*!< I2C REF_TICK characteristic*/ #endif }; diff --git a/cores/esp32/esp32-hal-i2c.h b/cores/esp32/esp32-hal-i2c.h index 51f24a79e..35783d350 100644 --- a/cores/esp32/esp32-hal-i2c.h +++ b/cores/esp32/esp32-hal-i2c.h @@ -28,14 +28,16 @@ extern "C" { #include #include - esp_err_t i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t clk_speed); - esp_err_t i2cDeinit(uint8_t i2c_num); - esp_err_t i2cSetClock(uint8_t i2c_num, uint32_t frequency); - esp_err_t i2cGetClock(uint8_t i2c_num, uint32_t* frequency); - esp_err_t i2cWrite(uint8_t i2c_num, uint16_t address, const uint8_t* buff, size_t size, uint32_t timeOutMillis); - esp_err_t i2cRead(uint8_t i2c_num, uint16_t address, uint8_t* buff, size_t size, uint32_t timeOutMillis, size_t* readCount); - esp_err_t i2cWriteReadNonStop(uint8_t i2c_num, uint16_t address, const uint8_t* wbuff, size_t wsize, uint8_t* rbuff, size_t rsize, uint32_t timeOutMillis, size_t* readCount); - bool i2cIsInit(uint8_t i2c_num); +esp_err_t i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t clk_speed); +esp_err_t i2cDeinit(uint8_t i2c_num); +esp_err_t i2cSetClock(uint8_t i2c_num, uint32_t frequency); +esp_err_t i2cGetClock(uint8_t i2c_num, uint32_t *frequency); +esp_err_t i2cWrite(uint8_t i2c_num, uint16_t address, const uint8_t *buff, size_t size, uint32_t timeOutMillis); +esp_err_t i2cRead(uint8_t i2c_num, uint16_t address, uint8_t *buff, size_t size, uint32_t timeOutMillis, size_t *readCount); +esp_err_t i2cWriteReadNonStop( + uint8_t i2c_num, uint16_t address, const uint8_t *wbuff, size_t wsize, uint8_t *rbuff, size_t rsize, uint32_t timeOutMillis, size_t *readCount +); +bool i2cIsInit(uint8_t i2c_num); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-ledc.c b/cores/esp32/esp32-hal-ledc.c index 121fc6ee3..de164c9a4 100644 --- a/cores/esp32/esp32-hal-ledc.c +++ b/cores/esp32/esp32-hal-ledc.c @@ -42,7 +42,7 @@ typedef struct { int used_channels : LEDC_CHANNELS; // Used channels as a bits } ledc_periph_t; -ledc_periph_t ledc_handle = { 0 }; +ledc_periph_t ledc_handle = {0}; static bool fade_initialized = false; @@ -86,13 +86,7 @@ bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t c uint8_t group = (channel / 8), timer = ((channel / 2) % 4); - ledc_timer_config_t ledc_timer = { - .speed_mode = group, - .timer_num = timer, - .duty_resolution = resolution, - .freq_hz = freq, - .clk_cfg = LEDC_DEFAULT_CLK - }; + ledc_timer_config_t ledc_timer = {.speed_mode = group, .timer_num = timer, .duty_resolution = resolution, .freq_hz = freq, .clk_cfg = LEDC_DEFAULT_CLK}; if (ledc_timer_config(&ledc_timer) != ESP_OK) { log_e("ledc setup failed!"); return false; @@ -101,13 +95,7 @@ bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t c uint32_t duty = ledc_get_duty(group, channel); ledc_channel_config_t ledc_channel = { - .speed_mode = group, - .channel = (channel % 8), - .timer_sel = timer, - .intr_type = LEDC_INTR_DISABLE, - .gpio_num = pin, - .duty = duty, - .hpoint = 0 + .speed_mode = group, .channel = (channel % 8), .timer_sel = timer, .intr_type = LEDC_INTR_DISABLE, .gpio_num = pin, .duty = duty, .hpoint = 0 }; ledc_channel_config(&ledc_channel); @@ -184,7 +172,6 @@ uint32_t ledcReadFreq(uint8_t pin) { return 0; } - uint32_t ledcWriteTone(uint8_t pin, uint32_t freq) { ledc_channel_handle_t *bus = (ledc_channel_handle_t *)perimanGetPinBus(pin, ESP32_BUS_TYPE_LEDC); if (bus != NULL) { @@ -196,13 +183,7 @@ uint32_t ledcWriteTone(uint8_t pin, uint32_t freq) { uint8_t group = (bus->channel / 8), timer = ((bus->channel / 2) % 4); - ledc_timer_config_t ledc_timer = { - .speed_mode = group, - .timer_num = timer, - .duty_resolution = 10, - .freq_hz = freq, - .clk_cfg = LEDC_DEFAULT_CLK - }; + ledc_timer_config_t ledc_timer = {.speed_mode = group, .timer_num = timer, .duty_resolution = 10, .freq_hz = freq, .clk_cfg = LEDC_DEFAULT_CLK}; if (ledc_timer_config(&ledc_timer) != ESP_OK) { log_e("ledcWriteTone configuration failed!"); @@ -218,9 +199,8 @@ uint32_t ledcWriteTone(uint8_t pin, uint32_t freq) { } uint32_t ledcWriteNote(uint8_t pin, note_t note, uint8_t octave) { - const uint16_t noteFrequencyBase[12] = { - // C C# D Eb E F F# G G# A Bb B - 4186, 4435, 4699, 4978, 5274, 5588, 5920, 6272, 6645, 7040, 7459, 7902 + const uint16_t noteFrequencyBase[12] = {// C C# D Eb E F F# G G# A Bb B + 4186, 4435, 4699, 4978, 5274, 5588, 5920, 6272, 6645, 7040, 7459, 7902 }; if (octave > 8 || note >= NOTE_MAX) { @@ -254,13 +234,7 @@ uint32_t ledcChangeFrequency(uint8_t pin, uint32_t freq, uint8_t resolution) { } uint8_t group = (bus->channel / 8), timer = ((bus->channel / 2) % 4); - ledc_timer_config_t ledc_timer = { - .speed_mode = group, - .timer_num = timer, - .duty_resolution = resolution, - .freq_hz = freq, - .clk_cfg = LEDC_DEFAULT_CLK - }; + ledc_timer_config_t ledc_timer = {.speed_mode = group, .timer_num = timer, .duty_resolution = resolution, .freq_hz = freq, .clk_cfg = LEDC_DEFAULT_CLK}; if (ledc_timer_config(&ledc_timer) != ESP_OK) { log_e("ledcChangeFrequency failed!"); @@ -336,9 +310,7 @@ static bool ledcFadeConfig(uint8_t pin, uint32_t start_duty, uint32_t target_dut bus->fn = (voidFuncPtr)userFunc; bus->arg = arg; - ledc_cbs_t callbacks = { - .fade_cb = ledcFnWrapper - }; + ledc_cbs_t callbacks = {.fade_cb = ledcFnWrapper}; ledc_cb_register(group, channel, &callbacks, (void *)bus); //Fixing if all bits in resolution is set = LEDC FULL ON @@ -359,8 +331,7 @@ static bool ledcFadeConfig(uint8_t pin, uint32_t start_duty, uint32_t target_dut return false; } // Wait for LEDCs next PWM cycle to update duty (~ 1-2 ms) - while (ledc_get_duty(group, channel) != start_duty) - ; + while (ledc_get_duty(group, channel) != start_duty); if (ledc_set_fade_time_and_start(group, channel, target_duty, max_fade_time_ms, LEDC_FADE_NO_WAIT) != ESP_OK) { log_e("ledc_set_fade_time_and_start failed"); diff --git a/cores/esp32/esp32-hal-ledc.h b/cores/esp32/esp32-hal-ledc.h index 432764f86..2cff8dc0a 100644 --- a/cores/esp32/esp32-hal-ledc.h +++ b/cores/esp32/esp32-hal-ledc.h @@ -27,37 +27,37 @@ extern "C" { #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" - typedef enum { - NOTE_C, - NOTE_Cs, - NOTE_D, - NOTE_Eb, - NOTE_E, - NOTE_F, - NOTE_Fs, - NOTE_G, - NOTE_Gs, - NOTE_A, - NOTE_Bb, - NOTE_B, - NOTE_MAX - } note_t; +typedef enum { + NOTE_C, + NOTE_Cs, + NOTE_D, + NOTE_Eb, + NOTE_E, + NOTE_F, + NOTE_Fs, + NOTE_G, + NOTE_Gs, + NOTE_A, + NOTE_Bb, + NOTE_B, + NOTE_MAX +} note_t; - typedef void (*voidFuncPtr)(void); - typedef void (*voidFuncPtrArg)(void*); +typedef void (*voidFuncPtr)(void); +typedef void (*voidFuncPtrArg)(void *); - typedef struct { - uint8_t pin; // Pin assigned to channel - uint8_t channel; // Channel number - uint8_t channel_resolution; // Resolution of channel - voidFuncPtr fn; - void* arg; +typedef struct { + uint8_t pin; // Pin assigned to channel + uint8_t channel; // Channel number + uint8_t channel_resolution; // Resolution of channel + voidFuncPtr fn; + void *arg; #ifndef SOC_LEDC_SUPPORT_FADE_STOP - SemaphoreHandle_t lock; //xSemaphoreCreateBinary + SemaphoreHandle_t lock; //xSemaphoreCreateBinary #endif - } ledc_channel_handle_t; +} ledc_channel_handle_t; - /** +/** * @brief Attach a pin to the LEDC driver, with a given frequency and resolution. * Channel is automatically assigned. * @@ -67,9 +67,9 @@ extern "C" { * * @return true if configuration is successful and pin was successfully attached, false otherwise. */ - bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution); +bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution); - /** +/** * @brief Attach a pin to the LEDC driver, with a given frequency, resolution and channel. * * @param pin GPIO pin @@ -79,9 +79,9 @@ extern "C" { * * @return true if configuration is successful and pin was successfully attached, false otherwise. */ - bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t channel); +bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t channel); - /** +/** * @brief Set the duty cycle of a given pin. * * @param pin GPIO pin @@ -89,9 +89,9 @@ extern "C" { * * @return true if duty cycle was successfully set, false otherwise. */ - bool ledcWrite(uint8_t pin, uint32_t duty); +bool ledcWrite(uint8_t pin, uint32_t duty); - /** +/** * @brief Sets the duty to 50 % PWM tone on selected frequency. * * @param pin GPIO pin @@ -100,9 +100,9 @@ extern "C" { * @return frequency if tone was successfully set. * If ``0`` is returned, error occurs and LEDC pin was not configured. */ - uint32_t ledcWriteTone(uint8_t pin, uint32_t freq); +uint32_t ledcWriteTone(uint8_t pin, uint32_t freq); - /** +/** * @brief Sets the LEDC pin to specific note. * * @param pin GPIO pin @@ -112,36 +112,36 @@ extern "C" { * @return frequency if note was successfully set. * If ``0`` is returned, error occurs and LEDC pin was not configured. */ - uint32_t ledcWriteNote(uint8_t pin, note_t note, uint8_t octave); +uint32_t ledcWriteNote(uint8_t pin, note_t note, uint8_t octave); - /** +/** * @brief Read the duty cycle of a given LEDC pin. * * @param pin GPIO pin * * @return duty cycle of selected LEDC pin. */ - uint32_t ledcRead(uint8_t pin); +uint32_t ledcRead(uint8_t pin); - /** +/** * @brief Read the frequency of a given LEDC pin. * * @param pin GPIO pin * * @return frequency of selected LEDC pin. */ - uint32_t ledcReadFreq(uint8_t pin); +uint32_t ledcReadFreq(uint8_t pin); - /** +/** * @brief Detach a pin from the LEDC driver. * * @param pin GPIO pin * * @return true if pin was successfully detached, false otherwise. */ - bool ledcDetach(uint8_t pin); +bool ledcDetach(uint8_t pin); - /** +/** * @brief Change the frequency and resolution of a given LEDC pin. * * @param pin GPIO pin @@ -151,9 +151,9 @@ extern "C" { * @return frequency configured for the LEDC channel. * If ``0`` is returned, error occurs and LEDC pin was not configured. */ - uint32_t ledcChangeFrequency(uint8_t pin, uint32_t freq, uint8_t resolution); +uint32_t ledcChangeFrequency(uint8_t pin, uint32_t freq, uint8_t resolution); - /** +/** * @brief Sets inverting of the output signal for a given LEDC pin. * * @param pin GPIO pin @@ -161,10 +161,10 @@ extern "C" { * * @return true if output inverting was successfully set, false otherwise. */ - bool ledcOutputInvert(uint8_t pin, bool out_invert); +bool ledcOutputInvert(uint8_t pin, bool out_invert); - //Fade functions - /** +//Fade functions +/** * @brief Setup and start a fade on a given LEDC pin. * * @param pin GPIO pin @@ -174,9 +174,9 @@ extern "C" { * * @return true if fade was successfully set and started, false otherwise. */ - bool ledcFade(uint8_t pin, uint32_t start_duty, uint32_t target_duty, int max_fade_time_ms); +bool ledcFade(uint8_t pin, uint32_t start_duty, uint32_t target_duty, int max_fade_time_ms); - /** +/** * @brief Setup and start a fade on a given LEDC pin with a callback function. * * @param pin GPIO pin @@ -187,9 +187,9 @@ extern "C" { * * @return true if fade was successfully set and started, false otherwise. */ - bool ledcFadeWithInterrupt(uint8_t pin, uint32_t start_duty, uint32_t target_duty, int max_fade_time_ms, void (*userFunc)(void)); +bool ledcFadeWithInterrupt(uint8_t pin, uint32_t start_duty, uint32_t target_duty, int max_fade_time_ms, void (*userFunc)(void)); - /** +/** * @brief Setup and start a fade on a given LEDC pin with a callback function and argument. * * @param pin GPIO pin @@ -201,7 +201,7 @@ extern "C" { * * @return true if fade was successfully set and started, false otherwise. */ - bool ledcFadeWithInterruptArg(uint8_t pin, uint32_t start_duty, uint32_t target_duty, int max_fade_time_ms, void (*userFunc)(void*), void* arg); +bool ledcFadeWithInterruptArg(uint8_t pin, uint32_t start_duty, uint32_t target_duty, int max_fade_time_ms, void (*userFunc)(void *), void *arg); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-log.h b/cores/esp32/esp32-hal-log.h index b43a07473..fda406fac 100644 --- a/cores/esp32/esp32-hal-log.h +++ b/cores/esp32/esp32-hal-log.h @@ -21,11 +21,11 @@ extern "C" { #include "sdkconfig.h" #include "esp_timer.h" -#define ARDUHAL_LOG_LEVEL_NONE (0) -#define ARDUHAL_LOG_LEVEL_ERROR (1) -#define ARDUHAL_LOG_LEVEL_WARN (2) -#define ARDUHAL_LOG_LEVEL_INFO (3) -#define ARDUHAL_LOG_LEVEL_DEBUG (4) +#define ARDUHAL_LOG_LEVEL_NONE (0) +#define ARDUHAL_LOG_LEVEL_ERROR (1) +#define ARDUHAL_LOG_LEVEL_WARN (2) +#define ARDUHAL_LOG_LEVEL_INFO (3) +#define ARDUHAL_LOG_LEVEL_DEBUG (4) #define ARDUHAL_LOG_LEVEL_VERBOSE (5) #ifndef CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL @@ -48,27 +48,27 @@ extern "C" { #endif #if CONFIG_ARDUHAL_LOG_COLORS -#define ARDUHAL_LOG_COLOR_BLACK "30" -#define ARDUHAL_LOG_COLOR_RED "31" //ERROR -#define ARDUHAL_LOG_COLOR_GREEN "32" //INFO -#define ARDUHAL_LOG_COLOR_YELLOW "33" //WARNING -#define ARDUHAL_LOG_COLOR_BLUE "34" +#define ARDUHAL_LOG_COLOR_BLACK "30" +#define ARDUHAL_LOG_COLOR_RED "31" //ERROR +#define ARDUHAL_LOG_COLOR_GREEN "32" //INFO +#define ARDUHAL_LOG_COLOR_YELLOW "33" //WARNING +#define ARDUHAL_LOG_COLOR_BLUE "34" #define ARDUHAL_LOG_COLOR_MAGENTA "35" -#define ARDUHAL_LOG_COLOR_CYAN "36" //DEBUG -#define ARDUHAL_LOG_COLOR_GRAY "37" //VERBOSE -#define ARDUHAL_LOG_COLOR_WHITE "38" +#define ARDUHAL_LOG_COLOR_CYAN "36" //DEBUG +#define ARDUHAL_LOG_COLOR_GRAY "37" //VERBOSE +#define ARDUHAL_LOG_COLOR_WHITE "38" #define ARDUHAL_LOG_COLOR(COLOR) "\033[0;" COLOR "m" -#define ARDUHAL_LOG_BOLD(COLOR) "\033[1;" COLOR "m" -#define ARDUHAL_LOG_RESET_COLOR "\033[0m" +#define ARDUHAL_LOG_BOLD(COLOR) "\033[1;" COLOR "m" +#define ARDUHAL_LOG_RESET_COLOR "\033[0m" -#define ARDUHAL_LOG_COLOR_E ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_RED) -#define ARDUHAL_LOG_COLOR_W ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_YELLOW) -#define ARDUHAL_LOG_COLOR_I ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_GREEN) -#define ARDUHAL_LOG_COLOR_D ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_CYAN) -#define ARDUHAL_LOG_COLOR_V ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_GRAY) +#define ARDUHAL_LOG_COLOR_E ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_RED) +#define ARDUHAL_LOG_COLOR_W ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_YELLOW) +#define ARDUHAL_LOG_COLOR_I ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_GREEN) +#define ARDUHAL_LOG_COLOR_D ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_CYAN) +#define ARDUHAL_LOG_COLOR_V ARDUHAL_LOG_COLOR(ARDUHAL_LOG_COLOR_GRAY) #define ARDUHAL_LOG_COLOR_PRINT(letter) log_printf(ARDUHAL_LOG_COLOR_##letter) -#define ARDUHAL_LOG_COLOR_PRINT_END log_printf(ARDUHAL_LOG_RESET_COLOR) +#define ARDUHAL_LOG_COLOR_PRINT_END log_printf(ARDUHAL_LOG_RESET_COLOR) #else #define ARDUHAL_LOG_COLOR_E #define ARDUHAL_LOG_COLOR_W @@ -80,194 +80,230 @@ extern "C" { #define ARDUHAL_LOG_COLOR_PRINT_END #endif - - - const char *pathToFileName(const char *path); - int log_printf(const char *fmt, ...); - void log_print_buf(const uint8_t *b, size_t len); +const char *pathToFileName(const char *path); +int log_printf(const char *fmt, ...); +void log_print_buf(const uint8_t *b, size_t len); #define ARDUHAL_SHORT_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_##letter format ARDUHAL_LOG_RESET_COLOR "\r\n" -#define ARDUHAL_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_##letter "[%6u][" #letter "][%s:%u] %s(): " format ARDUHAL_LOG_RESET_COLOR "\r\n", (unsigned long)(esp_timer_get_time() / 1000ULL), pathToFileName(__FILE__), __LINE__, __FUNCTION__ +#define ARDUHAL_LOG_FORMAT(letter, format) \ + ARDUHAL_LOG_COLOR_##letter "[%6u][" #letter "][%s:%u] %s(): " format ARDUHAL_LOG_RESET_COLOR "\r\n", (unsigned long)(esp_timer_get_time() / 1000ULL), \ + pathToFileName(__FILE__), __LINE__, __FUNCTION__ - //esp_rom_printf(DRAM_STR("ST:%d\n"), frame_pos); +//esp_rom_printf(DRAM_STR("ST:%d\n"), frame_pos); #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE #ifndef USE_ESP_IDF_LOG -#define log_v(format, ...) log_printf(ARDUHAL_LOG_FORMAT(V, format), ##__VA_ARGS__) +#define log_v(format, ...) log_printf(ARDUHAL_LOG_FORMAT(V, format), ##__VA_ARGS__) #define isr_log_v(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(V, format), ##__VA_ARGS__) -#define log_buf_v(b, l) \ - do { \ - ARDUHAL_LOG_COLOR_PRINT(V); \ - log_print_buf(b, l); \ +#define log_buf_v(b, l) \ + do { \ + ARDUHAL_LOG_COLOR_PRINT(V); \ + log_print_buf(b, l); \ ARDUHAL_LOG_COLOR_PRINT_END; \ } while (0) #else -#define log_v(format, ...) \ - do { ESP_LOG_LEVEL_LOCAL(ESP_LOG_VERBOSE, TAG, format, ##__VA_ARGS__); } while (0) -#define isr_log_v(format, ...) \ - do { ets_printf(LOG_FORMAT(V, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); } while (0) -#define log_buf_v(b, l) \ - do { ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_VERBOSE); } while (0) +#define log_v(format, ...) \ + do { \ + ESP_LOG_LEVEL_LOCAL(ESP_LOG_VERBOSE, TAG, format, ##__VA_ARGS__); \ + } while (0) +#define isr_log_v(format, ...) \ + do { \ + ets_printf(LOG_FORMAT(V, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); \ + } while (0) +#define log_buf_v(b, l) \ + do { \ + ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_VERBOSE); \ + } while (0) #endif #else #define log_v(format, ...) \ - do { \ + do { \ } while (0) #define isr_log_v(format, ...) \ - do { \ + do { \ } while (0) #define log_buf_v(b, l) \ - do { \ + do { \ } while (0) #endif #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG #ifndef USE_ESP_IDF_LOG -#define log_d(format, ...) log_printf(ARDUHAL_LOG_FORMAT(D, format), ##__VA_ARGS__) +#define log_d(format, ...) log_printf(ARDUHAL_LOG_FORMAT(D, format), ##__VA_ARGS__) #define isr_log_d(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(D, format), ##__VA_ARGS__) -#define log_buf_d(b, l) \ - do { \ - ARDUHAL_LOG_COLOR_PRINT(D); \ - log_print_buf(b, l); \ +#define log_buf_d(b, l) \ + do { \ + ARDUHAL_LOG_COLOR_PRINT(D); \ + log_print_buf(b, l); \ ARDUHAL_LOG_COLOR_PRINT_END; \ } while (0) #else -#define log_d(format, ...) \ - do { ESP_LOG_LEVEL_LOCAL(ESP_LOG_DEBUG, TAG, format, ##__VA_ARGS__); } while (0) -#define isr_log_d(format, ...) \ - do { ets_printf(LOG_FORMAT(D, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); } while (0) -#define log_buf_d(b, l) \ - do { ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_DEBUG); } while (0) +#define log_d(format, ...) \ + do { \ + ESP_LOG_LEVEL_LOCAL(ESP_LOG_DEBUG, TAG, format, ##__VA_ARGS__); \ + } while (0) +#define isr_log_d(format, ...) \ + do { \ + ets_printf(LOG_FORMAT(D, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); \ + } while (0) +#define log_buf_d(b, l) \ + do { \ + ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_DEBUG); \ + } while (0) #endif #else #define log_d(format, ...) \ - do { \ + do { \ } while (0) #define isr_log_d(format, ...) \ - do { \ + do { \ } while (0) #define log_buf_d(b, l) \ - do { \ + do { \ } while (0) #endif #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO #ifndef USE_ESP_IDF_LOG -#define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__) +#define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__) #define isr_log_i(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__) -#define log_buf_i(b, l) \ - do { \ - ARDUHAL_LOG_COLOR_PRINT(I); \ - log_print_buf(b, l); \ +#define log_buf_i(b, l) \ + do { \ + ARDUHAL_LOG_COLOR_PRINT(I); \ + log_print_buf(b, l); \ ARDUHAL_LOG_COLOR_PRINT_END; \ } while (0) #else -#define log_i(format, ...) \ - do { ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, TAG, format, ##__VA_ARGS__); } while (0) -#define isr_log_i(format, ...) \ - do { ets_printf(LOG_FORMAT(I, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); } while (0) -#define log_buf_i(b, l) \ - do { ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_INFO); } while (0) +#define log_i(format, ...) \ + do { \ + ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, TAG, format, ##__VA_ARGS__); \ + } while (0) +#define isr_log_i(format, ...) \ + do { \ + ets_printf(LOG_FORMAT(I, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); \ + } while (0) +#define log_buf_i(b, l) \ + do { \ + ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_INFO); \ + } while (0) #endif #else #define log_i(format, ...) \ - do { \ + do { \ } while (0) #define isr_log_i(format, ...) \ - do { \ + do { \ } while (0) #define log_buf_i(b, l) \ - do { \ + do { \ } while (0) #endif #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_WARN #ifndef USE_ESP_IDF_LOG -#define log_w(format, ...) log_printf(ARDUHAL_LOG_FORMAT(W, format), ##__VA_ARGS__) +#define log_w(format, ...) log_printf(ARDUHAL_LOG_FORMAT(W, format), ##__VA_ARGS__) #define isr_log_w(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(W, format), ##__VA_ARGS__) -#define log_buf_w(b, l) \ - do { \ - ARDUHAL_LOG_COLOR_PRINT(W); \ - log_print_buf(b, l); \ +#define log_buf_w(b, l) \ + do { \ + ARDUHAL_LOG_COLOR_PRINT(W); \ + log_print_buf(b, l); \ ARDUHAL_LOG_COLOR_PRINT_END; \ } while (0) #else -#define log_w(format, ...) \ - do { ESP_LOG_LEVEL_LOCAL(ESP_LOG_WARN, TAG, format, ##__VA_ARGS__); } while (0) -#define isr_log_w(format, ...) \ - do { ets_printf(LOG_FORMAT(W, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); } while (0) -#define log_buf_w(b, l) \ - do { ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_WARN); } while (0) +#define log_w(format, ...) \ + do { \ + ESP_LOG_LEVEL_LOCAL(ESP_LOG_WARN, TAG, format, ##__VA_ARGS__); \ + } while (0) +#define isr_log_w(format, ...) \ + do { \ + ets_printf(LOG_FORMAT(W, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); \ + } while (0) +#define log_buf_w(b, l) \ + do { \ + ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_WARN); \ + } while (0) #endif #else #define log_w(format, ...) \ - do { \ + do { \ } while (0) #define isr_log_w(format, ...) \ - do { \ + do { \ } while (0) #define log_buf_w(b, l) \ - do { \ + do { \ } while (0) #endif #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR #ifndef USE_ESP_IDF_LOG -#define log_e(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) +#define log_e(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) #define isr_log_e(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) -#define log_buf_e(b, l) \ - do { \ - ARDUHAL_LOG_COLOR_PRINT(E); \ - log_print_buf(b, l); \ +#define log_buf_e(b, l) \ + do { \ + ARDUHAL_LOG_COLOR_PRINT(E); \ + log_print_buf(b, l); \ ARDUHAL_LOG_COLOR_PRINT_END; \ } while (0) #else -#define log_e(format, ...) \ - do { ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, TAG, format, ##__VA_ARGS__); } while (0) -#define isr_log_e(format, ...) \ - do { ets_printf(LOG_FORMAT(E, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); } while (0) -#define log_buf_e(b, l) \ - do { ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_ERROR); } while (0) +#define log_e(format, ...) \ + do { \ + ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, TAG, format, ##__VA_ARGS__); \ + } while (0) +#define isr_log_e(format, ...) \ + do { \ + ets_printf(LOG_FORMAT(E, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); \ + } while (0) +#define log_buf_e(b, l) \ + do { \ + ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_ERROR); \ + } while (0) #endif #else #define log_e(format, ...) \ - do { \ + do { \ } while (0) #define isr_log_e(format, ...) \ - do { \ + do { \ } while (0) #define log_buf_e(b, l) \ - do { \ + do { \ } while (0) #endif #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_NONE #ifndef USE_ESP_IDF_LOG -#define log_n(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) +#define log_n(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) #define isr_log_n(format, ...) ets_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__) -#define log_buf_n(b, l) \ - do { \ - ARDUHAL_LOG_COLOR_PRINT(E); \ - log_print_buf(b, l); \ +#define log_buf_n(b, l) \ + do { \ + ARDUHAL_LOG_COLOR_PRINT(E); \ + log_print_buf(b, l); \ ARDUHAL_LOG_COLOR_PRINT_END; \ } while (0) #else -#define log_n(format, ...) \ - do { ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, TAG, format, ##__VA_ARGS__); } while (0) -#define isr_log_n(format, ...) \ - do { ets_printf(LOG_FORMAT(E, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); } while (0) -#define log_buf_n(b, l) \ - do { ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_ERROR); } while (0) +#define log_n(format, ...) \ + do { \ + ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, TAG, format, ##__VA_ARGS__); \ + } while (0) +#define isr_log_n(format, ...) \ + do { \ + ets_printf(LOG_FORMAT(E, format), esp_log_timestamp(), TAG, ##__VA_ARGS__); \ + } while (0) +#define log_buf_n(b, l) \ + do { \ + ESP_LOG_BUFFER_HEXDUMP(TAG, b, l, ESP_LOG_ERROR); \ + } while (0) #endif #else #define log_n(format, ...) \ - do { \ + do { \ } while (0) #define isr_log_n(format, ...) \ - do { \ + do { \ } while (0) #define log_buf_n(b, l) \ - do { \ + do { \ } while (0) #endif @@ -291,11 +327,11 @@ extern "C" { #undef ESP_EARLY_LOGD #undef ESP_EARLY_LOGV -#define ESP_LOGE(tag, format, ...) log_e("[%s] " format, tag, ##__VA_ARGS__) -#define ESP_LOGW(tag, format, ...) log_w("[%s] " format, tag, ##__VA_ARGS__) -#define ESP_LOGI(tag, format, ...) log_i("[%s] " format, tag, ##__VA_ARGS__) -#define ESP_LOGD(tag, format, ...) log_d("[%s] " format, tag, ##__VA_ARGS__) -#define ESP_LOGV(tag, format, ...) log_v("[%s] " format, tag, ##__VA_ARGS__) +#define ESP_LOGE(tag, format, ...) log_e("[%s] " format, tag, ##__VA_ARGS__) +#define ESP_LOGW(tag, format, ...) log_w("[%s] " format, tag, ##__VA_ARGS__) +#define ESP_LOGI(tag, format, ...) log_i("[%s] " format, tag, ##__VA_ARGS__) +#define ESP_LOGD(tag, format, ...) log_d("[%s] " format, tag, ##__VA_ARGS__) +#define ESP_LOGV(tag, format, ...) log_v("[%s] " format, tag, ##__VA_ARGS__) #define ESP_EARLY_LOGE(tag, format, ...) isr_log_e("[%s] " format, tag, ##__VA_ARGS__) #define ESP_EARLY_LOGW(tag, format, ...) isr_log_w("[%s] " format, tag, ##__VA_ARGS__) #define ESP_EARLY_LOGI(tag, format, ...) isr_log_i("[%s] " format, tag, ##__VA_ARGS__) diff --git a/cores/esp32/esp32-hal-matrix.c b/cores/esp32/esp32-hal-matrix.c index b47d70cdc..fba044d0c 100644 --- a/cores/esp32/esp32-hal-matrix.c +++ b/cores/esp32/esp32-hal-matrix.c @@ -38,10 +38,9 @@ #else // ESP32 Before IDF 4.0 #include "rom/gpio.h" #define GPIO_MATRIX_CONST_ZERO_INPUT GPIO_FUNC_IN_LOW -#define GPIO_MATRIX_CONST_ONE_INPUT GPIO_FUNC_IN_HIGH +#define GPIO_MATRIX_CONST_ONE_INPUT GPIO_FUNC_IN_HIGH #endif - void ARDUINO_ISR_ATTR pinMatrixOutAttach(uint8_t pin, uint8_t function, bool invertOut, bool invertEnable) { gpio_matrix_out(pin, function, invertOut, invertEnable); } diff --git a/cores/esp32/esp32-hal-matrix.h b/cores/esp32/esp32-hal-matrix.h index 32e99b782..f7c99ae77 100644 --- a/cores/esp32/esp32-hal-matrix.h +++ b/cores/esp32/esp32-hal-matrix.h @@ -15,7 +15,6 @@ #ifndef _ESP32_HAL_MATRIX_H_ #define _ESP32_HAL_MATRIX_H_ - #ifdef __cplusplus extern "C" { #endif @@ -23,10 +22,10 @@ extern "C" { #include "esp32-hal.h" #include "soc/gpio_sig_map.h" - void pinMatrixOutAttach(uint8_t pin, uint8_t function, bool invertOut, bool invertEnable); - void pinMatrixOutDetach(uint8_t pin, bool invertOut, bool invertEnable); - void pinMatrixInAttach(uint8_t pin, uint8_t signal, bool inverted); - void pinMatrixInDetach(uint8_t signal, bool high, bool inverted); +void pinMatrixOutAttach(uint8_t pin, uint8_t function, bool invertOut, bool invertEnable); +void pinMatrixOutDetach(uint8_t pin, bool invertOut, bool invertEnable); +void pinMatrixInAttach(uint8_t pin, uint8_t signal, bool inverted); +void pinMatrixInDetach(uint8_t signal, bool high, bool inverted); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-misc.c b/cores/esp32/esp32-hal-misc.c index 43c47bf15..cf8edcf27 100644 --- a/cores/esp32/esp32-hal-misc.c +++ b/cores/esp32/esp32-hal-misc.c @@ -176,13 +176,10 @@ void disableCore1WDT() { } #endif -BaseType_t xTaskCreateUniversal(TaskFunction_t pxTaskCode, - const char *const pcName, - const uint32_t usStackDepth, - void *const pvParameters, - UBaseType_t uxPriority, - TaskHandle_t *const pxCreatedTask, - const BaseType_t xCoreID) { +BaseType_t xTaskCreateUniversal( + TaskFunction_t pxTaskCode, const char *const pcName, const uint32_t usStackDepth, void *const pvParameters, UBaseType_t uxPriority, + TaskHandle_t *const pxCreatedTask, const BaseType_t xCoreID +) { #ifndef CONFIG_FREERTOS_UNICORE if (xCoreID >= 0 && xCoreID < 2) { return xTaskCreatePinnedToCore(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID); @@ -356,7 +353,7 @@ static void handle_custom_backtrace(panic_info_t *info) { #if CONFIG_IDF_TARGET_ARCH_XTENSA XtExcFrame *xt_frame = (XtExcFrame *)info->frame; - esp_backtrace_frame_t stk_frame = { .pc = xt_frame->pc, .sp = xt_frame->a1, .next_pc = xt_frame->a0, .exc_frame = xt_frame }; + esp_backtrace_frame_t stk_frame = {.pc = xt_frame->pc, .sp = xt_frame->a1, .next_pc = xt_frame->a0, .exc_frame = xt_frame}; uint32_t i = 100, pc_ptr = esp_cpu_process_stack_pc(stk_frame.pc); p_info.backtrace[p_info.backtrace_len++] = pc_ptr; diff --git a/cores/esp32/esp32-hal-periman.c b/cores/esp32/esp32-hal-periman.c index acd75dadc..6ef3c3d98 100644 --- a/cores/esp32/esp32-hal-periman.c +++ b/cores/esp32/esp32-hal-periman.c @@ -10,8 +10,8 @@ typedef struct ATTR_PACKED { peripheral_bus_type_t type; - const char* extra_type; - void* bus; + const char *extra_type; + void *bus; int8_t bus_num; int8_t bus_channel; } peripheral_pin_item_t; @@ -21,12 +21,12 @@ static peripheral_pin_item_t pins[SOC_GPIO_PIN_COUNT]; #define GPIO_NOT_VALID(p) ((p >= SOC_GPIO_PIN_COUNT) || ((SOC_GPIO_VALID_GPIO_MASK & (1ULL << p)) == 0)) -const char* perimanGetTypeName(peripheral_bus_type_t type) { +const char *perimanGetTypeName(peripheral_bus_type_t type) { switch (type) { - case ESP32_BUS_TYPE_INIT: return "INIT"; - case ESP32_BUS_TYPE_GPIO: return "GPIO"; - case ESP32_BUS_TYPE_UART_RX: return "UART_RX"; - case ESP32_BUS_TYPE_UART_TX: return "UART_TX"; + case ESP32_BUS_TYPE_INIT: return "INIT"; + case ESP32_BUS_TYPE_GPIO: return "GPIO"; + case ESP32_BUS_TYPE_UART_RX: return "UART_RX"; + case ESP32_BUS_TYPE_UART_TX: return "UART_TX"; case ESP32_BUS_TYPE_UART_CTS: return "UART_CTS"; case ESP32_BUS_TYPE_UART_RTS: return "UART_RTS"; #if SOC_SDM_SUPPORTED @@ -34,12 +34,12 @@ const char* perimanGetTypeName(peripheral_bus_type_t type) { #endif #if SOC_ADC_SUPPORTED case ESP32_BUS_TYPE_ADC_ONESHOT: return "ADC_ONESHOT"; - case ESP32_BUS_TYPE_ADC_CONT: return "ADC_CONT"; + case ESP32_BUS_TYPE_ADC_CONT: return "ADC_CONT"; #endif #if SOC_DAC_SUPPORTED case ESP32_BUS_TYPE_DAC_ONESHOT: return "DAC_ONESHOT"; - case ESP32_BUS_TYPE_DAC_CONT: return "DAC_CONT"; - case ESP32_BUS_TYPE_DAC_COSINE: return "DAC_COSINE"; + case ESP32_BUS_TYPE_DAC_CONT: return "DAC_CONT"; + case ESP32_BUS_TYPE_DAC_COSINE: return "DAC_COSINE"; #endif #if SOC_LEDC_SUPPORTED case ESP32_BUS_TYPE_LEDC: return "LEDC"; @@ -49,44 +49,44 @@ const char* perimanGetTypeName(peripheral_bus_type_t type) { case ESP32_BUS_TYPE_RMT_RX: return "RMT_RX"; #endif #if SOC_I2S_SUPPORTED - case ESP32_BUS_TYPE_I2S_STD_MCLK: return "I2S_STD_MCLK"; - case ESP32_BUS_TYPE_I2S_STD_BCLK: return "I2S_STD_BCLK"; - case ESP32_BUS_TYPE_I2S_STD_WS: return "I2S_STD_WS"; - case ESP32_BUS_TYPE_I2S_STD_DOUT: return "I2S_STD_DOUT"; - case ESP32_BUS_TYPE_I2S_STD_DIN: return "I2S_STD_DIN"; - case ESP32_BUS_TYPE_I2S_TDM_MCLK: return "I2S_TDM_MCLK"; - case ESP32_BUS_TYPE_I2S_TDM_BCLK: return "I2S_TDM_BCLK"; - case ESP32_BUS_TYPE_I2S_TDM_WS: return "I2S_TDM_WS"; - case ESP32_BUS_TYPE_I2S_TDM_DOUT: return "I2S_TDM_DOUT"; - case ESP32_BUS_TYPE_I2S_TDM_DIN: return "I2S_TDM_DIN"; - case ESP32_BUS_TYPE_I2S_PDM_TX_CLK: return "I2S_PDM_TX_CLK"; + case ESP32_BUS_TYPE_I2S_STD_MCLK: return "I2S_STD_MCLK"; + case ESP32_BUS_TYPE_I2S_STD_BCLK: return "I2S_STD_BCLK"; + case ESP32_BUS_TYPE_I2S_STD_WS: return "I2S_STD_WS"; + case ESP32_BUS_TYPE_I2S_STD_DOUT: return "I2S_STD_DOUT"; + case ESP32_BUS_TYPE_I2S_STD_DIN: return "I2S_STD_DIN"; + case ESP32_BUS_TYPE_I2S_TDM_MCLK: return "I2S_TDM_MCLK"; + case ESP32_BUS_TYPE_I2S_TDM_BCLK: return "I2S_TDM_BCLK"; + case ESP32_BUS_TYPE_I2S_TDM_WS: return "I2S_TDM_WS"; + case ESP32_BUS_TYPE_I2S_TDM_DOUT: return "I2S_TDM_DOUT"; + case ESP32_BUS_TYPE_I2S_TDM_DIN: return "I2S_TDM_DIN"; + case ESP32_BUS_TYPE_I2S_PDM_TX_CLK: return "I2S_PDM_TX_CLK"; case ESP32_BUS_TYPE_I2S_PDM_TX_DOUT0: return "I2S_PDM_TX_DOUT0"; case ESP32_BUS_TYPE_I2S_PDM_TX_DOUT1: return "I2S_PDM_TX_DOUT1"; - case ESP32_BUS_TYPE_I2S_PDM_RX_CLK: return "I2S_PDM_RX_CLK"; - case ESP32_BUS_TYPE_I2S_PDM_RX_DIN0: return "I2S_PDM_RX_DIN0"; - case ESP32_BUS_TYPE_I2S_PDM_RX_DIN1: return "I2S_PDM_RX_DIN1"; - case ESP32_BUS_TYPE_I2S_PDM_RX_DIN2: return "I2S_PDM_RX_DIN2"; - case ESP32_BUS_TYPE_I2S_PDM_RX_DIN3: return "I2S_PDM_RX_DIN3"; + case ESP32_BUS_TYPE_I2S_PDM_RX_CLK: return "I2S_PDM_RX_CLK"; + case ESP32_BUS_TYPE_I2S_PDM_RX_DIN0: return "I2S_PDM_RX_DIN0"; + case ESP32_BUS_TYPE_I2S_PDM_RX_DIN1: return "I2S_PDM_RX_DIN1"; + case ESP32_BUS_TYPE_I2S_PDM_RX_DIN2: return "I2S_PDM_RX_DIN2"; + case ESP32_BUS_TYPE_I2S_PDM_RX_DIN3: return "I2S_PDM_RX_DIN3"; #endif #if SOC_I2C_SUPPORTED case ESP32_BUS_TYPE_I2C_MASTER_SDA: return "I2C_MASTER_SDA"; case ESP32_BUS_TYPE_I2C_MASTER_SCL: return "I2C_MASTER_SCL"; - case ESP32_BUS_TYPE_I2C_SLAVE_SDA: return "I2C_SLAVE_SDA"; - case ESP32_BUS_TYPE_I2C_SLAVE_SCL: return "I2C_SLAVE_SCL"; + case ESP32_BUS_TYPE_I2C_SLAVE_SDA: return "I2C_SLAVE_SDA"; + case ESP32_BUS_TYPE_I2C_SLAVE_SCL: return "I2C_SLAVE_SCL"; #endif #if SOC_GPSPI_SUPPORTED - case ESP32_BUS_TYPE_SPI_MASTER_SCK: return "SPI_MASTER_SCK"; + case ESP32_BUS_TYPE_SPI_MASTER_SCK: return "SPI_MASTER_SCK"; case ESP32_BUS_TYPE_SPI_MASTER_MISO: return "SPI_MASTER_MISO"; case ESP32_BUS_TYPE_SPI_MASTER_MOSI: return "SPI_MASTER_MOSI"; - case ESP32_BUS_TYPE_SPI_MASTER_SS: return "SPI_MASTER_SS"; + case ESP32_BUS_TYPE_SPI_MASTER_SS: return "SPI_MASTER_SS"; #endif #if SOC_SDMMC_HOST_SUPPORTED case ESP32_BUS_TYPE_SDMMC_CLK: return "SDMMC_CLK"; case ESP32_BUS_TYPE_SDMMC_CMD: return "SDMMC_CMD"; - case ESP32_BUS_TYPE_SDMMC_D0: return "SDMMC_D0"; - case ESP32_BUS_TYPE_SDMMC_D1: return "SDMMC_D1"; - case ESP32_BUS_TYPE_SDMMC_D2: return "SDMMC_D2"; - case ESP32_BUS_TYPE_SDMMC_D3: return "SDMMC_D3"; + case ESP32_BUS_TYPE_SDMMC_D0: return "SDMMC_D0"; + case ESP32_BUS_TYPE_SDMMC_D1: return "SDMMC_D1"; + case ESP32_BUS_TYPE_SDMMC_D2: return "SDMMC_D2"; + case ESP32_BUS_TYPE_SDMMC_D3: return "SDMMC_D3"; #endif #if SOC_TOUCH_SENSOR_SUPPORTED case ESP32_BUS_TYPE_TOUCH: return "TOUCH"; @@ -100,14 +100,14 @@ const char* perimanGetTypeName(peripheral_bus_type_t type) { #endif #if CONFIG_ETH_USE_ESP32_EMAC case ESP32_BUS_TYPE_ETHERNET_RMII: return "ETHERNET_RMII"; - case ESP32_BUS_TYPE_ETHERNET_CLK: return "ETHERNET_CLK"; - case ESP32_BUS_TYPE_ETHERNET_MCD: return "ETHERNET_MCD"; + case ESP32_BUS_TYPE_ETHERNET_CLK: return "ETHERNET_CLK"; + case ESP32_BUS_TYPE_ETHERNET_MCD: return "ETHERNET_MCD"; case ESP32_BUS_TYPE_ETHERNET_MDIO: return "ETHERNET_MDIO"; - case ESP32_BUS_TYPE_ETHERNET_PWR: return "ETHERNET_PWR"; + case ESP32_BUS_TYPE_ETHERNET_PWR: return "ETHERNET_PWR"; #endif #if CONFIG_LWIP_PPP_SUPPORT - case ESP32_BUS_TYPE_PPP_TX: return "PPP_MODEM_TX"; - case ESP32_BUS_TYPE_PPP_RX: return "PPP_MODEM_RX"; + case ESP32_BUS_TYPE_PPP_TX: return "PPP_MODEM_TX"; + case ESP32_BUS_TYPE_PPP_RX: return "PPP_MODEM_RX"; case ESP32_BUS_TYPE_PPP_RTS: return "PPP_MODEM_RTS"; case ESP32_BUS_TYPE_PPP_CTS: return "PPP_MODEM_CTS"; #endif @@ -115,9 +115,9 @@ const char* perimanGetTypeName(peripheral_bus_type_t type) { } } -bool perimanSetPinBus(uint8_t pin, peripheral_bus_type_t type, void* bus, int8_t bus_num, int8_t bus_channel) { +bool perimanSetPinBus(uint8_t pin, peripheral_bus_type_t type, void *bus, int8_t bus_num, int8_t bus_channel) { peripheral_bus_type_t otype = ESP32_BUS_TYPE_INIT; - void* obus = NULL; + void *obus = NULL; if (GPIO_NOT_VALID(pin)) { log_e("Invalid pin: %u", pin); return false; @@ -161,7 +161,7 @@ bool perimanSetPinBus(uint8_t pin, peripheral_bus_type_t type, void* bus, int8_t return true; } -bool perimanSetPinBusExtraType(uint8_t pin, const char* extra_type) { +bool perimanSetPinBusExtraType(uint8_t pin, const char *extra_type) { if (GPIO_NOT_VALID(pin)) { log_e("Invalid pin: %u", pin); return false; @@ -175,7 +175,7 @@ bool perimanSetPinBusExtraType(uint8_t pin, const char* extra_type) { return true; } -void* perimanGetPinBus(uint8_t pin, peripheral_bus_type_t type) { +void *perimanGetPinBus(uint8_t pin, peripheral_bus_type_t type) { if (GPIO_NOT_VALID(pin)) { log_e("Invalid pin: %u", pin); return NULL; @@ -198,7 +198,7 @@ peripheral_bus_type_t perimanGetPinBusType(uint8_t pin) { return pins[pin].type; } -const char* perimanGetPinBusExtraType(uint8_t pin) { +const char *perimanGetPinBusExtraType(uint8_t pin) { if (GPIO_NOT_VALID(pin)) { log_e("Invalid pin: %u", pin); return NULL; diff --git a/cores/esp32/esp32-hal-periman.h b/cores/esp32/esp32-hal-periman.h index c2d16017a..217d62b87 100644 --- a/cores/esp32/esp32-hal-periman.h +++ b/cores/esp32/esp32-hal-periman.h @@ -17,131 +17,131 @@ extern "C" { #define perimanClearPinBus(p) perimanSetPinBus(p, ESP32_BUS_TYPE_INIT, NULL, -1, -1) - typedef enum { - ESP32_BUS_TYPE_INIT, // IO has not been attached to a bus yet - ESP32_BUS_TYPE_GPIO, // IO is used as GPIO - ESP32_BUS_TYPE_UART_RX, // IO is used as UART RX pin - ESP32_BUS_TYPE_UART_TX, // IO is used as UART TX pin - ESP32_BUS_TYPE_UART_CTS, // IO is used as UART CTS pin - ESP32_BUS_TYPE_UART_RTS, // IO is used as UART RTS pin +typedef enum { + ESP32_BUS_TYPE_INIT, // IO has not been attached to a bus yet + ESP32_BUS_TYPE_GPIO, // IO is used as GPIO + ESP32_BUS_TYPE_UART_RX, // IO is used as UART RX pin + ESP32_BUS_TYPE_UART_TX, // IO is used as UART TX pin + ESP32_BUS_TYPE_UART_CTS, // IO is used as UART CTS pin + ESP32_BUS_TYPE_UART_RTS, // IO is used as UART RTS pin #if SOC_SDM_SUPPORTED - ESP32_BUS_TYPE_SIGMADELTA, // IO is used as SigmeDelta output + ESP32_BUS_TYPE_SIGMADELTA, // IO is used as SigmeDelta output #endif #if SOC_ADC_SUPPORTED - ESP32_BUS_TYPE_ADC_ONESHOT, // IO is used as ADC OneShot input - ESP32_BUS_TYPE_ADC_CONT, // IO is used as ADC continuous input + ESP32_BUS_TYPE_ADC_ONESHOT, // IO is used as ADC OneShot input + ESP32_BUS_TYPE_ADC_CONT, // IO is used as ADC continuous input #endif #if SOC_DAC_SUPPORTED - ESP32_BUS_TYPE_DAC_ONESHOT, // IO is used as DAC OneShot output - ESP32_BUS_TYPE_DAC_CONT, // IO is used as DAC continuous output - ESP32_BUS_TYPE_DAC_COSINE, // IO is used as DAC cosine output + ESP32_BUS_TYPE_DAC_ONESHOT, // IO is used as DAC OneShot output + ESP32_BUS_TYPE_DAC_CONT, // IO is used as DAC continuous output + ESP32_BUS_TYPE_DAC_COSINE, // IO is used as DAC cosine output #endif #if SOC_LEDC_SUPPORTED - ESP32_BUS_TYPE_LEDC, // IO is used as LEDC output + ESP32_BUS_TYPE_LEDC, // IO is used as LEDC output #endif #if SOC_RMT_SUPPORTED - ESP32_BUS_TYPE_RMT_TX, // IO is used as RMT output - ESP32_BUS_TYPE_RMT_RX, // IO is used as RMT input + ESP32_BUS_TYPE_RMT_TX, // IO is used as RMT output + ESP32_BUS_TYPE_RMT_RX, // IO is used as RMT input #endif #if SOC_I2S_SUPPORTED - ESP32_BUS_TYPE_I2S_STD_MCLK, // IO is used as I2S STD MCLK pin - ESP32_BUS_TYPE_I2S_STD_BCLK, // IO is used as I2S STD BCLK pin - ESP32_BUS_TYPE_I2S_STD_WS, // IO is used as I2S STD WS pin - ESP32_BUS_TYPE_I2S_STD_DOUT, // IO is used as I2S STD DOUT pin - ESP32_BUS_TYPE_I2S_STD_DIN, // IO is used as I2S STD DIN pin + ESP32_BUS_TYPE_I2S_STD_MCLK, // IO is used as I2S STD MCLK pin + ESP32_BUS_TYPE_I2S_STD_BCLK, // IO is used as I2S STD BCLK pin + ESP32_BUS_TYPE_I2S_STD_WS, // IO is used as I2S STD WS pin + ESP32_BUS_TYPE_I2S_STD_DOUT, // IO is used as I2S STD DOUT pin + ESP32_BUS_TYPE_I2S_STD_DIN, // IO is used as I2S STD DIN pin - ESP32_BUS_TYPE_I2S_TDM_MCLK, // IO is used as I2S TDM MCLK pin - ESP32_BUS_TYPE_I2S_TDM_BCLK, // IO is used as I2S TDM BCLK pin - ESP32_BUS_TYPE_I2S_TDM_WS, // IO is used as I2S TDM WS pin - ESP32_BUS_TYPE_I2S_TDM_DOUT, // IO is used as I2S TDM DOUT pin - ESP32_BUS_TYPE_I2S_TDM_DIN, // IO is used as I2S TDM DIN pin + ESP32_BUS_TYPE_I2S_TDM_MCLK, // IO is used as I2S TDM MCLK pin + ESP32_BUS_TYPE_I2S_TDM_BCLK, // IO is used as I2S TDM BCLK pin + ESP32_BUS_TYPE_I2S_TDM_WS, // IO is used as I2S TDM WS pin + ESP32_BUS_TYPE_I2S_TDM_DOUT, // IO is used as I2S TDM DOUT pin + ESP32_BUS_TYPE_I2S_TDM_DIN, // IO is used as I2S TDM DIN pin - ESP32_BUS_TYPE_I2S_PDM_TX_CLK, // IO is used as I2S PDM CLK pin - ESP32_BUS_TYPE_I2S_PDM_TX_DOUT0, // IO is used as I2S PDM DOUT0 pin - ESP32_BUS_TYPE_I2S_PDM_TX_DOUT1, // IO is used as I2S PDM DOUT1 pin + ESP32_BUS_TYPE_I2S_PDM_TX_CLK, // IO is used as I2S PDM CLK pin + ESP32_BUS_TYPE_I2S_PDM_TX_DOUT0, // IO is used as I2S PDM DOUT0 pin + ESP32_BUS_TYPE_I2S_PDM_TX_DOUT1, // IO is used as I2S PDM DOUT1 pin - ESP32_BUS_TYPE_I2S_PDM_RX_CLK, // IO is used as I2S PDM CLK pin - ESP32_BUS_TYPE_I2S_PDM_RX_DIN0, // IO is used as I2S PDM DIN0 pin - ESP32_BUS_TYPE_I2S_PDM_RX_DIN1, // IO is used as I2S PDM DIN1 pin - ESP32_BUS_TYPE_I2S_PDM_RX_DIN2, // IO is used as I2S PDM DIN2 pin - ESP32_BUS_TYPE_I2S_PDM_RX_DIN3, // IO is used as I2S PDM DIN3 pin + ESP32_BUS_TYPE_I2S_PDM_RX_CLK, // IO is used as I2S PDM CLK pin + ESP32_BUS_TYPE_I2S_PDM_RX_DIN0, // IO is used as I2S PDM DIN0 pin + ESP32_BUS_TYPE_I2S_PDM_RX_DIN1, // IO is used as I2S PDM DIN1 pin + ESP32_BUS_TYPE_I2S_PDM_RX_DIN2, // IO is used as I2S PDM DIN2 pin + ESP32_BUS_TYPE_I2S_PDM_RX_DIN3, // IO is used as I2S PDM DIN3 pin #endif #if SOC_I2C_SUPPORTED - ESP32_BUS_TYPE_I2C_MASTER_SDA, // IO is used as I2C master SDA pin - ESP32_BUS_TYPE_I2C_MASTER_SCL, // IO is used as I2C master SCL pin - ESP32_BUS_TYPE_I2C_SLAVE_SDA, // IO is used as I2C slave SDA pin - ESP32_BUS_TYPE_I2C_SLAVE_SCL, // IO is used as I2C slave SCL pin + ESP32_BUS_TYPE_I2C_MASTER_SDA, // IO is used as I2C master SDA pin + ESP32_BUS_TYPE_I2C_MASTER_SCL, // IO is used as I2C master SCL pin + ESP32_BUS_TYPE_I2C_SLAVE_SDA, // IO is used as I2C slave SDA pin + ESP32_BUS_TYPE_I2C_SLAVE_SCL, // IO is used as I2C slave SCL pin #endif #if SOC_GPSPI_SUPPORTED - ESP32_BUS_TYPE_SPI_MASTER_SCK, // IO is used as SPI master SCK pin - ESP32_BUS_TYPE_SPI_MASTER_MISO, // IO is used as SPI master MISO pin - ESP32_BUS_TYPE_SPI_MASTER_MOSI, // IO is used as SPI master MOSI pin - ESP32_BUS_TYPE_SPI_MASTER_SS, // IO is used as SPI master SS pin + ESP32_BUS_TYPE_SPI_MASTER_SCK, // IO is used as SPI master SCK pin + ESP32_BUS_TYPE_SPI_MASTER_MISO, // IO is used as SPI master MISO pin + ESP32_BUS_TYPE_SPI_MASTER_MOSI, // IO is used as SPI master MOSI pin + ESP32_BUS_TYPE_SPI_MASTER_SS, // IO is used as SPI master SS pin #endif #if SOC_SDMMC_HOST_SUPPORTED - ESP32_BUS_TYPE_SDMMC_CLK, // IO is used as SDMMC CLK pin - ESP32_BUS_TYPE_SDMMC_CMD, // IO is used as SDMMC CMD pin - ESP32_BUS_TYPE_SDMMC_D0, // IO is used as SDMMC D0 pin - ESP32_BUS_TYPE_SDMMC_D1, // IO is used as SDMMC D1 pin - ESP32_BUS_TYPE_SDMMC_D2, // IO is used as SDMMC D2 pin - ESP32_BUS_TYPE_SDMMC_D3, // IO is used as SDMMC D3 pin + ESP32_BUS_TYPE_SDMMC_CLK, // IO is used as SDMMC CLK pin + ESP32_BUS_TYPE_SDMMC_CMD, // IO is used as SDMMC CMD pin + ESP32_BUS_TYPE_SDMMC_D0, // IO is used as SDMMC D0 pin + ESP32_BUS_TYPE_SDMMC_D1, // IO is used as SDMMC D1 pin + ESP32_BUS_TYPE_SDMMC_D2, // IO is used as SDMMC D2 pin + ESP32_BUS_TYPE_SDMMC_D3, // IO is used as SDMMC D3 pin #endif #if SOC_TOUCH_SENSOR_SUPPORTED - ESP32_BUS_TYPE_TOUCH, // IO is used as TOUCH pin + ESP32_BUS_TYPE_TOUCH, // IO is used as TOUCH pin #endif #if SOC_USB_SERIAL_JTAG_SUPPORTED || SOC_USB_OTG_SUPPORTED - ESP32_BUS_TYPE_USB_DM, // IO is used as USB DM (+) pin - ESP32_BUS_TYPE_USB_DP, // IO is used as USB DP (-) pin + ESP32_BUS_TYPE_USB_DM, // IO is used as USB DM (+) pin + ESP32_BUS_TYPE_USB_DP, // IO is used as USB DP (-) pin #endif #if SOC_GPSPI_SUPPORTED - ESP32_BUS_TYPE_ETHERNET_SPI, // IO is used as ETHERNET SPI pin + ESP32_BUS_TYPE_ETHERNET_SPI, // IO is used as ETHERNET SPI pin #endif #if CONFIG_ETH_USE_ESP32_EMAC - ESP32_BUS_TYPE_ETHERNET_RMII, // IO is used as ETHERNET RMII pin - ESP32_BUS_TYPE_ETHERNET_CLK, // IO is used as ETHERNET CLK pin - ESP32_BUS_TYPE_ETHERNET_MCD, // IO is used as ETHERNET MCD pin - ESP32_BUS_TYPE_ETHERNET_MDIO, // IO is used as ETHERNET MDIO pin - ESP32_BUS_TYPE_ETHERNET_PWR, // IO is used as ETHERNET PWR pin + ESP32_BUS_TYPE_ETHERNET_RMII, // IO is used as ETHERNET RMII pin + ESP32_BUS_TYPE_ETHERNET_CLK, // IO is used as ETHERNET CLK pin + ESP32_BUS_TYPE_ETHERNET_MCD, // IO is used as ETHERNET MCD pin + ESP32_BUS_TYPE_ETHERNET_MDIO, // IO is used as ETHERNET MDIO pin + ESP32_BUS_TYPE_ETHERNET_PWR, // IO is used as ETHERNET PWR pin #endif #if CONFIG_LWIP_PPP_SUPPORT - ESP32_BUS_TYPE_PPP_TX, // IO is used as PPP Modem TX pin - ESP32_BUS_TYPE_PPP_RX, // IO is used as PPP Modem RX pin - ESP32_BUS_TYPE_PPP_RTS, // IO is used as PPP Modem RTS pin - ESP32_BUS_TYPE_PPP_CTS, // IO is used as PPP Modem CTS pin + ESP32_BUS_TYPE_PPP_TX, // IO is used as PPP Modem TX pin + ESP32_BUS_TYPE_PPP_RX, // IO is used as PPP Modem RX pin + ESP32_BUS_TYPE_PPP_RTS, // IO is used as PPP Modem RTS pin + ESP32_BUS_TYPE_PPP_CTS, // IO is used as PPP Modem CTS pin #endif - ESP32_BUS_TYPE_MAX - } peripheral_bus_type_t; + ESP32_BUS_TYPE_MAX +} peripheral_bus_type_t; - typedef bool (*peripheral_bus_deinit_cb_t)(void* bus); +typedef bool (*peripheral_bus_deinit_cb_t)(void *bus); - const char* perimanGetTypeName(peripheral_bus_type_t type); +const char *perimanGetTypeName(peripheral_bus_type_t type); - // Sets the bus type, bus handle, bus number and bus channel for given pin. - bool perimanSetPinBus(uint8_t pin, peripheral_bus_type_t type, void* bus, int8_t bus_num, int8_t bus_channel); +// Sets the bus type, bus handle, bus number and bus channel for given pin. +bool perimanSetPinBus(uint8_t pin, peripheral_bus_type_t type, void *bus, int8_t bus_num, int8_t bus_channel); - // Returns handle of the bus for the given pin if type of bus matches. NULL otherwise - void* perimanGetPinBus(uint8_t pin, peripheral_bus_type_t type); +// Returns handle of the bus for the given pin if type of bus matches. NULL otherwise +void *perimanGetPinBus(uint8_t pin, peripheral_bus_type_t type); - // Returns the type of the bus for the given pin if attached. ESP32_BUS_TYPE_MAX otherwise - peripheral_bus_type_t perimanGetPinBusType(uint8_t pin); +// Returns the type of the bus for the given pin if attached. ESP32_BUS_TYPE_MAX otherwise +peripheral_bus_type_t perimanGetPinBusType(uint8_t pin); - // Returns the bus number or unit of the bus for the given pin if set. -1 otherwise - int8_t perimanGetPinBusNum(uint8_t pin); +// Returns the bus number or unit of the bus for the given pin if set. -1 otherwise +int8_t perimanGetPinBusNum(uint8_t pin); - // Returns the bus channel of the bus for the given pin if set. -1 otherwise - int8_t perimanGetPinBusChannel(uint8_t pin); +// Returns the bus channel of the bus for the given pin if set. -1 otherwise +int8_t perimanGetPinBusChannel(uint8_t pin); - // Sets the peripheral destructor callback. Used to destroy bus when pin is assigned another function - bool perimanSetBusDeinit(peripheral_bus_type_t type, peripheral_bus_deinit_cb_t cb); +// Sets the peripheral destructor callback. Used to destroy bus when pin is assigned another function +bool perimanSetBusDeinit(peripheral_bus_type_t type, peripheral_bus_deinit_cb_t cb); - // Check if given pin is a valid GPIO number - bool perimanPinIsValid(uint8_t pin); +// Check if given pin is a valid GPIO number +bool perimanPinIsValid(uint8_t pin); - // Sets the extra type for non Init bus. Used to customize pin bus name which can be printed by printPerimanInfo(). - bool perimanSetPinBusExtraType(uint8_t pin, const char* extra_type); +// Sets the extra type for non Init bus. Used to customize pin bus name which can be printed by printPerimanInfo(). +bool perimanSetPinBusExtraType(uint8_t pin, const char *extra_type); - // Returns the extra type of the bus for given pin if set. NULL otherwise - const char* perimanGetPinBusExtraType(uint8_t pin); +// Returns the extra type of the bus for given pin if set. NULL otherwise +const char *perimanGetPinBusExtraType(uint8_t pin); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-psram.c b/cores/esp32/esp32-hal-psram.c index 55acba2aa..5a741908f 100644 --- a/cores/esp32/esp32-hal-psram.c +++ b/cores/esp32/esp32-hal-psram.c @@ -39,7 +39,6 @@ __attribute__((weak)) bool testSPIRAM(void) { return esp_psram_extram_test(); } - bool psramInit() { if (spiramDetected) { return true; diff --git a/cores/esp32/esp32-hal-psram.h b/cores/esp32/esp32-hal-psram.h index 0d4fba22c..0ba6763c6 100644 --- a/cores/esp32/esp32-hal-psram.h +++ b/cores/esp32/esp32-hal-psram.h @@ -30,12 +30,12 @@ extern "C" { #endif #endif - bool psramInit(); - bool psramFound(); +bool psramInit(); +bool psramFound(); - void *ps_malloc(size_t size); - void *ps_calloc(size_t n, size_t size); - void *ps_realloc(void *ptr, size_t size); +void *ps_malloc(size_t size); +void *ps_calloc(size_t n, size_t size); +void *ps_realloc(void *ptr, size_t size); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-rgb-led.c b/cores/esp32/esp32-hal-rgb-led.c index d221a9443..99c95e194 100644 --- a/cores/esp32/esp32-hal-rgb-led.c +++ b/cores/esp32/esp32-hal-rgb-led.c @@ -2,7 +2,6 @@ #include "esp32-hal-rgb-led.h" - void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val) { #if SOC_RMT_SUPPORTED rmt_data_t led_data[24]; @@ -16,7 +15,7 @@ void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue return; } - int color[] = { green_val, red_val, blue_val }; // Color coding is in order GREEN, RED, BLUE + int color[] = {green_val, red_val, blue_val}; // Color coding is in order GREEN, RED, BLUE int i = 0; for (int col = 0; col < 3; col++) { for (int bit = 0; bit < 8; bit++) { diff --git a/cores/esp32/esp32-hal-rgb-led.h b/cores/esp32/esp32-hal-rgb-led.h index 0c40f53a6..33f37c849 100644 --- a/cores/esp32/esp32-hal-rgb-led.h +++ b/cores/esp32/esp32-hal-rgb-led.h @@ -11,7 +11,7 @@ extern "C" { #define RGB_BRIGHTNESS 64 #endif - void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val); +void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-rmt.c b/cores/esp32/esp32-hal-rmt.c index 7fd0d3763..0ed29ea9c 100644 --- a/cores/esp32/esp32-hal-rmt.c +++ b/cores/esp32/esp32-hal-rmt.c @@ -41,12 +41,11 @@ extern TaskHandle_t loopTaskHandle; #define RMT_MUTEX_UNLOCK(busptr) #else #define RMT_MUTEX_LOCK(busptr) \ - do { \ + do { \ } while (xSemaphoreTake(busptr->g_rmt_objlocks, portMAX_DELAY) != pdPASS) #define RMT_MUTEX_UNLOCK(busptr) xSemaphoreGive(busptr->g_rmt_objlocks) #endif /* CONFIG_DISABLE_HAL_LOCKS */ - /** Typedefs for internal structures, enums */ @@ -206,7 +205,7 @@ bool rmtSetCarrier(int pin, bool carrier_en, bool carrier_level, uint32_t freque log_w("GPIO %d - RMT Carrier must be a float percentage from 0 to 1. Setting to 50%.", pin); duty_percent = 0.5; } - rmt_carrier_config_t carrier_cfg = { 0 }; + rmt_carrier_config_t carrier_cfg = {0}; carrier_cfg.duty_cycle = duty_percent; // duty cycle carrier_cfg.frequency_hz = carrier_en ? frequency_Hz : 0; // carrier frequency in Hz carrier_cfg.flags.polarity_active_low = carrier_level; // carrier modulation polarity level @@ -303,14 +302,17 @@ static bool _rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, bool bl } log_v("GPIO: %d - Request: %d RMT Symbols - %s - Timeout: %d", pin, num_rmt_symbols, blocking ? "Blocking" : "Non-Blocking", timeout_ms); - log_v("GPIO: %d - Currently in Loop Mode: [%s] | Asked to Loop: %s, LoopCancel: %s", pin, bus->rmt_ch_is_looping ? "YES" : "NO", loop ? "YES" : "NO", loopCancel ? "YES" : "NO"); + log_v( + "GPIO: %d - Currently in Loop Mode: [%s] | Asked to Loop: %s, LoopCancel: %s", pin, bus->rmt_ch_is_looping ? "YES" : "NO", loop ? "YES" : "NO", + loopCancel ? "YES" : "NO" + ); if ((xEventGroupGetBits(bus->rmt_events) & RMT_FLAG_TX_DONE) == 0) { log_v("GPIO %d - RMT Write still pending to be completed.", pin); return false; } - rmt_transmit_config_t transmit_cfg = { 0 }; // loop mode disabled + rmt_transmit_config_t transmit_cfg = {0}; // loop mode disabled bool retCode = true; RMT_MUTEX_LOCK(bus); @@ -348,8 +350,7 @@ static bool _rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, bool bl } else { if (blocking) { // wait for transmission confirmation | timeout - retCode = (xEventGroupWaitBits(bus->rmt_events, RMT_FLAG_TX_DONE, pdFALSE /* do not clear on exit */, - pdFALSE /* wait for all bits */, timeout_ms) + retCode = (xEventGroupWaitBits(bus->rmt_events, RMT_FLAG_TX_DONE, pdFALSE /* do not clear on exit */, pdFALSE /* wait for all bits */, timeout_ms) & RMT_FLAG_TX_DONE) != 0; } @@ -387,8 +388,7 @@ static bool _rmtRead(int pin, rmt_data_t *data, size_t *num_rmt_symbols, bool wa rmt_receive(bus->rmt_channel_h, data, *num_rmt_symbols * sizeof(rmt_data_t), &receive_config); // wait for data if requested if (waitForData) { - retCode = (xEventGroupWaitBits(bus->rmt_events, RMT_FLAG_RX_DONE, pdFALSE /* do not clear on exit */, - pdFALSE /* wait for all bits */, timeout_ms) + retCode = (xEventGroupWaitBits(bus->rmt_events, RMT_FLAG_RX_DONE, pdFALSE /* do not clear on exit */, pdFALSE /* wait for all bits */, timeout_ms) & RMT_FLAG_RX_DONE) != 0; } @@ -397,7 +397,6 @@ static bool _rmtRead(int pin, rmt_data_t *data, size_t *num_rmt_symbols, bool wa return retCode; } - bool rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, uint32_t timeout_ms) { return _rmtWrite(pin, data, num_rmt_symbols, true /*blocks*/, false /*looping*/, timeout_ms); } @@ -451,7 +450,10 @@ bool rmtReceiveCompleted(int pin) { } bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_size, uint32_t frequency_Hz) { - log_v("GPIO %d - %s - MemSize[%d] - Freq=%dHz", pin, channel_direction == RMT_RX_MODE ? "RX MODE" : "TX MODE", mem_size * RMT_SYMBOLS_PER_CHANNEL_BLOCK, frequency_Hz); + log_v( + "GPIO %d - %s - MemSize[%d] - Freq=%dHz", pin, channel_direction == RMT_RX_MODE ? "RX MODE" : "TX MODE", mem_size * RMT_SYMBOLS_PER_CHANNEL_BLOCK, + frequency_Hz + ); // create common block mutex for protecting allocs from multiple threads allocating RMT channels if (!g_rmt_block_lock) { @@ -535,7 +537,7 @@ bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_ } // set TX Callback - rmt_tx_event_callbacks_t cbs = { .on_trans_done = _rmt_tx_done_callback }; + rmt_tx_event_callbacks_t cbs = {.on_trans_done = _rmt_tx_done_callback}; if (ESP_OK != rmt_tx_register_event_callbacks(bus->rmt_channel_h, &cbs, bus)) { log_e("GPIO %d RMT - Error registering TX Callback.", pin); goto Err; @@ -562,7 +564,7 @@ bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_ } // set RX Callback - rmt_rx_event_callbacks_t cbs = { .on_recv_done = _rmt_rx_done_callback }; + rmt_rx_event_callbacks_t cbs = {.on_recv_done = _rmt_rx_done_callback}; if (ESP_OK != rmt_rx_register_event_callbacks(bus->rmt_channel_h, &cbs, bus)) { log_e("GPIO %d RMT - Error registering RX Callback.", pin); goto Err; @@ -588,8 +590,7 @@ bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_ rmt_enable(bus->rmt_channel_h); // starts/enables the channel // Finally, allocate Peripheral Manager RMT bus and associate it to its GPIO - peripheral_bus_type_t pinBusType = - channel_direction == RMT_TX_MODE ? ESP32_BUS_TYPE_RMT_TX : ESP32_BUS_TYPE_RMT_RX; + peripheral_bus_type_t pinBusType = channel_direction == RMT_TX_MODE ? ESP32_BUS_TYPE_RMT_TX : ESP32_BUS_TYPE_RMT_RX; if (!perimanSetPinBus(pin, pinBusType, (void *)bus, -1, -1)) { log_e("Can't allocate the GPIO %d in the Peripheral Manager.", pin); goto Err; diff --git a/cores/esp32/esp32-hal-rmt.h b/cores/esp32/esp32-hal-rmt.h index 374483b4b..c15eadfbc 100644 --- a/cores/esp32/esp32-hal-rmt.h +++ b/cores/esp32/esp32-hal-rmt.h @@ -22,37 +22,37 @@ extern "C" { #endif - typedef enum { - RMT_RX_MODE = 0, // false - RMT_TX_MODE = 1, // true - } rmt_ch_dir_t; +typedef enum { + RMT_RX_MODE = 0, // false + RMT_TX_MODE = 1, // true +} rmt_ch_dir_t; - typedef enum { - RMT_MEM_NUM_BLOCKS_1 = 1, - RMT_MEM_NUM_BLOCKS_2 = 2, +typedef enum { + RMT_MEM_NUM_BLOCKS_1 = 1, + RMT_MEM_NUM_BLOCKS_2 = 2, #if SOC_RMT_TX_CANDIDATES_PER_GROUP > 2 - RMT_MEM_NUM_BLOCKS_3 = 3, - RMT_MEM_NUM_BLOCKS_4 = 4, + RMT_MEM_NUM_BLOCKS_3 = 3, + RMT_MEM_NUM_BLOCKS_4 = 4, #if SOC_RMT_TX_CANDIDATES_PER_GROUP > 4 - RMT_MEM_NUM_BLOCKS_5 = 5, - RMT_MEM_NUM_BLOCKS_6 = 6, - RMT_MEM_NUM_BLOCKS_7 = 7, - RMT_MEM_NUM_BLOCKS_8 = 8, + RMT_MEM_NUM_BLOCKS_5 = 5, + RMT_MEM_NUM_BLOCKS_6 = 6, + RMT_MEM_NUM_BLOCKS_7 = 7, + RMT_MEM_NUM_BLOCKS_8 = 8, #endif #endif - } rmt_reserve_memsize_t; +} rmt_reserve_memsize_t; - // Each RMT Symbols has 4 bytes - // Total number of bytes per RMT_MEM_BLOCK is RMT_SYMBOLS_PER_CHANNEL_BLOCK * 4 bytes - typedef union { - struct { - uint32_t duration0 : 15; - uint32_t level0 : 1; - uint32_t duration1 : 15; - uint32_t level1 : 1; - }; - uint32_t val; - } rmt_data_t; +// Each RMT Symbols has 4 bytes +// Total number of bytes per RMT_MEM_BLOCK is RMT_SYMBOLS_PER_CHANNEL_BLOCK * 4 bytes +typedef union { + struct { + uint32_t duration0 : 15; + uint32_t level0 : 1; + uint32_t duration1 : 15; + uint32_t level1 : 1; + }; + uint32_t val; +} rmt_data_t; // Reading and Writing shall use as rmt_symbols_size this unit // ESP32 has 8 MEM BLOCKS in total shared with Reading and/or Writing @@ -67,16 +67,16 @@ extern "C" { // Helper macro to calculate the number of RTM symbols in a array or type #define RMT_SYMBOLS_OF(x) (sizeof(x) / sizeof(rmt_data_t)) - /** +/** Initialize the object New Parameters in Arduino Core 3: RMT tick is set in the rmtInit() function by the frequency of the RMT channel. Example: 100ns tick => 10MHz, thus frequency will be 10,000,000 Hz Returns on execution success, otherwise */ - bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t memsize, uint32_t frequency_Hz); +bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t memsize, uint32_t frequency_Hz); - /** +/** Sets the End of Transmission level to be set for the when the RMT transmission ends. This function affects how rmtWrite(), rmtWriteAsync() or rmtWriteLooping() will set the pin after writing the data. The default EOT level is LOW, in case this function isn't used before RMT Writing. @@ -88,9 +88,9 @@ extern "C" { Returns when EOT has been correctly set for , otherwise. */ - bool rmtSetEOT(int pin, uint8_t EOT_Level); +bool rmtSetEOT(int pin, uint8_t EOT_Level); - /** +/** Sending data in Blocking Mode. is a 32 bits structure as defined by rmt_data_t type. It is possible to use the macro RMT_SYMBOLS_OF(data), if data is an array of . @@ -105,9 +105,9 @@ extern "C" { Returns when there is no error in the write operation, otherwise, including when it exits by timeout. */ - bool rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, uint32_t timeout_ms); +bool rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, uint32_t timeout_ms); - /** +/** Sending data in Async Mode. is a 32 bits structure as defined by rmt_data_t type. It is possible to use the macro RMT_SYMBOLS_OF(data), if is an array of @@ -121,9 +121,9 @@ extern "C" { will return when all data is sent. */ - bool rmtWriteAsync(int pin, rmt_data_t *data, size_t num_rmt_symbols); +bool rmtWriteAsync(int pin, rmt_data_t *data, size_t num_rmt_symbols); - /** +/** Writing data up to the reserved memsize, looping continuously is a 32 bits structure as defined by rmt_data_t type. It is possible to use the macro RMT_SYMBOLS_OF(data), if data is an array of rmt_data_t @@ -135,9 +135,9 @@ extern "C" { will return always while it is looping. */ - bool rmtWriteLooping(int pin, rmt_data_t *data, size_t num_rmt_symbols); +bool rmtWriteLooping(int pin, rmt_data_t *data, size_t num_rmt_symbols); - /** +/** Checks if transmission is completed and the rmtChannel ready for transmitting new data. To be ready for a new transmission, means that the previous transmission is completed. Returns when all data has been sent, otherwise. @@ -147,9 +147,9 @@ extern "C" { rmtTranmitCompleted() will always return when rmtWriteLooping() is called, because it has no effect in such case. */ - bool rmtTransmitCompleted(int pin); +bool rmtTransmitCompleted(int pin); - /** +/** Initiates blocking receive. Read data will be stored in a user provided buffer <*data> It will read up to RMT Symbols and the value of this variable will change to the effective number of symbols read. @@ -167,9 +167,9 @@ extern "C" { will read RMT data latter asynchronously, affecting <*data> and <*num_rmt_symbols>. After timeout, the application can check if data is already available using */ - bool rmtRead(int pin, rmt_data_t *data, size_t *num_rmt_symbols, uint32_t timeout_ms); +bool rmtRead(int pin, rmt_data_t *data, size_t *num_rmt_symbols, uint32_t timeout_ms); - /** +/** Initiates async (non-blocking) receive. It will return immediately after execution. Read data will be stored in a user provided buffer <*data>. It will read up to RMT Symbols and the value of this variable will @@ -181,16 +181,16 @@ extern "C" { the RMT received data to the user buffer when the read operation happens. The application can check if data is already available using */ - bool rmtReadAsync(int pin, rmt_data_t *data, size_t *num_rmt_symbols); +bool rmtReadAsync(int pin, rmt_data_t *data, size_t *num_rmt_symbols); - /** +/** Checks if a data reception is completed and the rmtChannel has new data for processing. Returns when data has been received, otherwise. The data reception information is reset when a new rmtRead/Async function is called. */ - bool rmtReceiveCompleted(int pin); +bool rmtReceiveCompleted(int pin); - /** +/** Function used to set a threshold (in ticks) used to consider that a data reception has ended. In receive mode, when no edge is detected on the input signal for longer than idle_thres_ticks time, the receiving process is finished and the Data is made available by @@ -198,9 +198,9 @@ extern "C" { define how many low/high bits are read at the end of the received data. The function returns if it is correctly executed, otherwise. */ - bool rmtSetRxMaxThreshold(int pin, uint16_t idle_thres_ticks); +bool rmtSetRxMaxThreshold(int pin, uint16_t idle_thres_ticks); - /** +/** Parameters changed in Arduino Core 3: low and high (ticks) are now expressed in Carrier Freq in Hz and duty cycle in percentage float 0.0 to 1.0 - example: 38.5KHz 33% High => 38500, 0.33 @@ -211,22 +211,22 @@ extern "C" { is a float deom 0 to 1 (0.5 means a square wave) of the carrier frequency The function returns if it is correctly executed, otherwise. */ - bool rmtSetCarrier(int pin, bool carrier_en, bool carrier_level, uint32_t frequency_Hz, float duty_percent); +bool rmtSetCarrier(int pin, bool carrier_en, bool carrier_level, uint32_t frequency_Hz, float duty_percent); - /** +/** Function used to filter input noise in the RX channel. In receiving mode, channel will ignore any input pulse which width (high or low) is smaller than If is Zero, it will to disable the filter. The function returns if it is correctly executed, otherwise. */ - bool rmtSetRxMinThreshold(int pin, uint8_t filter_pulse_ticks); +bool rmtSetRxMinThreshold(int pin, uint8_t filter_pulse_ticks); - /** +/** Deinitializes the driver and releases all allocated memory It also disables RMT for this gpio */ - bool rmtDeinit(int pin); +bool rmtDeinit(int pin); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-sigmadelta.c b/cores/esp32/esp32-hal-sigmadelta.c index 9d21286e9..988f44103 100644 --- a/cores/esp32/esp32-hal-sigmadelta.c +++ b/cores/esp32/esp32-hal-sigmadelta.c @@ -34,14 +34,7 @@ bool sigmaDeltaAttach(uint8_t pin, uint32_t freq) //freq 1220-312500 log_e("Pin %u could not be detached.", pin); return false; } - sdm_config_t config = { - .gpio_num = (int)pin, - .clk_src = SDM_CLK_SRC_DEFAULT, - .sample_rate_hz = freq, - .flags = { - .invert_out = 0, - .io_loop_back = 0 } - }; + sdm_config_t config = {.gpio_num = (int)pin, .clk_src = SDM_CLK_SRC_DEFAULT, .sample_rate_hz = freq, .flags = {.invert_out = 0, .io_loop_back = 0}}; esp_err_t err = sdm_new_channel(&config, &bus); if (err != ESP_OK) { log_e("sdm_new_channel failed with error: %d", err); diff --git a/cores/esp32/esp32-hal-sigmadelta.h b/cores/esp32/esp32-hal-sigmadelta.h index ea1f9c7a1..3ae5dd7be 100644 --- a/cores/esp32/esp32-hal-sigmadelta.h +++ b/cores/esp32/esp32-hal-sigmadelta.h @@ -16,10 +16,10 @@ extern "C" { #include #include - //freq 1220-312500 duty 0-255 - bool sigmaDeltaAttach(uint8_t pin, uint32_t freq); - bool sigmaDeltaWrite(uint8_t pin, uint8_t duty); - bool sigmaDeltaDetach(uint8_t pin); +//freq 1220-312500 duty 0-255 +bool sigmaDeltaAttach(uint8_t pin, uint32_t freq); +bool sigmaDeltaWrite(uint8_t pin, uint8_t duty); +bool sigmaDeltaDetach(uint8_t pin); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-spi.c b/cores/esp32/esp32-hal-spi.c index e0c9f4cf3..857c3d4bb 100644 --- a/cores/esp32/esp32-hal-spi.c +++ b/cores/esp32/esp32-hal-spi.c @@ -75,50 +75,50 @@ struct spi_struct_t { // ESP32S2 #define SPI_COUNT (3) -#define SPI_CLK_IDX(p) ((p == 0) ? SPICLK_OUT_MUX_IDX : ((p == 1) ? FSPICLK_OUT_MUX_IDX : ((p == 2) ? SPI3_CLK_OUT_MUX_IDX : 0))) +#define SPI_CLK_IDX(p) ((p == 0) ? SPICLK_OUT_MUX_IDX : ((p == 1) ? FSPICLK_OUT_MUX_IDX : ((p == 2) ? SPI3_CLK_OUT_MUX_IDX : 0))) #define SPI_MISO_IDX(p) ((p == 0) ? SPIQ_OUT_IDX : ((p == 1) ? FSPIQ_OUT_IDX : ((p == 2) ? SPI3_Q_OUT_IDX : 0))) #define SPI_MOSI_IDX(p) ((p == 0) ? SPID_IN_IDX : ((p == 1) ? FSPID_IN_IDX : ((p == 2) ? SPI3_D_IN_IDX : 0))) -#define SPI_SPI_SS_IDX(n) ((n == 0) ? SPICS0_OUT_IDX : ((n == 1) ? SPICS1_OUT_IDX : 0)) +#define SPI_SPI_SS_IDX(n) ((n == 0) ? SPICS0_OUT_IDX : ((n == 1) ? SPICS1_OUT_IDX : 0)) #define SPI_HSPI_SS_IDX(n) ((n == 0) ? SPI3_CS0_OUT_IDX : ((n == 1) ? SPI3_CS1_OUT_IDX : ((n == 2) ? SPI3_CS2_OUT_IDX : SPI3_CS0_OUT_IDX))) #define SPI_FSPI_SS_IDX(n) ((n == 0) ? FSPICS0_OUT_IDX : ((n == 1) ? FSPICS1_OUT_IDX : ((n == 2) ? FSPICS2_OUT_IDX : FSPICS0_OUT_IDX))) -#define SPI_SS_IDX(p, n) ((p == 0) ? SPI_SPI_SS_IDX(n) : ((p == 1) ? SPI_SPI_SS_IDX(n) : ((p == 2) ? SPI_HSPI_SS_IDX(n) : 0))) +#define SPI_SS_IDX(p, n) ((p == 0) ? SPI_SPI_SS_IDX(n) : ((p == 1) ? SPI_SPI_SS_IDX(n) : ((p == 2) ? SPI_HSPI_SS_IDX(n) : 0))) #elif CONFIG_IDF_TARGET_ESP32S3 // ESP32S3 #define SPI_COUNT (2) -#define SPI_CLK_IDX(p) ((p == 0) ? FSPICLK_OUT_IDX : ((p == 1) ? SPI3_CLK_OUT_IDX : 0)) +#define SPI_CLK_IDX(p) ((p == 0) ? FSPICLK_OUT_IDX : ((p == 1) ? SPI3_CLK_OUT_IDX : 0)) #define SPI_MISO_IDX(p) ((p == 0) ? FSPIQ_OUT_IDX : ((p == 1) ? SPI3_Q_OUT_IDX : 0)) #define SPI_MOSI_IDX(p) ((p == 0) ? FSPID_IN_IDX : ((p == 1) ? SPI3_D_IN_IDX : 0)) #define SPI_HSPI_SS_IDX(n) ((n == 0) ? SPI3_CS0_OUT_IDX : ((n == 1) ? SPI3_CS1_OUT_IDX : 0)) #define SPI_FSPI_SS_IDX(n) ((n == 0) ? FSPICS0_OUT_IDX : ((n == 1) ? FSPICS1_OUT_IDX : 0)) -#define SPI_SS_IDX(p, n) ((p == 0) ? SPI_FSPI_SS_IDX(n) : ((p == 1) ? SPI_HSPI_SS_IDX(n) : 0)) +#define SPI_SS_IDX(p, n) ((p == 0) ? SPI_FSPI_SS_IDX(n) : ((p == 1) ? SPI_HSPI_SS_IDX(n) : 0)) #elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 // ESP32C3 #define SPI_COUNT (1) -#define SPI_CLK_IDX(p) FSPICLK_OUT_IDX +#define SPI_CLK_IDX(p) FSPICLK_OUT_IDX #define SPI_MISO_IDX(p) FSPIQ_OUT_IDX #define SPI_MOSI_IDX(p) FSPID_IN_IDX #define SPI_SPI_SS_IDX(n) ((n == 0) ? FSPICS0_OUT_IDX : ((n == 1) ? FSPICS1_OUT_IDX : ((n == 2) ? FSPICS2_OUT_IDX : FSPICS0_OUT_IDX))) -#define SPI_SS_IDX(p, n) SPI_SPI_SS_IDX(n) +#define SPI_SS_IDX(p, n) SPI_SPI_SS_IDX(n) #else // ESP32 #define SPI_COUNT (4) -#define SPI_CLK_IDX(p) ((p == 0) ? SPICLK_OUT_IDX : ((p == 1) ? SPICLK_OUT_IDX : ((p == 2) ? HSPICLK_OUT_IDX : ((p == 3) ? VSPICLK_OUT_IDX : 0)))) +#define SPI_CLK_IDX(p) ((p == 0) ? SPICLK_OUT_IDX : ((p == 1) ? SPICLK_OUT_IDX : ((p == 2) ? HSPICLK_OUT_IDX : ((p == 3) ? VSPICLK_OUT_IDX : 0)))) #define SPI_MISO_IDX(p) ((p == 0) ? SPIQ_OUT_IDX : ((p == 1) ? SPIQ_OUT_IDX : ((p == 2) ? HSPIQ_OUT_IDX : ((p == 3) ? VSPIQ_OUT_IDX : 0)))) #define SPI_MOSI_IDX(p) ((p == 0) ? SPID_IN_IDX : ((p == 1) ? SPID_IN_IDX : ((p == 2) ? HSPID_IN_IDX : ((p == 3) ? VSPID_IN_IDX : 0)))) -#define SPI_SPI_SS_IDX(n) ((n == 0) ? SPICS0_OUT_IDX : ((n == 1) ? SPICS1_OUT_IDX : ((n == 2) ? SPICS2_OUT_IDX : SPICS0_OUT_IDX))) +#define SPI_SPI_SS_IDX(n) ((n == 0) ? SPICS0_OUT_IDX : ((n == 1) ? SPICS1_OUT_IDX : ((n == 2) ? SPICS2_OUT_IDX : SPICS0_OUT_IDX))) #define SPI_HSPI_SS_IDX(n) ((n == 0) ? HSPICS0_OUT_IDX : ((n == 1) ? HSPICS1_OUT_IDX : ((n == 2) ? HSPICS2_OUT_IDX : HSPICS0_OUT_IDX))) #define SPI_VSPI_SS_IDX(n) ((n == 0) ? VSPICS0_OUT_IDX : ((n == 1) ? VSPICS1_OUT_IDX : ((n == 2) ? VSPICS2_OUT_IDX : VSPICS0_OUT_IDX))) -#define SPI_SS_IDX(p, n) ((p == 0) ? SPI_SPI_SS_IDX(n) : ((p == 1) ? SPI_SPI_SS_IDX(n) : ((p == 2) ? SPI_HSPI_SS_IDX(n) : ((p == 3) ? SPI_VSPI_SS_IDX(n) : 0)))) +#define SPI_SS_IDX(p, n) ((p == 0) ? SPI_SPI_SS_IDX(n) : ((p == 1) ? SPI_SPI_SS_IDX(n) : ((p == 2) ? SPI_HSPI_SS_IDX(n) : ((p == 3) ? SPI_VSPI_SS_IDX(n) : 0)))) #endif @@ -128,50 +128,48 @@ struct spi_struct_t { static spi_t _spi_bus_array[] = { #if CONFIG_IDF_TARGET_ESP32S2 - { (volatile spi_dev_t *)(DR_REG_SPI1_BASE), 0, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), 1, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI3_BASE), 2, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 0, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 1, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 2, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32S3 - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI3_BASE), 1, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1}, {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 1, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32C2 - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32C3 - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 - { (spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1 } + {(spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1} #else - { (volatile spi_dev_t *)(DR_REG_SPI0_BASE), 0, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI1_BASE), 1, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), 2, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI3_BASE), 3, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), 0, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 1, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 2, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 3, -1, -1, -1, -1} #endif }; #else #define SPI_MUTEX_LOCK() \ - do { \ + do { \ } while (xSemaphoreTake(spi->lock, portMAX_DELAY) != pdPASS) #define SPI_MUTEX_UNLOCK() xSemaphoreGive(spi->lock) static spi_t _spi_bus_array[] = { #if CONFIG_IDF_TARGET_ESP32S2 - { (volatile spi_dev_t *)(DR_REG_SPI1_BASE), NULL, 0, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 1, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 2, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), NULL, 0, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 1, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 2, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32S3 - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 1, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1}, {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 1, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32C2 - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32C3 - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1} #elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 - { (spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1 } + {(spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1} #else - { (volatile spi_dev_t *)(DR_REG_SPI0_BASE), NULL, 0, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI1_BASE), NULL, 1, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 2, -1, -1, -1, -1 }, - { (volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 3, -1, -1, -1, -1 } + {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), NULL, 0, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), NULL, 1, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 2, -1, -1, -1, -1}, + {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 3, -1, -1, -1, -1} #endif }; #endif @@ -371,7 +369,8 @@ void spiEnableSSPins(spi_t *spi, uint8_t ss_mask) { return; } SPI_MUTEX_LOCK(); -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.val &= ~(ss_mask & SPI_SS_MASK_ALL); #else spi->dev->pin.val &= ~(ss_mask & SPI_SS_MASK_ALL); @@ -384,7 +383,8 @@ void spiDisableSSPins(spi_t *spi, uint8_t ss_mask) { return; } SPI_MUTEX_LOCK(); -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.val |= (ss_mask & SPI_SS_MASK_ALL); #else spi->dev->pin.val |= (ss_mask & SPI_SS_MASK_ALL); @@ -417,7 +417,8 @@ void spiSSSet(spi_t *spi) { return; } SPI_MUTEX_LOCK(); -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.cs_keep_active = 1; #else spi->dev->pin.cs_keep_active = 1; @@ -430,7 +431,8 @@ void spiSSClear(spi_t *spi) { return; } SPI_MUTEX_LOCK(); -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.cs_keep_active = 0; #else spi->dev->pin.cs_keep_active = 0; @@ -458,7 +460,8 @@ uint8_t spiGetDataMode(spi_t *spi) { if (!spi) { return 0; } -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 bool idleEdge = spi->dev->misc.ck_idle_edge; #else bool idleEdge = spi->dev->pin.ck_idle_edge; @@ -483,7 +486,8 @@ void spiSetDataMode(spi_t *spi, uint8_t dataMode) { SPI_MUTEX_LOCK(); switch (dataMode) { case SPI_MODE1: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 0; #else spi->dev->pin.ck_idle_edge = 0; @@ -491,7 +495,8 @@ void spiSetDataMode(spi_t *spi, uint8_t dataMode) { spi->dev->user.ck_out_edge = 1; break; case SPI_MODE2: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 1; #else spi->dev->pin.ck_idle_edge = 1; @@ -499,7 +504,8 @@ void spiSetDataMode(spi_t *spi, uint8_t dataMode) { spi->dev->user.ck_out_edge = 1; break; case SPI_MODE3: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 1; #else spi->dev->pin.ck_idle_edge = 1; @@ -508,7 +514,8 @@ void spiSetDataMode(spi_t *spi, uint8_t dataMode) { break; case SPI_MODE0: default: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 0; #else spi->dev->pin.ck_idle_edge = 0; @@ -545,8 +552,7 @@ static void _on_apb_change(void *arg, apb_change_ev_t ev_type, uint32_t old_apb, spi_t *spi = (spi_t *)arg; if (ev_type == APB_BEFORE_CHANGE) { SPI_MUTEX_LOCK(); - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); } else { spi->dev->clock.val = spiFrequencyToClockDiv(old_apb / ((spi->dev->clock.clkdiv_pre + 1) * (spi->dev->clock.clkcnt_n + 1))); SPI_MUTEX_UNLOCK(); @@ -558,7 +564,8 @@ static void spiInitBus(spi_t *spi) { spi->dev->slave.trans_done = 0; #endif spi->dev->slave.val = 0; -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.val = 0; #else spi->dev->pin.val = 0; @@ -684,8 +691,7 @@ void spiWaitReady(spi_t *spi) { if (!spi) { return; } - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); } #if CONFIG_IDF_TARGET_ESP32S2 @@ -694,8 +700,8 @@ void spiWaitReady(spi_t *spi) { #elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 #define usr_mosi_dbitlen ms_data_bitlen #define usr_miso_dbitlen ms_data_bitlen -#define mosi_dlen ms_dlen -#define miso_dlen ms_dlen +#define mosi_dlen ms_dlen +#define miso_dlen ms_dlen #endif void spiWrite(spi_t *spi, const uint32_t *data, uint8_t len) { @@ -720,12 +726,10 @@ void spiWrite(spi_t *spi, const uint32_t *data, uint8_t len) { } #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); SPI_MUTEX_UNLOCK(); } @@ -749,12 +753,10 @@ void spiTransfer(spi_t *spi, uint32_t *data, uint8_t len) { } #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); for (i = 0; i < len; i++) { #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data[i] = spi->dev->data_buf[i].val; @@ -782,12 +784,10 @@ void spiWriteByte(spi_t *spi, uint8_t data) { #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); SPI_MUTEX_UNLOCK(); } @@ -805,12 +805,10 @@ uint8_t spiTransferByte(spi_t *spi, uint8_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val & 0xFF; #else @@ -848,12 +846,10 @@ void spiWriteWord(spi_t *spi, uint16_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); SPI_MUTEX_UNLOCK(); } @@ -874,12 +870,10 @@ uint16_t spiTransferWord(spi_t *spi, uint16_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val; #else @@ -911,12 +905,10 @@ void spiWriteLong(spi_t *spi, uint32_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); SPI_MUTEX_UNLOCK(); } @@ -937,12 +929,10 @@ uint32_t spiTransferLong(spi_t *spi, uint32_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val; #else @@ -985,19 +975,17 @@ static void __spiTransferBytes(spi_t *spi, const uint8_t *data, uint8_t *out, ui #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->data_buf[i].val = wordsBuf[i]; //copy buffer to spi fifo #else - spi->dev->data_buf[i] = wordsBuf[i]; //copy buffer to spi fifo + spi->dev->data_buf[i] = wordsBuf[i]; //copy buffer to spi fifo #endif } #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); if (out) { for (i = 0; i < words; i++) { @@ -1047,21 +1035,21 @@ void spiTransferBits(spi_t *spi, uint32_t data, uint32_t *out, uint8_t bits) { * Manual Lock Management * */ -#define MSB_32_SET(var, val) \ - { \ - uint8_t *d = (uint8_t *)&(val); \ +#define MSB_32_SET(var, val) \ + { \ + uint8_t *d = (uint8_t *)&(val); \ (var) = d[3] | (d[2] << 8) | (d[1] << 16) | (d[0] << 24); \ } -#define MSB_24_SET(var, val) \ - { \ - uint8_t *d = (uint8_t *)&(val); \ +#define MSB_24_SET(var, val) \ + { \ + uint8_t *d = (uint8_t *)&(val); \ (var) = d[2] | (d[1] << 8) | (d[0] << 16); \ } #define MSB_16_SET(var, val) \ - { (var) = (((val)&0xFF00) >> 8) | (((val)&0xFF) << 8); } -#define MSB_PIX_SET(var, val) \ - { \ - uint8_t *d = (uint8_t *)&(val); \ + { (var) = (((val) & 0xFF00) >> 8) | (((val) & 0xFF) << 8); } +#define MSB_PIX_SET(var, val) \ + { \ + uint8_t *d = (uint8_t *)&(val); \ (var) = d[1] | (d[0] << 8) | (d[3] << 16) | (d[2] << 24); \ } @@ -1073,7 +1061,8 @@ void spiTransaction(spi_t *spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bit spi->dev->clock.val = clockDiv; switch (dataMode) { case SPI_MODE1: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 0; #else spi->dev->pin.ck_idle_edge = 0; @@ -1081,7 +1070,8 @@ void spiTransaction(spi_t *spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bit spi->dev->user.ck_out_edge = 1; break; case SPI_MODE2: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 1; #else spi->dev->pin.ck_idle_edge = 1; @@ -1089,7 +1079,8 @@ void spiTransaction(spi_t *spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bit spi->dev->user.ck_out_edge = 1; break; case SPI_MODE3: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 1; #else spi->dev->pin.ck_idle_edge = 1; @@ -1098,7 +1089,8 @@ void spiTransaction(spi_t *spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bit break; case SPI_MODE0: default: -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 \ + || CONFIG_IDF_TARGET_ESP32H2 spi->dev->misc.ck_idle_edge = 0; #else spi->dev->pin.ck_idle_edge = 0; @@ -1116,8 +1108,7 @@ void spiTransaction(spi_t *spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bit #if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 // Sync new config with hardware, fixes https://github.com/espressif/arduino-esp32/issues/9221 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif } @@ -1150,12 +1141,10 @@ void ARDUINO_ISR_ATTR spiWriteByteNL(spi_t *spi, uint8_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); } uint8_t spiTransferByteNL(spi_t *spi, uint8_t data) { @@ -1171,12 +1160,10 @@ uint8_t spiTransferByteNL(spi_t *spi, uint8_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val & 0xFF; #else @@ -1203,12 +1190,10 @@ void ARDUINO_ISR_ATTR spiWriteShortNL(spi_t *spi, uint16_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); } uint16_t spiTransferShortNL(spi_t *spi, uint16_t data) { @@ -1227,12 +1212,10 @@ uint16_t spiTransferShortNL(spi_t *spi, uint16_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val & 0xFFFF; #else @@ -1262,12 +1245,10 @@ void ARDUINO_ISR_ATTR spiWriteLongNL(spi_t *spi, uint32_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); } uint32_t spiTransferLongNL(spi_t *spi, uint32_t data) { @@ -1286,12 +1267,10 @@ uint32_t spiTransferLongNL(spi_t *spi, uint32_t data) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val; #else @@ -1331,12 +1310,10 @@ void spiWriteNL(spi_t *spi, const void *data_in, uint32_t len) { } #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); data += c_longs; longs -= c_longs; @@ -1381,12 +1358,10 @@ void spiTransferBytesNL(spi_t *spi, const void *data_in, uint8_t *data_out, uint } #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); if (result) { if (c_len & 3) { for (size_t i = 0; i < (c_longs - 1); i++) { @@ -1457,12 +1432,10 @@ void spiTransferBitsNL(spi_t *spi, uint32_t data, uint32_t *out, uint8_t bits) { #endif #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 data = spi->dev->data_buf[0].val; #else @@ -1533,12 +1506,10 @@ void ARDUINO_ISR_ATTR spiWritePixelsNL(spi_t *spi, const void *data_in, uint32_t } #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 spi->dev->cmd.update = 1; - while (spi->dev->cmd.update) - ; + while (spi->dev->cmd.update); #endif spi->dev->cmd.usr = 1; - while (spi->dev->cmd.usr) - ; + while (spi->dev->cmd.usr); data += c_longs; longs -= c_longs; @@ -1546,8 +1517,6 @@ void ARDUINO_ISR_ATTR spiWritePixelsNL(spi_t *spi, const void *data_in, uint32_t } } - - /* * Clock Calculators * @@ -1561,7 +1530,7 @@ typedef union { uint32_t clkcnt_n : 6; /*it is the divider of spi_clk. So spi_clk frequency is system/(spi_clkdiv_pre+1)/(spi_clkcnt_N+1)*/ #if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 uint32_t clkdiv_pre : 4; /*it is pre-divider of spi_clk.*/ - uint32_t reserved : 9; /*reserved*/ + uint32_t reserved : 9; /*reserved*/ #else uint32_t clkdiv_pre : 13; /*it is pre-divider of spi_clk.*/ #endif @@ -1573,7 +1542,7 @@ typedef union { uint32_t spiClockDivToFrequency(uint32_t clockDiv) { uint32_t apb_freq = getApbFrequency(); - spiClk_t reg = { clockDiv }; + spiClk_t reg = {clockDiv}; return ClkRegToFreq(®); } @@ -1584,18 +1553,18 @@ uint32_t spiFrequencyToClockDiv(uint32_t freq) { return SPI_CLK_EQU_SYSCLK; } - const spiClk_t minFreqReg = { 0x7FFFF000 }; + const spiClk_t minFreqReg = {0x7FFFF000}; uint32_t minFreq = ClkRegToFreq((spiClk_t *)&minFreqReg); if (freq < minFreq) { return minFreqReg.value; } uint8_t calN = 1; - spiClk_t bestReg = { 0 }; + spiClk_t bestReg = {0}; uint32_t bestFreq = 0; while (calN <= 0x3F) { - spiClk_t reg = { 0 }; + spiClk_t reg = {0}; uint32_t calFreq; int32_t calPre; int8_t calPreVari = -2; diff --git a/cores/esp32/esp32-hal-spi.h b/cores/esp32/esp32-hal-spi.h index 2eba5ae6a..a238cada8 100644 --- a/cores/esp32/esp32-hal-spi.h +++ b/cores/esp32/esp32-hal-spi.h @@ -44,12 +44,12 @@ extern "C" { // This defines are not representing the real Divider of the ESP32 // the Defines match to an AVR Arduino on 16MHz for better compatibility -#define SPI_CLOCK_DIV2 0x00101001 //8 MHz -#define SPI_CLOCK_DIV4 0x00241001 //4 MHz -#define SPI_CLOCK_DIV8 0x004c1001 //2 MHz -#define SPI_CLOCK_DIV16 0x009c1001 //1 MHz -#define SPI_CLOCK_DIV32 0x013c1001 //500 KHz -#define SPI_CLOCK_DIV64 0x027c1001 //250 KHz +#define SPI_CLOCK_DIV2 0x00101001 //8 MHz +#define SPI_CLOCK_DIV4 0x00241001 //4 MHz +#define SPI_CLOCK_DIV8 0x004c1001 //2 MHz +#define SPI_CLOCK_DIV16 0x009c1001 //1 MHz +#define SPI_CLOCK_DIV32 0x013c1001 //500 KHz +#define SPI_CLOCK_DIV64 0x027c1001 //250 KHz #define SPI_CLOCK_DIV128 0x04fc1001 //125 KHz #define SPI_MODE0 0 @@ -57,96 +57,95 @@ extern "C" { #define SPI_MODE2 2 #define SPI_MODE3 3 -#define SPI_SS0 0 -#define SPI_SS1 1 -#define SPI_SS2 2 +#define SPI_SS0 0 +#define SPI_SS1 1 +#define SPI_SS2 2 #define SPI_SS_MASK_ALL 0x7 #define SPI_LSBFIRST 0 #define SPI_MSBFIRST 1 - struct spi_struct_t; - typedef struct spi_struct_t spi_t; +struct spi_struct_t; +typedef struct spi_struct_t spi_t; - spi_t *spiStartBus(uint8_t spi_num, uint32_t clockDiv, uint8_t dataMode, uint8_t bitOrder); - void spiStopBus(spi_t *spi); +spi_t *spiStartBus(uint8_t spi_num, uint32_t clockDiv, uint8_t dataMode, uint8_t bitOrder); +void spiStopBus(spi_t *spi); - //Attach/Detach Signal Pins - bool spiAttachSCK(spi_t *spi, int8_t sck); - bool spiAttachMISO(spi_t *spi, int8_t miso); - bool spiAttachMOSI(spi_t *spi, int8_t mosi); - bool spiDetachSCK(spi_t *spi); - bool spiDetachMISO(spi_t *spi); - bool spiDetachMOSI(spi_t *spi); +//Attach/Detach Signal Pins +bool spiAttachSCK(spi_t *spi, int8_t sck); +bool spiAttachMISO(spi_t *spi, int8_t miso); +bool spiAttachMOSI(spi_t *spi, int8_t mosi); +bool spiDetachSCK(spi_t *spi); +bool spiDetachMISO(spi_t *spi); +bool spiDetachMOSI(spi_t *spi); - //Attach/Detach SS pin to SPI_SSx signal - bool spiAttachSS(spi_t *spi, uint8_t ss_num, int8_t ss); - bool spiDetachSS(spi_t *spi); +//Attach/Detach SS pin to SPI_SSx signal +bool spiAttachSS(spi_t *spi, uint8_t ss_num, int8_t ss); +bool spiDetachSS(spi_t *spi); - //Enable/Disable SPI_SSx pins - void spiEnableSSPins(spi_t *spi, uint8_t ss_mask); - void spiDisableSSPins(spi_t *spi, uint8_t ss_mask); +//Enable/Disable SPI_SSx pins +void spiEnableSSPins(spi_t *spi, uint8_t ss_mask); +void spiDisableSSPins(spi_t *spi, uint8_t ss_mask); - //Enable/Disable hardware control of SPI_SSx pins - void spiSSEnable(spi_t *spi); - void spiSSDisable(spi_t *spi); +//Enable/Disable hardware control of SPI_SSx pins +void spiSSEnable(spi_t *spi); +void spiSSDisable(spi_t *spi); - //Activate enabled SPI_SSx pins - void spiSSSet(spi_t *spi); - //Deactivate enabled SPI_SSx pins - void spiSSClear(spi_t *spi); +//Activate enabled SPI_SSx pins +void spiSSSet(spi_t *spi); +//Deactivate enabled SPI_SSx pins +void spiSSClear(spi_t *spi); - void spiWaitReady(spi_t *spi); +void spiWaitReady(spi_t *spi); - uint32_t spiGetClockDiv(spi_t *spi); - uint8_t spiGetDataMode(spi_t *spi); - uint8_t spiGetBitOrder(spi_t *spi); +uint32_t spiGetClockDiv(spi_t *spi); +uint8_t spiGetDataMode(spi_t *spi); +uint8_t spiGetBitOrder(spi_t *spi); - - /* +/* * Non transaction based lock methods (each locks and unlocks when called) * */ - void spiSetClockDiv(spi_t *spi, uint32_t clockDiv); - void spiSetDataMode(spi_t *spi, uint8_t dataMode); - void spiSetBitOrder(spi_t *spi, uint8_t bitOrder); +void spiSetClockDiv(spi_t *spi, uint32_t clockDiv); +void spiSetDataMode(spi_t *spi, uint8_t dataMode); +void spiSetBitOrder(spi_t *spi, uint8_t bitOrder); - void spiWrite(spi_t *spi, const uint32_t *data, uint8_t len); - void spiWriteByte(spi_t *spi, uint8_t data); - void spiWriteWord(spi_t *spi, uint16_t data); - void spiWriteLong(spi_t *spi, uint32_t data); +void spiWrite(spi_t *spi, const uint32_t *data, uint8_t len); +void spiWriteByte(spi_t *spi, uint8_t data); +void spiWriteWord(spi_t *spi, uint16_t data); +void spiWriteLong(spi_t *spi, uint32_t data); - void spiTransfer(spi_t *spi, uint32_t *out, uint8_t len); - uint8_t spiTransferByte(spi_t *spi, uint8_t data); - uint16_t spiTransferWord(spi_t *spi, uint16_t data); - uint32_t spiTransferLong(spi_t *spi, uint32_t data); - void spiTransferBytes(spi_t *spi, const uint8_t *data, uint8_t *out, uint32_t size); - void spiTransferBits(spi_t *spi, uint32_t data, uint32_t *out, uint8_t bits); +void spiTransfer(spi_t *spi, uint32_t *out, uint8_t len); +uint8_t spiTransferByte(spi_t *spi, uint8_t data); +uint16_t spiTransferWord(spi_t *spi, uint16_t data); +uint32_t spiTransferLong(spi_t *spi, uint32_t data); +void spiTransferBytes(spi_t *spi, const uint8_t *data, uint8_t *out, uint32_t size); +void spiTransferBits(spi_t *spi, uint32_t data, uint32_t *out, uint8_t bits); - /* +/* * New (EXPERIMENTAL) Transaction lock based API (lock once until endTransaction) * */ - void spiTransaction(spi_t *spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bitOrder); - void spiSimpleTransaction(spi_t *spi); - void spiEndTransaction(spi_t *spi); +void spiTransaction(spi_t *spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bitOrder); +void spiSimpleTransaction(spi_t *spi); +void spiEndTransaction(spi_t *spi); - void spiWriteNL(spi_t *spi, const void *data_in, uint32_t len); - void spiWriteByteNL(spi_t *spi, uint8_t data); - void spiWriteShortNL(spi_t *spi, uint16_t data); - void spiWriteLongNL(spi_t *spi, uint32_t data); - void spiWritePixelsNL(spi_t *spi, const void *data_in, uint32_t len); +void spiWriteNL(spi_t *spi, const void *data_in, uint32_t len); +void spiWriteByteNL(spi_t *spi, uint8_t data); +void spiWriteShortNL(spi_t *spi, uint16_t data); +void spiWriteLongNL(spi_t *spi, uint32_t data); +void spiWritePixelsNL(spi_t *spi, const void *data_in, uint32_t len); #define spiTransferNL(spi, data, len) spiTransferBytesNL(spi, data, data, len) - uint8_t spiTransferByteNL(spi_t *spi, uint8_t data); - uint16_t spiTransferShortNL(spi_t *spi, uint16_t data); - uint32_t spiTransferLongNL(spi_t *spi, uint32_t data); - void spiTransferBytesNL(spi_t *spi, const void *data_in, uint8_t *data_out, uint32_t len); - void spiTransferBitsNL(spi_t *spi, uint32_t data_in, uint32_t *data_out, uint8_t bits); +uint8_t spiTransferByteNL(spi_t *spi, uint8_t data); +uint16_t spiTransferShortNL(spi_t *spi, uint16_t data); +uint32_t spiTransferLongNL(spi_t *spi, uint32_t data); +void spiTransferBytesNL(spi_t *spi, const void *data_in, uint8_t *data_out, uint32_t len); +void spiTransferBitsNL(spi_t *spi, uint32_t data_in, uint32_t *data_out, uint8_t bits); - /* +/* * Helper functions to translate frequency to clock divider and back * */ - uint32_t spiFrequencyToClockDiv(uint32_t freq); - uint32_t spiClockDivToFrequency(uint32_t freq); +uint32_t spiFrequencyToClockDiv(uint32_t freq); +uint32_t spiClockDivToFrequency(uint32_t freq); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-time.c b/cores/esp32/esp32-hal-time.c index 6f8f93224..23bd3bf9e 100644 --- a/cores/esp32/esp32-hal-time.c +++ b/cores/esp32/esp32-hal-time.c @@ -18,9 +18,9 @@ #include "esp_netif.h" static void setTimeZone(long offset, int daylight) { - char cst[17] = { 0 }; + char cst[17] = {0}; char cdt[17] = "DST"; - char tz[33] = { 0 }; + char tz[33] = {0}; if (offset % 3600) { sprintf(cst, "UTC%ld:%02u:%02u", offset / 3600, abs((offset % 3600) / 60), abs(offset % 60)); @@ -44,16 +44,16 @@ static void setTimeZone(long offset, int daylight) { * configTime * Source: https://github.com/esp8266/Arduino/blob/master/cores/esp8266/time.c * */ -void configTime(long gmtOffset_sec, int daylightOffset_sec, const char* server1, const char* server2, const char* server3) { +void configTime(long gmtOffset_sec, int daylightOffset_sec, const char *server1, const char *server2, const char *server3) { //tcpip_adapter_init(); // Should not hurt anything if already inited esp_netif_init(); if (sntp_enabled()) { sntp_stop(); } sntp_setoperatingmode(SNTP_OPMODE_POLL); - sntp_setservername(0, (char*)server1); - sntp_setservername(1, (char*)server2); - sntp_setservername(2, (char*)server3); + sntp_setservername(0, (char *)server1); + sntp_setservername(1, (char *)server2); + sntp_setservername(2, (char *)server3); sntp_init(); setTimeZone(-gmtOffset_sec, daylightOffset_sec); } @@ -62,22 +62,22 @@ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char* server1, * configTzTime * sntp setup using TZ environment variable * */ -void configTzTime(const char* tz, const char* server1, const char* server2, const char* server3) { +void configTzTime(const char *tz, const char *server1, const char *server2, const char *server3) { //tcpip_adapter_init(); // Should not hurt anything if already inited esp_netif_init(); if (sntp_enabled()) { sntp_stop(); } sntp_setoperatingmode(SNTP_OPMODE_POLL); - sntp_setservername(0, (char*)server1); - sntp_setservername(1, (char*)server2); - sntp_setservername(2, (char*)server3); + sntp_setservername(0, (char *)server1); + sntp_setservername(1, (char *)server2); + sntp_setservername(2, (char *)server3); sntp_init(); setenv("TZ", tz, 1); tzset(); } -bool getLocalTime(struct tm* info, uint32_t ms) { +bool getLocalTime(struct tm *info, uint32_t ms) { uint32_t start = millis(); time_t now; while ((millis() - start) <= ms) { diff --git a/cores/esp32/esp32-hal-timer.c b/cores/esp32/esp32-hal-timer.c index b2ea5f8c0..56f58529e 100644 --- a/cores/esp32/esp32-hal-timer.c +++ b/cores/esp32/esp32-hal-timer.c @@ -97,7 +97,9 @@ hw_timer_t *timerBegin(uint32_t frequency) { divider = counter_src_hz / frequency; if ((divider >= 2) && (divider <= 65536)) { break; - } else divider = 0; + } else { + divider = 0; + } } if (divider == 0) { diff --git a/cores/esp32/esp32-hal-timer.h b/cores/esp32/esp32-hal-timer.h index 015716853..355185347 100644 --- a/cores/esp32/esp32-hal-timer.h +++ b/cores/esp32/esp32-hal-timer.h @@ -29,29 +29,29 @@ extern "C" { #endif - struct timer_struct_t; - typedef struct timer_struct_t hw_timer_t; +struct timer_struct_t; +typedef struct timer_struct_t hw_timer_t; - hw_timer_t* timerBegin(uint32_t frequency); - void timerEnd(hw_timer_t* timer); +hw_timer_t *timerBegin(uint32_t frequency); +void timerEnd(hw_timer_t *timer); - void timerStart(hw_timer_t* timer); - void timerStop(hw_timer_t* timer); - void timerRestart(hw_timer_t* timer); - void timerWrite(hw_timer_t* timer, uint64_t val); +void timerStart(hw_timer_t *timer); +void timerStop(hw_timer_t *timer); +void timerRestart(hw_timer_t *timer); +void timerWrite(hw_timer_t *timer, uint64_t val); - uint64_t timerRead(hw_timer_t* timer); - uint64_t timerReadMicros(hw_timer_t* timer); - uint64_t timerReadMilis(hw_timer_t* timer); - double timerReadSeconds(hw_timer_t* timer); +uint64_t timerRead(hw_timer_t *timer); +uint64_t timerReadMicros(hw_timer_t *timer); +uint64_t timerReadMilis(hw_timer_t *timer); +double timerReadSeconds(hw_timer_t *timer); - uint32_t timerGetFrequency(hw_timer_t* timer); +uint32_t timerGetFrequency(hw_timer_t *timer); - void timerAttachInterrupt(hw_timer_t* timer, void (*userFunc)(void)); - void timerAttachInterruptArg(hw_timer_t* timer, void (*userFunc)(void*), void* arg); - void timerDetachInterrupt(hw_timer_t* timer); +void timerAttachInterrupt(hw_timer_t *timer, void (*userFunc)(void)); +void timerAttachInterruptArg(hw_timer_t *timer, void (*userFunc)(void *), void *arg); +void timerDetachInterrupt(hw_timer_t *timer); - void timerAlarm(hw_timer_t* timer, uint64_t alarm_value, bool autoreload, uint64_t reload_count); +void timerAlarm(hw_timer_t *timer, uint64_t alarm_value, bool autoreload, uint64_t reload_count); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-tinyusb.c b/cores/esp32/esp32-hal-tinyusb.c index f0e9644da..d3b55bf90 100644 --- a/cores/esp32/esp32-hal-tinyusb.c +++ b/cores/esp32/esp32-hal-tinyusb.c @@ -102,9 +102,7 @@ static void configure_pins(usb_hal_context_t *usb) { } esp_err_t tinyusb_driver_install(const tinyusb_config_t *config) { - usb_hal_context_t hal = { - .use_external_phy = config->external_phy - }; + usb_hal_context_t hal = {.use_external_phy = config->external_phy}; usb_hal_init(&hal); configure_pins(&hal); if (!tusb_init()) { @@ -114,15 +112,6 @@ esp_err_t tinyusb_driver_install(const tinyusb_config_t *config) { return ESP_OK; } - - - - - - - - - typedef char tusb_str_t[127]; static bool WEBUSB_ENABLED = false; @@ -172,7 +161,6 @@ static char *tinyusb_string_descriptor[MAX_STRING_DESCRIPTORS] = { USB_DEVICE_SERIAL, // 3: Serials, should use chip ID }; - /* Microsoft OS 2.0 registry property descriptor Per MS requirements https://msdn.microsoft.com/en-us/library/windows/hardware/hh450799(v=vs.85).aspx device should create DeviceInterfaceGUIDs. It can be done by driver and @@ -200,25 +188,23 @@ static uint8_t const tinyusb_ms_os_20_descriptor[] = { U16_TO_U8S_LE(0x0008), U16_TO_U8S_LE(MS_OS_20_SUBSET_HEADER_FUNCTION), 0, 0, U16_TO_U8S_LE(MS_OS_20_DESC_LEN - 0x0A - 0x08), // MS OS 2.0 Compatible ID descriptor: length, type, compatible ID, sub compatible ID - U16_TO_U8S_LE(0x0014), U16_TO_U8S_LE(MS_OS_20_FEATURE_COMPATBLE_ID), 'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // sub-compatible + U16_TO_U8S_LE(0x0014), U16_TO_U8S_LE(MS_OS_20_FEATURE_COMPATBLE_ID), 'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, // sub-compatible // MS OS 2.0 Registry property descriptor: length, type - U16_TO_U8S_LE(MS_OS_20_DESC_LEN - 0x0A - 0x08 - 0x08 - 0x14), U16_TO_U8S_LE(MS_OS_20_FEATURE_REG_PROPERTY), - U16_TO_U8S_LE(0x0007), U16_TO_U8S_LE(0x002A), // wPropertyDataType, wPropertyNameLength and PropertyName "DeviceInterfaceGUIDs\0" in UTF-16 - 'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, 'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, - 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, 'G', 0x00, 'U', 0x00, 'I', 0x00, 'D', 0x00, 's', 0x00, 0x00, 0x00, + U16_TO_U8S_LE(MS_OS_20_DESC_LEN - 0x0A - 0x08 - 0x08 - 0x14), U16_TO_U8S_LE(MS_OS_20_FEATURE_REG_PROPERTY), U16_TO_U8S_LE(0x0007), + U16_TO_U8S_LE(0x002A), // wPropertyDataType, wPropertyNameLength and PropertyName "DeviceInterfaceGUIDs\0" in UTF-16 + 'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, 'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', + 0x00, 'G', 0x00, 'U', 0x00, 'I', 0x00, 'D', 0x00, 's', 0x00, 0x00, 0x00, U16_TO_U8S_LE(0x0050), // wPropertyDataLength //bPropertyData: “{975F44D9-0D08-43FD-8B3E-127CA8AFFF9D}”. - '{', 0x00, '9', 0x00, '7', 0x00, '5', 0x00, 'F', 0x00, '4', 0x00, '4', 0x00, 'D', 0x00, '9', 0x00, '-', 0x00, - '0', 0x00, 'D', 0x00, '0', 0x00, '8', 0x00, '-', 0x00, '4', 0x00, '3', 0x00, 'F', 0x00, 'D', 0x00, '-', 0x00, - '8', 0x00, 'B', 0x00, '3', 0x00, 'E', 0x00, '-', 0x00, '1', 0x00, '2', 0x00, '7', 0x00, 'C', 0x00, 'A', 0x00, - '8', 0x00, 'A', 0x00, 'F', 0x00, 'F', 0x00, 'F', 0x00, '9', 0x00, 'D', 0x00, '}', 0x00, 0x00, 0x00, 0x00, 0x00 + '{', 0x00, '9', 0x00, '7', 0x00, '5', 0x00, 'F', 0x00, '4', 0x00, '4', 0x00, 'D', 0x00, '9', 0x00, '-', 0x00, '0', 0x00, 'D', 0x00, '0', 0x00, '8', 0x00, '-', + 0x00, '4', 0x00, '3', 0x00, 'F', 0x00, 'D', 0x00, '-', 0x00, '8', 0x00, 'B', 0x00, '3', 0x00, 'E', 0x00, '-', 0x00, '1', 0x00, '2', 0x00, '7', 0x00, 'C', + 0x00, 'A', 0x00, '8', 0x00, 'A', 0x00, 'F', 0x00, 'F', 0x00, 'F', 0x00, '9', 0x00, 'D', 0x00, '}', 0x00, 0x00, 0x00, 0x00, 0x00 }; TU_VERIFY_STATIC(sizeof(tinyusb_ms_os_20_descriptor) == MS_OS_20_DESC_LEN, "Incorrect size"); - /* * BOS Descriptor (required for webUSB) * */ @@ -272,7 +258,7 @@ static uint8_t *tinyusb_config_descriptor = NULL; * */ typedef union { struct { - uint32_t in : 16; + uint32_t in : 16; uint32_t out : 16; }; uint32_t val; @@ -280,7 +266,6 @@ typedef union { static tinyusb_endpoints_usage_t tinyusb_endpoints; - /* * TinyUSB Callbacks * */ @@ -407,7 +392,6 @@ __attribute__((weak)) int32_t tud_msc_scsi_cb(uint8_t lun, uint8_t const scsi_cm } #endif - /* * Private API * */ @@ -651,10 +635,7 @@ static void tinyusb_apply_device_config(tinyusb_device_config_t *config) { } // Windows 10 will not recognize the CDC device if WebUSB is enabled and USB Class is not 2 (CDC) - if ( - (tinyusb_loaded_interfaces_mask & BIT(USB_INTERFACE_CDC)) - && config->webusb_enabled - && (config->usb_class != TUSB_CLASS_CDC)) { + if ((tinyusb_loaded_interfaces_mask & BIT(USB_INTERFACE_CDC)) && config->webusb_enabled && (config->usb_class != TUSB_CLASS_CDC)) { config->usb_class = TUSB_CLASS_CDC; config->usb_protocol = 0x00; } @@ -676,14 +657,16 @@ static void tinyusb_apply_device_config(tinyusb_device_config_t *config) { // This top level thread processes all usb events and invokes callbacks static void usb_device_task(void *param) { (void)param; - while (1) tud_task(); // RTOS forever loop + while (1) { + tud_task(); // RTOS forever loop + } } /* * PUBLIC API * */ #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR -const char *tinyusb_interface_names[USB_INTERFACE_MAX] = { "MSC", "DFU", "HID", "VENDOR", "CDC", "MIDI", "CUSTOM" }; +const char *tinyusb_interface_names[USB_INTERFACE_MAX] = {"MSC", "DFU", "HID", "VENDOR", "CDC", "MIDI", "CUSTOM"}; #endif static bool tinyusb_is_initialized = false; diff --git a/cores/esp32/esp32-hal-tinyusb.h b/cores/esp32/esp32-hal-tinyusb.h index de86642e7..9e9d044f8 100644 --- a/cores/esp32/esp32-hal-tinyusb.h +++ b/cores/esp32/esp32-hal-tinyusb.h @@ -28,81 +28,71 @@ extern "C" { #include "tusb_option.h" #include "tusb_config.h" -#define USB_ESPRESSIF_VID 0x303A +#define USB_ESPRESSIF_VID 0x303A #define USB_STRING_DESCRIPTOR_ARRAY_SIZE 10 - typedef struct { - uint16_t vid; - uint16_t pid; - const char *product_name; - const char *manufacturer_name; - const char *serial_number; - uint16_t fw_version; +typedef struct { + uint16_t vid; + uint16_t pid; + const char *product_name; + const char *manufacturer_name; + const char *serial_number; + uint16_t fw_version; - uint16_t usb_version; - uint8_t usb_class; - uint8_t usb_subclass; - uint8_t usb_protocol; - uint8_t usb_attributes; - uint16_t usb_power_ma; + uint16_t usb_version; + uint8_t usb_class; + uint8_t usb_subclass; + uint8_t usb_protocol; + uint8_t usb_attributes; + uint16_t usb_power_ma; - bool webusb_enabled; - const char *webusb_url; - } tinyusb_device_config_t; + bool webusb_enabled; + const char *webusb_url; +} tinyusb_device_config_t; -#define TINYUSB_CONFIG_DEFAULT() \ - { \ - .vid = USB_ESPRESSIF_VID, \ - .pid = 0x0002, \ - .product_name = CONFIG_TINYUSB_DESC_PRODUCT_STRING, \ - .manufacturer_name = CONFIG_TINYUSB_DESC_MANUFACTURER_STRING, \ - .serial_number = CONFIG_TINYUSB_DESC_SERIAL_STRING, \ - .fw_version = CONFIG_TINYUSB_DESC_BCDDEVICE, \ - .usb_version = 0x0200, \ - .usb_class = TUSB_CLASS_MISC, \ - .usb_subclass = MISC_SUBCLASS_COMMON, \ - .usb_protocol = MISC_PROTOCOL_IAD, \ - .usb_attributes = TUSB_DESC_CONFIG_ATT_SELF_POWERED, \ - .usb_power_ma = 500, \ - .webusb_enabled = false, \ - .webusb_url = "espressif.github.io/arduino-esp32/webusb.html" \ +#define TINYUSB_CONFIG_DEFAULT() \ + { \ + .vid = USB_ESPRESSIF_VID, .pid = 0x0002, .product_name = CONFIG_TINYUSB_DESC_PRODUCT_STRING, .manufacturer_name = CONFIG_TINYUSB_DESC_MANUFACTURER_STRING, \ + .serial_number = CONFIG_TINYUSB_DESC_SERIAL_STRING, .fw_version = CONFIG_TINYUSB_DESC_BCDDEVICE, .usb_version = 0x0200, .usb_class = TUSB_CLASS_MISC, \ + .usb_subclass = MISC_SUBCLASS_COMMON, .usb_protocol = MISC_PROTOCOL_IAD, .usb_attributes = TUSB_DESC_CONFIG_ATT_SELF_POWERED, .usb_power_ma = 500, \ + .webusb_enabled = false, .webusb_url = "espressif.github.io/arduino-esp32/webusb.html" \ } - esp_err_t tinyusb_init(tinyusb_device_config_t *config); +esp_err_t tinyusb_init(tinyusb_device_config_t *config); - /* +/* * USB Persistence API * */ - typedef enum { - RESTART_NO_PERSIST, - RESTART_PERSIST, - RESTART_BOOTLOADER, - RESTART_BOOTLOADER_DFU, - RESTART_TYPE_MAX - } restart_type_t; +typedef enum { + RESTART_NO_PERSIST, + RESTART_PERSIST, + RESTART_BOOTLOADER, + RESTART_BOOTLOADER_DFU, + RESTART_TYPE_MAX +} restart_type_t; - void usb_persist_restart(restart_type_t mode); +void usb_persist_restart(restart_type_t mode); - // The following definitions and functions are to be used only by the drivers - typedef enum { - USB_INTERFACE_MSC, - USB_INTERFACE_DFU, - USB_INTERFACE_HID, - USB_INTERFACE_VENDOR, - USB_INTERFACE_CDC, - USB_INTERFACE_MIDI, - USB_INTERFACE_CUSTOM, - USB_INTERFACE_MAX - } tinyusb_interface_t; +// The following definitions and functions are to be used only by the drivers +typedef enum { + USB_INTERFACE_MSC, + USB_INTERFACE_DFU, + USB_INTERFACE_HID, + USB_INTERFACE_VENDOR, + USB_INTERFACE_CDC, + USB_INTERFACE_MIDI, + USB_INTERFACE_CUSTOM, + USB_INTERFACE_MAX +} tinyusb_interface_t; - typedef uint16_t (*tinyusb_descriptor_cb_t)(uint8_t *dst, uint8_t *itf); +typedef uint16_t (*tinyusb_descriptor_cb_t)(uint8_t *dst, uint8_t *itf); - esp_err_t tinyusb_enable_interface(tinyusb_interface_t interface, uint16_t descriptor_len, tinyusb_descriptor_cb_t cb); - esp_err_t tinyusb_enable_interface2(tinyusb_interface_t interface, uint16_t descriptor_len, tinyusb_descriptor_cb_t cb, bool reserve_endpoints); - uint8_t tinyusb_add_string_descriptor(const char *str); - uint8_t tinyusb_get_free_duplex_endpoint(void); - uint8_t tinyusb_get_free_in_endpoint(void); - uint8_t tinyusb_get_free_out_endpoint(void); +esp_err_t tinyusb_enable_interface(tinyusb_interface_t interface, uint16_t descriptor_len, tinyusb_descriptor_cb_t cb); +esp_err_t tinyusb_enable_interface2(tinyusb_interface_t interface, uint16_t descriptor_len, tinyusb_descriptor_cb_t cb, bool reserve_endpoints); +uint8_t tinyusb_add_string_descriptor(const char *str); +uint8_t tinyusb_get_free_duplex_endpoint(void); +uint8_t tinyusb_get_free_in_endpoint(void); +uint8_t tinyusb_get_free_out_endpoint(void); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-touch.c b/cores/esp32/esp32-hal-touch.c index 1052ae6d7..d32b34d01 100644 --- a/cores/esp32/esp32-hal-touch.c +++ b/cores/esp32/esp32-hal-touch.c @@ -48,7 +48,7 @@ static TouchInterruptHandle_t __touchInterruptHandlers[SOC_TOUCH_SENSOR_NUM] = { static uint8_t used_pads = 0; static bool initialized = false; -static bool channels_initialized[SOC_TOUCH_SENSOR_NUM] = { false }; +static bool channels_initialized[SOC_TOUCH_SENSOR_NUM] = {false}; static void ARDUINO_ISR_ATTR __touchISR(void *arg) { #if SOC_TOUCH_VERSION_1 // ESP32 @@ -90,8 +90,6 @@ static void ARDUINO_ISR_ATTR __touchISR(void *arg) { #endif } - - static void __touchSetCycles(uint16_t measure, uint16_t sleep) { __touchSleepCycles = sleep; __touchMeasureCycles = measure; @@ -268,7 +266,6 @@ static void __touchDettachInterrupt(uint8_t pin) { __touchConfigInterrupt(pin, NULL, NULL, 0, false); // userFunc as NULL acts as detaching } - /* External Public Touch API Functions */ diff --git a/cores/esp32/esp32-hal-touch.h b/cores/esp32/esp32-hal-touch.h index 627e74b57..db33ce3bc 100644 --- a/cores/esp32/esp32-hal-touch.h +++ b/cores/esp32/esp32-hal-touch.h @@ -34,49 +34,48 @@ extern "C" { #endif #if SOC_TOUCH_VERSION_1 // ESP32 - typedef uint16_t touch_value_t; +typedef uint16_t touch_value_t; #elif SOC_TOUCH_VERSION_2 // ESP32S2 ESP32S3 typedef uint32_t touch_value_t; #endif - /* +/* * Set cycles that measurement operation takes * The result from touchRead, threshold and detection * accuracy depend on these values. Defaults are * 0x1000 for measure and 0x1000 for sleep. * With default values touchRead takes 0.5ms * */ - void touchSetCycles(uint16_t measure, uint16_t sleep); +void touchSetCycles(uint16_t measure, uint16_t sleep); - /* +/* * Read touch pad (for ESP32 values close to 0 mean touch detected / * for ESP32-S2/S3 higher values mean touch detected) * You can use this method to chose a good threshold value * to use as value for touchAttachInterrupt * */ - touch_value_t touchRead(uint8_t pin); +touch_value_t touchRead(uint8_t pin); - /* +/* * Set function to be called if touch pad value falls (ESP32) * below the given threshold / rises (ESP32-S2/S3) by given increment (threshold). * Use touchRead to determine a proper threshold between touched and untouched state * */ - void touchAttachInterrupt(uint8_t pin, void (*userFunc)(void), touch_value_t threshold); - void touchAttachInterruptArg(uint8_t pin, void (*userFunc)(void *), void *arg, touch_value_t threshold); - void touchDetachInterrupt(uint8_t pin); +void touchAttachInterrupt(uint8_t pin, void (*userFunc)(void), touch_value_t threshold); +void touchAttachInterruptArg(uint8_t pin, void (*userFunc)(void *), void *arg, touch_value_t threshold); +void touchDetachInterrupt(uint8_t pin); - /* +/* * Specific functions to ESP32 * Tells the driver if it shall activate the ISR if the sensor is Lower or Higher than the Threshold * Default if Lower. **/ #if SOC_TOUCH_VERSION_1 // Only for ESP32 SoC - void touchInterruptSetThresholdDirection(bool mustbeLower); +void touchInterruptSetThresholdDirection(bool mustbeLower); #endif - - /* +/* * Specific functions to ESP32-S2 and ESP32-S3 * Returns true when the latest ISR status for the Touchpad is that it is touched (Active) * and false when the Touchpad is untoouched (Inactive) @@ -85,14 +84,14 @@ typedef uint32_t touch_value_t; **/ #if SOC_TOUCH_VERSION_2 // Only for ESP32S2 and ESP32S3 - // returns true if touch pad has been and continues pressed and false otherwise - bool touchInterruptGetLastStatus(uint8_t pin); +// returns true if touch pad has been and continues pressed and false otherwise +bool touchInterruptGetLastStatus(uint8_t pin); #endif - /* +/* * Setup touch pad wake up from deep sleep with given threshold. **/ - void touchSleepWakeUpEnable(uint8_t pin, touch_value_t threshold); +void touchSleepWakeUpEnable(uint8_t pin, touch_value_t threshold); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index 39522fea5..91d3adea4 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -60,30 +60,32 @@ struct uart_struct_t { #define UART_MUTEX_UNLOCK() static uart_t _uart_bus_array[] = { - { 0, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0 }, + {0, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, #if SOC_UART_NUM > 1 - { 1, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0 }, + {1, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, #endif #if SOC_UART_NUM > 2 - { 2, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0 }, + {2, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, #endif }; #else #define UART_MUTEX_LOCK() \ - if (uart->lock != NULL) do { \ + if (uart->lock != NULL) \ + do { \ } while (xSemaphoreTake(uart->lock, portMAX_DELAY) != pdPASS) #define UART_MUTEX_UNLOCK() \ - if (uart->lock != NULL) xSemaphoreGive(uart->lock) + if (uart->lock != NULL) \ + xSemaphoreGive(uart->lock) static uart_t _uart_bus_array[] = { - { NULL, 0, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0 }, + {NULL, 0, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, #if SOC_UART_NUM > 1 - { NULL, 1, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0 }, + {NULL, 1, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, #endif #if SOC_UART_NUM > 2 - { NULL, 2, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0 }, + {NULL, 2, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, #endif }; @@ -97,7 +99,7 @@ static bool _uartDetachPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t return false; } // get UART information - uart_t* uart = &_uart_bus_array[uart_num]; + uart_t *uart = &_uart_bus_array[uart_num]; bool retCode = true; //log_v("detaching UART%d pins: prev,pin RX(%d,%d) TX(%d,%d) CTS(%d,%d) RTS(%d,%d)", uart_num, // uart->_rxPin, rxPin, uart->_txPin, txPin, uart->_ctsPin, ctsPin, uart->_rtsPin, rtsPin); vTaskDelay(10); @@ -148,32 +150,31 @@ static bool _uartDetachPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t } // Peripheral Manager detach callback for each specific UART PIN -static bool _uartDetachBus_RX(void* busptr) { +static bool _uartDetachBus_RX(void *busptr) { // sanity check - it should never happen assert(busptr && "_uartDetachBus_RX bus NULL pointer."); - uart_t* bus = (uart_t*)busptr; + uart_t *bus = (uart_t *)busptr; return _uartDetachPins(bus->num, bus->_rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); } -static bool _uartDetachBus_TX(void* busptr) { +static bool _uartDetachBus_TX(void *busptr) { // sanity check - it should never happen assert(busptr && "_uartDetachBus_TX bus NULL pointer."); - uart_t* bus = (uart_t*)busptr; + uart_t *bus = (uart_t *)busptr; return _uartDetachPins(bus->num, UART_PIN_NO_CHANGE, bus->_txPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); } - -static bool _uartDetachBus_CTS(void* busptr) { +static bool _uartDetachBus_CTS(void *busptr) { // sanity check - it should never happen assert(busptr && "_uartDetachBus_CTS bus NULL pointer."); - uart_t* bus = (uart_t*)busptr; + uart_t *bus = (uart_t *)busptr; return _uartDetachPins(bus->num, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, bus->_ctsPin, UART_PIN_NO_CHANGE); } -static bool _uartDetachBus_RTS(void* busptr) { +static bool _uartDetachBus_RTS(void *busptr) { // sanity check - it should never happen assert(busptr && "_uartDetachBus_RTS bus NULL pointer."); - uart_t* bus = (uart_t*)busptr; + uart_t *bus = (uart_t *)busptr; return _uartDetachPins(bus->num, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, bus->_rtsPin); } @@ -185,20 +186,23 @@ static bool _uartAttachPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t return false; } // get UART information - uart_t* uart = &_uart_bus_array[uart_num]; + uart_t *uart = &_uart_bus_array[uart_num]; //log_v("attaching UART%d pins: prev,new RX(%d,%d) TX(%d,%d) CTS(%d,%d) RTS(%d,%d)", uart_num, // uart->_rxPin, rxPin, uart->_txPin, txPin, uart->_ctsPin, ctsPin, uart->_rtsPin, rtsPin); vTaskDelay(10); - bool retCode = true; if (rxPin >= 0) { // forces a clean detaching from a previous peripheral - if (perimanGetPinBusType(rxPin) != ESP32_BUS_TYPE_INIT) perimanClearPinBus(rxPin); + if (perimanGetPinBusType(rxPin) != ESP32_BUS_TYPE_INIT) { + perimanClearPinBus(rxPin); + } // connect RX Pad bool ret = ESP_OK == uart_set_pin(uart->num, UART_PIN_NO_CHANGE, rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); if (ret) { - ret &= perimanSetPinBus(rxPin, ESP32_BUS_TYPE_UART_RX, (void*)uart, uart_num, -1); - if (ret) uart->_rxPin = rxPin; + ret &= perimanSetPinBus(rxPin, ESP32_BUS_TYPE_UART_RX, (void *)uart, uart_num, -1); + if (ret) { + uart->_rxPin = rxPin; + } } if (!ret) { log_e("UART%d failed to attach RX pin %d", uart_num, rxPin); @@ -207,12 +211,16 @@ static bool _uartAttachPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t } if (txPin >= 0) { // forces a clean detaching from a previous peripheral - if (perimanGetPinBusType(txPin) != ESP32_BUS_TYPE_INIT) perimanClearPinBus(txPin); + if (perimanGetPinBusType(txPin) != ESP32_BUS_TYPE_INIT) { + perimanClearPinBus(txPin); + } // connect TX Pad bool ret = ESP_OK == uart_set_pin(uart->num, txPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); if (ret) { - ret &= perimanSetPinBus(txPin, ESP32_BUS_TYPE_UART_TX, (void*)uart, uart_num, -1); - if (ret) uart->_txPin = txPin; + ret &= perimanSetPinBus(txPin, ESP32_BUS_TYPE_UART_TX, (void *)uart, uart_num, -1); + if (ret) { + uart->_txPin = txPin; + } } if (!ret) { log_e("UART%d failed to attach TX pin %d", uart_num, txPin); @@ -221,12 +229,16 @@ static bool _uartAttachPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t } if (ctsPin >= 0) { // forces a clean detaching from a previous peripheral - if (perimanGetPinBusType(ctsPin) != ESP32_BUS_TYPE_INIT) perimanClearPinBus(ctsPin); + if (perimanGetPinBusType(ctsPin) != ESP32_BUS_TYPE_INIT) { + perimanClearPinBus(ctsPin); + } // connect CTS Pad bool ret = ESP_OK == uart_set_pin(uart->num, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, ctsPin); if (ret) { - ret &= perimanSetPinBus(ctsPin, ESP32_BUS_TYPE_UART_CTS, (void*)uart, uart_num, -1); - if (ret) uart->_ctsPin = ctsPin; + ret &= perimanSetPinBus(ctsPin, ESP32_BUS_TYPE_UART_CTS, (void *)uart, uart_num, -1); + if (ret) { + uart->_ctsPin = ctsPin; + } } if (!ret) { log_e("UART%d failed to attach CTS pin %d", uart_num, ctsPin); @@ -235,12 +247,16 @@ static bool _uartAttachPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t } if (rtsPin >= 0) { // forces a clean detaching from a previous peripheral - if (perimanGetPinBusType(rtsPin) != ESP32_BUS_TYPE_INIT) perimanClearPinBus(rtsPin); + if (perimanGetPinBusType(rtsPin) != ESP32_BUS_TYPE_INIT) { + perimanClearPinBus(rtsPin); + } // connect RTS Pad bool ret = ESP_OK == uart_set_pin(uart->num, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, rtsPin, UART_PIN_NO_CHANGE); if (ret) { - ret &= perimanSetPinBus(rtsPin, ESP32_BUS_TYPE_UART_RTS, (void*)uart, uart_num, -1); - if (ret) uart->_rtsPin = rtsPin; + ret &= perimanSetPinBus(rtsPin, ESP32_BUS_TYPE_UART_RTS, (void *)uart, uart_num, -1); + if (ret) { + uart->_rtsPin = rtsPin; + } } if (!ret) { log_e("UART%d failed to attach RTS pin %d", uart_num, rtsPin); @@ -268,7 +284,7 @@ void uart_init_PeriMan(void) { } // Routines that take care of UART events will be in the HardwareSerial Class code -void uartGetEventQueue(uart_t* uart, QueueHandle_t* q) { +void uartGetEventQueue(uart_t *uart, QueueHandle_t *q) { // passing back NULL for the Queue pointer when UART is not initialized yet *q = NULL; if (uart == NULL) { @@ -278,7 +294,7 @@ void uartGetEventQueue(uart_t* uart, QueueHandle_t* q) { return; } -bool uartIsDriverInstalled(uart_t* uart) { +bool uartIsDriverInstalled(uart_t *uart) { if (uart == NULL) { return false; } @@ -297,7 +313,7 @@ bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, in return false; } // get UART information - uart_t* uart = &_uart_bus_array[uart_num]; + uart_t *uart = &_uart_bus_array[uart_num]; bool retCode = true; UART_MUTEX_LOCK(); @@ -345,7 +361,7 @@ bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, in } // -bool uartSetHwFlowCtrlMode(uart_t* uart, uart_hw_flowcontrol_t mode, uint8_t threshold) { +bool uartSetHwFlowCtrlMode(uart_t *uart, uart_hw_flowcontrol_t mode, uint8_t threshold) { if (uart == NULL) { return false; } @@ -358,15 +374,19 @@ bool uartSetHwFlowCtrlMode(uart_t* uart, uart_hw_flowcontrol_t mode, uint8_t thr } // This helper function will return true if a new IDF UART driver needs to be restarted and false if the current one can continue its execution -bool _testUartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t rx_buffer_size, uint16_t tx_buffer_size, bool inverted, uint8_t rxfifo_full_thrhd) { +bool _testUartBegin( + uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t rx_buffer_size, uint16_t tx_buffer_size, bool inverted, + uint8_t rxfifo_full_thrhd +) { if (uart_nr >= SOC_UART_NUM) { return false; // no new driver has to be installed } - uart_t* uart = &_uart_bus_array[uart_nr]; + uart_t *uart = &_uart_bus_array[uart_nr]; // verify if is necessary to restart the UART driver if (uart_is_driver_installed(uart_nr)) { // some parameters can't be changed unless we end the UART driver - if (uart->_rx_buffer_size != rx_buffer_size || uart->_tx_buffer_size != tx_buffer_size || uart->_inverted != inverted || uart->_rxfifo_full_thrhd != rxfifo_full_thrhd) { + if (uart->_rx_buffer_size != rx_buffer_size || uart->_tx_buffer_size != tx_buffer_size || uart->_inverted != inverted + || uart->_rxfifo_full_thrhd != rxfifo_full_thrhd) { return true; // the current IDF UART driver must be terminated and a new driver shall be installed } else { return false; // The current IDF UART driver can continue its execution @@ -376,12 +396,15 @@ bool _testUartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t } } -uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t rx_buffer_size, uint16_t tx_buffer_size, bool inverted, uint8_t rxfifo_full_thrhd) { +uart_t *uartBegin( + uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t rx_buffer_size, uint16_t tx_buffer_size, bool inverted, + uint8_t rxfifo_full_thrhd +) { if (uart_nr >= SOC_UART_NUM) { log_e("UART number is invalid, please use number from 0 to %u", SOC_UART_NUM - 1); return NULL; // no new driver was installed } - uart_t* uart = &_uart_bus_array[uart_nr]; + uart_t *uart = &_uart_bus_array[uart_nr]; log_v("UART%d baud(%ld) Mode(%x) rxPin(%d) txPin(%d)", uart_nr, baudrate, config, rxPin, txPin); #if !CONFIG_DISABLE_HAL_LOCKS @@ -397,7 +420,8 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx if (uart_is_driver_installed(uart_nr)) { log_v("UART%d Driver already installed.", uart_nr); // some parameters can't be changed unless we end the UART driver - if (uart->_rx_buffer_size != rx_buffer_size || uart->_tx_buffer_size != tx_buffer_size || uart->_inverted != inverted || uart->_rxfifo_full_thrhd != rxfifo_full_thrhd) { + if (uart->_rx_buffer_size != rx_buffer_size || uart->_tx_buffer_size != tx_buffer_size || uart->_inverted != inverted + || uart->_rxfifo_full_thrhd != rxfifo_full_thrhd) { log_v("UART%d changing buffer sizes or inverted signal or rxfifo_full_thrhd. IDF driver will be restarted", uart_nr); uartEnd(uart_nr); } else { @@ -429,8 +453,7 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx log_e("UART%d changing parity failed.", uart_nr); retCode = false; } else { - log_v("UART%d changed parity to %s", uart_nr, parity == 0 ? "NONE" : parity == 2 ? "EVEN" - : "ODD"); + log_v("UART%d changed parity to %s", uart_nr, parity == 0 ? "NONE" : parity == 2 ? "EVEN" : "ODD"); } } if (retCode && (uart->_config & 0xc30) >> 4 != stop_bits) { @@ -441,7 +464,9 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx log_v("UART%d changed stop bits to %d", uart_nr, stop_bits == 3 ? 2 : 1); } } - if (retCode) uart->_config = config; + if (retCode) { + uart->_config = config; + } if (retCode && rxPin > 0 && uart->_rxPin != rxPin) { retCode &= _uartDetachPins(uart_nr, uart->_rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); retCode &= _uartAttachPins(uart_nr, rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); @@ -484,7 +509,9 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx UART_MUTEX_LOCK(); bool retCode = ESP_OK == uart_driver_install(uart_nr, rx_buffer_size, tx_buffer_size, 20, &(uart->uart_event_queue), 0); - if (retCode) retCode &= ESP_OK == uart_param_config(uart_nr, &uart_config); + if (retCode) { + retCode &= ESP_OK == uart_param_config(uart_nr, &uart_config); + } // Is it right or the idea is to swap rx and tx pins? if (retCode && inverted) { @@ -505,7 +532,9 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx UART_MUTEX_UNLOCK(); // uartSetPins detaches previous pins if new ones are used over a previous begin() - if (retCode) retCode &= uartSetPins(uart_nr, rxPin, txPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); + if (retCode) { + retCode &= uartSetPins(uart_nr, rxPin, txPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); + } if (!retCode) { uartEnd(uart_nr); uart = NULL; @@ -518,7 +547,7 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx } // This function code is under testing - for now just keep it here -void uartSetFastReading(uart_t* uart) { +void uartSetFastReading(uart_t *uart) { if (uart == NULL) { return; } @@ -536,8 +565,7 @@ void uartSetFastReading(uart_t* uart) { UART_MUTEX_UNLOCK(); } - -bool uartSetRxTimeout(uart_t* uart, uint8_t numSymbTimeout) { +bool uartSetRxTimeout(uart_t *uart, uint8_t numSymbTimeout) { if (uart == NULL) { return false; } @@ -548,7 +576,7 @@ bool uartSetRxTimeout(uart_t* uart, uint8_t numSymbTimeout) { return retCode; } -bool uartSetRxFIFOFull(uart_t* uart, uint8_t numBytesFIFOFull) { +bool uartSetRxFIFOFull(uart_t *uart, uint8_t numBytesFIFOFull) { if (uart == NULL) { return false; } @@ -559,14 +587,13 @@ bool uartSetRxFIFOFull(uart_t* uart, uint8_t numBytesFIFOFull) { return retCode; } - void uartEnd(uint8_t uart_num) { if (uart_num >= SOC_UART_NUM) { log_e("Serial number is invalid, please use number from 0 to %u", SOC_UART_NUM - 1); return; } // get UART information - uart_t* uart = &_uart_bus_array[uart_num]; + uart_t *uart = &_uart_bus_array[uart_num]; UART_MUTEX_LOCK(); _uartDetachPins(uart_num, uart->_rxPin, uart->_txPin, uart->_ctsPin, uart->_rtsPin); @@ -576,31 +603,31 @@ void uartEnd(uint8_t uart_num) { UART_MUTEX_UNLOCK(); } - -void uartSetRxInvert(uart_t* uart, bool invert) { - if (uart == NULL) +void uartSetRxInvert(uart_t *uart, bool invert) { + if (uart == NULL) { return; + } #if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 - // POTENTIAL ISSUE :: original code only set/reset rxd_inv bit - // IDF or LL set/reset the whole inv_mask! - // if (invert) - // ESP_ERROR_CHECK(uart_set_line_inverse(uart->num, UART_SIGNAL_RXD_INV)); - // else - // ESP_ERROR_CHECK(uart_set_line_inverse(uart->num, UART_SIGNAL_INV_DISABLE)); + // POTENTIAL ISSUE :: original code only set/reset rxd_inv bit + // IDF or LL set/reset the whole inv_mask! + // if (invert) + // ESP_ERROR_CHECK(uart_set_line_inverse(uart->num, UART_SIGNAL_RXD_INV)); + // else + // ESP_ERROR_CHECK(uart_set_line_inverse(uart->num, UART_SIGNAL_INV_DISABLE)); #else // this implementation is better over IDF API because it only affects RXD // this is supported in ESP32, ESP32-S2 and ESP32-C3 - uart_dev_t* hw = UART_LL_GET_HW(uart->num); - if (invert) + uart_dev_t *hw = UART_LL_GET_HW(uart->num); + if (invert) { hw->conf0.rxd_inv = 1; - else + } else { hw->conf0.rxd_inv = 0; + } #endif } - -uint32_t uartAvailable(uart_t* uart) { +uint32_t uartAvailable(uart_t *uart) { if (uart == NULL) { return 0; @@ -609,13 +636,14 @@ uint32_t uartAvailable(uart_t* uart) { UART_MUTEX_LOCK(); size_t available; uart_get_buffered_data_len(uart->num, &available); - if (uart->has_peek) available++; + if (uart->has_peek) { + available++; + } UART_MUTEX_UNLOCK(); return available; } - -uint32_t uartAvailableForWrite(uart_t* uart) { +uint32_t uartAvailableForWrite(uart_t *uart) { if (uart == NULL) { return 0; } @@ -629,7 +657,7 @@ uint32_t uartAvailableForWrite(uart_t* uart) { return available; } -size_t uartReadBytes(uart_t* uart, uint8_t* buffer, size_t size, uint32_t timeout_ms) { +size_t uartReadBytes(uart_t *uart, uint8_t *buffer, size_t size, uint32_t timeout_ms) { if (uart == NULL || size == 0 || buffer == NULL) { return 0; } @@ -647,18 +675,19 @@ size_t uartReadBytes(uart_t* uart, uint8_t* buffer, size_t size, uint32_t timeou if (size > 0) { int len = uart_read_bytes(uart->num, buffer, size, pdMS_TO_TICKS(timeout_ms)); - if (len < 0) len = 0; // error reading UART + if (len < 0) { + len = 0; // error reading UART + } bytes_read += len; } - UART_MUTEX_UNLOCK(); return bytes_read; } // DEPRECATED but the original code will be kepts here as future reference when a final solution // to the UART driver is defined in the use case of reading byte by byte from UART. -uint8_t uartRead(uart_t* uart) { +uint8_t uartRead(uart_t *uart) { if (uart == NULL) { return 0; } @@ -680,8 +709,7 @@ uint8_t uartRead(uart_t* uart) { return c; } - -uint8_t uartPeek(uart_t* uart) { +uint8_t uartPeek(uart_t *uart) { if (uart == NULL) { return 0; } @@ -704,7 +732,7 @@ uint8_t uartPeek(uart_t* uart) { return c; } -void uartWrite(uart_t* uart, uint8_t c) { +void uartWrite(uart_t *uart, uint8_t c) { if (uart == NULL) { return; } @@ -713,7 +741,7 @@ void uartWrite(uart_t* uart, uint8_t c) { UART_MUTEX_UNLOCK(); } -void uartWriteBuf(uart_t* uart, const uint8_t* data, size_t len) { +void uartWriteBuf(uart_t *uart, const uint8_t *data, size_t len) { if (uart == NULL || data == NULL || !len) { return; } @@ -723,18 +751,17 @@ void uartWriteBuf(uart_t* uart, const uint8_t* data, size_t len) { UART_MUTEX_UNLOCK(); } -void uartFlush(uart_t* uart) { +void uartFlush(uart_t *uart) { uartFlushTxOnly(uart, true); } -void uartFlushTxOnly(uart_t* uart, bool txOnly) { +void uartFlushTxOnly(uart_t *uart, bool txOnly) { if (uart == NULL) { return; } UART_MUTEX_LOCK(); - while (!uart_ll_is_tx_idle(UART_LL_GET_HW(uart->num))) - ; + while (!uart_ll_is_tx_idle(UART_LL_GET_HW(uart->num))); if (!txOnly) { ESP_ERROR_CHECK(uart_flush_input(uart->num)); @@ -742,7 +769,7 @@ void uartFlushTxOnly(uart_t* uart, bool txOnly) { UART_MUTEX_UNLOCK(); } -void uartSetBaudRate(uart_t* uart, uint32_t baud_rate) { +void uartSetBaudRate(uart_t *uart, uint32_t baud_rate) { if (uart == NULL) { return; } @@ -755,7 +782,7 @@ void uartSetBaudRate(uart_t* uart, uint32_t baud_rate) { UART_MUTEX_UNLOCK(); } -uint32_t uartGetBaudRate(uart_t* uart) { +uint32_t uartGetBaudRate(uart_t *uart) { uint32_t baud_rate = 0; uint32_t sclk_freq; @@ -772,51 +799,40 @@ uint32_t uartGetBaudRate(uart_t* uart) { } static void ARDUINO_ISR_ATTR uart0_write_char(char c) { - while (uart_ll_get_txfifo_len(&UART0) == 0) - ; - uart_ll_write_txfifo(&UART0, (const uint8_t*)&c, 1); + while (uart_ll_get_txfifo_len(&UART0) == 0); + uart_ll_write_txfifo(&UART0, (const uint8_t *)&c, 1); } #if SOC_UART_NUM > 1 static void ARDUINO_ISR_ATTR uart1_write_char(char c) { - while (uart_ll_get_txfifo_len(&UART1) == 0) - ; - uart_ll_write_txfifo(&UART1, (const uint8_t*)&c, 1); + while (uart_ll_get_txfifo_len(&UART1) == 0); + uart_ll_write_txfifo(&UART1, (const uint8_t *)&c, 1); } #endif #if SOC_UART_NUM > 2 static void ARDUINO_ISR_ATTR uart2_write_char(char c) { - while (uart_ll_get_txfifo_len(&UART2) == 0) - ; - uart_ll_write_txfifo(&UART2, (const uint8_t*)&c, 1); + while (uart_ll_get_txfifo_len(&UART2) == 0); + uart_ll_write_txfifo(&UART2, (const uint8_t *)&c, 1); } #endif void uart_install_putc() { switch (s_uart_debug_nr) { - case 0: - ets_install_putc1((void (*)(char)) & uart0_write_char); - break; + case 0: ets_install_putc1((void (*)(char)) & uart0_write_char); break; #if SOC_UART_NUM > 1 - case 1: - ets_install_putc1((void (*)(char)) & uart1_write_char); - break; + case 1: ets_install_putc1((void (*)(char)) & uart1_write_char); break; #endif #if SOC_UART_NUM > 2 - case 2: - ets_install_putc1((void (*)(char)) & uart2_write_char); - break; + case 2: ets_install_putc1((void (*)(char)) & uart2_write_char); break; #endif - default: - ets_install_putc1(NULL); - break; + default: ets_install_putc1(NULL); break; } } // Routines that take care of UART mode in the HardwareSerial Class code // used to set UART_MODE_RS485_HALF_DUPLEX auto RTS for TXD for ESP32 chips -bool uartSetMode(uart_t* uart, uart_mode_t mode) { +bool uartSetMode(uart_t *uart, uart_mode_t mode) { if (uart == NULL || uart->num >= SOC_UART_NUM) { return false; } @@ -827,7 +843,7 @@ bool uartSetMode(uart_t* uart, uart_mode_t mode) { return retCode; } -void uartSetDebug(uart_t* uart) { +void uartSetDebug(uart_t *uart) { if (uart == NULL || uart->num >= SOC_UART_NUM) { s_uart_debug_nr = -1; } else { @@ -840,16 +856,16 @@ int uartGetDebug() { return s_uart_debug_nr; } -int log_printfv(const char* format, va_list arg) { +int log_printfv(const char *format, va_list arg) { static char loc_buf[64]; - char* temp = loc_buf; + char *temp = loc_buf; uint32_t len; va_list copy; va_copy(copy, arg); len = vsnprintf(NULL, 0, format, copy); va_end(copy); if (len >= sizeof(loc_buf)) { - temp = (char*)malloc(len + 1); + temp = (char *)malloc(len + 1); if (temp == NULL) { return 0; } @@ -883,13 +899,13 @@ int log_printfv(const char* format, va_list arg) { free(temp); } // flushes TX - make sure that the log message is completely sent. - if (s_uart_debug_nr != -1) - while (!uart_ll_is_tx_idle(UART_LL_GET_HW(s_uart_debug_nr))) - ; + if (s_uart_debug_nr != -1) { + while (!uart_ll_is_tx_idle(UART_LL_GET_HW(s_uart_debug_nr))); + } return len; } -int log_printf(const char* format, ...) { +int log_printf(const char *format, ...) { int len; va_list arg; va_start(arg, format); @@ -898,8 +914,7 @@ int log_printf(const char* format, ...) { return len; } - -static void log_print_buf_line(const uint8_t* b, size_t len, size_t total_len) { +static void log_print_buf_line(const uint8_t *b, size_t len, size_t total_len) { for (size_t i = 0; i < len; i++) { log_printf("%s0x%02x,", i ? " " : "", b[i]); } @@ -917,7 +932,7 @@ static void log_print_buf_line(const uint8_t* b, size_t len, size_t total_len) { log_printf("\n"); } -void log_print_buf(const uint8_t* b, size_t len) { +void log_print_buf(const uint8_t *b, size_t len) { if (!len || !b) { return; } @@ -933,17 +948,19 @@ void log_print_buf(const uint8_t* b, size_t len) { * if enough pulses are detected return the minimum high pulse duration + minimum low pulse duration divided by two. * This equals one bit period. If flag is true the function return immediately, otherwise it waits for enough pulses. */ -unsigned long uartBaudrateDetect(uart_t* uart, bool flg) { +unsigned long uartBaudrateDetect(uart_t *uart, bool flg) { // Baud rate detection only works for ESP32 and ESP32S2 #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 if (uart == NULL) { return 0; } - uart_dev_t* hw = UART_LL_GET_HW(uart->num); + uart_dev_t *hw = UART_LL_GET_HW(uart->num); while (hw->rxd_cnt.edge_cnt < 30) { // UART_PULSE_NUM(uart_num) - if (flg) return 0; + if (flg) { + return 0; + } ets_delay_us(1000); } @@ -958,7 +975,6 @@ unsigned long uartBaudrateDetect(uart_t* uart, bool flg) { #endif } - /* * To start detection of baud rate with the uart the auto_baud.en bit needs to be cleared and set. The bit period is * detected calling uartBadrateDetect(). The raw baudrate is computed using the UART_CLK_FREQ. The raw baudrate is @@ -980,14 +996,14 @@ unsigned long uartBaudrateDetect(uart_t* uart, bool flg) { * * */ -void uartStartDetectBaudrate(uart_t* uart) { +void uartStartDetectBaudrate(uart_t *uart) { if (uart == NULL) { return; } // Baud rate detection only works for ESP32 and ESP32S2 #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 - uart_dev_t* hw = UART_LL_GET_HW(uart->num); + uart_dev_t *hw = UART_LL_GET_HW(uart->num); hw->auto_baud.glitch_filt = 0x08; hw->auto_baud.en = 0; hw->auto_baud.en = 1; @@ -1007,7 +1023,7 @@ void uartStartDetectBaudrate(uart_t* uart) { #endif } -unsigned long uartDetectBaudrate(uart_t* uart) { +unsigned long uartDetectBaudrate(uart_t *uart) { if (uart == NULL) { return 0; } @@ -1027,7 +1043,7 @@ unsigned long uartDetectBaudrate(uart_t* uart) { return 0; } - uart_dev_t* hw = UART_LL_GET_HW(uart->num); + uart_dev_t *hw = UART_LL_GET_HW(uart->num); hw->auto_baud.en = 0; uartStateDetectingBaudrate = false; // Initialize for the next round @@ -1036,7 +1052,8 @@ unsigned long uartDetectBaudrate(uart_t* uart) { //log_i("APB_FREQ = %d\nraw baudrate detected = %d", getApbFrequency(), baudrate); - static const unsigned long default_rates[] = { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 74880, 115200, 230400, 256000, 460800, 921600, 1843200, 3686400 }; + static const unsigned long default_rates[] = {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, + 74880, 115200, 230400, 256000, 460800, 921600, 1843200, 3686400}; size_t i; for (i = 1; i < sizeof(default_rates) / sizeof(default_rates[0]) - 1; i++) // find the nearest real baudrate @@ -1080,7 +1097,9 @@ unsigned long uartDetectBaudrate(uart_t* uart) { This creates a loop that lets us receive anything we send on the UART without external wires. */ void uart_internal_loopback(uint8_t uartNum, int8_t rxPin) { - if (uartNum > SOC_UART_NUM - 1 || !GPIO_IS_VALID_GPIO(rxPin)) return; + if (uartNum > SOC_UART_NUM - 1 || !GPIO_IS_VALID_GPIO(rxPin)) { + return; + } esp_rom_gpio_connect_out_signal(rxPin, UART_TX_SIGNAL(uartNum), false, false); } @@ -1101,9 +1120,9 @@ void uart_send_break(uint8_t uartNum) { } // Sends a buffer and at the end of the stream, it generates BREAK in the line -int uart_send_msg_with_break(uint8_t uartNum, uint8_t* msg, size_t msgSize) { +int uart_send_msg_with_break(uint8_t uartNum, uint8_t *msg, size_t msgSize) { // 12 bits long BREAK for 8N1 - return uart_write_bytes_with_break(uartNum, (const void*)msg, msgSize, 12); + return uart_write_bytes_with_break(uartNum, (const void *)msg, msgSize, 12); } #endif /* SOC_UART_SUPPORTED */ diff --git a/cores/esp32/esp32-hal-uart.h b/cores/esp32/esp32-hal-uart.h index abc99294a..1cd5411bf 100644 --- a/cores/esp32/esp32-hal-uart.h +++ b/cores/esp32/esp32-hal-uart.h @@ -29,87 +29,91 @@ extern "C" { #include "freertos/queue.h" #include "hal/uart_types.h" - struct uart_struct_t; - typedef struct uart_struct_t uart_t; +struct uart_struct_t; +typedef struct uart_struct_t uart_t; - bool _testUartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t rx_buffer_size, uint16_t tx_buffer_size, bool inverted, uint8_t rxfifo_full_thrhd); - uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t rx_buffer_size, uint16_t tx_buffer_size, bool inverted, uint8_t rxfifo_full_thrhd); - void uartEnd(uint8_t uart_num); +bool _testUartBegin( + uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t rx_buffer_size, uint16_t tx_buffer_size, bool inverted, + uint8_t rxfifo_full_thrhd +); +uart_t *uartBegin( + uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint16_t rx_buffer_size, uint16_t tx_buffer_size, bool inverted, + uint8_t rxfifo_full_thrhd +); +void uartEnd(uint8_t uart_num); - // This is used to retrieve the Event Queue pointer from a UART IDF Driver in order to allow user to deal with its events - void uartGetEventQueue(uart_t* uart, QueueHandle_t* q); +// This is used to retrieve the Event Queue pointer from a UART IDF Driver in order to allow user to deal with its events +void uartGetEventQueue(uart_t *uart, QueueHandle_t *q); - uint32_t uartAvailable(uart_t* uart); - uint32_t uartAvailableForWrite(uart_t* uart); - size_t uartReadBytes(uart_t* uart, uint8_t* buffer, size_t size, uint32_t timeout_ms); - uint8_t uartRead(uart_t* uart); - uint8_t uartPeek(uart_t* uart); +uint32_t uartAvailable(uart_t *uart); +uint32_t uartAvailableForWrite(uart_t *uart); +size_t uartReadBytes(uart_t *uart, uint8_t *buffer, size_t size, uint32_t timeout_ms); +uint8_t uartRead(uart_t *uart); +uint8_t uartPeek(uart_t *uart); - void uartWrite(uart_t* uart, uint8_t c); - void uartWriteBuf(uart_t* uart, const uint8_t* data, size_t len); +void uartWrite(uart_t *uart, uint8_t c); +void uartWriteBuf(uart_t *uart, const uint8_t *data, size_t len); - void uartFlush(uart_t* uart); - void uartFlushTxOnly(uart_t* uart, bool txOnly); +void uartFlush(uart_t *uart); +void uartFlushTxOnly(uart_t *uart, bool txOnly); - void uartSetBaudRate(uart_t* uart, uint32_t baud_rate); - uint32_t uartGetBaudRate(uart_t* uart); +void uartSetBaudRate(uart_t *uart, uint32_t baud_rate); +uint32_t uartGetBaudRate(uart_t *uart); - void uartSetRxInvert(uart_t* uart, bool invert); - bool uartSetRxTimeout(uart_t* uart, uint8_t numSymbTimeout); - bool uartSetRxFIFOFull(uart_t* uart, uint8_t numBytesFIFOFull); - void uartSetFastReading(uart_t* uart); +void uartSetRxInvert(uart_t *uart, bool invert); +bool uartSetRxTimeout(uart_t *uart, uint8_t numSymbTimeout); +bool uartSetRxFIFOFull(uart_t *uart, uint8_t numBytesFIFOFull); +void uartSetFastReading(uart_t *uart); - void uartSetDebug(uart_t* uart); - int uartGetDebug(); +void uartSetDebug(uart_t *uart); +int uartGetDebug(); - bool uartIsDriverInstalled(uart_t* uart); +bool uartIsDriverInstalled(uart_t *uart); - // Negative Pin Number will keep it unmodified, thus this function can set individual pins - // When pins are changed, it will detach the previous ones - // Can be called before or after begin() - bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin); +// Negative Pin Number will keep it unmodified, thus this function can set individual pins +// When pins are changed, it will detach the previous ones +// Can be called before or after begin() +bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin); - // helper functions - int8_t uart_get_RxPin(uint8_t uart_num); - int8_t uart_get_TxPin(uint8_t uart_num); - void uart_init_PeriMan(void); +// helper functions +int8_t uart_get_RxPin(uint8_t uart_num); +int8_t uart_get_TxPin(uint8_t uart_num); +void uart_init_PeriMan(void); +// Enables or disables HW Flow Control function -- needs also to set CTS and/or RTS pins +// UART_HW_FLOWCTRL_DISABLE = 0x0 disable hardware flow control +// UART_HW_FLOWCTRL_RTS = 0x1 enable RX hardware flow control (rts) +// UART_HW_FLOWCTRL_CTS = 0x2 enable TX hardware flow control (cts) +// UART_HW_FLOWCTRL_CTS_RTS = 0x3 enable hardware flow control +bool uartSetHwFlowCtrlMode(uart_t *uart, uart_hw_flowcontrol_t mode, uint8_t threshold); - // Enables or disables HW Flow Control function -- needs also to set CTS and/or RTS pins - // UART_HW_FLOWCTRL_DISABLE = 0x0 disable hardware flow control - // UART_HW_FLOWCTRL_RTS = 0x1 enable RX hardware flow control (rts) - // UART_HW_FLOWCTRL_CTS = 0x2 enable TX hardware flow control (cts) - // UART_HW_FLOWCTRL_CTS_RTS = 0x3 enable hardware flow control - bool uartSetHwFlowCtrlMode(uart_t* uart, uart_hw_flowcontrol_t mode, uint8_t threshold); +// Used to set RS485 function -- needs to disable HW Flow Control and set RTS pin to use +// RTS pin becomes RS485 half duplex RE/DE +// UART_MODE_UART = 0x00 mode: regular UART mode +// UART_MODE_RS485_HALF_DUPLEX = 0x01 mode: half duplex RS485 UART mode control by RTS pin +// UART_MODE_IRDA = 0x02 mode: IRDA UART mode +// UART_MODE_RS485_COLLISION_DETECT = 0x03 mode: RS485 collision detection UART mode (used for test purposes) +// UART_MODE_RS485_APP_CTRL = 0x04 mode: application control RS485 UART mode (used for test purposes) +bool uartSetMode(uart_t *uart, uart_mode_t mode); - // Used to set RS485 function -- needs to disable HW Flow Control and set RTS pin to use - // RTS pin becomes RS485 half duplex RE/DE - // UART_MODE_UART = 0x00 mode: regular UART mode - // UART_MODE_RS485_HALF_DUPLEX = 0x01 mode: half duplex RS485 UART mode control by RTS pin - // UART_MODE_IRDA = 0x02 mode: IRDA UART mode - // UART_MODE_RS485_COLLISION_DETECT = 0x03 mode: RS485 collision detection UART mode (used for test purposes) - // UART_MODE_RS485_APP_CTRL = 0x04 mode: application control RS485 UART mode (used for test purposes) - bool uartSetMode(uart_t* uart, uart_mode_t mode); +void uartStartDetectBaudrate(uart_t *uart); +unsigned long uartDetectBaudrate(uart_t *uart); - void uartStartDetectBaudrate(uart_t* uart); - unsigned long uartDetectBaudrate(uart_t* uart); - - /* +/* These functions are for testing puspose only and can be used in Arduino Sketches Those are used in the UART examples */ - // Make sure UART's RX signal is connected to TX pin - // This creates a loop that lets us receive anything we send on the UART - void uart_internal_loopback(uint8_t uartNum, int8_t rxPin); +// Make sure UART's RX signal is connected to TX pin +// This creates a loop that lets us receive anything we send on the UART +void uart_internal_loopback(uint8_t uartNum, int8_t rxPin); - // Routines that generate BREAK in the UART for testing purpose - - // Forces a BREAK in the line based on SERIAL_8N1 configuration at any baud rate - void uart_send_break(uint8_t uartNum); - // Sends a buffer and at the end of the stream, it generates BREAK in the line - int uart_send_msg_with_break(uint8_t uartNum, uint8_t* msg, size_t msgSize); +// Routines that generate BREAK in the UART for testing purpose +// Forces a BREAK in the line based on SERIAL_8N1 configuration at any baud rate +void uart_send_break(uint8_t uartNum); +// Sends a buffer and at the end of the stream, it generates BREAK in the line +int uart_send_msg_with_break(uint8_t uartNum, uint8_t *msg, size_t msgSize); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal.h b/cores/esp32/esp32-hal.h index 8aa123a6f..60350ae96 100644 --- a/cores/esp32/esp32-hal.h +++ b/cores/esp32/esp32-hal.h @@ -61,13 +61,13 @@ extern "C" { #define ARDUINO_EVENT_RUNNING_CORE CONFIG_ARDUINO_EVENT_RUNNING_CORE #endif - //forward declaration from freertos/portmacro.h - void vPortYield(void); - void yield(void); +//forward declaration from freertos/portmacro.h +void vPortYield(void); +void yield(void); #define optimistic_yield(u) -#define ESP_REG(addr) *((volatile uint32_t*)(addr)) -#define NOP() asm volatile("nop") +#define ESP_REG(addr) *((volatile uint32_t *)(addr)) +#define NOP() asm volatile("nop") #include "esp32-hal-log.h" #include "esp32-hal-matrix.h" @@ -87,71 +87,68 @@ extern "C" { #include "esp32-hal-rgb-led.h" #include "esp32-hal-cpu.h" - void analogWrite(uint8_t pin, int value); - void analogWriteFrequency(uint8_t pin, uint32_t freq); - void analogWriteResolution(uint8_t pin, uint8_t bits); +void analogWrite(uint8_t pin, int value); +void analogWriteFrequency(uint8_t pin, uint32_t freq); +void analogWriteResolution(uint8_t pin, uint8_t bits); - //returns chip temperature in Celsius - float temperatureRead(); +//returns chip temperature in Celsius +float temperatureRead(); - //allows user to bypass SPI RAM test routine - bool testSPIRAM(void); +//allows user to bypass SPI RAM test routine +bool testSPIRAM(void); #if CONFIG_AUTOSTART_ARDUINO - //enable/disable WDT for Arduino's setup and loop functions - void enableLoopWDT(); - void disableLoopWDT(); - //feed WDT for the loop task - void feedLoopWDT(); +//enable/disable WDT for Arduino's setup and loop functions +void enableLoopWDT(); +void disableLoopWDT(); +//feed WDT for the loop task +void feedLoopWDT(); #endif - //enable/disable WDT for the IDLE task on Core 0 (SYSTEM) - void enableCore0WDT(); - void disableCore0WDT(); +//enable/disable WDT for the IDLE task on Core 0 (SYSTEM) +void enableCore0WDT(); +void disableCore0WDT(); #ifndef CONFIG_FREERTOS_UNICORE - //enable/disable WDT for the IDLE task on Core 1 (Arduino) - void enableCore1WDT(); - void disableCore1WDT(); +//enable/disable WDT for the IDLE task on Core 1 (Arduino) +void enableCore1WDT(); +void disableCore1WDT(); #endif - //if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore - //allows to easily handle all possible situations without repetitive code - BaseType_t xTaskCreateUniversal(TaskFunction_t pxTaskCode, - const char* const pcName, - const uint32_t usStackDepth, - void* const pvParameters, - UBaseType_t uxPriority, - TaskHandle_t* const pxCreatedTask, - const BaseType_t xCoreID); +//if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore +//allows to easily handle all possible situations without repetitive code +BaseType_t xTaskCreateUniversal( + TaskFunction_t pxTaskCode, const char *const pcName, const uint32_t usStackDepth, void *const pvParameters, UBaseType_t uxPriority, + TaskHandle_t *const pxCreatedTask, const BaseType_t xCoreID +); - unsigned long micros(); - unsigned long millis(); - void delay(uint32_t); - void delayMicroseconds(uint32_t us); +unsigned long micros(); +unsigned long millis(); +void delay(uint32_t); +void delayMicroseconds(uint32_t us); #if !CONFIG_ESP32_PHY_AUTO_INIT - void arduino_phy_init(); +void arduino_phy_init(); #endif #if !CONFIG_AUTOSTART_ARDUINO - void initArduino(); +void initArduino(); #endif - typedef struct { - int core; // core which triggered panic - const char* reason; // exception string - const void* pc; // instruction address that triggered the exception - bool backtrace_corrupt; // if backtrace is corrupt - bool backtrace_continues; // if backtrace continues, but did not fit - unsigned int backtrace_len; // number of backtrace addresses - unsigned int backtrace[60]; // backtrace addresses array - } arduino_panic_info_t; +typedef struct { + int core; // core which triggered panic + const char *reason; // exception string + const void *pc; // instruction address that triggered the exception + bool backtrace_corrupt; // if backtrace is corrupt + bool backtrace_continues; // if backtrace continues, but did not fit + unsigned int backtrace_len; // number of backtrace addresses + unsigned int backtrace[60]; // backtrace addresses array +} arduino_panic_info_t; - typedef void (*arduino_panic_handler_t)(arduino_panic_info_t* info, void* arg); +typedef void (*arduino_panic_handler_t)(arduino_panic_info_t *info, void *arg); - void set_arduino_panic_handler(arduino_panic_handler_t handler, void* arg); - arduino_panic_handler_t get_arduino_panic_handler(void); - void* get_arduino_panic_handler_arg(void); +void set_arduino_panic_handler(arduino_panic_handler_t handler, void *arg); +arduino_panic_handler_t get_arduino_panic_handler(void); +void *get_arduino_panic_handler_arg(void); #ifdef __cplusplus } diff --git a/cores/esp32/esp8266-compat.h b/cores/esp32/esp8266-compat.h index 7c21481bd..8123cd078 100644 --- a/cores/esp32/esp8266-compat.h +++ b/cores/esp32/esp8266-compat.h @@ -20,5 +20,4 @@ #define ICACHE_FLASH_ATTR #define ICACHE_RAM_ATTR ARDUINO_ISR_ATTR - #endif /* _ESP8266_COMPAT_H_ */ diff --git a/cores/esp32/esp_arduino_version.h b/cores/esp32/esp_arduino_version.h index 0f60d88d0..41c0b40bd 100644 --- a/cores/esp32/esp_arduino_version.h +++ b/cores/esp32/esp_arduino_version.h @@ -37,15 +37,13 @@ extern "C" { * * To be used in comparisons, such as ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) */ -#define ESP_ARDUINO_VERSION ESP_ARDUINO_VERSION_VAL(ESP_ARDUINO_VERSION_MAJOR, \ - ESP_ARDUINO_VERSION_MINOR, \ - ESP_ARDUINO_VERSION_PATCH) +#define ESP_ARDUINO_VERSION ESP_ARDUINO_VERSION_VAL(ESP_ARDUINO_VERSION_MAJOR, ESP_ARDUINO_VERSION_MINOR, ESP_ARDUINO_VERSION_PATCH) /** * Current ARDUINO version, as string */ -#define df2xstr(s) #s -#define df2str(s) df2xstr(s) +#define df2xstr(s) #s +#define df2str(s) df2xstr(s) #define ESP_ARDUINO_VERSION_STR df2str(ESP_ARDUINO_VERSION_MAJOR) "." df2str(ESP_ARDUINO_VERSION_MINOR) "." df2str(ESP_ARDUINO_VERSION_PATCH) #ifdef __cplusplus diff --git a/cores/esp32/extra_attr.h b/cores/esp32/extra_attr.h index a0d8b196d..d5342a5bc 100644 --- a/cores/esp32/extra_attr.h +++ b/cores/esp32/extra_attr.h @@ -1,3 +1,3 @@ -#define ATTR_PACKED __attribute__((__packed__)) +#define ATTR_PACKED __attribute__((__packed__)) #define ATTR_ALIGNED(x) __attribute__((__aligned__(x))) #define ATTR_SECTION(x) __attribute__((__section__(x))) diff --git a/cores/esp32/firmware_msc_fat.c b/cores/esp32/firmware_msc_fat.c index 7dfe6c8c0..e66cc262c 100644 --- a/cores/esp32/firmware_msc_fat.c +++ b/cores/esp32/firmware_msc_fat.c @@ -111,7 +111,9 @@ void fat_set_table_index(uint8_t *table, uint16_t index, uint16_t value, bool fa } } -fat_boot_sector_t *fat_add_boot_sector(uint8_t *dst, uint16_t sector_num, uint16_t table_sectors, const char *file_system_type, const char *volume_label, uint32_t serial_number) { +fat_boot_sector_t *fat_add_boot_sector( + uint8_t *dst, uint16_t sector_num, uint16_t table_sectors, const char *file_system_type, const char *volume_label, uint32_t serial_number +) { fat_boot_sector_t *boot = (fat_boot_sector_t *)dst; boot->jump_instruction[0] = 0xEB; boot->jump_instruction[1] = 0x3C; @@ -149,7 +151,9 @@ fat_dir_entry_t *fat_add_label(uint8_t *dst, const char *volume_label) { return entry; } -fat_dir_entry_t *fat_add_root_file(uint8_t *dst, uint8_t index, const char *file_name, const char *file_extension, size_t file_size, uint16_t data_start_sector, bool is_fat16) { +fat_dir_entry_t *fat_add_root_file( + uint8_t *dst, uint8_t index, const char *file_name, const char *file_extension, size_t file_size, uint16_t data_start_sector, bool is_fat16 +) { fat_boot_sector_t *boot = (fat_boot_sector_t *)dst; uint8_t *table = dst + DISK_SECTOR_SIZE; fat_dir_entry_t *entry = (fat_dir_entry_t *)(dst + ((boot->sectors_per_alloc_table + 1) * DISK_SECTOR_SIZE) + (index * sizeof(fat_dir_entry_t))); @@ -173,7 +177,7 @@ fat_dir_entry_t *fat_add_root_file(uint8_t *dst, uint8_t index, const char *file fat_set_table_index(table, data_end_sector - 1, 0xFFFF, is_fat16); //Set Firmware Date based on the build time - static const char *month_names_short[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + static const char *month_names_short[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; char mstr[8] = { '\0', }; diff --git a/cores/esp32/firmware_msc_fat.h b/cores/esp32/firmware_msc_fat.h index 3b26465bf..a88e051b1 100644 --- a/cores/esp32/firmware_msc_fat.h +++ b/cores/esp32/firmware_msc_fat.h @@ -24,117 +24,121 @@ extern "C" { #endif -#define FAT_U8(v) ((v)&0xFF) +#define FAT_U8(v) ((v) & 0xFF) #define FAT_U16(v) FAT_U8(v), FAT_U8((v) >> 8) #define FAT_U32(v) FAT_U8(v), FAT_U8((v) >> 8), FAT_U8((v) >> 16), FAT_U8((v) >> 24) #define FAT12_TBL2B(l, h) FAT_U8(l), FAT_U8(((l >> 8) & 0xF) | ((h << 4) & 0xF0)), FAT_U8(h >> 4) -#define FAT_MS2B(s, ms) FAT_U8(((((s)&0x1) * 1000) + (ms)) / 10) -#define FAT_HMS2B(h, m, s) FAT_U8(((s) >> 1) | (((m)&0x7) << 5)), FAT_U8((((m) >> 3) & 0x7) | ((h) << 3)) -#define FAT_YMD2B(y, m, d) FAT_U8(((d)&0x1F) | (((m)&0x7) << 5)), FAT_U8((((m) >> 3) & 0x1) | ((((y)-1980) & 0x7F) << 1)) +#define FAT_MS2B(s, ms) FAT_U8(((((s) & 0x1) * 1000) + (ms)) / 10) +#define FAT_HMS2B(h, m, s) FAT_U8(((s) >> 1) | (((m) & 0x7) << 5)), FAT_U8((((m) >> 3) & 0x7) | ((h) << 3)) +#define FAT_YMD2B(y, m, d) FAT_U8(((d) & 0x1F) | (((m) & 0x7) << 5)), FAT_U8((((m) >> 3) & 0x1) | ((((y) - 1980) & 0x7F) << 1)) -#define FAT_MS2V(s, ms) FAT_U8(((((s)&0x1) * 1000) + (ms)) / 10) -#define FAT_HMS2V(h, m, s) (FAT_U8(((s) >> 1) | (((m)&0x7) << 5)) | (FAT_U8((((m) >> 3) & 0x7) | ((h) << 3)) << 8)) -#define FAT_YMD2V(y, m, d) (FAT_U8(((d)&0x1F) | (((m)&0x7) << 5)) | (FAT_U8((((m) >> 3) & 0x1) | ((((y)-1980) & 0x7F) << 1)) << 8)) +#define FAT_MS2V(s, ms) FAT_U8(((((s) & 0x1) * 1000) + (ms)) / 10) +#define FAT_HMS2V(h, m, s) (FAT_U8(((s) >> 1) | (((m) & 0x7) << 5)) | (FAT_U8((((m) >> 3) & 0x7) | ((h) << 3)) << 8)) +#define FAT_YMD2V(y, m, d) (FAT_U8(((d) & 0x1F) | (((m) & 0x7) << 5)) | (FAT_U8((((m) >> 3) & 0x1) | ((((y) - 1980) & 0x7F) << 1)) << 8)) #define FAT_B2HMS(hms) ((hms >> 11) & 0x1F), ((hms >> 5) & 0x3F), ((hms & 0x1F) << 1) #define FAT_B2YMD(ymd) (((ymd >> 9) & 0x7F) + 1980), ((ymd >> 5) & 0x0F), (ymd & 0x1F) -#define FAT_FILE_ATTR_READ_ONLY 0x01 -#define FAT_FILE_ATTR_HIDDEN 0x02 -#define FAT_FILE_ATTR_SYSTEM 0x04 +#define FAT_FILE_ATTR_READ_ONLY 0x01 +#define FAT_FILE_ATTR_HIDDEN 0x02 +#define FAT_FILE_ATTR_SYSTEM 0x04 #define FAT_FILE_ATTR_VOLUME_LABEL 0x08 #define FAT_FILE_ATTR_SUBDIRECTORY 0x10 -#define FAT_FILE_ATTR_ARCHIVE 0x20 -#define FAT_FILE_ATTR_DEVICE 0x40 +#define FAT_FILE_ATTR_ARCHIVE 0x20 +#define FAT_FILE_ATTR_DEVICE 0x40 - static const uint16_t DISK_SECTOR_SIZE = 512; +static const uint16_t DISK_SECTOR_SIZE = 512; #define FAT_SIZE_TO_SECTORS(bytes) ((bytes) / DISK_SECTOR_SIZE) + (((bytes) % DISK_SECTOR_SIZE) ? 1 : 0) - typedef struct __attribute__((packed)) { - uint8_t jump_instruction[3]; - char oem_name[8]; //padded with spaces (0x20) - uint16_t bytes_per_sector; //DISK_SECTOR_SIZE usually 512 - uint8_t sectors_per_cluster; //Allowed values are 1, 2, 4, 8, 16, 32, 64, and 128 - uint16_t reserved_sectors_count; //At least 1 for this sector, usually 32 for FAT32 - uint8_t file_alloc_tables_num; //Almost always 2; RAM disks might use 1 - uint16_t max_root_dir_entries; //FAT12 and FAT16 - uint16_t fat12_sector_num; //DISK_SECTOR_NUM FAT12 and FAT16 - uint8_t media_descriptor; - uint16_t sectors_per_alloc_table; //FAT12 and FAT16 - uint16_t sectors_per_track; //A value of 0 may indicate LBA-only access - uint16_t num_heads; - uint32_t hidden_sectors_count; - uint32_t total_sectors_32; - uint8_t physical_drive_number; //0x00 for (first) removable media, 0x80 for (first) fixed disk - uint8_t reserved0; - uint8_t extended_boot_signature; //should be 0x29 - uint32_t serial_number; //0x1234 => 1234 - char volume_label[11]; //padded with spaces (0x20) - char file_system_type[8]; //padded with spaces (0x20) - uint8_t reserved[448]; - uint16_t signature; //should be 0xAA55 - } fat_boot_sector_t; +typedef struct __attribute__((packed)) { + uint8_t jump_instruction[3]; + char oem_name[8]; //padded with spaces (0x20) + uint16_t bytes_per_sector; //DISK_SECTOR_SIZE usually 512 + uint8_t sectors_per_cluster; //Allowed values are 1, 2, 4, 8, 16, 32, 64, and 128 + uint16_t reserved_sectors_count; //At least 1 for this sector, usually 32 for FAT32 + uint8_t file_alloc_tables_num; //Almost always 2; RAM disks might use 1 + uint16_t max_root_dir_entries; //FAT12 and FAT16 + uint16_t fat12_sector_num; //DISK_SECTOR_NUM FAT12 and FAT16 + uint8_t media_descriptor; + uint16_t sectors_per_alloc_table; //FAT12 and FAT16 + uint16_t sectors_per_track; //A value of 0 may indicate LBA-only access + uint16_t num_heads; + uint32_t hidden_sectors_count; + uint32_t total_sectors_32; + uint8_t physical_drive_number; //0x00 for (first) removable media, 0x80 for (first) fixed disk + uint8_t reserved0; + uint8_t extended_boot_signature; //should be 0x29 + uint32_t serial_number; //0x1234 => 1234 + char volume_label[11]; //padded with spaces (0x20) + char file_system_type[8]; //padded with spaces (0x20) + uint8_t reserved[448]; + uint16_t signature; //should be 0xAA55 +} fat_boot_sector_t; - typedef struct __attribute__((packed)) { - union { - struct { - char file_name[8]; //padded with spaces (0x20) - char file_extension[3]; //padded with spaces (0x20) - }; - struct { - uint8_t file_magic; // 0xE5:deleted, 0x05:will_be_deleted, 0x00:end_marker, 0x2E:dot_marker(. or ..) - char file_magic_data[10]; - }; - char volume_label[11]; //padded with spaces (0x20) +typedef struct __attribute__((packed)) { + union { + struct { + char file_name[8]; //padded with spaces (0x20) + char file_extension[3]; //padded with spaces (0x20) }; - uint8_t file_attr; //mask of FAT_FILE_ATTR_* - uint8_t reserved; //always 0 - uint8_t creation_time_ms; //ms * 10; max 1990 (1s 990ms) - uint16_t creation_time_hms; // [5:6:5] => h:m:(s/2) - uint16_t creation_time_ymd; // [7:4:5] => (y+1980):m:d - uint16_t last_access_ymd; - uint16_t extended_attr; - uint16_t last_modified_hms; - uint16_t last_modified_ymd; - uint16_t data_start_sector; - uint32_t file_size; - } fat_dir_entry_t; - - typedef struct __attribute__((packed)) { - union { - struct { - uint8_t number : 5; - uint8_t reserved0 : 1; - uint8_t llfp : 1; - uint8_t reserved1 : 1; - } seq; - uint8_t seq_num; //0xE5: Deleted Entry + struct { + uint8_t file_magic; // 0xE5:deleted, 0x05:will_be_deleted, 0x00:end_marker, 0x2E:dot_marker(. or ..) + char file_magic_data[10]; }; - uint16_t name0[5]; - uint8_t attr; //ALWAYS 0x0F - uint8_t type; //ALWAYS 0x00 - uint8_t dos_checksum; - uint16_t name1[6]; - uint16_t first_cluster; //ALWAYS 0x0000 - uint16_t name2[2]; - } fat_lfn_entry_t; + char volume_label[11]; //padded with spaces (0x20) + }; + uint8_t file_attr; //mask of FAT_FILE_ATTR_* + uint8_t reserved; //always 0 + uint8_t creation_time_ms; //ms * 10; max 1990 (1s 990ms) + uint16_t creation_time_hms; // [5:6:5] => h:m:(s/2) + uint16_t creation_time_ymd; // [7:4:5] => (y+1980):m:d + uint16_t last_access_ymd; + uint16_t extended_attr; + uint16_t last_modified_hms; + uint16_t last_modified_ymd; + uint16_t data_start_sector; + uint32_t file_size; +} fat_dir_entry_t; - typedef union { - fat_dir_entry_t dir; - fat_lfn_entry_t lfn; - } fat_entry_t; +typedef struct __attribute__((packed)) { + union { + struct { + uint8_t number : 5; + uint8_t reserved0 : 1; + uint8_t llfp : 1; + uint8_t reserved1 : 1; + } seq; + uint8_t seq_num; //0xE5: Deleted Entry + }; + uint16_t name0[5]; + uint8_t attr; //ALWAYS 0x0F + uint8_t type; //ALWAYS 0x00 + uint8_t dos_checksum; + uint16_t name1[6]; + uint16_t first_cluster; //ALWAYS 0x0000 + uint16_t name2[2]; +} fat_lfn_entry_t; - const char *fat_file_system_type(bool fat16); - uint16_t fat_sectors_per_alloc_table(uint32_t sector_num, bool fat16); - uint8_t *fat_add_table(uint8_t *dst, fat_boot_sector_t *boot, bool fat16); - void fat_set_table_index(uint8_t *table, uint16_t index, uint16_t value, bool fat16); - fat_boot_sector_t *fat_add_boot_sector(uint8_t *dst, uint16_t sector_num, uint16_t table_sectors, const char *file_system_type, const char *volume_label, uint32_t serial_number); - fat_dir_entry_t *fat_add_label(uint8_t *dst, const char *volume_label); - fat_dir_entry_t *fat_add_root_file(uint8_t *dst, uint8_t index, const char *file_name, const char *file_extension, size_t file_size, uint16_t data_start_sector, bool is_fat16); - uint8_t fat_lfn_checksum(const uint8_t *short_filename); +typedef union { + fat_dir_entry_t dir; + fat_lfn_entry_t lfn; +} fat_entry_t; + +const char *fat_file_system_type(bool fat16); +uint16_t fat_sectors_per_alloc_table(uint32_t sector_num, bool fat16); +uint8_t *fat_add_table(uint8_t *dst, fat_boot_sector_t *boot, bool fat16); +void fat_set_table_index(uint8_t *table, uint16_t index, uint16_t value, bool fat16); +fat_boot_sector_t *fat_add_boot_sector( + uint8_t *dst, uint16_t sector_num, uint16_t table_sectors, const char *file_system_type, const char *volume_label, uint32_t serial_number +); +fat_dir_entry_t *fat_add_label(uint8_t *dst, const char *volume_label); +fat_dir_entry_t *fat_add_root_file( + uint8_t *dst, uint8_t index, const char *file_name, const char *file_extension, size_t file_size, uint16_t data_start_sector, bool is_fat16 +); +uint8_t fat_lfn_checksum(const uint8_t *short_filename); #ifdef __cplusplus } diff --git a/cores/esp32/io_pin_remap.h b/cores/esp32/io_pin_remap.h index b2f70627d..4e422632e 100644 --- a/cores/esp32/io_pin_remap.h +++ b/cores/esp32/io_pin_remap.h @@ -16,103 +16,109 @@ int8_t gpioNumberToDigitalPin(int8_t gpioNumber); // cores/esp32/Arduino.h #define pulseInLong(pin, args...) pulseInLong(digitalPinToGPIONumber(pin), args) -#define pulseIn(pin, args...) pulseIn(digitalPinToGPIONumber(pin), args) -#define noTone(_pin) noTone(digitalPinToGPIONumber(_pin)) -#define tone(_pin, args...) tone(digitalPinToGPIONumber(_pin), args) +#define pulseIn(pin, args...) pulseIn(digitalPinToGPIONumber(pin), args) +#define noTone(_pin) noTone(digitalPinToGPIONumber(_pin)) +#define tone(_pin, args...) tone(digitalPinToGPIONumber(_pin), args) // cores/esp32/esp32-hal.h -#define analogGetChannel(pin) analogGetChannel(digitalPinToGPIONumber(pin)) -#define analogWrite(pin, value) analogWrite(digitalPinToGPIONumber(pin), value) -#define analogWriteFrequency(pin, freq) analogWriteFrequency(digitalPinToGPIONumber(pin), freq) +#define analogGetChannel(pin) analogGetChannel(digitalPinToGPIONumber(pin)) +#define analogWrite(pin, value) analogWrite(digitalPinToGPIONumber(pin), value) +#define analogWriteFrequency(pin, freq) analogWriteFrequency(digitalPinToGPIONumber(pin), freq) #define analogWriteResolution(pin, bits) analogWriteResolution(digitalPinToGPIONumber(pin), bits) // cores/esp32/esp32-hal-adc.h -#define analogRead(pin) analogRead(digitalPinToGPIONumber(pin)) -#define analogReadMilliVolts(pin) analogReadMilliVolts(digitalPinToGPIONumber(pin)) +#define analogRead(pin) analogRead(digitalPinToGPIONumber(pin)) +#define analogReadMilliVolts(pin) analogReadMilliVolts(digitalPinToGPIONumber(pin)) #define analogSetPinAttenuation(pin, attenuation) analogSetPinAttenuation(digitalPinToGPIONumber(pin), attenuation) // cores/esp32/esp32-hal-dac.h -#define dacDisable(pin) dacDisable(digitalPinToGPIONumber(pin)) +#define dacDisable(pin) dacDisable(digitalPinToGPIONumber(pin)) #define dacWrite(pin, value) dacWrite(digitalPinToGPIONumber(pin), value) // cores/esp32/esp32-hal-gpio.h -#define analogChannelToDigitalPin(channel) gpioNumberToDigitalPin(analogChannelToDigitalPin(channel)) -#define digitalPinToAnalogChannel(pin) digitalPinToAnalogChannel(digitalPinToGPIONumber(pin)) -#define digitalPinToTouchChannel(pin) digitalPinToTouchChannel(digitalPinToGPIONumber(pin)) -#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin)) +#define analogChannelToDigitalPin(channel) gpioNumberToDigitalPin(analogChannelToDigitalPin(channel)) +#define digitalPinToAnalogChannel(pin) digitalPinToAnalogChannel(digitalPinToGPIONumber(pin)) +#define digitalPinToTouchChannel(pin) digitalPinToTouchChannel(digitalPinToGPIONumber(pin)) +#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin)) #define attachInterruptArg(pin, fcn, arg, mode) attachInterruptArg(digitalPinToGPIONumber(pin), fcn, arg, mode) -#define attachInterrupt(pin, fcn, mode) attachInterrupt(digitalPinToGPIONumber(pin), fcn, mode) -#define detachInterrupt(pin) detachInterrupt(digitalPinToGPIONumber(pin)) -#define digitalWrite(pin, val) digitalWrite(digitalPinToGPIONumber(pin), val) -#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode) +#define attachInterrupt(pin, fcn, mode) attachInterrupt(digitalPinToGPIONumber(pin), fcn, mode) +#define detachInterrupt(pin) detachInterrupt(digitalPinToGPIONumber(pin)) +#define digitalWrite(pin, val) digitalWrite(digitalPinToGPIONumber(pin), val) +#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode) // cores/esp32/esp32-hal-i2c.h #define i2cInit(i2c_num, sda, scl, clk_speed) i2cInit(i2c_num, digitalPinToGPIONumber(sda), digitalPinToGPIONumber(scl), clk_speed) // cores/esp32/esp32-hal-i2c-slave.h -#define i2cSlaveInit(num, sda, scl, slaveID, frequency, rx_len, tx_len) i2cSlaveInit(num, digitalPinToGPIONumber(sda), digitalPinToGPIONumber(scl), slaveID, frequency, rx_len, tx_len) +#define i2cSlaveInit(num, sda, scl, slaveID, frequency, rx_len, tx_len) \ + i2cSlaveInit(num, digitalPinToGPIONumber(sda), digitalPinToGPIONumber(scl), slaveID, frequency, rx_len, tx_len) // cores/esp32/esp32-hal-ledc.h -#define ledcAttach(pin, freq, resolution) ledcAttach(digitalPinToGPIONumber(pin), freq, resolution) +#define ledcAttach(pin, freq, resolution) ledcAttach(digitalPinToGPIONumber(pin), freq, resolution) #define ledcAttachChannel(pin, freq, resolution, channel) ledcAttachChannel(digitalPinToGPIONumber(pin), freq, resolution, channel) -#define ledcWrite(pin, duty) ledcWrite(digitalPinToGPIONumber(pin), duty) -#define ledcWriteTone(pin, freq) ledcWriteTone(digitalPinToGPIONumber(pin), freq) -#define ledcWriteNote(pin, note, octave) ledcWriteNote(digitalPinToGPIONumber(pin), note, octave) -#define ledcRead(pin) ledcRead(digitalPinToGPIONumber(pin)) -#define ledcReadFreq(pin) ledcReadFreq(digitalPinToGPIONumber(pin)) -#define ledcDetach(pin) ledcDetach(digitalPinToGPIONumber(pin)) -#define ledcChangeFrequency(pin, freq, resolution) ledcChangeFrequency(digitalPinToGPIONumber(pin), freq, resolution) -#define ledcOutputInvert(pin, out_invert) ledcOutputInvert(digitalPinToGPIONumber(pin), out_invert) +#define ledcWrite(pin, duty) ledcWrite(digitalPinToGPIONumber(pin), duty) +#define ledcWriteTone(pin, freq) ledcWriteTone(digitalPinToGPIONumber(pin), freq) +#define ledcWriteNote(pin, note, octave) ledcWriteNote(digitalPinToGPIONumber(pin), note, octave) +#define ledcRead(pin) ledcRead(digitalPinToGPIONumber(pin)) +#define ledcReadFreq(pin) ledcReadFreq(digitalPinToGPIONumber(pin)) +#define ledcDetach(pin) ledcDetach(digitalPinToGPIONumber(pin)) +#define ledcChangeFrequency(pin, freq, resolution) ledcChangeFrequency(digitalPinToGPIONumber(pin), freq, resolution) +#define ledcOutputInvert(pin, out_invert) ledcOutputInvert(digitalPinToGPIONumber(pin), out_invert) #define ledcFade(pin, start_duty, target_duty, max_fade_time_ms) ledcFade(digitalPinToGPIONumber(pin), start_duty, target_duty, max_fade_time_ms) -#define ledcFadeWithInterrupt(pin, start_duty, target_duty, max_fade_time_ms, userFunc) ledcFadeWithInterrupt(digitalPinToGPIONumber(pin), start_duty, target_duty, max_fade_time_ms, userFunc) -#define ledcFadeWithInterruptArg(pin, start_duty, target_duty, max_fade_time_ms, userFunc, arg) ledcFadeWithInterruptArg(digitalPinToGPIONumber(pin), start_duty, target_duty, max_fade_time_ms, userFunc, arg) +#define ledcFadeWithInterrupt(pin, start_duty, target_duty, max_fade_time_ms, userFunc) \ + ledcFadeWithInterrupt(digitalPinToGPIONumber(pin), start_duty, target_duty, max_fade_time_ms, userFunc) +#define ledcFadeWithInterruptArg(pin, start_duty, target_duty, max_fade_time_ms, userFunc, arg) \ + ledcFadeWithInterruptArg(digitalPinToGPIONumber(pin), start_duty, target_duty, max_fade_time_ms, userFunc, arg) // cores/esp32/esp32-hal-matrix.h -#define pinMatrixInAttach(pin, signal, inverted) pinMatrixInAttach(digitalPinToGPIONumber(pin), signal, inverted) +#define pinMatrixInAttach(pin, signal, inverted) pinMatrixInAttach(digitalPinToGPIONumber(pin), signal, inverted) #define pinMatrixOutAttach(pin, function, invertOut, invertEnable) pinMatrixOutAttach(digitalPinToGPIONumber(pin), function, invertOut, invertEnable) -#define pinMatrixOutDetach(pin, invertOut, invertEnable) pinMatrixOutDetach(digitalPinToGPIONumber(pin), invertOut, invertEnable) +#define pinMatrixOutDetach(pin, invertOut, invertEnable) pinMatrixOutDetach(digitalPinToGPIONumber(pin), invertOut, invertEnable) // cores/esp32/esp32-hal-rgb-led.h #define neopixelWrite(pin, red_val, green_val, blue_val) neopixelWrite(digitalPinToGPIONumber(pin), red_val, green_val, blue_val) // cores/esp32/esp32-hal-rmt.h #define rmtInit(pin, channel_direction, memsize, frequency_Hz) rmtInit(digitalPinToGPIONumber(pin), channel_direction, memsize, frequency_Hz) -#define rmtSetEOT(pin, EOT_Level) rmtSetEOT(digitalPinToGPIONumber(pin), EOT_Level) -#define rmtWrite(pin, data, num_rmt_symbols, timeout_ms) rmtWrite(digitalPinToGPIONumber(pin), data, num_rmt_symbols, timeout_ms) -#define rmtWriteAsync(pin, data, num_rmt_symbols) rmtWriteAsync(digitalPinToGPIONumber(pin), data, num_rmt_symbols) -#define rmtWriteLooping(pin, data, num_rmt_symbols) rmtWriteLooping(digitalPinToGPIONumber(pin), data, num_rmt_symbols) -#define rmtTransmitCompleted(pin) rmtTransmitCompleted(digitalPinToGPIONumber(pin)) -#define rmtRead(pin, data, num_rmt_symbols, timeout_ms) rmtRead(digitalPinToGPIONumber(pin), data, num_rmt_symbols, timeout_ms) -#define rmtReadAsync(pin, data, num_rmt_symbols) rmtReadAsync(digitalPinToGPIONumber(pin), data, num_rmt_symbols) -#define rmtReceiveCompleted(pin) rmtReceiveCompleted(digitalPinToGPIONumber(pin)) -#define rmtSetRxMaxThreshold(pin, idle_thres_ticks) rmtSetRxMaxThreshold(digitalPinToGPIONumber(pin), idle_thres_ticks) -#define rmtSetCarrier(pin, carrier_en, carrier_level, frequency_Hz, duty_percent) rmtSetCarrier(digitalPinToGPIONumber(pin), carrier_en, carrier_level, frequency_Hz, duty_percent) +#define rmtSetEOT(pin, EOT_Level) rmtSetEOT(digitalPinToGPIONumber(pin), EOT_Level) +#define rmtWrite(pin, data, num_rmt_symbols, timeout_ms) rmtWrite(digitalPinToGPIONumber(pin), data, num_rmt_symbols, timeout_ms) +#define rmtWriteAsync(pin, data, num_rmt_symbols) rmtWriteAsync(digitalPinToGPIONumber(pin), data, num_rmt_symbols) +#define rmtWriteLooping(pin, data, num_rmt_symbols) rmtWriteLooping(digitalPinToGPIONumber(pin), data, num_rmt_symbols) +#define rmtTransmitCompleted(pin) rmtTransmitCompleted(digitalPinToGPIONumber(pin)) +#define rmtRead(pin, data, num_rmt_symbols, timeout_ms) rmtRead(digitalPinToGPIONumber(pin), data, num_rmt_symbols, timeout_ms) +#define rmtReadAsync(pin, data, num_rmt_symbols) rmtReadAsync(digitalPinToGPIONumber(pin), data, num_rmt_symbols) +#define rmtReceiveCompleted(pin) rmtReceiveCompleted(digitalPinToGPIONumber(pin)) +#define rmtSetRxMaxThreshold(pin, idle_thres_ticks) rmtSetRxMaxThreshold(digitalPinToGPIONumber(pin), idle_thres_ticks) +#define rmtSetCarrier(pin, carrier_en, carrier_level, frequency_Hz, duty_percent) \ + rmtSetCarrier(digitalPinToGPIONumber(pin), carrier_en, carrier_level, frequency_Hz, duty_percent) #define rmtSetRxMinThreshold(pin, filter_pulse_ticks) rmtSetRxMinThreshold(digitalPinToGPIONumber(pin), filter_pulse_ticks) -#define rmtDeinit(pin) rmtDeinit(digitalPinToGPIONumber(pin)) +#define rmtDeinit(pin) rmtDeinit(digitalPinToGPIONumber(pin)) // cores/esp32/esp32-hal-sigmadelta.h #define sigmaDeltaAttach(pin, freq) sigmaDeltaAttach(digitalPinToGPIONumber(pin), freq) -#define sigmaDeltaWrite(pin, duty) sigmaDeltaWrite(digitalPinToGPIONumber(pin), duty) -#define sigmaDeltaDetach(pin) sigmaDeltaDetach(digitalPinToGPIONumber(pin)) +#define sigmaDeltaWrite(pin, duty) sigmaDeltaWrite(digitalPinToGPIONumber(pin), duty) +#define sigmaDeltaDetach(pin) sigmaDeltaDetach(digitalPinToGPIONumber(pin)) // cores/esp32/esp32-hal-spi.h -#define spiAttachSCK(spi, sck) spiAttachSCK(spi, digitalPinToGPIONumber(sck)) -#define spiAttachMISO(spi, miso) spiAttachMISO(spi, digitalPinToGPIONumber(miso)) -#define spiAttachMOSI(spi, mosi) spiAttachMOSI(spi, digitalPinToGPIONumber(mosi)) +#define spiAttachSCK(spi, sck) spiAttachSCK(spi, digitalPinToGPIONumber(sck)) +#define spiAttachMISO(spi, miso) spiAttachMISO(spi, digitalPinToGPIONumber(miso)) +#define spiAttachMOSI(spi, mosi) spiAttachMOSI(spi, digitalPinToGPIONumber(mosi)) #define spiAttachSS(spi, cs_num, ss) spiAttachSS(spi, cs_num, digitalPinToGPIONumber(ss)) // cores/esp32/esp32-hal-touch.h -#define touchInterruptGetLastStatus(pin) touchInterruptGetLastStatus(digitalPinToGPIONumber(pin)) -#define touchRead(pin) touchRead(digitalPinToGPIONumber(pin)) +#define touchInterruptGetLastStatus(pin) touchInterruptGetLastStatus(digitalPinToGPIONumber(pin)) +#define touchRead(pin) touchRead(digitalPinToGPIONumber(pin)) #define touchAttachInterruptArg(pin, userFunc, arg, threshold) touchAttachInterruptArg(digitalPinToGPIONumber(pin), userFunc, arg, threshold) -#define touchAttachInterrupt(pin, userFunc, threshold) touchAttachInterrupt(digitalPinToGPIONumber(pin), userFunc, threshold) -#define touchDetachInterrupt(pin) touchDetachInterrupt(digitalPinToGPIONumber(pin)) -#define touchSleepWakeUpEnable(pin, threshold) touchSleepWakeUpEnable(digitalPinToGPIONumber(pin), threshold) +#define touchAttachInterrupt(pin, userFunc, threshold) touchAttachInterrupt(digitalPinToGPIONumber(pin), userFunc, threshold) +#define touchDetachInterrupt(pin) touchDetachInterrupt(digitalPinToGPIONumber(pin)) +#define touchSleepWakeUpEnable(pin, threshold) touchSleepWakeUpEnable(digitalPinToGPIONumber(pin), threshold) // cores/esp32/esp32-hal-uart.h -#define uartBegin(uart_nr, baudrate, config, rxPin, txPin, rx_buffer_size, tx_buffer_size, inverted, rxfifo_full_thrhd) \ - uartBegin(uart_nr, baudrate, config, digitalPinToGPIONumber(rxPin), digitalPinToGPIONumber(txPin), rx_buffer_size, tx_buffer_size, inverted, rxfifo_full_thrhd) +#define uartBegin(uart_nr, baudrate, config, rxPin, txPin, rx_buffer_size, tx_buffer_size, inverted, rxfifo_full_thrhd) \ + uartBegin( \ + uart_nr, baudrate, config, digitalPinToGPIONumber(rxPin), digitalPinToGPIONumber(txPin), rx_buffer_size, tx_buffer_size, inverted, rxfifo_full_thrhd \ + ) #define uartSetPins(uart, rxPin, txPin, ctsPin, rtsPin) \ uartSetPins(uart, digitalPinToGPIONumber(rxPin), digitalPinToGPIONumber(txPin), digitalPinToGPIONumber(ctsPin), digitalPinToGPIONumber(rtsPin)) #define uartDetachPins(uart, rxPin, txPin, ctsPin, rtsPin) \ diff --git a/cores/esp32/libb64/cdecode.c b/cores/esp32/libb64/cdecode.c index a4ba209b0..2485397d2 100644 --- a/cores/esp32/libb64/cdecode.c +++ b/cores/esp32/libb64/cdecode.c @@ -9,21 +9,25 @@ For details, see http://sourceforge.net/projects/libb64 #include static int base64_decode_value_signed(int8_t value_in) { - static const int8_t decoding[] = { 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }; + static const int8_t decoding[] = {62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51}; static const int8_t decoding_size = sizeof(decoding); value_in -= 43; - if (value_in < 0 || value_in >= decoding_size) return -1; + if (value_in < 0 || value_in >= decoding_size) { + return -1; + } return decoding[(int)value_in]; } -void base64_init_decodestate(base64_decodestate* state_in) { +void base64_init_decodestate(base64_decodestate *state_in) { state_in->step = step_a; state_in->plainchar = 0; } -static int base64_decode_block_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out, base64_decodestate* state_in) { - const int8_t* codechar = code_in; - int8_t* plainchar = plaintext_out; +static int base64_decode_block_signed(const int8_t *code_in, const int length_in, int8_t *plaintext_out, base64_decodestate *state_in) { + const int8_t *codechar = code_in; + int8_t *plainchar = plaintext_out; int8_t fragment; *plainchar = state_in->plainchar; @@ -81,22 +85,24 @@ static int base64_decode_block_signed(const int8_t* code_in, const int length_in return plainchar - plaintext_out; } -static int base64_decode_chars_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out) { +static int base64_decode_chars_signed(const int8_t *code_in, const int length_in, int8_t *plaintext_out) { base64_decodestate _state; base64_init_decodestate(&_state); int len = base64_decode_block_signed(code_in, length_in, plaintext_out, &_state); - if (len > 0) plaintext_out[len] = 0; + if (len > 0) { + plaintext_out[len] = 0; + } return len; } int base64_decode_value(char value_in) { - return base64_decode_value_signed(*((int8_t*)&value_in)); + return base64_decode_value_signed(*((int8_t *)&value_in)); } -int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in) { - return base64_decode_block_signed((int8_t*)code_in, length_in, (int8_t*)plaintext_out, state_in); +int base64_decode_block(const char *code_in, const int length_in, char *plaintext_out, base64_decodestate *state_in) { + return base64_decode_block_signed((int8_t *)code_in, length_in, (int8_t *)plaintext_out, state_in); } -int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out) { - return base64_decode_chars_signed((int8_t*)code_in, length_in, (int8_t*)plaintext_out); +int base64_decode_chars(const char *code_in, const int length_in, char *plaintext_out) { + return base64_decode_chars_signed((int8_t *)code_in, length_in, (int8_t *)plaintext_out); } diff --git a/cores/esp32/libb64/cdecode.h b/cores/esp32/libb64/cdecode.h index c8b8ef4e9..f2ec3d606 100644 --- a/cores/esp32/libb64/cdecode.h +++ b/cores/esp32/libb64/cdecode.h @@ -14,25 +14,25 @@ For details, see http://sourceforge.net/projects/libb64 extern "C" { #endif - typedef enum { - step_a, - step_b, - step_c, - step_d - } base64_decodestep; +typedef enum { + step_a, + step_b, + step_c, + step_d +} base64_decodestep; - typedef struct { - base64_decodestep step; - char plainchar; - } base64_decodestate; +typedef struct { + base64_decodestep step; + char plainchar; +} base64_decodestate; - void base64_init_decodestate(base64_decodestate* state_in); +void base64_init_decodestate(base64_decodestate *state_in); - int base64_decode_value(char value_in); +int base64_decode_value(char value_in); - int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in); +int base64_decode_block(const char *code_in, const int length_in, char *plaintext_out, base64_decodestate *state_in); - int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out); +int base64_decode_chars(const char *code_in, const int length_in, char *plaintext_out); #ifdef __cplusplus } // extern "C" diff --git a/cores/esp32/libb64/cencode.c b/cores/esp32/libb64/cencode.c index 2954d2f0f..75b0f31bc 100644 --- a/cores/esp32/libb64/cencode.c +++ b/cores/esp32/libb64/cencode.c @@ -7,23 +7,23 @@ For details, see http://sourceforge.net/projects/libb64 #include "cencode.h" -void base64_init_encodestate(base64_encodestate* state_in) { +void base64_init_encodestate(base64_encodestate *state_in) { state_in->step = step_A; state_in->result = 0; } char base64_encode_value(char value_in) { - static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + static const char *encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; if (value_in > 63) { return '='; } return encoding[(int)value_in]; } -int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in) { - const char* plainchar = plaintext_in; - const char* const plaintextend = plaintext_in + length_in; - char* codechar = code_out; +int base64_encode_block(const char *plaintext_in, int length_in, char *code_out, base64_encodestate *state_in) { + const char *plainchar = plaintext_in; + const char *const plaintextend = plaintext_in + length_in; + char *codechar = code_out; char result; char fragment; @@ -70,8 +70,8 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, return codechar - code_out; } -int base64_encode_blockend(char* code_out, base64_encodestate* state_in) { - char* codechar = code_out; +int base64_encode_blockend(char *code_out, base64_encodestate *state_in) { + char *codechar = code_out; switch (state_in->step) { case step_B: @@ -83,15 +83,14 @@ int base64_encode_blockend(char* code_out, base64_encodestate* state_in) { *codechar++ = base64_encode_value(state_in->result); *codechar++ = '='; break; - case step_A: - break; + case step_A: break; } *codechar = 0x00; return codechar - code_out; } -int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out) { +int base64_encode_chars(const char *plaintext_in, int length_in, char *code_out) { base64_encodestate _state; base64_init_encodestate(&_state); int len = base64_encode_block(plaintext_in, length_in, code_out, &_state); diff --git a/cores/esp32/libb64/cencode.h b/cores/esp32/libb64/cencode.h index e81e804f6..165220ec0 100644 --- a/cores/esp32/libb64/cencode.h +++ b/cores/esp32/libb64/cencode.h @@ -14,27 +14,27 @@ For details, see http://sourceforge.net/projects/libb64 extern "C" { #endif - typedef enum { - step_A, - step_B, - step_C - } base64_encodestep; +typedef enum { + step_A, + step_B, + step_C +} base64_encodestep; - typedef struct { - base64_encodestep step; - char result; - int stepcount; - } base64_encodestate; +typedef struct { + base64_encodestep step; + char result; + int stepcount; +} base64_encodestate; - void base64_init_encodestate(base64_encodestate* state_in); +void base64_init_encodestate(base64_encodestate *state_in); - char base64_encode_value(char value_in); +char base64_encode_value(char value_in); - int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in); +int base64_encode_block(const char *plaintext_in, int length_in, char *code_out, base64_encodestate *state_in); - int base64_encode_blockend(char* code_out, base64_encodestate* state_in); +int base64_encode_blockend(char *code_out, base64_encodestate *state_in); - int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out); +int base64_encode_chars(const char *plaintext_in, int length_in, char *code_out); #ifdef __cplusplus } // extern "C" diff --git a/cores/esp32/main.cpp b/cores/esp32/main.cpp index d613b58da..21f150834 100644 --- a/cores/esp32/main.cpp +++ b/cores/esp32/main.cpp @@ -71,7 +71,9 @@ void loopTask(void *pvParameters) { esp_task_wdt_reset(); } loop(); - if (serialEventRun) serialEventRun(); + if (serialEventRun) { + serialEventRun(); + } } } diff --git a/cores/esp32/pgmspace.h b/cores/esp32/pgmspace.h index 2b0f0270b..4a53b1d66 100644 --- a/cores/esp32/pgmspace.h +++ b/cores/esp32/pgmspace.h @@ -30,60 +30,64 @@ typedef long prog_int32_t; typedef unsigned long prog_uint32_t; #define PROGMEM -#define PGM_P const char * -#define PGM_VOID_P const void * -#define PSTR(s) (s) +#define PGM_P const char * +#define PGM_VOID_P const void * +#define PSTR(s) (s) #define _SFR_BYTE(n) (n) #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) -#define pgm_read_word(addr) ({ \ - typeof(addr) _addr = (addr); \ - *(const unsigned short *)(_addr); \ -}) -#define pgm_read_dword(addr) ({ \ - typeof(addr) _addr = (addr); \ - *(const unsigned long *)(_addr); \ -}) -#define pgm_read_float(addr) ({ \ - typeof(addr) _addr = (addr); \ - *(const float *)(_addr); \ -}) -#define pgm_read_ptr(addr) ({ \ - typeof(addr) _addr = (addr); \ - *(void *const *)(_addr); \ -}) +#define pgm_read_word(addr) \ + ({ \ + typeof(addr) _addr = (addr); \ + *(const unsigned short *)(_addr); \ + }) +#define pgm_read_dword(addr) \ + ({ \ + typeof(addr) _addr = (addr); \ + *(const unsigned long *)(_addr); \ + }) +#define pgm_read_float(addr) \ + ({ \ + typeof(addr) _addr = (addr); \ + *(const float *)(_addr); \ + }) +#define pgm_read_ptr(addr) \ + ({ \ + typeof(addr) _addr = (addr); \ + *(void *const *)(_addr); \ + }) #define pgm_get_far_address(x) ((uint32_t)(&(x))) -#define pgm_read_byte_near(addr) pgm_read_byte(addr) -#define pgm_read_word_near(addr) pgm_read_word(addr) +#define pgm_read_byte_near(addr) pgm_read_byte(addr) +#define pgm_read_word_near(addr) pgm_read_word(addr) #define pgm_read_dword_near(addr) pgm_read_dword(addr) #define pgm_read_float_near(addr) pgm_read_float(addr) -#define pgm_read_ptr_near(addr) pgm_read_ptr(addr) -#define pgm_read_byte_far(addr) pgm_read_byte(addr) -#define pgm_read_word_far(addr) pgm_read_word(addr) -#define pgm_read_dword_far(addr) pgm_read_dword(addr) -#define pgm_read_float_far(addr) pgm_read_float(addr) -#define pgm_read_ptr_far(addr) pgm_read_ptr(addr) +#define pgm_read_ptr_near(addr) pgm_read_ptr(addr) +#define pgm_read_byte_far(addr) pgm_read_byte(addr) +#define pgm_read_word_far(addr) pgm_read_word(addr) +#define pgm_read_dword_far(addr) pgm_read_dword(addr) +#define pgm_read_float_far(addr) pgm_read_float(addr) +#define pgm_read_ptr_far(addr) pgm_read_ptr(addr) -#define memcmp_P memcmp -#define memccpy_P memccpy -#define memmem_P memmem -#define memcpy_P memcpy -#define strcpy_P strcpy -#define strncpy_P strncpy -#define strcat_P strcat -#define strncat_P strncat -#define strcmp_P strcmp -#define strncmp_P strncmp -#define strcasecmp_P strcasecmp +#define memcmp_P memcmp +#define memccpy_P memccpy +#define memmem_P memmem +#define memcpy_P memcpy +#define strcpy_P strcpy +#define strncpy_P strncpy +#define strcat_P strcat +#define strncat_P strncat +#define strcmp_P strcmp +#define strncmp_P strncmp +#define strcasecmp_P strcasecmp #define strncasecmp_P strncasecmp -#define strlen_P strlen -#define strnlen_P strnlen -#define strstr_P strstr -#define printf_P printf -#define sprintf_P sprintf -#define snprintf_P snprintf -#define vsnprintf_P vsnprintf +#define strlen_P strlen +#define strnlen_P strnlen +#define strstr_P strstr +#define printf_P printf +#define sprintf_P sprintf +#define snprintf_P snprintf +#define vsnprintf_P vsnprintf #endif diff --git a/cores/esp32/stdlib_noniso.c b/cores/esp32/stdlib_noniso.c index aac17971b..0acb26c67 100644 --- a/cores/esp32/stdlib_noniso.c +++ b/cores/esp32/stdlib_noniso.c @@ -30,9 +30,9 @@ #include "stdlib_noniso.h" #include "esp_system.h" -static void reverse(char* begin, char* end) { - char* is = begin; - char* ie = end - 1; +static void reverse(char *begin, char *end) { + char *is = begin; + char *ie = end - 1; while (is < ie) { char tmp = *ie; *ie = *is; @@ -42,13 +42,13 @@ static void reverse(char* begin, char* end) { } } -char* ltoa(long value, char* result, int base) { +char *ltoa(long value, char *result, int base) { if (base < 2 || base > 16) { *result = 0; return result; } - char* out = result; + char *out = result; long quotient = abs(value); do { @@ -59,21 +59,22 @@ char* ltoa(long value, char* result, int base) { } while (quotient); // Apply negative sign - if (value < 0) + if (value < 0) { *out++ = '-'; + } reverse(result, out); *out = 0; return result; } -char* lltoa(long long val, char* result, int base) { +char *lltoa(long long val, char *result, int base) { if (base < 2 || base > 16) { *result = 0; return result; } - char* out = result; + char *out = result; long long quotient = val > 0 ? val : -val; do { @@ -84,21 +85,22 @@ char* lltoa(long long val, char* result, int base) { } while (quotient); // Apply negative sign - if (val < 0) + if (val < 0) { *out++ = '-'; + } reverse(result, out); *out = 0; return result; } -char* ultoa(unsigned long value, char* result, int base) { +char *ultoa(unsigned long value, char *result, int base) { if (base < 2 || base > 16) { *result = 0; return result; } - char* out = result; + char *out = result; unsigned long quotient = value; do { @@ -113,13 +115,13 @@ char* ultoa(unsigned long value, char* result, int base) { return result; } -char* ulltoa(unsigned long long val, char* result, int base) { +char *ulltoa(unsigned long long val, char *result, int base) { if (base < 2 || base > 16) { *result = 0; return result; } - char* out = result; + char *out = result; unsigned long long quotient = val; do { @@ -134,7 +136,7 @@ char* ulltoa(unsigned long long val, char* result, int base) { return result; } -char* dtostrf(double number, signed int width, unsigned int prec, char* s) { +char *dtostrf(double number, signed int width, unsigned int prec, char *s) { bool negative = false; if (isnan(number)) { @@ -146,7 +148,7 @@ char* dtostrf(double number, signed int width, unsigned int prec, char* s) { return s; } - char* out = s; + char *out = s; int fillme = width; // how many cells to fill for the integer part if (prec > 0) { @@ -163,8 +165,9 @@ char* dtostrf(double number, signed int width, unsigned int prec, char* s) { // Round correctly so that print(1.999, 2) prints as "2.00" // I optimized out most of the divisions double rounding = 2.0; - for (unsigned int i = 0; i < prec; ++i) + for (unsigned int i = 0; i < prec; ++i) { rounding *= 10.0; + } rounding = 1.0 / rounding; number += rounding; @@ -186,14 +189,18 @@ char* dtostrf(double number, signed int width, unsigned int prec, char* s) { } // Handle negative sign - if (negative) *out++ = '-'; + if (negative) { + *out++ = '-'; + } // Print the digits, and if necessary, the decimal point digitcount += prec; int8_t digit = 0; while (digitcount-- > 0) { digit = (int8_t)number; - if (digit > 9) digit = 9; // insurance + if (digit > 9) { + digit = 9; // insurance + } *out++ = (char)('0' | digit); if ((digitcount == prec) && (prec > 0)) { *out++ = '.'; diff --git a/cores/esp32/stdlib_noniso.h b/cores/esp32/stdlib_noniso.h index 33fbe7143..8c162e690 100644 --- a/cores/esp32/stdlib_noniso.h +++ b/cores/esp32/stdlib_noniso.h @@ -25,29 +25,28 @@ extern "C" { #endif - int atoi(const char* s); +int atoi(const char *s); - long atol(const char* s); +long atol(const char *s); - double atof(const char* s); +double atof(const char *s); - char* itoa(int val, char* s, int radix); +char *itoa(int val, char *s, int radix); - char* ltoa(long val, char* s, int radix); +char *ltoa(long val, char *s, int radix); - char* lltoa(long long val, char* s, int radix); +char *lltoa(long long val, char *s, int radix); - char* utoa(unsigned int val, char* s, int radix); +char *utoa(unsigned int val, char *s, int radix); - char* ultoa(unsigned long val, char* s, int radix); +char *ultoa(unsigned long val, char *s, int radix); - char* ulltoa(unsigned long long val, char* s, int radix); +char *ulltoa(unsigned long long val, char *s, int radix); - char* dtostrf(double val, signed int width, unsigned int prec, char* s); +char *dtostrf(double val, signed int width, unsigned int prec, char *s); #ifdef __cplusplus } // extern "C" #endif - #endif diff --git a/cores/esp32/wiring_private.h b/cores/esp32/wiring_private.h index 37a21556d..753fe40f8 100644 --- a/cores/esp32/wiring_private.h +++ b/cores/esp32/wiring_private.h @@ -34,9 +34,9 @@ extern "C" { #endif - typedef void (*voidFuncPtr)(void); +typedef void (*voidFuncPtr)(void); - void initPins(); +void initPins(); #ifdef __cplusplus } // extern "C" diff --git a/cores/esp32/wiring_pulse.c b/cores/esp32/wiring_pulse.c index 9dabb3d4e..1f9d175ad 100644 --- a/cores/esp32/wiring_pulse.c +++ b/cores/esp32/wiring_pulse.c @@ -19,11 +19,11 @@ #include "pins_arduino.h" #include "esp_cpu.h" -#define WAIT_FOR_PIN_STATE(state) \ - while (digitalRead(pin) != (state)) { \ +#define WAIT_FOR_PIN_STATE(state) \ + while (digitalRead(pin) != (state)) { \ if (esp_cpu_get_cycle_count() - start_cycle_count > timeout_cycles) { \ - return 0; \ - } \ + return 0; \ + } \ } // max timeout is 27 seconds at 160MHz clock and 54 seconds at 80MHz clock diff --git a/cores/esp32/wiring_shift.c b/cores/esp32/wiring_shift.c index 67360a586..7148ec303 100644 --- a/cores/esp32/wiring_shift.c +++ b/cores/esp32/wiring_shift.c @@ -26,10 +26,11 @@ uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) { for (i = 0; i < 8; ++i) { //digitalWrite(clockPin, HIGH); - if (bitOrder == LSBFIRST) + if (bitOrder == LSBFIRST) { value |= digitalRead(dataPin) << i; - else + } else { value |= digitalRead(dataPin) << (7 - i); + } digitalWrite(clockPin, HIGH); digitalWrite(clockPin, LOW); } @@ -40,10 +41,11 @@ void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val) uint8_t i; for (i = 0; i < 8; i++) { - if (bitOrder == LSBFIRST) + if (bitOrder == LSBFIRST) { digitalWrite(dataPin, !!(val & (1 << i))); - else + } else { digitalWrite(dataPin, !!(val & (1 << (7 - i)))); + } digitalWrite(clockPin, HIGH); digitalWrite(clockPin, LOW); diff --git a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino index 2c7380f10..cac1e4f4b 100644 --- a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino +++ b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino @@ -3,8 +3,8 @@ #include #include -const char* ssid = ".........."; -const char* password = ".........."; +const char *ssid = ".........."; +const char *password = ".........."; void setup() { Serial.begin(115200); @@ -33,10 +33,11 @@ void setup() { ArduinoOTA .onStart([]() { String type; - if (ArduinoOTA.getCommand() == U_FLASH) + if (ArduinoOTA.getCommand() == U_FLASH) { type = "sketch"; - else // U_SPIFFS + } else { // U_SPIFFS type = "filesystem"; + } // NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end() Serial.println("Start updating " + type); @@ -49,11 +50,17 @@ void setup() { }) .onError([](ota_error_t error) { Serial.printf("Error[%u]: ", error); - if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); - else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); - else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); - else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); - else if (error == OTA_END_ERROR) Serial.println("End Failed"); + if (error == OTA_AUTH_ERROR) { + Serial.println("Auth Failed"); + } else if (error == OTA_BEGIN_ERROR) { + Serial.println("Begin Failed"); + } else if (error == OTA_CONNECT_ERROR) { + Serial.println("Connect Failed"); + } else if (error == OTA_RECEIVE_ERROR) { + Serial.println("Receive Failed"); + } else if (error == OTA_END_ERROR) { + Serial.println("End Failed"); + } }); ArduinoOTA.begin(); diff --git a/libraries/ArduinoOTA/src/ArduinoOTA.cpp b/libraries/ArduinoOTA/src/ArduinoOTA.cpp index d8a00433b..6fa482e13 100644 --- a/libraries/ArduinoOTA/src/ArduinoOTA.cpp +++ b/libraries/ArduinoOTA/src/ArduinoOTA.cpp @@ -8,45 +8,44 @@ #include "MD5Builder.h" #include "Update.h" - // #define OTA_DEBUG Serial ArduinoOTAClass::ArduinoOTAClass() - : _port(0), _initialized(false), _rebootOnSuccess(true), _mdnsEnabled(true), _state(OTA_IDLE), _size(0), _cmd(0), _ota_port(0), _ota_timeout(1000), _start_callback(NULL), _end_callback(NULL), _error_callback(NULL), _progress_callback(NULL) { -} + : _port(0), _initialized(false), _rebootOnSuccess(true), _mdnsEnabled(true), _state(OTA_IDLE), _size(0), _cmd(0), _ota_port(0), _ota_timeout(1000), + _start_callback(NULL), _end_callback(NULL), _error_callback(NULL), _progress_callback(NULL) {} ArduinoOTAClass::~ArduinoOTAClass() { _udp_ota.stop(); } -ArduinoOTAClass& ArduinoOTAClass::onStart(THandlerFunction fn) { +ArduinoOTAClass &ArduinoOTAClass::onStart(THandlerFunction fn) { _start_callback = fn; return *this; } -ArduinoOTAClass& ArduinoOTAClass::onEnd(THandlerFunction fn) { +ArduinoOTAClass &ArduinoOTAClass::onEnd(THandlerFunction fn) { _end_callback = fn; return *this; } -ArduinoOTAClass& ArduinoOTAClass::onProgress(THandlerFunction_Progress fn) { +ArduinoOTAClass &ArduinoOTAClass::onProgress(THandlerFunction_Progress fn) { _progress_callback = fn; return *this; } -ArduinoOTAClass& ArduinoOTAClass::onError(THandlerFunction_Error fn) { +ArduinoOTAClass &ArduinoOTAClass::onError(THandlerFunction_Error fn) { _error_callback = fn; return *this; } -ArduinoOTAClass& ArduinoOTAClass::setPort(uint16_t port) { +ArduinoOTAClass &ArduinoOTAClass::setPort(uint16_t port) { if (!_initialized && !_port && port) { _port = port; } return *this; } -ArduinoOTAClass& ArduinoOTAClass::setHostname(const char* hostname) { +ArduinoOTAClass &ArduinoOTAClass::setHostname(const char *hostname) { if (!_initialized && !_hostname.length() && hostname) { _hostname = hostname; } @@ -57,7 +56,7 @@ String ArduinoOTAClass::getHostname() { return _hostname; } -ArduinoOTAClass& ArduinoOTAClass::setPassword(const char* password) { +ArduinoOTAClass &ArduinoOTAClass::setPassword(const char *password) { if (!_initialized && !_password.length() && password) { MD5Builder passmd5; passmd5.begin(); @@ -68,14 +67,14 @@ ArduinoOTAClass& ArduinoOTAClass::setPassword(const char* password) { return *this; } -ArduinoOTAClass& ArduinoOTAClass::setPasswordHash(const char* password) { +ArduinoOTAClass &ArduinoOTAClass::setPasswordHash(const char *password) { if (!_initialized && !_password.length() && password) { _password = password; } return *this; } -ArduinoOTAClass& ArduinoOTAClass::setPartitionLabel(const char* partition_label) { +ArduinoOTAClass &ArduinoOTAClass::setPartitionLabel(const char *partition_label) { if (!_initialized && !_partition_label.length() && partition_label) { _partition_label = partition_label; } @@ -86,12 +85,12 @@ String ArduinoOTAClass::getPartitionLabel() { return _partition_label; } -ArduinoOTAClass& ArduinoOTAClass::setRebootOnSuccess(bool reboot) { +ArduinoOTAClass &ArduinoOTAClass::setRebootOnSuccess(bool reboot) { _rebootOnSuccess = reboot; return *this; } -ArduinoOTAClass& ArduinoOTAClass::setMdnsEnabled(bool enabled) { +ArduinoOTAClass &ArduinoOTAClass::setMdnsEnabled(bool enabled) { _mdnsEnabled = enabled; return *this; } @@ -111,7 +110,6 @@ void ArduinoOTAClass::begin() { return; } - if (!_hostname.length()) { char tmp[20]; uint8_t mac[6]; @@ -132,7 +130,9 @@ int ArduinoOTAClass::parseInt() { char data[INT_BUFFER_SIZE]; uint8_t index = 0; char value; - while (_udp_ota.peek() == ' ') _udp_ota.read(); + while (_udp_ota.peek() == ' ') { + _udp_ota.read(); + } while (index < INT_BUFFER_SIZE - 1) { value = _udp_ota.peek(); if (value < '0' || value > '9') { @@ -160,8 +160,9 @@ String ArduinoOTAClass::readStringUntil(char end) { void ArduinoOTAClass::_onRx() { if (_state == OTA_IDLE) { int cmd = parseInt(); - if (cmd != U_FLASH && cmd != U_SPIFFS) + if (cmd != U_FLASH && cmd != U_SPIFFS) { return; + } _cmd = cmd; _ota_port = parseInt(); _size = parseInt(); @@ -226,14 +227,16 @@ void ArduinoOTAClass::_onRx() { _udp_ota.print("Authentication Failed"); log_w("Authentication Failed"); _udp_ota.endPacket(); - if (_error_callback) _error_callback(OTA_AUTH_ERROR); + if (_error_callback) { + _error_callback(OTA_AUTH_ERROR); + } _state = OTA_IDLE; } } } void ArduinoOTAClass::_runUpdate() { - const char* partition_label = _partition_label.length() ? _partition_label.c_str() : NULL; + const char *partition_label = _partition_label.length() ? _partition_label.c_str() : NULL; if (!Update.begin(_size, _cmd, -1, LOW, partition_label)) { log_e("Begin ERROR: %s", Update.errorString()); diff --git a/libraries/ArduinoOTA/src/ArduinoOTA.h b/libraries/ArduinoOTA/src/ArduinoOTA.h index 9b751b752..02960d06f 100644 --- a/libraries/ArduinoOTA/src/ArduinoOTA.h +++ b/libraries/ArduinoOTA/src/ArduinoOTA.h @@ -31,39 +31,39 @@ public: ~ArduinoOTAClass(); //Sets the service port. Default 3232 - ArduinoOTAClass& setPort(uint16_t port); + ArduinoOTAClass &setPort(uint16_t port); //Sets the device hostname. Default esp32-xxxxxx - ArduinoOTAClass& setHostname(const char* hostname); + ArduinoOTAClass &setHostname(const char *hostname); String getHostname(); //Sets the password that will be required for OTA. Default NULL - ArduinoOTAClass& setPassword(const char* password); + ArduinoOTAClass &setPassword(const char *password); //Sets the password as above but in the form MD5(password). Default NULL - ArduinoOTAClass& setPasswordHash(const char* password); + ArduinoOTAClass &setPasswordHash(const char *password); //Sets the partition label to write to when updating SPIFFS. Default NULL - ArduinoOTAClass& setPartitionLabel(const char* partition_label); + ArduinoOTAClass &setPartitionLabel(const char *partition_label); String getPartitionLabel(); //Sets if the device should be rebooted after successful update. Default true - ArduinoOTAClass& setRebootOnSuccess(bool reboot); + ArduinoOTAClass &setRebootOnSuccess(bool reboot); //Sets if the device should advertise itself to Arduino IDE. Default true - ArduinoOTAClass& setMdnsEnabled(bool enabled); + ArduinoOTAClass &setMdnsEnabled(bool enabled); //This callback will be called when OTA connection has begun - ArduinoOTAClass& onStart(THandlerFunction fn); + ArduinoOTAClass &onStart(THandlerFunction fn); //This callback will be called when OTA has finished - ArduinoOTAClass& onEnd(THandlerFunction fn); + ArduinoOTAClass &onEnd(THandlerFunction fn); //This callback will be called when OTA encountered Error - ArduinoOTAClass& onError(THandlerFunction_Error fn); + ArduinoOTAClass &onError(THandlerFunction_Error fn); //This callback will be called when OTA is receiving data - ArduinoOTAClass& onProgress(THandlerFunction_Progress fn); + ArduinoOTAClass &onProgress(THandlerFunction_Progress fn); //Starts the ArduinoOTA service void begin(); diff --git a/libraries/AsyncUDP/examples/AsyncUDPClient/AsyncUDPClient.ino b/libraries/AsyncUDP/examples/AsyncUDPClient/AsyncUDPClient.ino index 23b24a303..c842eab72 100644 --- a/libraries/AsyncUDP/examples/AsyncUDPClient/AsyncUDPClient.ino +++ b/libraries/AsyncUDP/examples/AsyncUDPClient/AsyncUDPClient.ino @@ -1,8 +1,8 @@ #include "WiFi.h" #include "AsyncUDP.h" -const char* ssid = "***********"; -const char* password = "***********"; +const char *ssid = "***********"; +const char *password = "***********"; AsyncUDP udp; @@ -20,8 +20,7 @@ void setup() { Serial.println("UDP connected"); udp.onPacket([](AsyncUDPPacket packet) { Serial.print("UDP Packet Type: "); - Serial.print(packet.isBroadcast() ? "Broadcast" : packet.isMulticast() ? "Multicast" - : "Unicast"); + Serial.print(packet.isBroadcast() ? "Broadcast" : packet.isMulticast() ? "Multicast" : "Unicast"); Serial.print(", From: "); Serial.print(packet.remoteIP()); Serial.print(":"); diff --git a/libraries/AsyncUDP/examples/AsyncUDPMulticastServer/AsyncUDPMulticastServer.ino b/libraries/AsyncUDP/examples/AsyncUDPMulticastServer/AsyncUDPMulticastServer.ino index 375cda23d..0da2f1f00 100644 --- a/libraries/AsyncUDP/examples/AsyncUDPMulticastServer/AsyncUDPMulticastServer.ino +++ b/libraries/AsyncUDP/examples/AsyncUDPMulticastServer/AsyncUDPMulticastServer.ino @@ -1,8 +1,8 @@ #include "WiFi.h" #include "AsyncUDP.h" -const char* ssid = "***********"; -const char* password = "***********"; +const char *ssid = "***********"; +const char *password = "***********"; AsyncUDP udp; @@ -21,8 +21,7 @@ void setup() { Serial.println(WiFi.localIP()); udp.onPacket([](AsyncUDPPacket packet) { Serial.print("UDP Packet Type: "); - Serial.print(packet.isBroadcast() ? "Broadcast" : packet.isMulticast() ? "Multicast" - : "Unicast"); + Serial.print(packet.isBroadcast() ? "Broadcast" : packet.isMulticast() ? "Multicast" : "Unicast"); Serial.print(", From: "); Serial.print(packet.remoteIP()); Serial.print(":"); diff --git a/libraries/AsyncUDP/examples/AsyncUDPServer/AsyncUDPServer.ino b/libraries/AsyncUDP/examples/AsyncUDPServer/AsyncUDPServer.ino index c4f4a6c24..18cd66a5d 100644 --- a/libraries/AsyncUDP/examples/AsyncUDPServer/AsyncUDPServer.ino +++ b/libraries/AsyncUDP/examples/AsyncUDPServer/AsyncUDPServer.ino @@ -1,8 +1,8 @@ #include "WiFi.h" #include "AsyncUDP.h" -const char* ssid = "***********"; -const char* password = "***********"; +const char *ssid = "***********"; +const char *password = "***********"; AsyncUDP udp; @@ -21,8 +21,7 @@ void setup() { Serial.println(WiFi.localIP()); udp.onPacket([](AsyncUDPPacket packet) { Serial.print("UDP Packet Type: "); - Serial.print(packet.isBroadcast() ? "Broadcast" : packet.isMulticast() ? "Multicast" - : "Unicast"); + Serial.print(packet.isBroadcast() ? "Broadcast" : packet.isMulticast() ? "Multicast" : "Unicast"); Serial.print(", From: "); Serial.print(packet.remoteIP()); Serial.print(":"); diff --git a/libraries/AsyncUDP/src/AsyncUDP.cpp b/libraries/AsyncUDP/src/AsyncUDP.cpp index 3ebef6abd..4f799b4d4 100644 --- a/libraries/AsyncUDP/src/AsyncUDP.cpp +++ b/libraries/AsyncUDP/src/AsyncUDP.cpp @@ -15,9 +15,7 @@ extern "C" { #include "lwip/priv/tcpip_priv.h" -static const char *netif_ifkeys[TCPIP_ADAPTER_IF_MAX] = { - "WIFI_STA_DEF", "WIFI_AP_DEF", "ETH_DEF", "PPP_DEF" -}; +static const char *netif_ifkeys[TCPIP_ADAPTER_IF_MAX] = {"WIFI_STA_DEF", "WIFI_AP_DEF", "ETH_DEF", "PPP_DEF"}; static esp_err_t tcpip_adapter_get_netif(tcpip_adapter_if_t tcpip_if, void **netif) { *netif = NULL; @@ -172,7 +170,9 @@ static bool _udp_task_start() { } } if (!_udp_task_handle) { - xTaskCreateUniversal(_udp_task, "async_udp", 4096, NULL, CONFIG_ARDUINO_UDP_TASK_PRIORITY, (TaskHandle_t *)&_udp_task_handle, CONFIG_ARDUINO_UDP_RUNNING_CORE); + xTaskCreateUniversal( + _udp_task, "async_udp", 4096, NULL, CONFIG_ARDUINO_UDP_TASK_PRIORITY, (TaskHandle_t *)&_udp_task_handle, CONFIG_ARDUINO_UDP_RUNNING_CORE + ); if (!_udp_task_handle) { return false; } @@ -232,12 +232,9 @@ static bool _udp_task_stop(){ } */ - - #define UDP_MUTEX_LOCK() //xSemaphoreTake(_lock, portMAX_DELAY) #define UDP_MUTEX_UNLOCK() //xSemaphoreGive(_lock) - AsyncUDPMessage::AsyncUDPMessage(size_t size) { _index = 0; if (size > CONFIG_TCP_MSS) { @@ -762,7 +759,6 @@ size_t AsyncUDP::broadcast(const char *data) { return broadcast((uint8_t *)data, strlen(data)); } - size_t AsyncUDP::sendTo(AsyncUDPMessage &message, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if) { if (!message) { return 0; diff --git a/libraries/AsyncUDP/src/AsyncUDP.h b/libraries/AsyncUDP/src/AsyncUDP.h index b9cb6319a..160fb7b15 100644 --- a/libraries/AsyncUDP/src/AsyncUDP.h +++ b/libraries/AsyncUDP/src/AsyncUDP.h @@ -36,6 +36,7 @@ protected: uint8_t *_buffer; size_t _index; size_t _size; + public: AsyncUDPMessage(size_t size = CONFIG_TCP_MSS); virtual ~AsyncUDPMessage(); @@ -63,6 +64,7 @@ protected: uint8_t *_data; size_t _len; size_t _index; + public: AsyncUDPPacket(AsyncUDPPacket &packet); AsyncUDPPacket(AsyncUDP *udp, pbuf *pb, const ip_addr_t *addr, uint16_t port, struct netif *netif); diff --git a/libraries/BLE/examples/BLE5_extended_scan/BLE5_extended_scan.ino b/libraries/BLE/examples/BLE5_extended_scan/BLE5_extended_scan.ino index b05269415..f49794b6b 100644 --- a/libraries/BLE/examples/BLE5_extended_scan/BLE5_extended_scan.ino +++ b/libraries/BLE/examples/BLE5_extended_scan/BLE5_extended_scan.ino @@ -17,7 +17,7 @@ #include uint32_t scanTime = 100; //In 10ms (1000ms) -BLEScan* pBLEScan; +BLEScan *pBLEScan; class MyBLEExtAdvertisingCallbacks : public BLEExtAdvertisingCallbacks { void onResult(esp_ble_gap_ext_adv_report_t report) { diff --git a/libraries/BLE/examples/BLE5_multi_advertising/BLE5_multi_advertising.ino b/libraries/BLE/examples/BLE5_multi_advertising/BLE5_multi_advertising.ino index 6a69d706a..c4d614786 100644 --- a/libraries/BLE/examples/BLE5_multi_advertising/BLE5_multi_advertising.ino +++ b/libraries/BLE/examples/BLE5_multi_advertising/BLE5_multi_advertising.ino @@ -20,7 +20,7 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_1M = { .channel_map = ADV_CHNL_ALL, .own_addr_type = BLE_ADDR_TYPE_RANDOM, .peer_addr_type = BLE_ADDR_TYPE_RANDOM, - .peer_addr = { 0, 0, 0, 0, 0, 0 }, + .peer_addr = {0, 0, 0, 0, 0, 0}, .filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY, .tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE, .primary_phy = ESP_BLE_GAP_PHY_CODED, @@ -37,7 +37,7 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_2M = { .channel_map = ADV_CHNL_ALL, .own_addr_type = BLE_ADDR_TYPE_RANDOM, .peer_addr_type = BLE_ADDR_TYPE_RANDOM, - .peer_addr = { 0, 0, 0, 0, 0, 0 }, + .peer_addr = {0, 0, 0, 0, 0, 0}, .filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY, .tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE, .primary_phy = ESP_BLE_GAP_PHY_1M, @@ -54,7 +54,7 @@ esp_ble_gap_ext_adv_params_t legacy_adv_params = { .channel_map = ADV_CHNL_ALL, .own_addr_type = BLE_ADDR_TYPE_RANDOM, .peer_addr_type = BLE_ADDR_TYPE_RANDOM, - .peer_addr = { 0, 0, 0, 0, 0, 0 }, + .peer_addr = {0, 0, 0, 0, 0, 0}, .filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY, .tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE, .primary_phy = ESP_BLE_GAP_PHY_1M, @@ -71,7 +71,7 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_coded = { .channel_map = ADV_CHNL_ALL, .own_addr_type = BLE_ADDR_TYPE_RANDOM, .peer_addr_type = BLE_ADDR_TYPE_RANDOM, - .peer_addr = { 0, 0, 0, 0, 0, 0 }, + .peer_addr = {0, 0, 0, 0, 0, 0}, .filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY, .tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE, .primary_phy = ESP_BLE_GAP_PHY_1M, @@ -81,44 +81,26 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_coded = { .scan_req_notif = false, }; -static uint8_t raw_adv_data_1m[] = { - 0x02, 0x01, 0x06, - 0x02, 0x0a, 0xeb, - 0x12, 0x09, 'E', 'S', 'P', '_', 'M', 'U', 'L', 'T', 'I', '_', 'A', - 'D', 'V', '_', '1', 'M', 0X0 -}; +static uint8_t raw_adv_data_1m[] = {0x02, 0x01, 0x06, 0x02, 0x0a, 0xeb, 0x12, 0x09, 'E', 'S', 'P', '_', 'M', + 'U', 'L', 'T', 'I', '_', 'A', 'D', 'V', '_', '1', 'M', 0X0}; -static uint8_t raw_scan_rsp_data_2m[] = { - 0x02, 0x01, 0x06, - 0x02, 0x0a, 0xeb, - 0x12, 0x09, 'E', 'S', 'P', '_', 'M', 'U', 'L', 'T', 'I', '_', 'A', - 'D', 'V', '_', '2', 'M', 0X0 -}; +static uint8_t raw_scan_rsp_data_2m[] = {0x02, 0x01, 0x06, 0x02, 0x0a, 0xeb, 0x12, 0x09, 'E', 'S', 'P', '_', 'M', + 'U', 'L', 'T', 'I', '_', 'A', 'D', 'V', '_', '2', 'M', 0X0}; -static uint8_t legacy_adv_data[] = { - 0x02, 0x01, 0x06, - 0x02, 0x0a, 0xeb, - 0x15, 0x09, 'E', 'S', 'P', '_', 'M', 'U', 'L', 'T', 'I', '_', 'A', - 'D', 'V', '_', 'C', 'O', 'D', 'E', 'D', 0X0 -}; +static uint8_t legacy_adv_data[] = {0x02, 0x01, 0x06, 0x02, 0x0a, 0xeb, 0x15, 0x09, 'E', 'S', 'P', '_', 'M', 'U', + 'L', 'T', 'I', '_', 'A', 'D', 'V', '_', 'C', 'O', 'D', 'E', 'D', 0X0}; -static uint8_t legacy_scan_rsp_data[] = { - 0x02, 0x01, 0x06, - 0x02, 0x0a, 0xeb, - 0x16, 0x09, 'E', 'S', 'P', '_', 'M', 'U', 'L', 'T', 'I', '_', 'A', - 'D', 'V', '_', 'L', 'E', 'G', 'A', 'C', 'Y', 0X0 -}; +static uint8_t legacy_scan_rsp_data[] = {0x02, 0x01, 0x06, 0x02, 0x0a, 0xeb, 0x16, 0x09, 'E', 'S', 'P', '_', 'M', 'U', 'L', + 'T', 'I', '_', 'A', 'D', 'V', '_', 'L', 'E', 'G', 'A', 'C', 'Y', 0X0}; -static uint8_t raw_scan_rsp_data_coded[] = { - 0x37, 0x09, 'V', 'E', 'R', 'Y', '_', 'L', 'O', 'N', 'G', '_', 'D', 'E', 'V', 'I', 'C', 'E', '_', 'N', 'A', 'M', 'E', '_', - 'S', 'E', 'N', 'T', '_', 'U', 'S', 'I', 'N', 'G', '_', 'E', 'X', 'T', 'E', 'N', 'D', 'E', 'D', '_', 'A', 'D', 'V', 'E', 'R', 'T', 'I', 'S', 'I', 'N', 'G', 0X0 -}; +static uint8_t raw_scan_rsp_data_coded[] = {0x37, 0x09, 'V', 'E', 'R', 'Y', '_', 'L', 'O', 'N', 'G', '_', 'D', 'E', 'V', 'I', 'C', 'E', '_', + 'N', 'A', 'M', 'E', '_', 'S', 'E', 'N', 'T', '_', 'U', 'S', 'I', 'N', 'G', '_', 'E', 'X', 'T', + 'E', 'N', 'D', 'E', 'D', '_', 'A', 'D', 'V', 'E', 'R', 'T', 'I', 'S', 'I', 'N', 'G', 0X0}; - -uint8_t addr_1m[6] = { 0xc0, 0xde, 0x52, 0x00, 0x00, 0x01 }; -uint8_t addr_2m[6] = { 0xc0, 0xde, 0x52, 0x00, 0x00, 0x02 }; -uint8_t addr_legacy[6] = { 0xc0, 0xde, 0x52, 0x00, 0x00, 0x03 }; -uint8_t addr_coded[6] = { 0xc0, 0xde, 0x52, 0x00, 0x00, 0x04 }; +uint8_t addr_1m[6] = {0xc0, 0xde, 0x52, 0x00, 0x00, 0x01}; +uint8_t addr_2m[6] = {0xc0, 0xde, 0x52, 0x00, 0x00, 0x02}; +uint8_t addr_legacy[6] = {0xc0, 0xde, 0x52, 0x00, 0x00, 0x03}; +uint8_t addr_coded[6] = {0xc0, 0xde, 0x52, 0x00, 0x00, 0x04}; BLEMultiAdvertising advert(4); // max number of advertisement data diff --git a/libraries/BLE/examples/BLE5_periodic_advertising/BLE5_periodic_advertising.ino b/libraries/BLE/examples/BLE5_periodic_advertising/BLE5_periodic_advertising.ino index 8587a928c..796f63666 100644 --- a/libraries/BLE/examples/BLE5_periodic_advertising/BLE5_periodic_advertising.ino +++ b/libraries/BLE/examples/BLE5_periodic_advertising/BLE5_periodic_advertising.ino @@ -11,7 +11,6 @@ #include #include - esp_ble_gap_ext_adv_params_t ext_adv_params_2M = { .type = ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED, .interval_min = 0x40, @@ -19,7 +18,7 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_2M = { .channel_map = ADV_CHNL_ALL, .own_addr_type = BLE_ADDR_TYPE_RANDOM, .peer_addr_type = BLE_ADDR_TYPE_RANDOM, - .peer_addr = { 0, 0, 0, 0, 0, 0 }, + .peer_addr = {0, 0, 0, 0, 0, 0}, .filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY, .tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE, .primary_phy = ESP_BLE_GAP_PHY_1M, @@ -29,12 +28,8 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_2M = { .scan_req_notif = false, }; -static uint8_t raw_scan_rsp_data_2m[] = { - 0x02, 0x01, 0x06, - 0x02, 0x0a, 0xeb, - 0x12, 0x09, 'E', 'S', 'P', '_', 'M', 'U', 'L', 'T', 'I', '_', 'A', - 'D', 'V', '_', '2', 'M', 0X0 -}; +static uint8_t raw_scan_rsp_data_2m[] = {0x02, 0x01, 0x06, 0x02, 0x0a, 0xeb, 0x12, 0x09, 'E', 'S', 'P', '_', 'M', + 'U', 'L', 'T', 'I', '_', 'A', 'D', 'V', '_', '2', 'M', 0X0}; static esp_ble_gap_periodic_adv_params_t periodic_adv_params = { .interval_min = 0x320, // 1000 ms interval @@ -42,16 +37,10 @@ static esp_ble_gap_periodic_adv_params_t periodic_adv_params = { .properties = 0, // Do not include TX power }; -static uint8_t periodic_adv_raw_data[] = { - 0x02, 0x01, 0x06, - 0x02, 0x0a, 0xeb, - 0x03, 0x03, 0xab, 0xcd, - 0x11, 0x09, 'E', 'S', 'P', '_', 'P', 'E', 'R', 'I', 'O', 'D', 'I', - 'C', '_', 'A', 'D', 'V' -}; +static uint8_t periodic_adv_raw_data[] = {0x02, 0x01, 0x06, 0x02, 0x0a, 0xeb, 0x03, 0x03, 0xab, 0xcd, 0x11, 0x09, 'E', 'S', + 'P', '_', 'P', 'E', 'R', 'I', 'O', 'D', 'I', 'C', '_', 'A', 'D', 'V'}; - -uint8_t addr_2m[6] = { 0xc0, 0xde, 0x52, 0x00, 0x00, 0x02 }; +uint8_t addr_2m[6] = {0xc0, 0xde, 0x52, 0x00, 0x00, 0x02}; BLEMultiAdvertising advert(1); // max number of advertisement data diff --git a/libraries/BLE/examples/BLE5_periodic_sync/BLE5_periodic_sync.ino b/libraries/BLE/examples/BLE5_periodic_sync/BLE5_periodic_sync.ino index 795049364..9e976e6ca 100644 --- a/libraries/BLE/examples/BLE5_periodic_sync/BLE5_periodic_sync.ino +++ b/libraries/BLE/examples/BLE5_periodic_sync/BLE5_periodic_sync.ino @@ -21,7 +21,7 @@ static esp_ble_gap_periodic_adv_sync_params_t periodic_adv_sync_params = { .filter_policy = 0, .sid = 0, .addr_type = BLE_ADDR_TYPE_RANDOM, - .addr = { 0, 0, 0, 0, 0, 0 }, + .addr = {0, 0, 0, 0, 0, 0}, .skip = 10, .sync_timeout = 1000, // timeout: 1000 * 10ms }; @@ -33,7 +33,7 @@ class MyBLEExtAdvertisingCallbacks : public BLEExtAdvertisingCallbacks { adv_name = esp_ble_resolve_adv_data(params.adv_data, ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len); if ((adv_name != NULL) && (memcmp(adv_name, "ESP_MULTI_ADV_2M", adv_name_len) == 0) && !periodic_sync) { periodic_sync = true; - char adv_temp_name[60] = { '0' }; + char adv_temp_name[60] = {'0'}; memcpy(adv_temp_name, adv_name, adv_name_len); log_i("Start create sync with the peer device %s", adv_temp_name); periodic_adv_sync_params.sid = params.sid; @@ -63,17 +63,11 @@ class MyPeriodicScan : public BLEPeriodicScanCallbacks { void onSync(esp_ble_periodic_adv_sync_estab_param_t params) { log_i("ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, status %d", params.status); // esp_log_buffer_hex("sync addr", param->periodic_adv_sync_estab.adv_addr, 6); - log_i("sync handle %d sid %d perioic adv interval %d adv phy %d", params.sync_handle, - params.sid, - params.period_adv_interval, - params.adv_phy); + log_i("sync handle %d sid %d perioic adv interval %d adv phy %d", params.sync_handle, params.sid, params.period_adv_interval, params.adv_phy); } void onReport(esp_ble_gap_periodic_adv_report_t params) { - log_i("periodic adv report, sync handle %d data status %d data len %d rssi %d", params.sync_handle, - params.data_status, - params.data_length, - params.rssi); + log_i("periodic adv report, sync handle %d data status %d data len %d rssi %d", params.sync_handle, params.data_status, params.data_length, params.rssi); } }; diff --git a/libraries/BLE/examples/Beacon_Scanner/Beacon_Scanner.ino b/libraries/BLE/examples/Beacon_Scanner/Beacon_Scanner.ino index 54cd5a20e..fbbf89ad2 100644 --- a/libraries/BLE/examples/Beacon_Scanner/Beacon_Scanner.ino +++ b/libraries/BLE/examples/Beacon_Scanner/Beacon_Scanner.ino @@ -44,7 +44,10 @@ class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks { BLEBeacon oBeacon = BLEBeacon(); oBeacon.setData(strManufacturerData); Serial.printf("iBeacon Frame\n"); - Serial.printf("ID: %04X Major: %d Minor: %d UUID: %s Power: %d\n", oBeacon.getManufacturerId(), ENDIAN_CHANGE_U16(oBeacon.getMajor()), ENDIAN_CHANGE_U16(oBeacon.getMinor()), oBeacon.getProximityUUID().toString().c_str(), oBeacon.getSignalPower()); + Serial.printf( + "ID: %04X Major: %d Minor: %d UUID: %s Power: %d\n", oBeacon.getManufacturerId(), ENDIAN_CHANGE_U16(oBeacon.getMajor()), + ENDIAN_CHANGE_U16(oBeacon.getMinor()), oBeacon.getProximityUUID().toString().c_str(), oBeacon.getSignalPower() + ); } else { Serial.println("Found another manufacturers beacon!"); Serial.printf("strManufacturerData: %d ", strManufacturerData.length()); diff --git a/libraries/BLE/examples/Client/Client.ino b/libraries/BLE/examples/Client/Client.ino index ff6852d14..ce2eb2ff7 100644 --- a/libraries/BLE/examples/Client/Client.ino +++ b/libraries/BLE/examples/Client/Client.ino @@ -16,14 +16,10 @@ static BLEUUID charUUID("beb5483e-36e1-4688-b7f5-ea07361b26a8"); static boolean doConnect = false; static boolean connected = false; static boolean doScan = false; -static BLERemoteCharacteristic* pRemoteCharacteristic; -static BLEAdvertisedDevice* myDevice; +static BLERemoteCharacteristic *pRemoteCharacteristic; +static BLEAdvertisedDevice *myDevice; -static void notifyCallback( - BLERemoteCharacteristic* pBLERemoteCharacteristic, - uint8_t* pData, - size_t length, - bool isNotify) { +static void notifyCallback(BLERemoteCharacteristic *pBLERemoteCharacteristic, uint8_t *pData, size_t length, bool isNotify) { Serial.print("Notify callback for characteristic "); Serial.print(pBLERemoteCharacteristic->getUUID().toString().c_str()); Serial.print(" of data length "); @@ -34,10 +30,9 @@ static void notifyCallback( } class MyClientCallback : public BLEClientCallbacks { - void onConnect(BLEClient* pclient) { - } + void onConnect(BLEClient *pclient) {} - void onDisconnect(BLEClient* pclient) { + void onDisconnect(BLEClient *pclient) { connected = false; Serial.println("onDisconnect"); } @@ -47,7 +42,7 @@ bool connectToServer() { Serial.print("Forming a connection to "); Serial.println(myDevice->getAddress().toString().c_str()); - BLEClient* pClient = BLEDevice::createClient(); + BLEClient *pClient = BLEDevice::createClient(); Serial.println(" - Created client"); pClient->setClientCallbacks(new MyClientCallback()); @@ -58,7 +53,7 @@ bool connectToServer() { pClient->setMTU(517); //set client to request maximum MTU from server (default is 23 otherwise) // Obtain a reference to the service we are after in the remote BLE server. - BLERemoteService* pRemoteService = pClient->getService(serviceUUID); + BLERemoteService *pRemoteService = pClient->getService(serviceUUID); if (pRemoteService == nullptr) { Serial.print("Failed to find our service UUID: "); Serial.println(serviceUUID.toString().c_str()); @@ -67,7 +62,6 @@ bool connectToServer() { } Serial.println(" - Found our service"); - // Obtain a reference to the characteristic in the service of the remote BLE server. pRemoteCharacteristic = pRemoteService->getCharacteristic(charUUID); if (pRemoteCharacteristic == nullptr) { @@ -85,8 +79,9 @@ bool connectToServer() { Serial.println(value.c_str()); } - if (pRemoteCharacteristic->canNotify()) + if (pRemoteCharacteristic->canNotify()) { pRemoteCharacteristic->registerForNotify(notifyCallback); + } connected = true; return true; @@ -111,9 +106,8 @@ class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks { doScan = true; } // Found our server - } // onResult -}; // MyAdvertisedDeviceCallbacks - + } // onResult +}; // MyAdvertisedDeviceCallbacks void setup() { Serial.begin(115200); @@ -123,7 +117,7 @@ void setup() { // Retrieve a Scanner and set the callback we want to use to be informed when we // have detected a new device. Specify that we want active scanning and start the // scan to run for 5 seconds. - BLEScan* pBLEScan = BLEDevice::getScan(); + BLEScan *pBLEScan = BLEDevice::getScan(); pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks()); pBLEScan->setInterval(1349); pBLEScan->setWindow(449); @@ -131,7 +125,6 @@ void setup() { pBLEScan->start(5, false); } // End of setup. - // This is the Arduino main loop function. void loop() { diff --git a/libraries/BLE/examples/EddystoneTLM_Beacon/EddystoneTLM_Beacon.ino b/libraries/BLE/examples/EddystoneTLM_Beacon/EddystoneTLM_Beacon.ino index dc8eadd92..d66ceb53b 100644 --- a/libraries/BLE/examples/EddystoneTLM_Beacon/EddystoneTLM_Beacon.ino +++ b/libraries/BLE/examples/EddystoneTLM_Beacon/EddystoneTLM_Beacon.ino @@ -28,7 +28,7 @@ #include "esp_sleep.h" #define GPIO_DEEP_SLEEP_DURATION 10 // sleep x seconds and then wake up -#define BEACON_POWER ESP_PWR_LVL_N12 +#define BEACON_POWER ESP_PWR_LVL_N12 RTC_DATA_ATTR static time_t last; // remember last boot in RTC Memory RTC_DATA_ATTR static uint32_t bootcount; // remember number of boots in RTC Memory @@ -89,5 +89,4 @@ void setup() { esp_deep_sleep(1000000LL * GPIO_DEEP_SLEEP_DURATION); } -void loop() { -} +void loop() {} diff --git a/libraries/BLE/examples/EddystoneURL_Beacon/EddystoneURL_Beacon.ino b/libraries/BLE/examples/EddystoneURL_Beacon/EddystoneURL_Beacon.ino index a5805a5ed..d520c844b 100644 --- a/libraries/BLE/examples/EddystoneURL_Beacon/EddystoneURL_Beacon.ino +++ b/libraries/BLE/examples/EddystoneURL_Beacon/EddystoneURL_Beacon.ino @@ -28,7 +28,7 @@ #include "BLEEddystoneURL.h" #include "esp_sleep.h" -char unprintable[] = { 0x01, 0xFF, 0xDE, 0xAD }; +char unprintable[] = {0x01, 0xFF, 0xDE, 0xAD}; String URL[] = { "http://www.espressif.com/", // prefix 0x00, suffix 0x00 "https://www.texas.gov", // prefix 0x01, suffix 0x0D @@ -42,7 +42,7 @@ String URL[] = { }; #define GPIO_DEEP_SLEEP_DURATION 10 // sleep x seconds and then wake up -#define BEACON_POWER ESP_PWR_LVL_N12 +#define BEACON_POWER ESP_PWR_LVL_N12 RTC_DATA_ATTR static time_t last; // remember last boot in RTC Memory RTC_DATA_ATTR static uint32_t bootcount; // remember number of boots in RTC Memory @@ -102,5 +102,4 @@ void setup() { esp_deep_sleep(1000000LL * GPIO_DEEP_SLEEP_DURATION); } -void loop() { -} +void loop() {} diff --git a/libraries/BLE/examples/Notify/Notify.ino b/libraries/BLE/examples/Notify/Notify.ino index 59cc8f3cf..896cc2260 100644 --- a/libraries/BLE/examples/Notify/Notify.ino +++ b/libraries/BLE/examples/Notify/Notify.ino @@ -24,8 +24,8 @@ #include #include -BLEServer* pServer = NULL; -BLECharacteristic* pCharacteristic = NULL; +BLEServer *pServer = NULL; +BLECharacteristic *pCharacteristic = NULL; bool deviceConnected = false; bool oldDeviceConnected = false; uint32_t value = 0; @@ -33,22 +33,19 @@ uint32_t value = 0; // See the following for generating UUIDs: // https://www.uuidgenerator.net/ -#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" +#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" #define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" - class MyServerCallbacks : public BLEServerCallbacks { - void onConnect(BLEServer* pServer) { + void onConnect(BLEServer *pServer) { deviceConnected = true; }; - void onDisconnect(BLEServer* pServer) { + void onDisconnect(BLEServer *pServer) { deviceConnected = false; } }; - - void setup() { Serial.begin(115200); @@ -60,12 +57,13 @@ void setup() { pServer->setCallbacks(new MyServerCallbacks()); // Create the BLE Service - BLEService* pService = pServer->createService(SERVICE_UUID); + BLEService *pService = pServer->createService(SERVICE_UUID); // Create a BLE Characteristic pCharacteristic = pService->createCharacteristic( CHARACTERISTIC_UUID, - BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE); + BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE + ); // https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml // Create a BLE Descriptor @@ -75,7 +73,7 @@ void setup() { pService->start(); // Start advertising - BLEAdvertising* pAdvertising = BLEDevice::getAdvertising(); + BLEAdvertising *pAdvertising = BLEDevice::getAdvertising(); pAdvertising->addServiceUUID(SERVICE_UUID); pAdvertising->setScanResponse(false); pAdvertising->setMinPreferred(0x0); // set value to 0x00 to not advertise this parameter @@ -86,7 +84,7 @@ void setup() { void loop() { // notify changed value if (deviceConnected) { - pCharacteristic->setValue((uint8_t*)&value, 4); + pCharacteristic->setValue((uint8_t *)&value, 4); pCharacteristic->notify(); value++; delay(3); // bluetooth stack will go into congestion, if too many packets are sent, in 6 hours test i was able to go as low as 3ms diff --git a/libraries/BLE/examples/Scan/Scan.ino b/libraries/BLE/examples/Scan/Scan.ino index b9f7eb116..6b8a1fa6f 100644 --- a/libraries/BLE/examples/Scan/Scan.ino +++ b/libraries/BLE/examples/Scan/Scan.ino @@ -9,7 +9,7 @@ #include int scanTime = 5; //In seconds -BLEScan* pBLEScan; +BLEScan *pBLEScan; class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks { void onResult(BLEAdvertisedDevice advertisedDevice) { @@ -31,7 +31,7 @@ void setup() { void loop() { // put your main code here, to run repeatedly: - BLEScanResults* foundDevices = pBLEScan->start(scanTime, false); + BLEScanResults *foundDevices = pBLEScan->start(scanTime, false); Serial.print("Devices found: "); Serial.println(foundDevices->getCount()); Serial.println("Scan done!"); diff --git a/libraries/BLE/examples/Server/Server.ino b/libraries/BLE/examples/Server/Server.ino index 952be3854..e86ed7232 100644 --- a/libraries/BLE/examples/Server/Server.ino +++ b/libraries/BLE/examples/Server/Server.ino @@ -11,7 +11,7 @@ // See the following for generating UUIDs: // https://www.uuidgenerator.net/ -#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" +#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" #define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" void setup() { @@ -21,9 +21,8 @@ void setup() { BLEDevice::init("Long name works now"); BLEServer *pServer = BLEDevice::createServer(); BLEService *pService = pServer->createService(SERVICE_UUID); - BLECharacteristic *pCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID, - BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE); + BLECharacteristic *pCharacteristic = + pService->createCharacteristic(CHARACTERISTIC_UUID, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE); pCharacteristic->setValue("Hello World says Neil"); pService->start(); diff --git a/libraries/BLE/examples/Server_multiconnect/Server_multiconnect.ino b/libraries/BLE/examples/Server_multiconnect/Server_multiconnect.ino index b26f7e8ff..afd15e9ae 100644 --- a/libraries/BLE/examples/Server_multiconnect/Server_multiconnect.ino +++ b/libraries/BLE/examples/Server_multiconnect/Server_multiconnect.ino @@ -24,8 +24,8 @@ #include #include -BLEServer* pServer = NULL; -BLECharacteristic* pCharacteristic = NULL; +BLEServer *pServer = NULL; +BLECharacteristic *pCharacteristic = NULL; bool deviceConnected = false; bool oldDeviceConnected = false; uint32_t value = 0; @@ -33,23 +33,20 @@ uint32_t value = 0; // See the following for generating UUIDs: // https://www.uuidgenerator.net/ -#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" +#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" #define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" - class MyServerCallbacks : public BLEServerCallbacks { - void onConnect(BLEServer* pServer) { + void onConnect(BLEServer *pServer) { deviceConnected = true; BLEDevice::startAdvertising(); }; - void onDisconnect(BLEServer* pServer) { + void onDisconnect(BLEServer *pServer) { deviceConnected = false; } }; - - void setup() { Serial.begin(115200); @@ -61,12 +58,13 @@ void setup() { pServer->setCallbacks(new MyServerCallbacks()); // Create the BLE Service - BLEService* pService = pServer->createService(SERVICE_UUID); + BLEService *pService = pServer->createService(SERVICE_UUID); // Create a BLE Characteristic pCharacteristic = pService->createCharacteristic( CHARACTERISTIC_UUID, - BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE); + BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE + ); // https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml // Create a BLE Descriptor @@ -76,7 +74,7 @@ void setup() { pService->start(); // Start advertising - BLEAdvertising* pAdvertising = BLEDevice::getAdvertising(); + BLEAdvertising *pAdvertising = BLEDevice::getAdvertising(); pAdvertising->addServiceUUID(SERVICE_UUID); pAdvertising->setScanResponse(false); pAdvertising->setMinPreferred(0x0); // set value to 0x00 to not advertise this parameter @@ -87,7 +85,7 @@ void setup() { void loop() { // notify changed value if (deviceConnected) { - pCharacteristic->setValue((uint8_t*)&value, 4); + pCharacteristic->setValue((uint8_t *)&value, 4); pCharacteristic->notify(); value++; delay(10); // bluetooth stack will go into congestion, if too many packets are sent, in 6 hours test i was able to go as low as 3ms diff --git a/libraries/BLE/examples/UART/UART.ino b/libraries/BLE/examples/UART/UART.ino index 725b45c0b..71cc850db 100644 --- a/libraries/BLE/examples/UART/UART.ino +++ b/libraries/BLE/examples/UART/UART.ino @@ -33,11 +33,10 @@ uint8_t txValue = 0; // See the following for generating UUIDs: // https://www.uuidgenerator.net/ -#define SERVICE_UUID "6E400001-B5A3-F393-E0A9-E50E24DCCA9E" // UART service UUID +#define SERVICE_UUID "6E400001-B5A3-F393-E0A9-E50E24DCCA9E" // UART service UUID #define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E" #define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E" - class MyServerCallbacks : public BLEServerCallbacks { void onConnect(BLEServer *pServer) { deviceConnected = true; @@ -55,8 +54,9 @@ class MyCallbacks : public BLECharacteristicCallbacks { if (rxValue.length() > 0) { Serial.println("*********"); Serial.print("Received Value: "); - for (int i = 0; i < rxValue.length(); i++) + for (int i = 0; i < rxValue.length(); i++) { Serial.print(rxValue[i]); + } Serial.println(); Serial.println("*********"); @@ -64,7 +64,6 @@ class MyCallbacks : public BLECharacteristicCallbacks { } }; - void setup() { Serial.begin(115200); @@ -79,15 +78,11 @@ void setup() { BLEService *pService = pServer->createService(SERVICE_UUID); // Create a BLE Characteristic - pTxCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID_TX, - BLECharacteristic::PROPERTY_NOTIFY); + pTxCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_TX, BLECharacteristic::PROPERTY_NOTIFY); pTxCharacteristic->addDescriptor(new BLE2902()); - BLECharacteristic *pRxCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID_RX, - BLECharacteristic::PROPERTY_WRITE); + BLECharacteristic *pRxCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_RX, BLECharacteristic::PROPERTY_WRITE); pRxCharacteristic->setCallbacks(new MyCallbacks()); diff --git a/libraries/BLE/examples/Write/Write.ino b/libraries/BLE/examples/Write/Write.ino index efad59f31..3cc693618 100644 --- a/libraries/BLE/examples/Write/Write.ino +++ b/libraries/BLE/examples/Write/Write.ino @@ -10,10 +10,9 @@ // See the following for generating UUIDs: // https://www.uuidgenerator.net/ -#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" +#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" #define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" - class MyCallbacks : public BLECharacteristicCallbacks { void onWrite(BLECharacteristic *pCharacteristic) { String value = pCharacteristic->getValue(); @@ -21,8 +20,9 @@ class MyCallbacks : public BLECharacteristicCallbacks { if (value.length() > 0) { Serial.println("*********"); Serial.print("New value: "); - for (int i = 0; i < value.length(); i++) + for (int i = 0; i < value.length(); i++) { Serial.print(value[i]); + } Serial.println(); Serial.println("*********"); @@ -44,9 +44,8 @@ void setup() { BLEService *pService = pServer->createService(SERVICE_UUID); - BLECharacteristic *pCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID, - BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE); + BLECharacteristic *pCharacteristic = + pService->createCharacteristic(CHARACTERISTIC_UUID, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE); pCharacteristic->setCallbacks(new MyCallbacks()); diff --git a/libraries/BLE/examples/iBeacon/iBeacon.ino b/libraries/BLE/examples/iBeacon/iBeacon.ino index bc46f4f8e..d5db613dc 100644 --- a/libraries/BLE/examples/iBeacon/iBeacon.ino +++ b/libraries/BLE/examples/iBeacon/iBeacon.ino @@ -18,29 +18,29 @@ #include #include -#define DEVICE_NAME "ESP32" -#define SERVICE_UUID "7A0247E7-8E88-409B-A959-AB5092DDB03E" -#define BEACON_UUID "2D7A9F0C-E0E8-4CC9-A71B-A21DB2D034A1" -#define BEACON_UUID_REV "A134D0B2-1DA2-1BA7-C94C-E8E00C9F7A2D" +#define DEVICE_NAME "ESP32" +#define SERVICE_UUID "7A0247E7-8E88-409B-A959-AB5092DDB03E" +#define BEACON_UUID "2D7A9F0C-E0E8-4CC9-A71B-A21DB2D034A1" +#define BEACON_UUID_REV "A134D0B2-1DA2-1BA7-C94C-E8E00C9F7A2D" #define CHARACTERISTIC_UUID "82258BAA-DF72-47E8-99BC-B73D7ECD08A5" -BLEServer* pServer; -BLECharacteristic* pCharacteristic; +BLEServer *pServer; +BLECharacteristic *pCharacteristic; bool deviceConnected = false; uint8_t value = 0; class MyServerCallbacks : public BLEServerCallbacks { - void onConnect(BLEServer* pServer) { + void onConnect(BLEServer *pServer) { deviceConnected = true; Serial.println("deviceConnected = true"); }; - void onDisconnect(BLEServer* pServer) { + void onDisconnect(BLEServer *pServer) { deviceConnected = false; Serial.println("deviceConnected = false"); // Restart advertising to be visible and connectable again - BLEAdvertising* pAdvertising; + BLEAdvertising *pAdvertising; pAdvertising = pServer->getAdvertising(); pAdvertising->start(); Serial.println("iBeacon advertising restarted"); @@ -48,7 +48,7 @@ class MyServerCallbacks : public BLEServerCallbacks { }; class MyCallbacks : public BLECharacteristicCallbacks { - void onWrite(BLECharacteristic* pCharacteristic) { + void onWrite(BLECharacteristic *pCharacteristic) { String rxValue = pCharacteristic->getValue(); if (rxValue.length() > 0) { @@ -63,19 +63,18 @@ class MyCallbacks : public BLECharacteristicCallbacks { } }; - void init_service() { - BLEAdvertising* pAdvertising; + BLEAdvertising *pAdvertising; pAdvertising = pServer->getAdvertising(); pAdvertising->stop(); // Create the BLE Service - BLEService* pService = pServer->createService(BLEUUID(SERVICE_UUID)); + BLEService *pService = pServer->createService(BLEUUID(SERVICE_UUID)); // Create a BLE Characteristic pCharacteristic = pService->createCharacteristic( - CHARACTERISTIC_UUID, - BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY); + CHARACTERISTIC_UUID, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY + ); pCharacteristic->setCallbacks(new MyCallbacks()); pCharacteristic->addDescriptor(new BLE2902()); @@ -88,7 +87,7 @@ void init_service() { } void init_beacon() { - BLEAdvertising* pAdvertising; + BLEAdvertising *pAdvertising; pAdvertising = pServer->getAdvertising(); pAdvertising->stop(); // iBeacon diff --git a/libraries/BLE/src/BLE2902.cpp b/libraries/BLE/src/BLE2902.cpp index 0aa05067e..90cdf088f 100644 --- a/libraries/BLE/src/BLE2902.cpp +++ b/libraries/BLE/src/BLE2902.cpp @@ -17,13 +17,11 @@ #include "BLE2902.h" -BLE2902::BLE2902() - : BLEDescriptor(BLEUUID((uint16_t)0x2902)) { - uint8_t data[2] = { 0, 0 }; +BLE2902::BLE2902() : BLEDescriptor(BLEUUID((uint16_t)0x2902)) { + uint8_t data[2] = {0, 0}; setValue(data, 2); } // BLE2902 - /** * @brief Get the notifications value. * @return The notifications value. True if notifications are enabled and false if not. @@ -32,7 +30,6 @@ bool BLE2902::getNotifications() { return (getValue()[0] & (1 << 0)) != 0; } // getNotifications - /** * @brief Get the indications value. * @return The indications value. True if indications are enabled and false if not. @@ -41,27 +38,31 @@ bool BLE2902::getIndications() { return (getValue()[0] & (1 << 1)) != 0; } // getIndications - /** * @brief Set the indications flag. * @param [in] flag The indications flag. */ void BLE2902::setIndications(bool flag) { uint8_t *pValue = getValue(); - if (flag) pValue[0] |= 1 << 1; - else pValue[0] &= ~(1 << 1); + if (flag) { + pValue[0] |= 1 << 1; + } else { + pValue[0] &= ~(1 << 1); + } setValue(pValue, 2); } // setIndications - /** * @brief Set the notifications flag. * @param [in] flag The notifications flag. */ void BLE2902::setNotifications(bool flag) { uint8_t *pValue = getValue(); - if (flag) pValue[0] |= 1 << 0; - else pValue[0] &= ~(1 << 0); + if (flag) { + pValue[0] |= 1 << 0; + } else { + pValue[0] &= ~(1 << 0); + } setValue(pValue, 2); } // setNotifications diff --git a/libraries/BLE/src/BLE2904.cpp b/libraries/BLE/src/BLE2904.cpp index 2268fafef..aeed11eba 100644 --- a/libraries/BLE/src/BLE2904.cpp +++ b/libraries/BLE/src/BLE2904.cpp @@ -17,54 +17,47 @@ #include "BLE2904.h" - -BLE2904::BLE2904() - : BLEDescriptor(BLEUUID((uint16_t)0x2904)) { +BLE2904::BLE2904() : BLEDescriptor(BLEUUID((uint16_t)0x2904)) { m_data.m_format = 0; m_data.m_exponent = 0; m_data.m_namespace = 1; // 1 = Bluetooth SIG Assigned Numbers m_data.m_unit = 0; m_data.m_description = 0; - setValue((uint8_t*)&m_data, sizeof(m_data)); + setValue((uint8_t *)&m_data, sizeof(m_data)); } // BLE2902 - /** * @brief Set the description. */ void BLE2904::setDescription(uint16_t description) { m_data.m_description = description; - setValue((uint8_t*)&m_data, sizeof(m_data)); + setValue((uint8_t *)&m_data, sizeof(m_data)); } - /** * @brief Set the exponent. */ void BLE2904::setExponent(int8_t exponent) { m_data.m_exponent = exponent; - setValue((uint8_t*)&m_data, sizeof(m_data)); + setValue((uint8_t *)&m_data, sizeof(m_data)); } // setExponent - /** * @brief Set the format. */ void BLE2904::setFormat(uint8_t format) { m_data.m_format = format; - setValue((uint8_t*)&m_data, sizeof(m_data)); + setValue((uint8_t *)&m_data, sizeof(m_data)); } // setFormat - /** * @brief Set the namespace. */ void BLE2904::setNamespace(uint8_t namespace_value) { m_data.m_namespace = namespace_value; - setValue((uint8_t*)&m_data, sizeof(m_data)); + setValue((uint8_t *)&m_data, sizeof(m_data)); } // setNamespace - /** * @brief Set the units for this value. It should be one of the encoded values defined here: * https://www.bluetooth.com/specifications/assigned-numbers/units @@ -72,7 +65,7 @@ void BLE2904::setNamespace(uint8_t namespace_value) { */ void BLE2904::setUnit(uint16_t unit) { m_data.m_unit = unit; - setValue((uint8_t*)&m_data, sizeof(m_data)); + setValue((uint8_t *)&m_data, sizeof(m_data)); } // setUnit #endif diff --git a/libraries/BLE/src/BLEAddress.cpp b/libraries/BLE/src/BLEAddress.cpp index ccdfca162..b91ef3cc4 100644 --- a/libraries/BLE/src/BLEAddress.cpp +++ b/libraries/BLE/src/BLEAddress.cpp @@ -21,7 +21,6 @@ #include "esp32-hal-log.h" #endif - /** * @brief Create an address from the native ESP32 representation. * @param [in] address The native representation. @@ -30,7 +29,6 @@ BLEAddress::BLEAddress(esp_bd_addr_t address) { memcpy(m_address, address, ESP_BD_ADDR_LEN); } // BLEAddress - /** * @brief Create an address from a hex string * @@ -43,7 +41,9 @@ BLEAddress::BLEAddress(esp_bd_addr_t address) { * @param [in] stringAddress The hex representation of the address. */ BLEAddress::BLEAddress(String stringAddress) { - if (stringAddress.length() != 17) return; + if (stringAddress.length() != 17) { + return; + } int data[6]; sscanf(stringAddress.c_str(), "%x:%x:%x:%x:%x:%x", &data[0], &data[1], &data[2], &data[3], &data[4], &data[5]); @@ -55,7 +55,6 @@ BLEAddress::BLEAddress(String stringAddress) { m_address[5] = (uint8_t)data[5]; } // BLEAddress - /** * @brief Determine if this address equals another. * @param [in] otherAddress The other address to compare against. @@ -65,27 +64,27 @@ bool BLEAddress::equals(BLEAddress otherAddress) { return memcmp(otherAddress.getNative(), m_address, ESP_BD_ADDR_LEN) == 0; } // equals -bool BLEAddress::operator==(const BLEAddress& otherAddress) const { +bool BLEAddress::operator==(const BLEAddress &otherAddress) const { return memcmp(otherAddress.m_address, m_address, ESP_BD_ADDR_LEN) == 0; } -bool BLEAddress::operator!=(const BLEAddress& otherAddress) const { +bool BLEAddress::operator!=(const BLEAddress &otherAddress) const { return !(*this == otherAddress); } -bool BLEAddress::operator<(const BLEAddress& otherAddress) const { +bool BLEAddress::operator<(const BLEAddress &otherAddress) const { return memcmp(m_address, otherAddress.m_address, ESP_BD_ADDR_LEN) < 0; } -bool BLEAddress::operator<=(const BLEAddress& otherAddress) const { +bool BLEAddress::operator<=(const BLEAddress &otherAddress) const { return !(*this > otherAddress); } -bool BLEAddress::operator>=(const BLEAddress& otherAddress) const { +bool BLEAddress::operator>=(const BLEAddress &otherAddress) const { return !(*this < otherAddress); } -bool BLEAddress::operator>(const BLEAddress& otherAddress) const { +bool BLEAddress::operator>(const BLEAddress &otherAddress) const { return memcmp(m_address, otherAddress.m_address, ESP_BD_ADDR_LEN) > 0; } @@ -93,11 +92,10 @@ bool BLEAddress::operator>(const BLEAddress& otherAddress) const { * @brief Return the native representation of the address. * @return The native representation of the address. */ -esp_bd_addr_t* BLEAddress::getNative() { +esp_bd_addr_t *BLEAddress::getNative() { return &m_address; } // getNative - /** * @brief Convert a BLE address to a string. * @@ -111,7 +109,7 @@ esp_bd_addr_t* BLEAddress::getNative() { */ String BLEAddress::toString() { auto size = 18; - char* res = (char*)malloc(size); + char *res = (char *)malloc(size); snprintf(res, size, "%02x:%02x:%02x:%02x:%02x:%02x", m_address[0], m_address[1], m_address[2], m_address[3], m_address[4], m_address[5]); String ret(res); free(res); diff --git a/libraries/BLE/src/BLEAddress.h b/libraries/BLE/src/BLEAddress.h index d743dfabc..f1c8aa9b6 100644 --- a/libraries/BLE/src/BLEAddress.h +++ b/libraries/BLE/src/BLEAddress.h @@ -16,7 +16,6 @@ #include // ESP32 BLE #include - /** * @brief A %BLE device address. * @@ -27,13 +26,13 @@ public: BLEAddress(esp_bd_addr_t address); BLEAddress(String stringAddress); bool equals(BLEAddress otherAddress); - bool operator==(const BLEAddress& otherAddress) const; - bool operator!=(const BLEAddress& otherAddress) const; - bool operator<(const BLEAddress& otherAddress) const; - bool operator<=(const BLEAddress& otherAddress) const; - bool operator>(const BLEAddress& otherAddress) const; - bool operator>=(const BLEAddress& otherAddress) const; - esp_bd_addr_t* getNative(); + bool operator==(const BLEAddress &otherAddress) const; + bool operator!=(const BLEAddress &otherAddress) const; + bool operator<(const BLEAddress &otherAddress) const; + bool operator<=(const BLEAddress &otherAddress) const; + bool operator>(const BLEAddress &otherAddress) const; + bool operator>=(const BLEAddress &otherAddress) const; + esp_bd_addr_t *getNative(); String toString(); private: diff --git a/libraries/BLE/src/BLEAdvertisedDevice.cpp b/libraries/BLE/src/BLEAdvertisedDevice.cpp index 3f9cab958..8752d24a1 100644 --- a/libraries/BLE/src/BLEAdvertisedDevice.cpp +++ b/libraries/BLE/src/BLEAdvertisedDevice.cpp @@ -41,7 +41,6 @@ BLEAdvertisedDevice::BLEAdvertisedDevice() { } // BLEAdvertisedDevice - /** * @brief Get the address. * @@ -54,7 +53,6 @@ BLEAddress BLEAdvertisedDevice::getAddress() { return m_address; } // getAddress - /** * @brief Get the appearance. * @@ -67,7 +65,6 @@ uint16_t BLEAdvertisedDevice::getAppearance() { return m_appearance; } // getAppearance - /** * @brief Get the manufacturer data. * @return The manufacturer data of the advertised device. @@ -76,7 +73,6 @@ String BLEAdvertisedDevice::getManufacturerData() { return m_manufacturerData; } // getManufacturerData - /** * @brief Get the name. * @return The name of the advertised device. @@ -85,7 +81,6 @@ String BLEAdvertisedDevice::getName() { return m_name; } // getName - /** * @brief Get the RSSI. * @return The RSSI of the advertised device. @@ -94,12 +89,11 @@ int BLEAdvertisedDevice::getRSSI() { return m_rssi; } // getRSSI - /** * @brief Get the scan object that created this advertisement. * @return The scan object. */ -BLEScan* BLEAdvertisedDevice::getScan() { +BLEScan *BLEAdvertisedDevice::getScan() { return m_pScan; } // getScan @@ -181,7 +175,9 @@ BLEUUID BLEAdvertisedDevice::getServiceUUID(int i) { */ bool BLEAdvertisedDevice::isAdvertisingService(BLEUUID uuid) { for (int i = 0; i < getServiceUUIDCount(); i++) { - if (m_serviceUUIDs[i].equals(uuid)) return true; + if (m_serviceUUIDs[i].equals(uuid)) { + return true; + } } return false; } @@ -194,8 +190,6 @@ int8_t BLEAdvertisedDevice::getTXPower() { return m_txPower; } // getTXPower - - /** * @brief Does this advertisement have an appearance value? * @return True if there is an appearance value present. @@ -204,7 +198,6 @@ bool BLEAdvertisedDevice::haveAppearance() { return m_haveAppearance; } // haveAppearance - /** * @brief Does this advertisement have manufacturer data? * @return True if there is manufacturer data present. @@ -213,7 +206,6 @@ bool BLEAdvertisedDevice::haveManufacturerData() { return m_haveManufacturerData; } // haveManufacturerData - /** * @brief Does this advertisement have a name value? * @return True if there is a name value present. @@ -222,7 +214,6 @@ bool BLEAdvertisedDevice::haveName() { return m_haveName; } // haveName - /** * @brief Does this advertisement have a signal strength value? * @return True if there is a signal strength value present. @@ -231,7 +222,6 @@ bool BLEAdvertisedDevice::haveRSSI() { return m_haveRSSI; } // haveRSSI - /** * @brief Does this advertisement have a service data value? * @return True if there is a service data value present. @@ -240,7 +230,6 @@ bool BLEAdvertisedDevice::haveServiceData() { return !m_serviceData.empty(); } // haveServiceData - /** * @brief Does this advertisement have a service UUID value? * @return True if there is a service UUID value present. @@ -249,7 +238,6 @@ bool BLEAdvertisedDevice::haveServiceUUID() { return !m_serviceUUIDs.empty(); } // haveServiceUUID - /** * @brief Does this advertisement have a transmission power value? * @return True if there is a transmission power value present. @@ -258,7 +246,6 @@ bool BLEAdvertisedDevice::haveTXPower() { return m_haveTXPower; } // haveTXPower - /** * @brief Parse the advertising pay load. * @@ -271,7 +258,7 @@ bool BLEAdvertisedDevice::haveTXPower() { * * https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile */ -void BLEAdvertisedDevice::parseAdvertisement(uint8_t* payload, size_t total_len) { +void BLEAdvertisedDevice::parseAdvertisement(uint8_t *payload, size_t total_len) { uint8_t length; uint8_t ad_type; uint8_t sizeConsumed = 0; @@ -289,127 +276,126 @@ void BLEAdvertisedDevice::parseAdvertisement(uint8_t* payload, size_t total_len) payload++; length--; - char* pHex = BLEUtils::buildHexData(nullptr, payload, length); - log_d("Type: 0x%.2x (%s), length: %d, data: %s", - ad_type, BLEUtils::advTypeToString(ad_type), length, pHex); + char *pHex = BLEUtils::buildHexData(nullptr, payload, length); + log_d("Type: 0x%.2x (%s), length: %d, data: %s", ad_type, BLEUtils::advTypeToString(ad_type), length, pHex); free(pHex); switch (ad_type) { case ESP_BLE_AD_TYPE_NAME_CMPL: - { // Adv Data Type: 0x09 - setName(String(reinterpret_cast(payload), length)); - break; - } // ESP_BLE_AD_TYPE_NAME_CMPL + { // Adv Data Type: 0x09 + setName(String(reinterpret_cast(payload), length)); + break; + } // ESP_BLE_AD_TYPE_NAME_CMPL case ESP_BLE_AD_TYPE_TX_PWR: - { // Adv Data Type: 0x0A - setTXPower(*payload); - break; - } // ESP_BLE_AD_TYPE_TX_PWR + { // Adv Data Type: 0x0A + setTXPower(*payload); + break; + } // ESP_BLE_AD_TYPE_TX_PWR case ESP_BLE_AD_TYPE_APPEARANCE: - { // Adv Data Type: 0x19 - setAppearance(*reinterpret_cast(payload)); - break; - } // ESP_BLE_AD_TYPE_APPEARANCE + { // Adv Data Type: 0x19 + setAppearance(*reinterpret_cast(payload)); + break; + } // ESP_BLE_AD_TYPE_APPEARANCE case ESP_BLE_AD_TYPE_FLAG: - { // Adv Data Type: 0x01 - setAdFlag(*payload); - break; - } // ESP_BLE_AD_TYPE_FLAG + { // Adv Data Type: 0x01 + setAdFlag(*payload); + break; + } // ESP_BLE_AD_TYPE_FLAG case ESP_BLE_AD_TYPE_16SRV_CMPL: case ESP_BLE_AD_TYPE_16SRV_PART: - { // Adv Data Type: 0x02 - for (int var = 0; var < length / 2; ++var) { - setServiceUUID(BLEUUID(*reinterpret_cast(payload + var * 2))); - } - break; - } // ESP_BLE_AD_TYPE_16SRV_PART + { // Adv Data Type: 0x02 + for (int var = 0; var < length / 2; ++var) { + setServiceUUID(BLEUUID(*reinterpret_cast(payload + var * 2))); + } + break; + } // ESP_BLE_AD_TYPE_16SRV_PART case ESP_BLE_AD_TYPE_32SRV_CMPL: case ESP_BLE_AD_TYPE_32SRV_PART: - { // Adv Data Type: 0x04 - for (int var = 0; var < length / 4; ++var) { - setServiceUUID(BLEUUID(*reinterpret_cast(payload + var * 4))); - } - break; - } // ESP_BLE_AD_TYPE_32SRV_PART + { // Adv Data Type: 0x04 + for (int var = 0; var < length / 4; ++var) { + setServiceUUID(BLEUUID(*reinterpret_cast(payload + var * 4))); + } + break; + } // ESP_BLE_AD_TYPE_32SRV_PART case ESP_BLE_AD_TYPE_128SRV_CMPL: - { // Adv Data Type: 0x07 - setServiceUUID(BLEUUID(payload, 16, false)); - break; - } // ESP_BLE_AD_TYPE_128SRV_CMPL + { // Adv Data Type: 0x07 + setServiceUUID(BLEUUID(payload, 16, false)); + break; + } // ESP_BLE_AD_TYPE_128SRV_CMPL case ESP_BLE_AD_TYPE_128SRV_PART: - { // Adv Data Type: 0x06 - setServiceUUID(BLEUUID(payload, 16, false)); - break; - } // ESP_BLE_AD_TYPE_128SRV_PART + { // Adv Data Type: 0x06 + setServiceUUID(BLEUUID(payload, 16, false)); + break; + } // ESP_BLE_AD_TYPE_128SRV_PART // See CSS Part A 1.4 Manufacturer Specific Data case ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE: - { - setManufacturerData(String(reinterpret_cast(payload), length)); - break; - } // ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE + { + setManufacturerData(String(reinterpret_cast(payload), length)); + break; + } // ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE case ESP_BLE_AD_TYPE_SERVICE_DATA: - { // Adv Data Type: 0x16 (Service Data) - 2 byte UUID - if (length < 2) { - log_e("Length too small for ESP_BLE_AD_TYPE_SERVICE_DATA"); - break; - } - uint16_t uuid = *(uint16_t*)payload; - setServiceDataUUID(BLEUUID(uuid)); - if (length > 2) { - setServiceData(String(reinterpret_cast(payload + 2), length - 2)); - } - break; - } //ESP_BLE_AD_TYPE_SERVICE_DATA - - case ESP_BLE_AD_TYPE_32SERVICE_DATA: - { // Adv Data Type: 0x20 (Service Data) - 4 byte UUID - if (length < 4) { - log_e("Length too small for ESP_BLE_AD_TYPE_32SERVICE_DATA"); - break; - } - uint32_t uuid = *(uint32_t*)payload; - setServiceDataUUID(BLEUUID(uuid)); - if (length > 4) { - setServiceData(String(reinterpret_cast(payload + 4), length - 4)); - } - break; - } //ESP_BLE_AD_TYPE_32SERVICE_DATA - - case ESP_BLE_AD_TYPE_128SERVICE_DATA: - { // Adv Data Type: 0x21 (Service Data) - 16 byte UUID - if (length < 16) { - log_e("Length too small for ESP_BLE_AD_TYPE_128SERVICE_DATA"); - break; - } - - setServiceDataUUID(BLEUUID(payload, (size_t)16, false)); - if (length > 16) { - setServiceData(String(reinterpret_cast(payload + 16), length - 16)); - } - break; - } //ESP_BLE_AD_TYPE_32SERVICE_DATA - - default: - { - log_d("Unhandled type: adType: %d - 0x%.2x", ad_type, ad_type); + { // Adv Data Type: 0x16 (Service Data) - 2 byte UUID + if (length < 2) { + log_e("Length too small for ESP_BLE_AD_TYPE_SERVICE_DATA"); break; } + uint16_t uuid = *(uint16_t *)payload; + setServiceDataUUID(BLEUUID(uuid)); + if (length > 2) { + setServiceData(String(reinterpret_cast(payload + 2), length - 2)); + } + break; + } //ESP_BLE_AD_TYPE_SERVICE_DATA + + case ESP_BLE_AD_TYPE_32SERVICE_DATA: + { // Adv Data Type: 0x20 (Service Data) - 4 byte UUID + if (length < 4) { + log_e("Length too small for ESP_BLE_AD_TYPE_32SERVICE_DATA"); + break; + } + uint32_t uuid = *(uint32_t *)payload; + setServiceDataUUID(BLEUUID(uuid)); + if (length > 4) { + setServiceData(String(reinterpret_cast(payload + 4), length - 4)); + } + break; + } //ESP_BLE_AD_TYPE_32SERVICE_DATA + + case ESP_BLE_AD_TYPE_128SERVICE_DATA: + { // Adv Data Type: 0x21 (Service Data) - 16 byte UUID + if (length < 16) { + log_e("Length too small for ESP_BLE_AD_TYPE_128SERVICE_DATA"); + break; + } + + setServiceDataUUID(BLEUUID(payload, (size_t)16, false)); + if (length > 16) { + setServiceData(String(reinterpret_cast(payload + 16), length - 16)); + } + break; + } //ESP_BLE_AD_TYPE_32SERVICE_DATA + + default: + { + log_d("Unhandled type: adType: %d - 0x%.2x", ad_type, ad_type); + break; + } } // switch payload += length; } // Length <> 0 - - if (sizeConsumed >= total_len) + if (sizeConsumed >= total_len) { finished = true; + } } // !finished } // parseAdvertisement @@ -419,7 +405,7 @@ void BLEAdvertisedDevice::parseAdvertisement(uint8_t* payload, size_t total_len) * @param [in] payload The payload of the advertised device. * @param [in] total_len The length of payload */ -void BLEAdvertisedDevice::setPayload(uint8_t* payload, size_t total_len) { +void BLEAdvertisedDevice::setPayload(uint8_t *payload, size_t total_len) { m_payload = payload; m_payloadLength = total_len; } // setPayload @@ -432,7 +418,6 @@ void BLEAdvertisedDevice::setAddress(BLEAddress address) { m_address = address; } // setAddress - /** * @brief Set the adFlag for this device. * @param [in] The discovered adFlag. @@ -441,7 +426,6 @@ void BLEAdvertisedDevice::setAdFlag(uint8_t adFlag) { m_adFlag = adFlag; } // setAdFlag - /** * @brief Set the appearance for this device. * @param [in] The discovered appearance. @@ -452,7 +436,6 @@ void BLEAdvertisedDevice::setAppearance(uint16_t appearance) { log_d("- appearance: %d", m_appearance); } // setAppearance - /** * @brief Set the manufacturer data for this device. * @param [in] The discovered manufacturer data. @@ -460,12 +443,11 @@ void BLEAdvertisedDevice::setAppearance(uint16_t appearance) { void BLEAdvertisedDevice::setManufacturerData(String manufacturerData) { m_manufacturerData = manufacturerData; m_haveManufacturerData = true; - char* pHex = BLEUtils::buildHexData(nullptr, (uint8_t*)m_manufacturerData.c_str(), (uint8_t)m_manufacturerData.length()); + char *pHex = BLEUtils::buildHexData(nullptr, (uint8_t *)m_manufacturerData.c_str(), (uint8_t)m_manufacturerData.length()); log_d("- manufacturer data: %s", pHex); free(pHex); } // setManufacturerData - /** * @brief Set the name for this device. * @param [in] name The discovered name. @@ -476,7 +458,6 @@ void BLEAdvertisedDevice::setName(String name) { log_d("- setName(): name: %s", m_name.c_str()); } // setName - /** * @brief Set the RSSI for this device. * @param [in] rssi The discovered RSSI. @@ -487,25 +468,22 @@ void BLEAdvertisedDevice::setRSSI(int rssi) { log_d("- setRSSI(): rssi: %d", m_rssi); } // setRSSI - /** * @brief Set the Scan that created this advertised device. * @param pScan The Scan that created this advertised device. */ -void BLEAdvertisedDevice::setScan(BLEScan* pScan) { +void BLEAdvertisedDevice::setScan(BLEScan *pScan) { m_pScan = pScan; } // setScan - /** * @brief Set the Service UUID for this device. * @param [in] serviceUUID The discovered serviceUUID */ -void BLEAdvertisedDevice::setServiceUUID(const char* serviceUUID) { +void BLEAdvertisedDevice::setServiceUUID(const char *serviceUUID) { return setServiceUUID(BLEUUID(serviceUUID)); } // setServiceUUID - /** * @brief Set the Service UUID for this device. * @param [in] serviceUUID The discovered serviceUUID @@ -515,7 +493,6 @@ void BLEAdvertisedDevice::setServiceUUID(BLEUUID serviceUUID) { log_d("- addServiceUUID(): serviceUUID: %s", serviceUUID.toString().c_str()); } // setServiceUUID - /** * @brief Set the ServiceData value. * @param [in] data ServiceData value. @@ -524,7 +501,6 @@ void BLEAdvertisedDevice::setServiceData(String serviceData) { m_serviceData.push_back(serviceData); // Save the service data that we received. } //setServiceData - /** * @brief Set the ServiceDataUUID value. * @param [in] data ServiceDataUUID value. @@ -534,7 +510,6 @@ void BLEAdvertisedDevice::setServiceDataUUID(BLEUUID uuid) { log_d("- addServiceDataUUID(): serviceDataUUID: %s", uuid.toString().c_str()); } // setServiceDataUUID - /** * @brief Set the power level for this device. * @param [in] txPower The discovered power level. @@ -545,7 +520,6 @@ void BLEAdvertisedDevice::setTXPower(int8_t txPower) { log_d("- txPower: %d", m_txPower); } // setTXPower - /** * @brief Create a string representation of this device. * @return A string representation of this device. @@ -559,7 +533,7 @@ String BLEAdvertisedDevice::toString() { res += val; } if (haveManufacturerData()) { - char* pHex = BLEUtils::buildHexData(nullptr, (uint8_t*)getManufacturerData().c_str(), getManufacturerData().length()); + char *pHex = BLEUtils::buildHexData(nullptr, (uint8_t *)getManufacturerData().c_str(), getManufacturerData().length()); res += ", manufacturer data: "; res += pHex; free(pHex); @@ -589,7 +563,7 @@ String BLEAdvertisedDevice::toString() { return res; } // toString -uint8_t* BLEAdvertisedDevice::getPayload() { +uint8_t *BLEAdvertisedDevice::getPayload() { return m_payload; } diff --git a/libraries/BLE/src/BLEAdvertisedDevice.h b/libraries/BLE/src/BLEAdvertisedDevice.h index b9f640073..700e57040 100644 --- a/libraries/BLE/src/BLEAdvertisedDevice.h +++ b/libraries/BLE/src/BLEAdvertisedDevice.h @@ -44,7 +44,7 @@ public: String getManufacturerData(); String getName(); int getRSSI(); - BLEScan* getScan(); + BLEScan *getScan(); String getServiceData(); String getServiceData(int i); BLEUUID getServiceDataUUID(); @@ -55,13 +55,12 @@ public: int getServiceDataUUIDCount(); int getServiceUUIDCount(); int8_t getTXPower(); - uint8_t* getPayload(); + uint8_t *getPayload(); size_t getPayloadLength(); esp_ble_addr_type_t getAddressType(); ble_frame_type_t getFrameType(); void setAddressType(esp_ble_addr_type_t type); - bool isAdvertisingService(BLEUUID uuid); bool haveAppearance(); bool haveManufacturerData(); @@ -76,19 +75,19 @@ public: private: friend class BLEScan; - void parseAdvertisement(uint8_t* payload, size_t total_len = 62); - void setPayload(uint8_t* payload, size_t total_len = 62); + void parseAdvertisement(uint8_t *payload, size_t total_len = 62); + void setPayload(uint8_t *payload, size_t total_len = 62); void setAddress(BLEAddress address); void setAdFlag(uint8_t adFlag); - void setAdvertizementResult(uint8_t* payload); + void setAdvertizementResult(uint8_t *payload); void setAppearance(uint16_t appearance); void setManufacturerData(String manufacturerData); void setName(String name); void setRSSI(int rssi); - void setScan(BLEScan* pScan); + void setScan(BLEScan *pScan); void setServiceData(String data); void setServiceDataUUID(BLEUUID uuid); - void setServiceUUID(const char* serviceUUID); + void setServiceUUID(const char *serviceUUID); void setServiceUUID(BLEUUID serviceUUID); void setTXPower(int8_t txPower); @@ -98,20 +97,19 @@ private: bool m_haveRSSI; bool m_haveTXPower; - - BLEAddress m_address = BLEAddress((uint8_t*)"\0\0\0\0\0\0"); + BLEAddress m_address = BLEAddress((uint8_t *)"\0\0\0\0\0\0"); uint8_t m_adFlag; uint16_t m_appearance; int m_deviceType; String m_manufacturerData; String m_name; - BLEScan* m_pScan; + BLEScan *m_pScan; int m_rssi; std::vector m_serviceUUIDs; int8_t m_txPower; std::vector m_serviceData; std::vector m_serviceDataUUIDs; - uint8_t* m_payload; + uint8_t *m_payload; size_t m_payloadLength = 0; esp_ble_addr_type_t m_addressType; }; @@ -149,7 +147,6 @@ public: }; #endif // SOC_BLE_50_SUPPORTED - #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ #endif /* COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ */ diff --git a/libraries/BLE/src/BLEAdvertising.cpp b/libraries/BLE/src/BLEAdvertising.cpp index 9aebfe6a3..1f2e6cd28 100644 --- a/libraries/BLE/src/BLEAdvertising.cpp +++ b/libraries/BLE/src/BLEAdvertising.cpp @@ -31,8 +31,7 @@ * @brief Construct a default advertising object. * */ -BLEAdvertising::BLEAdvertising() - : m_scanRespData{} { +BLEAdvertising::BLEAdvertising() : m_scanRespData{} { m_advData.set_scan_rsp = false; m_advData.include_name = true; m_advData.include_txpower = true; @@ -59,7 +58,6 @@ BLEAdvertising::BLEAdvertising() m_customScanResponseData = false; // No custom scan response data } // BLEAdvertising - /** * @brief Add a service uuid to exposed list of services. * @param [in] serviceUUID The UUID of the service to expose. @@ -68,16 +66,14 @@ void BLEAdvertising::addServiceUUID(BLEUUID serviceUUID) { m_serviceUUIDs.push_back(serviceUUID); } // addServiceUUID - /** * @brief Add a service uuid to exposed list of services. * @param [in] serviceUUID The string representation of the service to expose. */ -void BLEAdvertising::addServiceUUID(const char* serviceUUID) { +void BLEAdvertising::addServiceUUID(const char *serviceUUID) { addServiceUUID(BLEUUID(serviceUUID)); } // addServiceUUID - /** * @brief Remove a service uuid to exposed list of services. * @param [in] index The index of the service to stop exposing. @@ -86,7 +82,9 @@ bool BLEAdvertising::removeServiceUUID(int index) { // If index is larger than the size of the // advertised services, return false - if (index > m_serviceUUIDs.size()) return false; + if (index > m_serviceUUIDs.size()) { + return false; + } m_serviceUUIDs.erase(m_serviceUUIDs.begin() + index); return true; @@ -109,7 +107,7 @@ bool BLEAdvertising::removeServiceUUID(BLEUUID serviceUUID) { * @brief Remove a service uuid to exposed list of services. * @param [in] serviceUUID The string of the service to stop exposing. */ -bool BLEAdvertising::removeServiceUUID(const char* serviceUUID) { +bool BLEAdvertising::removeServiceUUID(const char *serviceUUID) { return removeServiceUUID(BLEUUID(serviceUUID)); } @@ -181,16 +179,13 @@ void BLEAdvertising::setScanFilter(bool scanRequestWhitelistOnly, bool connectWh } } // setScanFilter - /** * @brief Set the advertisement data that is to be published in a regular advertisement. * @param [in] advertisementData The data to be advertised. */ -void BLEAdvertising::setAdvertisementData(BLEAdvertisementData& advertisementData) { +void BLEAdvertising::setAdvertisementData(BLEAdvertisementData &advertisementData) { log_v(">> setAdvertisementData"); - esp_err_t errRc = ::esp_ble_gap_config_adv_data_raw( - (uint8_t*)advertisementData.getPayload().c_str(), - advertisementData.getPayload().length()); + esp_err_t errRc = ::esp_ble_gap_config_adv_data_raw((uint8_t *)advertisementData.getPayload().c_str(), advertisementData.getPayload().length()); if (errRc != ESP_OK) { log_e("esp_ble_gap_config_adv_data_raw: %d %s", errRc, GeneralUtils::errorToString(errRc)); } @@ -198,16 +193,13 @@ void BLEAdvertising::setAdvertisementData(BLEAdvertisementData& advertisementDat log_v("<< setAdvertisementData"); } // setAdvertisementData - /** * @brief Set the advertisement data that is to be published in a scan response. * @param [in] advertisementData The data to be advertised. */ -void BLEAdvertising::setScanResponseData(BLEAdvertisementData& advertisementData) { +void BLEAdvertising::setScanResponseData(BLEAdvertisementData &advertisementData) { log_v(">> setScanResponseData"); - esp_err_t errRc = ::esp_ble_gap_config_scan_rsp_data_raw( - (uint8_t*)advertisementData.getPayload().c_str(), - advertisementData.getPayload().length()); + esp_err_t errRc = ::esp_ble_gap_config_scan_rsp_data_raw((uint8_t *)advertisementData.getPayload().c_str(), advertisementData.getPayload().length()); if (errRc != ESP_OK) { log_e("esp_ble_gap_config_scan_rsp_data_raw: %d %s", errRc, GeneralUtils::errorToString(errRc)); } @@ -230,13 +222,13 @@ void BLEAdvertising::start() { int numServices = m_serviceUUIDs.size(); if (numServices > 0) { m_advData.service_uuid_len = 16 * numServices; - m_advData.p_service_uuid = (uint8_t*)malloc(m_advData.service_uuid_len); + m_advData.p_service_uuid = (uint8_t *)malloc(m_advData.service_uuid_len); if (!m_advData.p_service_uuid) { log_e(">> start failed: out of memory"); return; } - uint8_t* p = m_advData.p_service_uuid; + uint8_t *p = m_advData.p_service_uuid; for (int i = 0; i < numServices; i++) { log_d("- advertising service: %s", m_serviceUUIDs[i].toString().c_str()); BLEUUID serviceUUID128 = m_serviceUUIDs[i].to128(); @@ -292,7 +284,6 @@ void BLEAdvertising::start() { log_v("<< start"); } // start - /** * @brief Stop advertising. * Stop advertising. @@ -319,7 +310,7 @@ void BLEAdvertising::setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t ty log_v(">> setPrivateAddress"); m_advParams.own_addr_type = type; - esp_err_t errRc = esp_ble_gap_set_rand_addr((uint8_t*)addr); + esp_err_t errRc = esp_ble_gap_set_rand_addr((uint8_t *)addr); if (errRc != ESP_OK) { log_e("esp_ble_gap_set_rand_addr: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); return; @@ -338,7 +329,6 @@ void BLEAdvertisementData::addData(String data) { m_payload.concat(data); } // addData - /** * @brief Set the appearance. * @param [in] appearance The appearance code value. @@ -350,10 +340,9 @@ void BLEAdvertisementData::setAppearance(uint16_t appearance) { char cdata[2]; cdata[0] = 3; cdata[1] = ESP_BLE_AD_TYPE_APPEARANCE; // 0x19 - addData(String(cdata, 2) + String((char*)&appearance, 2)); + addData(String(cdata, 2) + String((char *)&appearance, 2)); } // setAppearance - /** * @brief Set the complete services. * @param [in] uuid The single service to advertise. @@ -362,38 +351,36 @@ void BLEAdvertisementData::setCompleteServices(BLEUUID uuid) { char cdata[2]; switch (uuid.bitSize()) { case 16: - { - // [Len] [0x02] [LL] [HH] - cdata[0] = 3; - cdata[1] = ESP_BLE_AD_TYPE_16SRV_CMPL; // 0x03 - addData(String(cdata, 2) + String((char*)&uuid.getNative()->uuid.uuid16, 2)); - break; - } + { + // [Len] [0x02] [LL] [HH] + cdata[0] = 3; + cdata[1] = ESP_BLE_AD_TYPE_16SRV_CMPL; // 0x03 + addData(String(cdata, 2) + String((char *)&uuid.getNative()->uuid.uuid16, 2)); + break; + } case 32: - { - // [Len] [0x04] [LL] [LL] [HH] [HH] - cdata[0] = 5; - cdata[1] = ESP_BLE_AD_TYPE_32SRV_CMPL; // 0x05 - addData(String(cdata, 2) + String((char*)&uuid.getNative()->uuid.uuid32, 4)); - break; - } + { + // [Len] [0x04] [LL] [LL] [HH] [HH] + cdata[0] = 5; + cdata[1] = ESP_BLE_AD_TYPE_32SRV_CMPL; // 0x05 + addData(String(cdata, 2) + String((char *)&uuid.getNative()->uuid.uuid32, 4)); + break; + } case 128: - { - // [Len] [0x04] [0] [1] ... [15] - cdata[0] = 17; - cdata[1] = ESP_BLE_AD_TYPE_128SRV_CMPL; // 0x07 - addData(String(cdata, 2) + String((char*)uuid.getNative()->uuid.uuid128, 16)); - break; - } + { + // [Len] [0x04] [0] [1] ... [15] + cdata[0] = 17; + cdata[1] = ESP_BLE_AD_TYPE_128SRV_CMPL; // 0x07 + addData(String(cdata, 2) + String((char *)uuid.getNative()->uuid.uuid128, 16)); + break; + } - default: - return; + default: return; } } // setCompleteServices - /** * @brief Set the advertisement flags. * @param [in] The flags to be set in the advertisement. @@ -413,8 +400,6 @@ void BLEAdvertisementData::setFlags(uint8_t flag) { addData(String(cdata, 3)); } // setFlag - - /** * @brief Set manufacturer specific data. * @param [in] data Manufacturer data. @@ -428,7 +413,6 @@ void BLEAdvertisementData::setManufacturerData(String data) { log_d("BLEAdvertisementData", "<< setManufacturerData"); } // setManufacturerData - /** * @brief Set the name. * @param [in] The complete name of the device. @@ -442,7 +426,6 @@ void BLEAdvertisementData::setName(String name) { log_d("BLEAdvertisementData", "<< setName"); } // setName - /** * @brief Set the partial services. * @param [in] uuid The single service to advertise. @@ -451,38 +434,36 @@ void BLEAdvertisementData::setPartialServices(BLEUUID uuid) { char cdata[2]; switch (uuid.bitSize()) { case 16: - { - // [Len] [0x02] [LL] [HH] - cdata[0] = 3; - cdata[1] = ESP_BLE_AD_TYPE_16SRV_PART; // 0x02 - addData(String(cdata, 2) + String((char*)&uuid.getNative()->uuid.uuid16, 2)); - break; - } + { + // [Len] [0x02] [LL] [HH] + cdata[0] = 3; + cdata[1] = ESP_BLE_AD_TYPE_16SRV_PART; // 0x02 + addData(String(cdata, 2) + String((char *)&uuid.getNative()->uuid.uuid16, 2)); + break; + } case 32: - { - // [Len] [0x04] [LL] [LL] [HH] [HH] - cdata[0] = 5; - cdata[1] = ESP_BLE_AD_TYPE_32SRV_PART; // 0x04 - addData(String(cdata, 2) + String((char*)&uuid.getNative()->uuid.uuid32, 4)); - break; - } + { + // [Len] [0x04] [LL] [LL] [HH] [HH] + cdata[0] = 5; + cdata[1] = ESP_BLE_AD_TYPE_32SRV_PART; // 0x04 + addData(String(cdata, 2) + String((char *)&uuid.getNative()->uuid.uuid32, 4)); + break; + } case 128: - { - // [Len] [0x04] [0] [1] ... [15] - cdata[0] = 17; - cdata[1] = ESP_BLE_AD_TYPE_128SRV_PART; // 0x06 - addData(String(cdata, 2) + String((char*)&uuid.getNative()->uuid.uuid128, 16)); - break; - } + { + // [Len] [0x04] [0] [1] ... [15] + cdata[0] = 17; + cdata[1] = ESP_BLE_AD_TYPE_128SRV_PART; // 0x06 + addData(String(cdata, 2) + String((char *)&uuid.getNative()->uuid.uuid128, 16)); + break; + } - default: - return; + default: return; } } // setPartialServices - /** * @brief Set the service data (UUID + data) * @param [in] uuid The UUID to set with the service data. Size of UUID will be used. @@ -492,38 +473,36 @@ void BLEAdvertisementData::setServiceData(BLEUUID uuid, String data) { char cdata[2]; switch (uuid.bitSize()) { case 16: - { - // [Len] [0x16] [UUID16] data - cdata[0] = data.length() + 3; - cdata[1] = ESP_BLE_AD_TYPE_SERVICE_DATA; // 0x16 - addData(String(cdata, 2) + String((char*)&uuid.getNative()->uuid.uuid16, 2) + data); - break; - } + { + // [Len] [0x16] [UUID16] data + cdata[0] = data.length() + 3; + cdata[1] = ESP_BLE_AD_TYPE_SERVICE_DATA; // 0x16 + addData(String(cdata, 2) + String((char *)&uuid.getNative()->uuid.uuid16, 2) + data); + break; + } case 32: - { - // [Len] [0x20] [UUID32] data - cdata[0] = data.length() + 5; - cdata[1] = ESP_BLE_AD_TYPE_32SERVICE_DATA; // 0x20 - addData(String(cdata, 2) + String((char*)&uuid.getNative()->uuid.uuid32, 4) + data); - break; - } + { + // [Len] [0x20] [UUID32] data + cdata[0] = data.length() + 5; + cdata[1] = ESP_BLE_AD_TYPE_32SERVICE_DATA; // 0x20 + addData(String(cdata, 2) + String((char *)&uuid.getNative()->uuid.uuid32, 4) + data); + break; + } case 128: - { - // [Len] [0x21] [UUID128] data - cdata[0] = data.length() + 17; - cdata[1] = ESP_BLE_AD_TYPE_128SERVICE_DATA; // 0x21 - addData(String(cdata, 2) + String((char*)&uuid.getNative()->uuid.uuid128, 16) + data); - break; - } + { + // [Len] [0x21] [UUID128] data + cdata[0] = data.length() + 17; + cdata[1] = ESP_BLE_AD_TYPE_128SERVICE_DATA; // 0x21 + addData(String(cdata, 2) + String((char *)&uuid.getNative()->uuid.uuid128, 16) + data); + break; + } - default: - return; + default: return; } } // setServiceData - /** * @brief Set the short name. * @param [in] The short name of the device. @@ -537,7 +516,6 @@ void BLEAdvertisementData::setShortName(String name) { log_d("BLEAdvertisementData", "<< setShortName"); } // setShortName - /** * @brief Retrieve the payload that is to be advertised. * @return The payload that is to be advertised. @@ -546,36 +524,33 @@ String BLEAdvertisementData::getPayload() { return m_payload; } // getPayload -void BLEAdvertising::handleGAPEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param) { +void BLEAdvertising::handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { log_d("handleGAPEvent [event no: %d]", (int)event); switch (event) { case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT: - { - // m_semaphoreSetAdv.give(); - break; - } - case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT: - { - // m_semaphoreSetAdv.give(); - break; - } - case ESP_GAP_BLE_ADV_START_COMPLETE_EVT: - { - // m_semaphoreSetAdv.give(); - break; - } - case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT: - { - log_i("STOP advertising"); - //start(); - break; - } - default: + { + // m_semaphoreSetAdv.give(); break; + } + case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT: + { + // m_semaphoreSetAdv.give(); + break; + } + case ESP_GAP_BLE_ADV_START_COMPLETE_EVT: + { + // m_semaphoreSetAdv.give(); + break; + } + case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT: + { + log_i("STOP advertising"); + //start(); + break; + } + default: break; } } @@ -589,8 +564,8 @@ void BLEAdvertising::handleGAPEvent( * */ BLEMultiAdvertising::BLEMultiAdvertising(uint8_t num) { - params_arrays = (esp_ble_gap_ext_adv_params_t*)calloc(num, sizeof(esp_ble_gap_ext_adv_params_t)); - ext_adv = (esp_ble_gap_ext_adv_t*)calloc(num, sizeof(esp_ble_gap_ext_adv_t)); + params_arrays = (esp_ble_gap_ext_adv_params_t *)calloc(num, sizeof(esp_ble_gap_ext_adv_params_t)); + ext_adv = (esp_ble_gap_ext_adv_t *)calloc(num, sizeof(esp_ble_gap_ext_adv_t)); count = num; } @@ -604,8 +579,10 @@ BLEMultiAdvertising::BLEMultiAdvertising(uint8_t num) { * - false : failed * */ -bool BLEMultiAdvertising::setAdvertisingParams(uint8_t instance, const esp_ble_gap_ext_adv_params_t* params) { - if (params->type == ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_IND && params->primary_phy == ESP_BLE_GAP_PHY_2M) return false; +bool BLEMultiAdvertising::setAdvertisingParams(uint8_t instance, const esp_ble_gap_ext_adv_params_t *params) { + if (params->type == ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_IND && params->primary_phy == ESP_BLE_GAP_PHY_2M) { + return false; + } esp_err_t rc; rc = esp_ble_gap_ext_adv_set_params(instance, params); @@ -623,18 +600,22 @@ bool BLEMultiAdvertising::setAdvertisingParams(uint8_t instance, const esp_ble_g * - false : failed * */ -bool BLEMultiAdvertising::setAdvertisingData(uint8_t instance, uint16_t length, const uint8_t* data) { +bool BLEMultiAdvertising::setAdvertisingData(uint8_t instance, uint16_t length, const uint8_t *data) { esp_err_t rc; rc = esp_ble_gap_config_ext_adv_data_raw(instance, length, data); - if (rc) log_e("set advertising data err: %d", rc); + if (rc) { + log_e("set advertising data err: %d", rc); + } return ESP_OK == rc; } -bool BLEMultiAdvertising::setScanRspData(uint8_t instance, uint16_t length, const uint8_t* data) { +bool BLEMultiAdvertising::setScanRspData(uint8_t instance, uint16_t length, const uint8_t *data) { esp_err_t rc; rc = esp_ble_gap_config_ext_scan_rsp_data_raw(instance, length, data); - if (rc) log_e("set scan resp data err: %d", rc); + if (rc) { + log_e("set scan resp data err: %d", rc); + } return ESP_OK == rc; } @@ -663,11 +644,15 @@ bool BLEMultiAdvertising::start() { * */ bool BLEMultiAdvertising::start(uint8_t num, uint8_t from) { - if (num > count || from >= count) return false; + if (num > count || from >= count) { + return false; + } esp_err_t rc; rc = esp_ble_gap_ext_adv_start(num, &ext_adv[from]); - if (rc) log_e("start extended advertising err: %d", rc); + if (rc) { + log_e("start extended advertising err: %d", rc); + } return ESP_OK == rc; } @@ -683,10 +668,12 @@ bool BLEMultiAdvertising::start(uint8_t num, uint8_t from) { * - other : failed * */ -bool BLEMultiAdvertising::stop(uint8_t num_adv, const uint8_t* ext_adv_inst) { +bool BLEMultiAdvertising::stop(uint8_t num_adv, const uint8_t *ext_adv_inst) { esp_err_t rc; rc = esp_ble_gap_ext_adv_stop(num_adv, ext_adv_inst); - if (rc) log_e("stop extended advertising err: %d", rc); + if (rc) { + log_e("stop extended advertising err: %d", rc); + } return ESP_OK == rc; } @@ -703,7 +690,9 @@ bool BLEMultiAdvertising::stop(uint8_t num_adv, const uint8_t* ext_adv_inst) { bool BLEMultiAdvertising::remove(uint8_t instance) { esp_err_t rc; rc = esp_ble_gap_ext_adv_set_remove(instance); - if (rc) log_e("remove extended advertising err: %d", rc); + if (rc) { + log_e("remove extended advertising err: %d", rc); + } return ESP_OK == rc; } @@ -719,7 +708,9 @@ bool BLEMultiAdvertising::remove(uint8_t instance) { bool BLEMultiAdvertising::clear() { esp_err_t rc; rc = esp_ble_gap_ext_adv_set_clear(); - if (rc) log_e("clear extended advertising err: %d", rc); + if (rc) { + log_e("clear extended advertising err: %d", rc); + } return ESP_OK == rc; } @@ -734,10 +725,12 @@ bool BLEMultiAdvertising::clear() { * - false : failed * */ -bool BLEMultiAdvertising::setInstanceAddress(uint8_t instance, uint8_t* addr_legacy) { +bool BLEMultiAdvertising::setInstanceAddress(uint8_t instance, uint8_t *addr_legacy) { esp_err_t rc; rc = esp_ble_gap_ext_adv_set_rand_addr(instance, addr_legacy); - if (rc) log_e("set random address err: %d", rc); + if (rc) { + log_e("set random address err: %d", rc); + } return ESP_OK == rc; } @@ -752,10 +745,12 @@ bool BLEMultiAdvertising::setInstanceAddress(uint8_t instance, uint8_t* addr_leg * - false : failed * */ -bool BLEMultiAdvertising::setPeriodicAdvertisingParams(uint8_t instance, const esp_ble_gap_periodic_adv_params_t* params) { +bool BLEMultiAdvertising::setPeriodicAdvertisingParams(uint8_t instance, const esp_ble_gap_periodic_adv_params_t *params) { esp_err_t rc; rc = esp_ble_gap_periodic_adv_set_params(instance, params); - if (rc) log_e("set periodic advertising params err: %d", rc); + if (rc) { + log_e("set periodic advertising params err: %d", rc); + } return ESP_OK == rc; } @@ -771,10 +766,12 @@ bool BLEMultiAdvertising::setPeriodicAdvertisingParams(uint8_t instance, const e * - false : failed * */ -bool BLEMultiAdvertising::setPeriodicAdvertisingData(uint8_t instance, uint16_t length, const uint8_t* data) { +bool BLEMultiAdvertising::setPeriodicAdvertisingData(uint8_t instance, uint16_t length, const uint8_t *data) { esp_err_t rc; rc = esp_ble_gap_config_periodic_adv_data_raw(instance, length, data); - if (rc) log_e("set periodic advertising raw data err: %d", rc); + if (rc) { + log_e("set periodic advertising raw data err: %d", rc); + } return ESP_OK == rc; } @@ -791,13 +788,15 @@ bool BLEMultiAdvertising::setPeriodicAdvertisingData(uint8_t instance, uint16_t bool BLEMultiAdvertising::startPeriodicAdvertising(uint8_t instance) { esp_err_t rc; rc = esp_ble_gap_periodic_adv_start(instance); - if (rc) log_e("start periodic advertising err: %d", rc); + if (rc) { + log_e("start periodic advertising err: %d", rc); + } return ESP_OK == rc; } void BLEMultiAdvertising::setDuration(uint8_t instance, int duration, int max_events) { - ext_adv[instance] = { instance, duration, max_events }; + ext_adv[instance] = {instance, duration, max_events}; } #endif // SOC_BLE_50_SUPPORTED diff --git a/libraries/BLE/src/BLEAdvertising.h b/libraries/BLE/src/BLEAdvertising.h index 7dda32773..cc716f14c 100644 --- a/libraries/BLE/src/BLEAdvertising.h +++ b/libraries/BLE/src/BLEAdvertising.h @@ -39,8 +39,7 @@ public: private: friend class BLEAdvertising; String m_payload; // The payload of the advertisement. -}; // BLEAdvertisementData - +}; // BLEAdvertisementData /** * @brief Perform and manage %BLE advertising. @@ -51,10 +50,10 @@ class BLEAdvertising { public: BLEAdvertising(); void addServiceUUID(BLEUUID serviceUUID); - void addServiceUUID(const char* serviceUUID); + void addServiceUUID(const char *serviceUUID); bool removeServiceUUID(int index); bool removeServiceUUID(BLEUUID serviceUUID); - bool removeServiceUUID(const char* serviceUUID); + bool removeServiceUUID(const char *serviceUUID); void start(); void stop(); void setAppearance(uint16_t appearance); @@ -62,13 +61,13 @@ public: void setAdvertisementChannelMap(esp_ble_adv_channel_t channel_map); void setMaxInterval(uint16_t maxinterval); void setMinInterval(uint16_t mininterval); - void setAdvertisementData(BLEAdvertisementData& advertisementData); + void setAdvertisementData(BLEAdvertisementData &advertisementData); void setScanFilter(bool scanRequertWhitelistOnly, bool connectWhitelistOnly); - void setScanResponseData(BLEAdvertisementData& advertisementData); + void setScanResponseData(BLEAdvertisementData &advertisementData); void setPrivateAddress(esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM); void setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM); - void handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param); + void handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param); void setMinPreferred(uint16_t); void setMaxPreferred(uint16_t); void setScanResponse(bool); @@ -88,26 +87,26 @@ private: class BLEMultiAdvertising { private: - esp_ble_gap_ext_adv_params_t* params_arrays; - esp_ble_gap_ext_adv_t* ext_adv; + esp_ble_gap_ext_adv_params_t *params_arrays; + esp_ble_gap_ext_adv_t *ext_adv; uint8_t count; public: BLEMultiAdvertising(uint8_t num = 1); ~BLEMultiAdvertising() {} - bool setAdvertisingParams(uint8_t instance, const esp_ble_gap_ext_adv_params_t* params); - bool setAdvertisingData(uint8_t instance, uint16_t length, const uint8_t* data); - bool setScanRspData(uint8_t instance, uint16_t length, const uint8_t* data); + bool setAdvertisingParams(uint8_t instance, const esp_ble_gap_ext_adv_params_t *params); + bool setAdvertisingData(uint8_t instance, uint16_t length, const uint8_t *data); + bool setScanRspData(uint8_t instance, uint16_t length, const uint8_t *data); bool start(); bool start(uint8_t num, uint8_t from); void setDuration(uint8_t instance, int duration = 0, int max_events = 0); bool setInstanceAddress(uint8_t instance, esp_bd_addr_t rand_addr); - bool stop(uint8_t num_adv, const uint8_t* ext_adv_inst); + bool stop(uint8_t num_adv, const uint8_t *ext_adv_inst); bool remove(uint8_t instance); bool clear(); - bool setPeriodicAdvertisingParams(uint8_t instance, const esp_ble_gap_periodic_adv_params_t* params); - bool setPeriodicAdvertisingData(uint8_t instance, uint16_t length, const uint8_t* data); + bool setPeriodicAdvertisingParams(uint8_t instance, const esp_ble_gap_periodic_adv_params_t *params); + bool setPeriodicAdvertisingData(uint8_t instance, uint16_t length, const uint8_t *data); bool startPeriodicAdvertising(uint8_t instance); }; diff --git a/libraries/BLE/src/BLEBeacon.cpp b/libraries/BLE/src/BLEBeacon.cpp index 1ae2b62bb..43366a7b2 100644 --- a/libraries/BLE/src/BLEBeacon.cpp +++ b/libraries/BLE/src/BLEBeacon.cpp @@ -12,8 +12,7 @@ #include "BLEBeacon.h" #include "esp32-hal-log.h" -#define ENDIAN_CHANGE_U16(x) ((((x)&0xFF00) >> 8) + (((x)&0xFF) << 8)) - +#define ENDIAN_CHANGE_U16(x) ((((x) & 0xFF00) >> 8) + (((x) & 0xFF) << 8)) BLEBeacon::BLEBeacon() { m_beaconData.manufacturerId = 0x4c00; @@ -26,7 +25,7 @@ BLEBeacon::BLEBeacon() { } // BLEBeacon String BLEBeacon::getData() { - return String((char*)&m_beaconData, sizeof(m_beaconData)); + return String((char *)&m_beaconData, sizeof(m_beaconData)); } // getData uint16_t BLEBeacon::getMajor() { @@ -81,6 +80,5 @@ void BLEBeacon::setSignalPower(int8_t signalPower) { m_beaconData.signalPower = signalPower; } // setSignalPower - #endif #endif /* SOC_BLE_SUPPORTED */ diff --git a/libraries/BLE/src/BLEBeacon.h b/libraries/BLE/src/BLEBeacon.h index ee8d8244d..dcc41aafe 100644 --- a/libraries/BLE/src/BLEBeacon.h +++ b/libraries/BLE/src/BLEBeacon.h @@ -27,6 +27,7 @@ private: uint16_t minor; int8_t signalPower; } __attribute__((packed)) m_beaconData; + public: BLEBeacon(); String getData(); diff --git a/libraries/BLE/src/BLECharacteristic.cpp b/libraries/BLE/src/BLECharacteristic.cpp index b07e915a0..1d1bafdda 100644 --- a/libraries/BLE/src/BLECharacteristic.cpp +++ b/libraries/BLE/src/BLECharacteristic.cpp @@ -32,9 +32,7 @@ static BLECharacteristicCallbacks defaultCallback; //null-object-pattern * @param [in] uuid - UUID (const char*) for the characteristic. * @param [in] properties - Properties for the characteristic. */ -BLECharacteristic::BLECharacteristic(const char* uuid, uint32_t properties) - : BLECharacteristic(BLEUUID(uuid), properties) { -} +BLECharacteristic::BLECharacteristic(const char *uuid, uint32_t properties) : BLECharacteristic(BLEUUID(uuid), properties) {} /** * @brief Construct a characteristic @@ -62,24 +60,22 @@ BLECharacteristic::~BLECharacteristic() { //free(m_value.attr_value); // Release the storage for the value. } // ~BLECharacteristic - /** * @brief Associate a descriptor with this characteristic. * @param [in] pDescriptor * @return N/A. */ -void BLECharacteristic::addDescriptor(BLEDescriptor* pDescriptor) { +void BLECharacteristic::addDescriptor(BLEDescriptor *pDescriptor) { log_v(">> addDescriptor(): Adding %s to %s", pDescriptor->toString().c_str(), toString().c_str()); m_descriptorMap.setByUUID(pDescriptor->getUUID(), pDescriptor); log_v("<< addDescriptor()"); } // addDescriptor - /** * @brief Register a new characteristic with the ESP runtime. * @param [in] pService The service with which to associate this characteristic. */ -void BLECharacteristic::executeCreate(BLEService* pService) { +void BLECharacteristic::executeCreate(BLEService *pService) { log_v(">> executeCreate()"); if (m_handle != NULL_HANDLE) { @@ -89,21 +85,16 @@ void BLECharacteristic::executeCreate(BLEService* pService) { m_pService = pService; // Save the service to which this characteristic belongs. - log_d("Registering characteristic (esp_ble_gatts_add_char): uuid: %s, service: %s", - getUUID().toString().c_str(), - m_pService->toString().c_str()); + log_d("Registering characteristic (esp_ble_gatts_add_char): uuid: %s, service: %s", getUUID().toString().c_str(), m_pService->toString().c_str()); esp_attr_control_t control; control.auto_rsp = ESP_GATT_RSP_BY_APP; m_semaphoreCreateEvt.take("executeCreate"); esp_err_t errRc = ::esp_ble_gatts_add_char( - m_pService->getHandle(), - getUUID().getNative(), - static_cast(m_permissions), - getProperties(), - nullptr, - &control); // Whether to auto respond or not. + m_pService->getHandle(), getUUID().getNative(), static_cast(m_permissions), getProperties(), nullptr, + &control + ); // Whether to auto respond or not. if (errRc != ESP_OK) { log_e("<< esp_ble_gatts_add_char: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); @@ -111,7 +102,7 @@ void BLECharacteristic::executeCreate(BLEService* pService) { } m_semaphoreCreateEvt.wait("executeCreate"); - BLEDescriptor* pDescriptor = m_descriptorMap.getFirst(); + BLEDescriptor *pDescriptor = m_descriptorMap.getFirst(); while (pDescriptor != nullptr) { pDescriptor->executeCreate(this); pDescriptor = m_descriptorMap.getNext(); @@ -120,27 +111,24 @@ void BLECharacteristic::executeCreate(BLEService* pService) { log_v("<< executeCreate"); } // executeCreate - /** * @brief Return the BLE Descriptor for the given UUID if associated with this characteristic. * @param [in] descriptorUUID The UUID of the descriptor that we wish to retrieve. * @return The BLE Descriptor. If no such descriptor is associated with the characteristic, nullptr is returned. */ -BLEDescriptor* BLECharacteristic::getDescriptorByUUID(const char* descriptorUUID) { +BLEDescriptor *BLECharacteristic::getDescriptorByUUID(const char *descriptorUUID) { return m_descriptorMap.getByUUID(BLEUUID(descriptorUUID)); } // getDescriptorByUUID - /** * @brief Return the BLE Descriptor for the given UUID if associated with this characteristic. * @param [in] descriptorUUID The UUID of the descriptor that we wish to retrieve. * @return The BLE Descriptor. If no such descriptor is associated with the characteristic, nullptr is returned. */ -BLEDescriptor* BLECharacteristic::getDescriptorByUUID(BLEUUID descriptorUUID) { +BLEDescriptor *BLECharacteristic::getDescriptorByUUID(BLEUUID descriptorUUID) { return m_descriptorMap.getByUUID(descriptorUUID); } // getDescriptorByUUID - /** * @brief Get the handle of the characteristic. * @return The handle of the characteristic. @@ -157,15 +145,13 @@ esp_gatt_char_prop_t BLECharacteristic::getProperties() { return m_properties; } // getProperties - /** * @brief Get the service associated with this characteristic. */ -BLEService* BLECharacteristic::getService() { +BLEService *BLECharacteristic::getService() { return m_pService; } // getService - /** * @brief Get the UUID of the characteristic. * @return The UUID of the characteristic. @@ -174,7 +160,6 @@ BLEUUID BLECharacteristic::getUUID() { return m_bleUUID; } // getUUID - /** * @brief Retrieve the current value of the characteristic. * @return A pointer to storage containing the current characteristic value. @@ -187,7 +172,7 @@ String BLECharacteristic::getValue() { * @brief Retrieve the current raw data of the characteristic. * @return A pointer to storage containing the current characteristic data. */ -uint8_t* BLECharacteristic::getData() { +uint8_t *BLECharacteristic::getData() { return m_value.getData(); } // getData @@ -202,10 +187,7 @@ size_t BLECharacteristic::getLength() { /** * Handle a GATT server event. */ -void BLECharacteristic::handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param) { +void BLECharacteristic::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) { log_v(">> handleGATTServerEvent: %s", BLEUtils::gattServerEventTypeToString(event).c_str()); switch (event) { @@ -230,28 +212,24 @@ void BLECharacteristic::handleGATTServerEvent( // - uint8_t exec_write_flag - Either ESP_GATT_PREP_WRITE_EXEC or ESP_GATT_PREP_WRITE_CANCEL // case ESP_GATTS_EXEC_WRITE_EVT: - { - if (m_writeEvt) { - m_writeEvt = false; - if (param->exec_write.exec_write_flag == ESP_GATT_PREP_WRITE_EXEC) { - m_value.commit(); - // Invoke the onWrite callback handler. - m_pCallbacks->onWrite(this, param); - } else { - m_value.cancel(); - } - // ??? - esp_err_t errRc = ::esp_ble_gatts_send_response( - gatts_if, - param->write.conn_id, - param->write.trans_id, ESP_GATT_OK, nullptr); - if (errRc != ESP_OK) { - log_e("esp_ble_gatts_send_response: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } + { + if (m_writeEvt) { + m_writeEvt = false; + if (param->exec_write.exec_write_flag == ESP_GATT_PREP_WRITE_EXEC) { + m_value.commit(); + // Invoke the onWrite callback handler. + m_pCallbacks->onWrite(this, param); + } else { + m_value.cancel(); } - break; - } // ESP_GATTS_EXEC_WRITE_EVT - + // ??? + esp_err_t errRc = ::esp_ble_gatts_send_response(gatts_if, param->write.conn_id, param->write.trans_id, ESP_GATT_OK, nullptr); + if (errRc != ESP_OK) { + log_e("esp_ble_gatts_send_response: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); + } + } + break; + } // ESP_GATTS_EXEC_WRITE_EVT // ESP_GATTS_ADD_CHAR_EVT - Indicate that a characteristic was added to the service. // add_char: @@ -260,19 +238,18 @@ void BLECharacteristic::handleGATTServerEvent( // - uint16_t service_handle // - esp_bt_uuid_t char_uuid case ESP_GATTS_ADD_CHAR_EVT: - { - if (getHandle() == param->add_char.attr_handle) { - // we have created characteristic, now we can create descriptors - // BLEDescriptor* pDescriptor = m_descriptorMap.getFirst(); - // while (pDescriptor != nullptr) { - // pDescriptor->executeCreate(this); - // pDescriptor = m_descriptorMap.getNext(); - // } // End while - m_semaphoreCreateEvt.give(); - } - break; - } // ESP_GATTS_ADD_CHAR_EVT - + { + if (getHandle() == param->add_char.attr_handle) { + // we have created characteristic, now we can create descriptors + // BLEDescriptor* pDescriptor = m_descriptorMap.getFirst(); + // while (pDescriptor != nullptr) { + // pDescriptor->executeCreate(this); + // pDescriptor = m_descriptorMap.getNext(); + // } // End while + m_semaphoreCreateEvt.give(); + } + break; + } // ESP_GATTS_ADD_CHAR_EVT // ESP_GATTS_WRITE_EVT - A request to write the value of a characteristic has arrived. // @@ -288,51 +265,46 @@ void BLECharacteristic::handleGATTServerEvent( // - uint8_t *value // case ESP_GATTS_WRITE_EVT: - { - // We check if this write request is for us by comparing the handles in the event. If it is for us - // we save the new value. Next we look at the need_rsp flag which indicates whether or not we need - // to send a response. If we do, then we formulate a response and send it. - if (param->write.handle == m_handle) { - if (param->write.is_prep) { - m_value.addPart(param->write.value, param->write.len); - m_writeEvt = true; - } else { - setValue(param->write.value, param->write.len); + { + // We check if this write request is for us by comparing the handles in the event. If it is for us + // we save the new value. Next we look at the need_rsp flag which indicates whether or not we need + // to send a response. If we do, then we formulate a response and send it. + if (param->write.handle == m_handle) { + if (param->write.is_prep) { + m_value.addPart(param->write.value, param->write.len); + m_writeEvt = true; + } else { + setValue(param->write.value, param->write.len); + } + + log_d(" - Response to write event: New value: handle: %.2x, uuid: %s", getHandle(), getUUID().toString().c_str()); + + char *pHexData = BLEUtils::buildHexData(nullptr, param->write.value, param->write.len); + log_d(" - Data: length: %d, data: %s", param->write.len, pHexData); + free(pHexData); + + if (param->write.need_rsp) { + esp_gatt_rsp_t rsp; + + rsp.attr_value.len = param->write.len; + rsp.attr_value.handle = m_handle; + rsp.attr_value.offset = param->write.offset; + rsp.attr_value.auth_req = ESP_GATT_AUTH_REQ_NONE; + memcpy(rsp.attr_value.value, param->write.value, param->write.len); + + esp_err_t errRc = ::esp_ble_gatts_send_response(gatts_if, param->write.conn_id, param->write.trans_id, ESP_GATT_OK, &rsp); + if (errRc != ESP_OK) { + log_e("esp_ble_gatts_send_response: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); } + } // Response needed - log_d(" - Response to write event: New value: handle: %.2x, uuid: %s", - getHandle(), getUUID().toString().c_str()); - - char* pHexData = BLEUtils::buildHexData(nullptr, param->write.value, param->write.len); - log_d(" - Data: length: %d, data: %s", param->write.len, pHexData); - free(pHexData); - - if (param->write.need_rsp) { - esp_gatt_rsp_t rsp; - - rsp.attr_value.len = param->write.len; - rsp.attr_value.handle = m_handle; - rsp.attr_value.offset = param->write.offset; - rsp.attr_value.auth_req = ESP_GATT_AUTH_REQ_NONE; - memcpy(rsp.attr_value.value, param->write.value, param->write.len); - - esp_err_t errRc = ::esp_ble_gatts_send_response( - gatts_if, - param->write.conn_id, - param->write.trans_id, ESP_GATT_OK, &rsp); - if (errRc != ESP_OK) { - log_e("esp_ble_gatts_send_response: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } - } // Response needed - - if (param->write.is_prep != true) { - // Invoke the onWrite callback handler. - m_pCallbacks->onWrite(this, param); - } - } // Match on handles. - break; - } // ESP_GATTS_WRITE_EVT - + if (param->write.is_prep != true) { + // Invoke the onWrite callback handler. + m_pCallbacks->onWrite(this, param); + } + } // Match on handles. + break; + } // ESP_GATTS_WRITE_EVT // ESP_GATTS_READ_EVT - A request to read the value of a characteristic has arrived. // @@ -346,97 +318,90 @@ void BLECharacteristic::handleGATTServerEvent( // - bool need_rsp // case ESP_GATTS_READ_EVT: - { - if (param->read.handle == m_handle) { + { + if (param->read.handle == m_handle) { + // Here's an interesting thing. The read request has the option of saying whether we need a response + // or not. What would it "mean" to receive a read request and NOT send a response back? That feels like + // a very strange read. + // + // We have to handle the case where the data we wish to send back to the client is greater than the maximum + // packet size of 22 bytes. In this case, we become responsible for chunking the data into units of 22 bytes. + // The apparent algorithm is as follows: + // + // If the is_long flag is set then this is a follow on from an original read and we will already have sent at least 22 bytes. + // If the is_long flag is not set then we need to check how much data we are going to send. If we are sending LESS than + // 22 bytes, then we "just" send it and that's the end of the story. + // If we are sending 22 bytes exactly, we just send it BUT we will get a follow on request. + // If we are sending more than 22 bytes, we send the first 22 bytes and we will get a follow on request. + // Because of follow on request processing, we need to maintain an offset of how much data we have already sent + // so that when a follow on request arrives, we know where to start in the data to send the next sequence. + // Note that the indication that the client will send a follow on request is that we sent exactly 22 bytes as a response. + // If our payload is divisible by 22 then the last response will be a response of 0 bytes in length. + // + // The following code has deliberately not been factored to make it fewer statements because this would cloud the + // the logic flow comprehension. + // + // get mtu for peer device that we are sending read request to + uint16_t maxOffset = getService()->getServer()->getPeerMTU(param->read.conn_id) - 1; + log_d("mtu value: %d", maxOffset); + if (param->read.need_rsp) { + log_d("Sending a response (esp_ble_gatts_send_response)"); + esp_gatt_rsp_t rsp; - // Here's an interesting thing. The read request has the option of saying whether we need a response - // or not. What would it "mean" to receive a read request and NOT send a response back? That feels like - // a very strange read. - // - // We have to handle the case where the data we wish to send back to the client is greater than the maximum - // packet size of 22 bytes. In this case, we become responsible for chunking the data into units of 22 bytes. - // The apparent algorithm is as follows: - // - // If the is_long flag is set then this is a follow on from an original read and we will already have sent at least 22 bytes. - // If the is_long flag is not set then we need to check how much data we are going to send. If we are sending LESS than - // 22 bytes, then we "just" send it and that's the end of the story. - // If we are sending 22 bytes exactly, we just send it BUT we will get a follow on request. - // If we are sending more than 22 bytes, we send the first 22 bytes and we will get a follow on request. - // Because of follow on request processing, we need to maintain an offset of how much data we have already sent - // so that when a follow on request arrives, we know where to start in the data to send the next sequence. - // Note that the indication that the client will send a follow on request is that we sent exactly 22 bytes as a response. - // If our payload is divisible by 22 then the last response will be a response of 0 bytes in length. - // - // The following code has deliberately not been factored to make it fewer statements because this would cloud the - // the logic flow comprehension. - // + if (param->read.is_long) { + String value = m_value.getValue(); - // get mtu for peer device that we are sending read request to - uint16_t maxOffset = getService()->getServer()->getPeerMTU(param->read.conn_id) - 1; - log_d("mtu value: %d", maxOffset); - if (param->read.need_rsp) { - log_d("Sending a response (esp_ble_gatts_send_response)"); - esp_gatt_rsp_t rsp; - - if (param->read.is_long) { - String value = m_value.getValue(); - - if (value.length() - m_value.getReadOffset() < maxOffset) { - // This is the last in the chain - rsp.attr_value.len = value.length() - m_value.getReadOffset(); - rsp.attr_value.offset = m_value.getReadOffset(); - memcpy(rsp.attr_value.value, value.c_str() + rsp.attr_value.offset, rsp.attr_value.len); - m_value.setReadOffset(0); - } else { - // There will be more to come. - rsp.attr_value.len = maxOffset; - rsp.attr_value.offset = m_value.getReadOffset(); - memcpy(rsp.attr_value.value, value.c_str() + rsp.attr_value.offset, rsp.attr_value.len); - m_value.setReadOffset(rsp.attr_value.offset + maxOffset); - } - } else { // read.is_long == false - - // If is.long is false then this is the first (or only) request to read data, so invoke the callback - // Invoke the read callback. - m_pCallbacks->onRead(this, param); - - String value = m_value.getValue(); - - if (value.length() + 1 > maxOffset) { - // Too big for a single shot entry. - m_value.setReadOffset(maxOffset); - rsp.attr_value.len = maxOffset; - rsp.attr_value.offset = 0; - memcpy(rsp.attr_value.value, value.c_str(), rsp.attr_value.len); - } else { - // Will fit in a single packet with no callbacks required. - rsp.attr_value.len = value.length(); - rsp.attr_value.offset = 0; - memcpy(rsp.attr_value.value, value.c_str(), rsp.attr_value.len); - } + if (value.length() - m_value.getReadOffset() < maxOffset) { + // This is the last in the chain + rsp.attr_value.len = value.length() - m_value.getReadOffset(); + rsp.attr_value.offset = m_value.getReadOffset(); + memcpy(rsp.attr_value.value, value.c_str() + rsp.attr_value.offset, rsp.attr_value.len); + m_value.setReadOffset(0); + } else { + // There will be more to come. + rsp.attr_value.len = maxOffset; + rsp.attr_value.offset = m_value.getReadOffset(); + memcpy(rsp.attr_value.value, value.c_str() + rsp.attr_value.offset, rsp.attr_value.len); + m_value.setReadOffset(rsp.attr_value.offset + maxOffset); } - rsp.attr_value.handle = param->read.handle; - rsp.attr_value.auth_req = ESP_GATT_AUTH_REQ_NONE; + } else { // read.is_long == false - char* pHexData = BLEUtils::buildHexData(nullptr, rsp.attr_value.value, rsp.attr_value.len); - log_d(" - Data: length=%d, data=%s, offset=%d", rsp.attr_value.len, pHexData, rsp.attr_value.offset); - free(pHexData); + // If is.long is false then this is the first (or only) request to read data, so invoke the callback + // Invoke the read callback. + m_pCallbacks->onRead(this, param); - esp_err_t errRc = ::esp_ble_gatts_send_response( - gatts_if, param->read.conn_id, - param->read.trans_id, - ESP_GATT_OK, - &rsp); - if (errRc != ESP_OK) { - log_e("esp_ble_gatts_send_response: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); + String value = m_value.getValue(); + + if (value.length() + 1 > maxOffset) { + // Too big for a single shot entry. + m_value.setReadOffset(maxOffset); + rsp.attr_value.len = maxOffset; + rsp.attr_value.offset = 0; + memcpy(rsp.attr_value.value, value.c_str(), rsp.attr_value.len); + } else { + // Will fit in a single packet with no callbacks required. + rsp.attr_value.len = value.length(); + rsp.attr_value.offset = 0; + memcpy(rsp.attr_value.value, value.c_str(), rsp.attr_value.len); } - } // Response needed - } // Handle matches this characteristic. - break; - } // ESP_GATTS_READ_EVT + } + rsp.attr_value.handle = param->read.handle; + rsp.attr_value.auth_req = ESP_GATT_AUTH_REQ_NONE; + char *pHexData = BLEUtils::buildHexData(nullptr, rsp.attr_value.value, rsp.attr_value.len); + log_d(" - Data: length=%d, data=%s, offset=%d", rsp.attr_value.len, pHexData, rsp.attr_value.offset); + free(pHexData); + + esp_err_t errRc = ::esp_ble_gatts_send_response(gatts_if, param->read.conn_id, param->read.trans_id, ESP_GATT_OK, &rsp); + if (errRc != ESP_OK) { + log_e("esp_ble_gatts_send_response: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); + } + } // Response needed + } // Handle matches this characteristic. + break; + } // ESP_GATTS_READ_EVT // ESP_GATTS_CONF_EVT // @@ -445,28 +410,30 @@ void BLECharacteristic::handleGATTServerEvent( // - uint16_t conn_id – The connection used. // case ESP_GATTS_CONF_EVT: - { - // log_d("m_handle = %d, conf->handle = %d", m_handle, param->conf.handle); - if (param->conf.conn_id == getService()->getServer()->getConnId()) // && param->conf.handle == m_handle) // bug in esp-idf and not implemented in arduino yet - m_semaphoreConfEvt.give(param->conf.status); - break; + { + // log_d("m_handle = %d, conf->handle = %d", m_handle, param->conf.handle); + if (param->conf.conn_id + == getService()->getServer()->getConnId()) { // && param->conf.handle == m_handle) // bug in esp-idf and not implemented in arduino yet + m_semaphoreConfEvt.give(param->conf.status); } + break; + } case ESP_GATTS_CONNECT_EVT: - { - break; - } + { + break; + } case ESP_GATTS_DISCONNECT_EVT: - { - m_semaphoreConfEvt.give(); - break; - } + { + m_semaphoreConfEvt.give(); + break; + } default: - { - break; - } // default + { + break; + } // default } // switch event @@ -477,7 +444,6 @@ void BLECharacteristic::handleGATTServerEvent( log_v("<< handleGATTServerEvent"); } // handleGATTServerEvent - /** * @brief Send an indication. * An indication is a transmission of up to the first 20 bytes of the characteristic value. An indication @@ -491,7 +457,6 @@ void BLECharacteristic::indicate() { log_v("<< indicate"); } // indicate - /** * @brief Send a notify. * A notification is a transmission of up to the first 20 bytes of the characteristic value. An notification @@ -506,7 +471,7 @@ void BLECharacteristic::notify(bool is_notification) { m_pCallbacks->onNotify(this); // Invoke the notify callback. - GeneralUtils::hexDump((uint8_t*)m_value.getValue().c_str(), m_value.getValue().length()); + GeneralUtils::hexDump((uint8_t *)m_value.getValue().c_str(), m_value.getValue().length()); if (getService()->getServer()->getConnectedCount() == 0) { log_v("<< notify: No connected clients."); @@ -517,7 +482,7 @@ void BLECharacteristic::notify(bool is_notification) { // Test to see if we have a 0x2902 descriptor. If we do, then check to see if notification is enabled // and, if not, prevent the notification. - BLE2902* p2902 = (BLE2902*)getDescriptorByUUID((uint16_t)0x2902); + BLE2902 *p2902 = (BLE2902 *)getDescriptorByUUID((uint16_t)0x2902); if (is_notification) { if (p2902 != nullptr && !p2902->getNotifications()) { log_v("<< notifications disabled; ignoring"); @@ -531,19 +496,19 @@ void BLECharacteristic::notify(bool is_notification) { return; } } - for (auto& myPair : getService()->getServer()->getPeerDevices(false)) { + for (auto &myPair : getService()->getServer()->getPeerDevices(false)) { uint16_t _mtu = (myPair.second.mtu); if (m_value.getValue().length() > _mtu - 3) { log_w("- Truncating to %d bytes (maximum notify size)", _mtu - 3); } size_t length = m_value.getValue().length(); - if (!is_notification) // is indication + if (!is_notification) { // is indication m_semaphoreConfEvt.take("indicate"); + } esp_err_t errRc = ::esp_ble_gatts_send_indicate( - getService()->getServer()->getGattsIf(), - myPair.first, - getHandle(), length, (uint8_t*)m_value.getValue().c_str(), !is_notification); // The need_confirm = false makes this a notify. + getService()->getServer()->getGattsIf(), myPair.first, getHandle(), length, (uint8_t *)m_value.getValue().c_str(), !is_notification + ); // The need_confirm = false makes this a notify. if (errRc != ESP_OK) { log_e("<< esp_ble_gatts_send_ %s: rc=%d %s", is_notification ? "notify" : "indicate", errRc, GeneralUtils::errorToString(errRc)); m_semaphoreConfEvt.give(); @@ -568,7 +533,6 @@ void BLECharacteristic::notify(bool is_notification) { log_v("<< notify"); } // Notify - /** * @brief Set the permission to broadcast. * A characteristics has properties associated with it which define what it is capable of doing. @@ -585,12 +549,11 @@ void BLECharacteristic::setBroadcastProperty(bool value) { } } // setBroadcastProperty - /** * @brief Set the callback handlers for this characteristic. * @param [in] pCallbacks An instance of a callbacks structure used to define any callbacks for the characteristic. */ -void BLECharacteristic::setCallbacks(BLECharacteristicCallbacks* pCallbacks) { +void BLECharacteristic::setCallbacks(BLECharacteristicCallbacks *pCallbacks) { log_v(">> setCallbacks: 0x%x", (uint32_t)pCallbacks); if (pCallbacks != nullptr) { m_pCallbacks = pCallbacks; @@ -600,7 +563,6 @@ void BLECharacteristic::setCallbacks(BLECharacteristicCallbacks* pCallbacks) { log_v("<< setCallbacks"); } // setCallbacks - /** * @brief Set the BLE handle associated with this characteristic. * A user program will request that a characteristic be created against a service. When the characteristic has been @@ -617,7 +579,6 @@ void BLECharacteristic::setHandle(uint16_t handle) { log_v("<< setHandle"); } // setHandle - /** * @brief Set the Indicate property value. * @param [in] value Set to true if we are to allow indicate messages. @@ -631,7 +592,6 @@ void BLECharacteristic::setIndicateProperty(bool value) { } } // setIndicateProperty - /** * @brief Set the Notify property value. * @param [in] value Set to true if we are to allow notification messages. @@ -645,7 +605,6 @@ void BLECharacteristic::setNotifyProperty(bool value) { } } // setNotifyProperty - /** * @brief Set the Read property value. * @param [in] value Set to true if we are to allow reads. @@ -659,14 +618,13 @@ void BLECharacteristic::setReadProperty(bool value) { } } // setReadProperty - /** * @brief Set the value of the characteristic. * @param [in] data The data to set for the characteristic. * @param [in] length The length of the data in bytes. */ -void BLECharacteristic::setValue(uint8_t* data, size_t length) { - char* pHex = BLEUtils::buildHexData(nullptr, data, length); +void BLECharacteristic::setValue(uint8_t *data, size_t length) { + char *pHex = BLEUtils::buildHexData(nullptr, data, length); log_v(">> setValue: length=%d, data=%s, characteristic UUID=%s", length, pHex, getUUID().toString().c_str()); free(pHex); if (length > ESP_GATT_MAX_ATTR_LEN) { @@ -679,7 +637,6 @@ void BLECharacteristic::setValue(uint8_t* data, size_t length) { log_v("<< setValue"); } // setValue - /** * @brief Set the value of the characteristic from string data. * We set the value of the characteristic from the bytes contained in the @@ -688,17 +645,17 @@ void BLECharacteristic::setValue(uint8_t* data, size_t length) { * @return N/A. */ void BLECharacteristic::setValue(String value) { - setValue((uint8_t*)(value.c_str()), value.length()); + setValue((uint8_t *)(value.c_str()), value.length()); } // setValue -void BLECharacteristic::setValue(uint16_t& data16) { +void BLECharacteristic::setValue(uint16_t &data16) { uint8_t temp[2]; temp[0] = data16; temp[1] = data16 >> 8; setValue(temp, 2); } // setValue -void BLECharacteristic::setValue(uint32_t& data32) { +void BLECharacteristic::setValue(uint32_t &data32) { uint8_t temp[4]; temp[0] = data32; temp[1] = data32 >> 8; @@ -707,7 +664,7 @@ void BLECharacteristic::setValue(uint32_t& data32) { setValue(temp, 4); } // setValue -void BLECharacteristic::setValue(int& data32) { +void BLECharacteristic::setValue(int &data32) { uint8_t temp[4]; temp[0] = data32; temp[1] = data32 >> 8; @@ -716,17 +673,16 @@ void BLECharacteristic::setValue(int& data32) { setValue(temp, 4); } // setValue -void BLECharacteristic::setValue(float& data32) { +void BLECharacteristic::setValue(float &data32) { float temp = data32; - setValue((uint8_t*)&temp, 4); + setValue((uint8_t *)&temp, 4); } // setValue -void BLECharacteristic::setValue(double& data64) { +void BLECharacteristic::setValue(double &data64) { double temp = data64; - setValue((uint8_t*)&temp, 8); + setValue((uint8_t *)&temp, 8); } // setValue - /** * @brief Set the Write No Response property value. * @param [in] value Set to true if we are to allow writes with no response. @@ -740,7 +696,6 @@ void BLECharacteristic::setWriteNoResponseProperty(bool value) { } } // setWriteNoResponseProperty - /** * @brief Set the Write property value. * @param [in] value Set to true if we are to allow writes. @@ -754,7 +709,6 @@ void BLECharacteristic::setWriteProperty(bool value) { } } // setWriteProperty - /** * @brief Return a string representation of the characteristic. * @return A string representation of the characteristic. @@ -765,49 +719,56 @@ String BLECharacteristic::toString() { snprintf(hex, sizeof(hex), "%04x", m_handle); res += hex; res += " "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_READ) res += "Read "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE) res += "Write "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE_NR) res += "WriteNoResponse "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_BROADCAST) res += "Broadcast "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_NOTIFY) res += "Notify "; - if (m_properties & ESP_GATT_CHAR_PROP_BIT_INDICATE) res += "Indicate "; + if (m_properties & ESP_GATT_CHAR_PROP_BIT_READ) { + res += "Read "; + } + if (m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE) { + res += "Write "; + } + if (m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE_NR) { + res += "WriteNoResponse "; + } + if (m_properties & ESP_GATT_CHAR_PROP_BIT_BROADCAST) { + res += "Broadcast "; + } + if (m_properties & ESP_GATT_CHAR_PROP_BIT_NOTIFY) { + res += "Notify "; + } + if (m_properties & ESP_GATT_CHAR_PROP_BIT_INDICATE) { + res += "Indicate "; + } return res; } // toString - BLECharacteristicCallbacks::~BLECharacteristicCallbacks() {} -void BLECharacteristicCallbacks::onRead(BLECharacteristic* pCharacteristic, esp_ble_gatts_cb_param_t* param) { +void BLECharacteristicCallbacks::onRead(BLECharacteristic *pCharacteristic, esp_ble_gatts_cb_param_t *param) { onRead(pCharacteristic); } // onRead -void BLECharacteristicCallbacks::onRead(BLECharacteristic* pCharacteristic) { +void BLECharacteristicCallbacks::onRead(BLECharacteristic *pCharacteristic) { log_d(">> onRead: default"); log_d("<< onRead"); } // onRead - -void BLECharacteristicCallbacks::onWrite(BLECharacteristic* pCharacteristic, esp_ble_gatts_cb_param_t* param) { +void BLECharacteristicCallbacks::onWrite(BLECharacteristic *pCharacteristic, esp_ble_gatts_cb_param_t *param) { onWrite(pCharacteristic); } // onWrite -void BLECharacteristicCallbacks::onWrite(BLECharacteristic* pCharacteristic) { +void BLECharacteristicCallbacks::onWrite(BLECharacteristic *pCharacteristic) { log_d(">> onWrite: default"); log_d("<< onWrite"); } // onWrite - -void BLECharacteristicCallbacks::onNotify(BLECharacteristic* pCharacteristic) { +void BLECharacteristicCallbacks::onNotify(BLECharacteristic *pCharacteristic) { log_d(">> onNotify: default"); log_d("<< onNotify"); } // onNotify - -void BLECharacteristicCallbacks::onStatus(BLECharacteristic* pCharacteristic, Status s, uint32_t code) { +void BLECharacteristicCallbacks::onStatus(BLECharacteristic *pCharacteristic, Status s, uint32_t code) { log_d(">> onStatus: default"); log_d("<< onStatus"); } // onStatus - #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ diff --git a/libraries/BLE/src/BLECharacteristic.h b/libraries/BLE/src/BLECharacteristic.h index 1428b0fe3..29f105868 100644 --- a/libraries/BLE/src/BLECharacteristic.h +++ b/libraries/BLE/src/BLECharacteristic.h @@ -30,22 +30,22 @@ class BLECharacteristicCallbacks; */ class BLEDescriptorMap { public: - void setByUUID(const char* uuid, BLEDescriptor* pDescriptor); - void setByUUID(BLEUUID uuid, BLEDescriptor* pDescriptor); - void setByHandle(uint16_t handle, BLEDescriptor* pDescriptor); - BLEDescriptor* getByUUID(const char* uuid); - BLEDescriptor* getByUUID(BLEUUID uuid); - BLEDescriptor* getByHandle(uint16_t handle); + void setByUUID(const char *uuid, BLEDescriptor *pDescriptor); + void setByUUID(BLEUUID uuid, BLEDescriptor *pDescriptor); + void setByHandle(uint16_t handle, BLEDescriptor *pDescriptor); + BLEDescriptor *getByUUID(const char *uuid); + BLEDescriptor *getByUUID(BLEUUID uuid); + BLEDescriptor *getByHandle(uint16_t handle); String toString(); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param); - BLEDescriptor* getFirst(); - BLEDescriptor* getNext(); -private: - std::map m_uuidMap; - std::map m_handleMap; - std::map::iterator m_iterator; -}; + void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); + BLEDescriptor *getFirst(); + BLEDescriptor *getNext(); +private: + std::map m_uuidMap; + std::map m_handleMap; + std::map::iterator m_iterator; +}; /** * @brief The model of a %BLE Characteristic. @@ -55,32 +55,32 @@ private: */ class BLECharacteristic { public: - BLECharacteristic(const char* uuid, uint32_t properties = 0); + BLECharacteristic(const char *uuid, uint32_t properties = 0); BLECharacteristic(BLEUUID uuid, uint32_t properties = 0); virtual ~BLECharacteristic(); - void addDescriptor(BLEDescriptor* pDescriptor); - BLEDescriptor* getDescriptorByUUID(const char* descriptorUUID); - BLEDescriptor* getDescriptorByUUID(BLEUUID descriptorUUID); + void addDescriptor(BLEDescriptor *pDescriptor); + BLEDescriptor *getDescriptorByUUID(const char *descriptorUUID); + BLEDescriptor *getDescriptorByUUID(BLEUUID descriptorUUID); BLEUUID getUUID(); String getValue(); - uint8_t* getData(); + uint8_t *getData(); size_t getLength(); void indicate(); void notify(bool is_notification = true); void setBroadcastProperty(bool value); - void setCallbacks(BLECharacteristicCallbacks* pCallbacks); + void setCallbacks(BLECharacteristicCallbacks *pCallbacks); void setIndicateProperty(bool value); void setNotifyProperty(bool value); void setReadProperty(bool value); - void setValue(uint8_t* data, size_t size); + void setValue(uint8_t *data, size_t size); void setValue(String value); - void setValue(uint16_t& data16); - void setValue(uint32_t& data32); - void setValue(int& data32); - void setValue(float& data32); - void setValue(double& data64); + void setValue(uint16_t &data16); + void setValue(uint32_t &data32); + void setValue(int &data32); + void setValue(float &data32); + void setValue(double &data64); void setWriteProperty(bool value); void setWriteNoResponseProperty(bool value); String toString(); @@ -97,7 +97,6 @@ public: static const uint32_t indicationTimeout = 1000; private: - friend class BLEServer; friend class BLEService; friend class BLEDescriptor; @@ -107,27 +106,23 @@ private: BLEDescriptorMap m_descriptorMap; uint16_t m_handle; esp_gatt_char_prop_t m_properties; - BLECharacteristicCallbacks* m_pCallbacks; - BLEService* m_pService; + BLECharacteristicCallbacks *m_pCallbacks; + BLEService *m_pService; BLEValue m_value; esp_gatt_perm_t m_permissions = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE; bool m_writeEvt = false; // If we have started a long write, this tells the commit code that we were the target - void handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param); + void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); - void executeCreate(BLEService* pService); + void executeCreate(BLEService *pService); esp_gatt_char_prop_t getProperties(); - BLEService* getService(); + BLEService *getService(); void setHandle(uint16_t handle); FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt"); FreeRTOS::Semaphore m_semaphoreConfEvt = FreeRTOS::Semaphore("ConfEvt"); FreeRTOS::Semaphore m_semaphoreSetValue = FreeRTOS::Semaphore("SetValue"); }; // BLECharacteristic - /** * @brief Callbacks that can be associated with a %BLE characteristic to inform of events. * @@ -155,30 +150,30 @@ public: * @param [in] pCharacteristic The characteristic that is the source of the event. * @param [in] param The BLE GATTS param. Use param->read. */ - virtual void onRead(BLECharacteristic* pCharacteristic, esp_ble_gatts_cb_param_t* param); + virtual void onRead(BLECharacteristic *pCharacteristic, esp_ble_gatts_cb_param_t *param); /** * @brief DEPRECATED! Callback function to support a read request. Called only if onRead(,) is not overridden * @param [in] pCharacteristic The characteristic that is the source of the event. */ - virtual void onRead(BLECharacteristic* pCharacteristic); + virtual void onRead(BLECharacteristic *pCharacteristic); /** * @brief Callback function to support a write request. * @param [in] pCharacteristic The characteristic that is the source of the event. * @param [in] param The BLE GATTS param. Use param->write. */ - virtual void onWrite(BLECharacteristic* pCharacteristic, esp_ble_gatts_cb_param_t* param); + virtual void onWrite(BLECharacteristic *pCharacteristic, esp_ble_gatts_cb_param_t *param); /** * @brief DEPRECATED! Callback function to support a write request. Called only if onWrite(,) is not overridden. * @param [in] pCharacteristic The characteristic that is the source of the event. */ - virtual void onWrite(BLECharacteristic* pCharacteristic); + virtual void onWrite(BLECharacteristic *pCharacteristic); /** * @brief Callback function to support a Notify request. * @param [in] pCharacteristic The characteristic that is the source of the event. */ - virtual void onNotify(BLECharacteristic* pCharacteristic); + virtual void onNotify(BLECharacteristic *pCharacteristic); /** * @brief Callback function to support a Notify/Indicate Status report. @@ -186,7 +181,7 @@ public: * @param [in] s Status of the notification/indication * @param [in] code Additional code of underlying errors */ - virtual void onStatus(BLECharacteristic* pCharacteristic, Status s, uint32_t code); + virtual void onStatus(BLECharacteristic *pCharacteristic, Status s, uint32_t code); }; #endif /* CONFIG_BLUEDROID_ENABLED */ diff --git a/libraries/BLE/src/BLECharacteristicMap.cpp b/libraries/BLE/src/BLECharacteristicMap.cpp index 6d8b33691..6f2c0bb11 100644 --- a/libraries/BLE/src/BLECharacteristicMap.cpp +++ b/libraries/BLE/src/BLECharacteristicMap.cpp @@ -16,34 +16,31 @@ #include "esp32-hal-log.h" #endif - /** * @brief Return the characteristic by handle. * @param [in] handle The handle to look up the characteristic. * @return The characteristic. */ -BLECharacteristic* BLECharacteristicMap::getByHandle(uint16_t handle) { +BLECharacteristic *BLECharacteristicMap::getByHandle(uint16_t handle) { return m_handleMap.at(handle); } // getByHandle - /** * @brief Return the characteristic by UUID. * @param [in] UUID The UUID to look up the characteristic. * @return The characteristic. */ -BLECharacteristic* BLECharacteristicMap::getByUUID(const char* uuid) { +BLECharacteristic *BLECharacteristicMap::getByUUID(const char *uuid) { return getByUUID(BLEUUID(uuid)); } - /** * @brief Return the characteristic by UUID. * @param [in] UUID The UUID to look up the characteristic. * @return The characteristic. */ -BLECharacteristic* BLECharacteristicMap::getByUUID(BLEUUID uuid) { - for (auto& myPair : m_uuidMap) { +BLECharacteristic *BLECharacteristicMap::getByUUID(BLEUUID uuid) { + for (auto &myPair : m_uuidMap) { if (myPair.first->getUUID().equals(uuid)) { return myPair.first; } @@ -52,68 +49,66 @@ BLECharacteristic* BLECharacteristicMap::getByUUID(BLEUUID uuid) { return nullptr; } // getByUUID - /** * @brief Get the first characteristic in the map. * @return The first characteristic in the map. */ -BLECharacteristic* BLECharacteristicMap::getFirst() { +BLECharacteristic *BLECharacteristicMap::getFirst() { m_iterator = m_uuidMap.begin(); - if (m_iterator == m_uuidMap.end()) return nullptr; - BLECharacteristic* pRet = m_iterator->first; + if (m_iterator == m_uuidMap.end()) { + return nullptr; + } + BLECharacteristic *pRet = m_iterator->first; m_iterator++; return pRet; } // getFirst - /** * @brief Get the next characteristic in the map. * @return The next characteristic in the map. */ -BLECharacteristic* BLECharacteristicMap::getNext() { - if (m_iterator == m_uuidMap.end()) return nullptr; - BLECharacteristic* pRet = m_iterator->first; +BLECharacteristic *BLECharacteristicMap::getNext() { + if (m_iterator == m_uuidMap.end()) { + return nullptr; + } + BLECharacteristic *pRet = m_iterator->first; m_iterator++; return pRet; } // getNext - /** * @brief Pass the GATT server event onwards to each of the characteristics found in the mapping * @param [in] event * @param [in] gatts_if * @param [in] param */ -void BLECharacteristicMap::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param) { +void BLECharacteristicMap::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) { // Invoke the handler for every Service we have. - for (auto& myPair : m_uuidMap) { + for (auto &myPair : m_uuidMap) { myPair.first->handleGATTServerEvent(event, gatts_if, param); } } // handleGATTServerEvent - /** * @brief Set the characteristic by handle. * @param [in] handle The handle of the characteristic. * @param [in] characteristic The characteristic to cache. * @return N/A. */ -void BLECharacteristicMap::setByHandle(uint16_t handle, BLECharacteristic* characteristic) { - m_handleMap.insert(std::pair(handle, characteristic)); +void BLECharacteristicMap::setByHandle(uint16_t handle, BLECharacteristic *characteristic) { + m_handleMap.insert(std::pair(handle, characteristic)); } // setByHandle - /** * @brief Set the characteristic by UUID. * @param [in] uuid The uuid of the characteristic. * @param [in] characteristic The characteristic to cache. * @return N/A. */ -void BLECharacteristicMap::setByUUID(BLECharacteristic* pCharacteristic, BLEUUID uuid) { - m_uuidMap.insert(std::pair(pCharacteristic, uuid.toString())); +void BLECharacteristicMap::setByUUID(BLECharacteristic *pCharacteristic, BLEUUID uuid) { + m_uuidMap.insert(std::pair(pCharacteristic, uuid.toString())); } // setByUUID - /** * @brief Return a string representation of the characteristic map. * @return A string representation of the characteristic map. @@ -122,8 +117,10 @@ String BLECharacteristicMap::toString() { String res; int count = 0; char hex[5]; - for (auto& myPair : m_uuidMap) { - if (count > 0) { res += "\n"; } + for (auto &myPair : m_uuidMap) { + if (count > 0) { + res += "\n"; + } snprintf(hex, sizeof(hex), "%04x", myPair.first->getHandle()); count++; res += "handle: 0x"; @@ -133,6 +130,5 @@ String BLECharacteristicMap::toString() { return res; } // toString - #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ diff --git a/libraries/BLE/src/BLEClient.cpp b/libraries/BLE/src/BLEClient.cpp index 37b3b26d8..ee60030a8 100644 --- a/libraries/BLE/src/BLEClient.cpp +++ b/libraries/BLE/src/BLEClient.cpp @@ -53,21 +53,19 @@ BLEClient::BLEClient() { m_isConnected = false; // Initially, we are flagged as not connected. } // BLEClient - /** * @brief Destructor. */ BLEClient::~BLEClient() { // We may have allocated service references associated with this client. Before we are finished // with the client, we must release resources. - for (auto& myPair : m_servicesMap) { + for (auto &myPair : m_servicesMap) { delete myPair.second; } m_servicesMap.clear(); m_servicesMapByInstID.clear(); } // ~BLEClient - /** * @brief Clear any existing services. * @@ -75,7 +73,7 @@ BLEClient::~BLEClient() { void BLEClient::clearServices() { log_v(">> clearServices"); // Delete all the services. - for (auto& myPair : m_servicesMap) { + for (auto &myPair : m_servicesMap) { delete myPair.second; } m_servicesMap.clear(); @@ -86,7 +84,7 @@ void BLEClient::clearServices() { /** * Add overloaded function to ease connect to peer device with not public address */ -bool BLEClient::connect(BLEAdvertisedDevice* device) { +bool BLEClient::connect(BLEAdvertisedDevice *device) { BLEAddress address = device->getAddress(); esp_ble_addr_type_t type = device->getAddressType(); return connect(address, type); @@ -95,7 +93,7 @@ bool BLEClient::connect(BLEAdvertisedDevice* device) { /** * Add overloaded function to ease connect to peer device with not public address */ -bool BLEClient::connectTimeout(BLEAdvertisedDevice* device, uint32_t timeoutMs) { +bool BLEClient::connectTimeout(BLEAdvertisedDevice *device, uint32_t timeoutMs) { BLEAddress address = device->getAddress(); esp_ble_addr_type_t type = device->getAddressType(); return connect(address, type, timeoutMs); @@ -165,7 +163,6 @@ bool BLEClient::connect(BLEAddress address, esp_ble_addr_type_t type, uint32_t t return rc == ESP_GATT_OK; } // connect - /** * @brief Disconnect from the peer. * @return N/A. @@ -180,17 +177,12 @@ void BLEClient::disconnect() { log_v("<< disconnect()"); } // disconnect - /** * @brief Handle GATT Client events */ -void BLEClient::gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam) { +void BLEClient::gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *evtParam) { - log_d("gattClientEventHandler [esp_gatt_if: %d] ... %s", - gattc_if, BLEUtils::gattClientEventTypeToString(event).c_str()); + log_d("gattClientEventHandler [esp_gatt_if: %d] ... %s", gattc_if, BLEUtils::gattClientEventTypeToString(event).c_str()); // it is possible to receive events from other connections while waiting for registration if (m_gattc_if == ESP_GATT_IF_NONE && event != ESP_GATTC_REG_EVT) { @@ -200,16 +192,14 @@ void BLEClient::gattClientEventHandler( // Execute handler code based on the type of event received. switch (event) { - case ESP_GATTC_SRVC_CHG_EVT: - log_i("SERVICE CHANGED"); - break; + case ESP_GATTC_SRVC_CHG_EVT: log_i("SERVICE CHANGED"); break; case ESP_GATTC_CLOSE_EVT: - { - // esp_ble_gattc_app_unregister(m_appId); - // BLEDevice::removePeerDevice(m_gattc_if, true); - break; - } + { + // esp_ble_gattc_app_unregister(m_appId); + // BLEDevice::removePeerDevice(m_gattc_if, true); + break; + } // // ESP_GATTC_DISCONNECT_EVT @@ -219,23 +209,25 @@ void BLEClient::gattClientEventHandler( // - uint16_t conn_id // - esp_bd_addr_t remote_bda case ESP_GATTC_DISCONNECT_EVT: - { - if (evtParam->disconnect.conn_id != getConnId()) break; - // If we receive a disconnect event, set the class flag that indicates that we are - // no longer connected. - bool m_wasConnected = m_isConnected; - m_isConnected = false; - esp_ble_gattc_app_unregister(m_gattc_if); - m_gattc_if = ESP_GATT_IF_NONE; - m_semaphoreOpenEvt.give(ESP_GATT_IF_NONE); - m_semaphoreRssiCmplEvt.give(); - m_semaphoreSearchCmplEvt.give(1); - BLEDevice::removePeerDevice(m_appId, true); - if (m_wasConnected && m_pClientCallbacks != nullptr) { - m_pClientCallbacks->onDisconnect(this); - } + { + if (evtParam->disconnect.conn_id != getConnId()) { break; - } // ESP_GATTC_DISCONNECT_EVT + } + // If we receive a disconnect event, set the class flag that indicates that we are + // no longer connected. + bool m_wasConnected = m_isConnected; + m_isConnected = false; + esp_ble_gattc_app_unregister(m_gattc_if); + m_gattc_if = ESP_GATT_IF_NONE; + m_semaphoreOpenEvt.give(ESP_GATT_IF_NONE); + m_semaphoreRssiCmplEvt.give(); + m_semaphoreSearchCmplEvt.give(1); + BLEDevice::removePeerDevice(m_appId, true); + if (m_wasConnected && m_pClientCallbacks != nullptr) { + m_pClientCallbacks->onDisconnect(this); + } + break; + } // ESP_GATTC_DISCONNECT_EVT // // ESP_GATTC_OPEN_EVT @@ -246,20 +238,19 @@ void BLEClient::gattClientEventHandler( // - esp_bd_addr_t remote_bda // case ESP_GATTC_OPEN_EVT: - { - m_conn_id = evtParam->open.conn_id; - if (evtParam->open.status == ESP_GATT_OK) { - m_isConnected = true; // Flag us as connected. - if (m_pClientCallbacks != nullptr) { - m_pClientCallbacks->onConnect(this); - } - } else { - log_e("Failed to connect, status=%s", GeneralUtils::errorToString(evtParam->open.status)); + { + m_conn_id = evtParam->open.conn_id; + if (evtParam->open.status == ESP_GATT_OK) { + m_isConnected = true; // Flag us as connected. + if (m_pClientCallbacks != nullptr) { + m_pClientCallbacks->onConnect(this); } - m_semaphoreOpenEvt.give(evtParam->open.status); - break; - } // ESP_GATTC_OPEN_EVT - + } else { + log_e("Failed to connect, status=%s", GeneralUtils::errorToString(evtParam->open.status)); + } + m_semaphoreOpenEvt.give(evtParam->open.status); + break; + } // ESP_GATTC_OPEN_EVT // // ESP_GATTC_REG_EVT @@ -269,15 +260,17 @@ void BLEClient::gattClientEventHandler( // uint16_t app_id // case ESP_GATTC_REG_EVT: - { - m_gattc_if = gattc_if; - // pass on the registration status result, in case of failure - m_semaphoreRegEvt.give(evtParam->reg.status); - break; - } // ESP_GATTC_REG_EVT + { + m_gattc_if = gattc_if; + // pass on the registration status result, in case of failure + m_semaphoreRegEvt.give(evtParam->reg.status); + break; + } // ESP_GATTC_REG_EVT case ESP_GATTC_CFG_MTU_EVT: - if (evtParam->cfg_mtu.conn_id != getConnId()) break; + if (evtParam->cfg_mtu.conn_id != getConnId()) { + break; + } if (evtParam->cfg_mtu.status != ESP_GATT_OK) { log_e("Config mtu failed"); } @@ -285,20 +278,22 @@ void BLEClient::gattClientEventHandler( break; case ESP_GATTC_CONNECT_EVT: - { - if (evtParam->connect.conn_id != getConnId()) break; - BLEDevice::updatePeerDevice(this, true, m_appId); - esp_err_t errRc = esp_ble_gattc_send_mtu_req(gattc_if, evtParam->connect.conn_id); - if (errRc != ESP_OK) { - log_e("esp_ble_gattc_send_mtu_req: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - } -#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if (BLEDevice::m_securityLevel) { - esp_ble_set_encryption(evtParam->connect.remote_bda, BLEDevice::m_securityLevel); - } -#endif // CONFIG_BLE_SMP_ENABLE + { + if (evtParam->connect.conn_id != getConnId()) { break; - } // ESP_GATTC_CONNECT_EVT + } + BLEDevice::updatePeerDevice(this, true, m_appId); + esp_err_t errRc = esp_ble_gattc_send_mtu_req(gattc_if, evtParam->connect.conn_id); + if (errRc != ESP_OK) { + log_e("esp_ble_gattc_send_mtu_req: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); + } +#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig + if (BLEDevice::m_securityLevel) { + esp_ble_set_encryption(evtParam->connect.remote_bda, BLEDevice::m_securityLevel); + } +#endif // CONFIG_BLE_SMP_ENABLE + break; + } // ESP_GATTC_CONNECT_EVT // // ESP_GATTC_SEARCH_CMPL_EVT @@ -308,13 +303,15 @@ void BLEClient::gattClientEventHandler( // - uint16_t conn_id // case ESP_GATTC_SEARCH_CMPL_EVT: - { - if (evtParam->search_cmpl.conn_id != getConnId()) break; - esp_ble_gattc_cb_param_t* p_data = (esp_ble_gattc_cb_param_t*)evtParam; - if (p_data->search_cmpl.status != ESP_GATT_OK) { - log_e("search service failed, error status = %x", p_data->search_cmpl.status); - break; - } + { + if (evtParam->search_cmpl.conn_id != getConnId()) { + break; + } + esp_ble_gattc_cb_param_t *p_data = (esp_ble_gattc_cb_param_t *)evtParam; + if (p_data->search_cmpl.status != ESP_GATT_OK) { + log_e("search service failed, error status = %x", p_data->search_cmpl.status); + break; + } #ifndef ARDUINO_ARCH_ESP32 // commented out just for now to keep backward compatibility // if(p_data->search_cmpl.searched_service_source == ESP_GATT_SERVICE_FROM_REMOTE_DEVICE) { @@ -325,10 +322,9 @@ void BLEClient::gattClientEventHandler( // log_i("unknown service source"); // } #endif - m_semaphoreSearchCmplEvt.give(0); - break; - } // ESP_GATTC_SEARCH_CMPL_EVT - + m_semaphoreSearchCmplEvt.give(0); + break; + } // ESP_GATTC_SEARCH_CMPL_EVT // // ESP_GATTC_SEARCH_RES_EVT @@ -340,45 +336,39 @@ void BLEClient::gattClientEventHandler( // - esp_gatt_id_t srvc_id // case ESP_GATTC_SEARCH_RES_EVT: - { - if (evtParam->search_res.conn_id != getConnId()) break; - BLEUUID uuid = BLEUUID(evtParam->search_res.srvc_id); - BLERemoteService* pRemoteService = new BLERemoteService( - evtParam->search_res.srvc_id, - this, - evtParam->search_res.start_handle, - evtParam->search_res.end_handle); - m_servicesMap.insert(std::pair(uuid.toString(), pRemoteService)); - m_servicesMapByInstID.insert(std::pair(pRemoteService, evtParam->search_res.srvc_id.inst_id)); - break; - } // ESP_GATTC_SEARCH_RES_EVT - - - default: - { + { + if (evtParam->search_res.conn_id != getConnId()) { break; } + BLEUUID uuid = BLEUUID(evtParam->search_res.srvc_id); + BLERemoteService *pRemoteService = + new BLERemoteService(evtParam->search_res.srvc_id, this, evtParam->search_res.start_handle, evtParam->search_res.end_handle); + m_servicesMap.insert(std::pair(uuid.toString(), pRemoteService)); + m_servicesMapByInstID.insert(std::pair(pRemoteService, evtParam->search_res.srvc_id.inst_id)); + break; + } // ESP_GATTC_SEARCH_RES_EVT + + default: + { + break; + } } // Switch // Pass the request on to all services. - for (auto& myPair : m_servicesMap) { + for (auto &myPair : m_servicesMap) { myPair.second->gattClientEventHandler(event, gattc_if, evtParam); } } // gattClientEventHandler - uint16_t BLEClient::getConnId() { return m_conn_id; } // getConnId - - esp_gatt_if_t BLEClient::getGattcIf() { return m_gattc_if; } // getGattcIf - /** * @brief Retrieve the address of the peer. * @@ -388,7 +378,6 @@ BLEAddress BLEClient::getPeerAddress() { return m_peerAddress; } // getAddress - /** * @brief Ask the BLE server for the RSSI value. * @return The RSSI value. @@ -413,24 +402,22 @@ int BLEClient::getRssi() { return rssiValue; } // getRssi - /** * @brief Get the service BLE Remote Service instance corresponding to the uuid. * @param [in] uuid The UUID of the service being sought. * @return A reference to the Service or nullptr if don't know about it. */ -BLERemoteService* BLEClient::getService(const char* uuid) { +BLERemoteService *BLEClient::getService(const char *uuid) { return getService(BLEUUID(uuid)); } // getService - /** * @brief Get the service object corresponding to the uuid. * @param [in] uuid The UUID of the service being sought. * @return A reference to the Service or nullptr if don't know about it. * @throws BLEUuidNotFound */ -BLERemoteService* BLEClient::getService(BLEUUID uuid) { +BLERemoteService *BLEClient::getService(BLEUUID uuid) { log_v(">> getService: uuid: %s", uuid.toString().c_str()); // Design // ------ @@ -442,7 +429,7 @@ BLERemoteService* BLEClient::getService(BLEUUID uuid) { getServices(); } String uuidStr = uuid.toString(); - for (auto& myPair : m_servicesMap) { + for (auto &myPair : m_servicesMap) { if (myPair.first == uuidStr) { log_v("<< getService: found the service with uuid: %s", uuid.toString().c_str()); return myPair.second; @@ -452,14 +439,13 @@ BLERemoteService* BLEClient::getService(BLEUUID uuid) { return nullptr; } // getService - /** * @brief Ask the remote %BLE server for its services. * A %BLE Server exposes a set of services for its partners. Here we ask the server for its set of * services and wait until we have received them all. * @return N/A */ -std::map* BLEClient::getServices() { +std::map *BLEClient::getServices() { /* * Design * ------ @@ -472,8 +458,7 @@ std::map* BLEClient::getServices() { clearServices(); // Clear any services that may exist. esp_err_t errRc = esp_ble_gattc_search_service( - getGattcIf(), - getConnId(), + getGattcIf(), getConnId(), NULL // Filter UUID ); @@ -488,7 +473,6 @@ std::map* BLEClient::getServices() { return &m_servicesMap; } // getServices - /** * @brief Get the value of a specific characteristic associated with a specific service. * @param [in] serviceUUID The service that owns the characteristic. @@ -502,16 +486,13 @@ String BLEClient::getValue(BLEUUID serviceUUID, BLEUUID characteristicUUID) { return ret; } // getValue - /** * @brief Handle a received GAP event. * * @param [in] event * @param [in] param */ -void BLEClient::handleGAPEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param) { +void BLEClient::handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { log_d("BLEClient ... handling GAP event!"); switch (event) { // @@ -523,17 +504,15 @@ void BLEClient::handleGAPEvent( // - esp_bd_addr_t remote_addr // case ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT: - { - m_semaphoreRssiCmplEvt.give((uint32_t)param->read_rssi_cmpl.rssi); - break; - } // ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT - - default: + { + m_semaphoreRssiCmplEvt.give((uint32_t)param->read_rssi_cmpl.rssi); break; + } // ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT + + default: break; } } // handleGAPEvent - /** * @brief Are we connected to a partner? * @return True if we are connected and false if we are not connected. @@ -542,17 +521,13 @@ bool BLEClient::isConnected() { return m_isConnected; } // isConnected - - - /** * @brief Set the callbacks that will be invoked. */ -void BLEClient::setClientCallbacks(BLEClientCallbacks* pClientCallbacks) { +void BLEClient::setClientCallbacks(BLEClientCallbacks *pClientCallbacks) { m_pClientCallbacks = pClientCallbacks; } // setClientCallbacks - /** * @brief Set the value of a specific characteristic associated with a specific service. * @param [in] serviceUUID The service that owns the characteristic. @@ -569,7 +544,6 @@ uint16_t BLEClient::getMTU() { return m_mtu; } - /** @brief Set the local and remote MTU size. Should be called once after client connects if MTU size needs to be changed. @@ -594,9 +568,6 @@ bool BLEClient::setMTU(uint16_t mtu) { return true; } - - - /** * @brief Return a string representation of this client. * @return A string representation of this client. @@ -604,7 +575,7 @@ bool BLEClient::setMTU(uint16_t mtu) { String BLEClient::toString() { String res = "peer address: " + m_peerAddress.toString(); res += "\nServices:\n"; - for (auto& myPair : m_servicesMap) { + for (auto &myPair : m_servicesMap) { res += myPair.second->toString() + "\n"; // myPair.second is the value } diff --git a/libraries/BLE/src/BLEClient.h b/libraries/BLE/src/BLEClient.h index 84a12b922..5820b8634 100644 --- a/libraries/BLE/src/BLEClient.h +++ b/libraries/BLE/src/BLEClient.h @@ -36,24 +36,22 @@ public: BLEClient(); ~BLEClient(); - bool connect(BLEAdvertisedDevice* device); - bool connectTimeout(BLEAdvertisedDevice* device, uint32_t timeoutMS = portMAX_DELAY); + bool connect(BLEAdvertisedDevice *device); + bool connectTimeout(BLEAdvertisedDevice *device, uint32_t timeoutMS = portMAX_DELAY); bool connect(BLEAddress address, esp_ble_addr_type_t type = BLE_ADDR_TYPE_PUBLIC, uint32_t timeoutMS = portMAX_DELAY); // Connect to the remote BLE Server - void disconnect(); // Disconnect from the remote BLE Server - BLEAddress getPeerAddress(); // Get the address of the remote BLE Server - int getRssi(); // Get the RSSI of the remote BLE Server - std::map* getServices(); // Get a map of the services offered by the remote BLE Server - BLERemoteService* getService(const char* uuid); // Get a reference to a specified service offered by the remote BLE server. - BLERemoteService* getService(BLEUUID uuid); // Get a reference to a specified service offered by the remote BLE server. - String getValue(BLEUUID serviceUUID, BLEUUID characteristicUUID); // Get the value of a given characteristic at a given service. + void disconnect(); // Disconnect from the remote BLE Server + BLEAddress getPeerAddress(); // Get the address of the remote BLE Server + int getRssi(); // Get the RSSI of the remote BLE Server + std::map *getServices(); // Get a map of the services offered by the remote BLE Server + BLERemoteService *getService(const char *uuid); // Get a reference to a specified service offered by the remote BLE server. + BLERemoteService *getService(BLEUUID uuid); // Get a reference to a specified service offered by the remote BLE server. + String getValue(BLEUUID serviceUUID, BLEUUID characteristicUUID); // Get the value of a given characteristic at a given service. - void handleGAPEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param); + void handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param); bool isConnected(); // Return true if we are connected. - void setClientCallbacks(BLEClientCallbacks* pClientCallbacks); + void setClientCallbacks(BLEClientCallbacks *pClientCallbacks); void setValue(BLEUUID serviceUUID, BLEUUID characteristicUUID, String value); // Set the value of a given characteristic at a given service. String toString(); // Return a string representation of this client. @@ -63,44 +61,41 @@ public: bool setMTU(uint16_t mtu); uint16_t m_appId; + private: friend class BLEDevice; friend class BLERemoteService; friend class BLERemoteCharacteristic; friend class BLERemoteDescriptor; - void gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* param); + void gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param); - BLEAddress m_peerAddress = BLEAddress((uint8_t*)"\0\0\0\0\0\0"); // The BD address of the remote server. + BLEAddress m_peerAddress = BLEAddress((uint8_t *)"\0\0\0\0\0\0"); // The BD address of the remote server. uint16_t m_conn_id; // int m_deviceType; esp_gatt_if_t m_gattc_if; bool m_haveServices = false; // Have we previously obtain the set of services from the remote server. bool m_isConnected = false; // Are we currently connected. - BLEClientCallbacks* m_pClientCallbacks; + BLEClientCallbacks *m_pClientCallbacks; FreeRTOS::Semaphore m_semaphoreRegEvt = FreeRTOS::Semaphore("RegEvt"); FreeRTOS::Semaphore m_semaphoreOpenEvt = FreeRTOS::Semaphore("OpenEvt"); FreeRTOS::Semaphore m_semaphoreSearchCmplEvt = FreeRTOS::Semaphore("SearchCmplEvt"); FreeRTOS::Semaphore m_semaphoreRssiCmplEvt = FreeRTOS::Semaphore("RssiCmplEvt"); - std::map m_servicesMap; - std::map m_servicesMapByInstID; + std::map m_servicesMap; + std::map m_servicesMapByInstID; void clearServices(); // Clear any existing services. uint16_t m_mtu = 23; }; // class BLEDevice - /** * @brief Callbacks associated with a %BLE client. */ class BLEClientCallbacks { public: virtual ~BLEClientCallbacks(){}; - virtual void onConnect(BLEClient* pClient) = 0; - virtual void onDisconnect(BLEClient* pClient) = 0; + virtual void onConnect(BLEClient *pClient) = 0; + virtual void onDisconnect(BLEClient *pClient) = 0; }; #endif /* CONFIG_BLUEDROID_ENABLED */ diff --git a/libraries/BLE/src/BLEDescriptor.cpp b/libraries/BLE/src/BLEDescriptor.cpp index 3132f4d2e..69a93e572 100644 --- a/libraries/BLE/src/BLEDescriptor.cpp +++ b/libraries/BLE/src/BLEDescriptor.cpp @@ -22,13 +22,10 @@ #define NULL_HANDLE (0xffff) - /** * @brief BLEDescriptor constructor. */ -BLEDescriptor::BLEDescriptor(const char* uuid, uint16_t len) - : BLEDescriptor(BLEUUID(uuid), len) { -} +BLEDescriptor::BLEDescriptor(const char *uuid, uint16_t len) : BLEDescriptor(BLEUUID(uuid), len) {} /** * @brief BLEDescriptor constructor. @@ -41,10 +38,9 @@ BLEDescriptor::BLEDescriptor(BLEUUID uuid, uint16_t max_len) { m_pCharacteristic = nullptr; // No initial characteristic. m_pCallback = nullptr; // No initial callback. - m_value.attr_value = (uint8_t*)malloc(max_len); // Allocate storage for the value. + m_value.attr_value = (uint8_t *)malloc(max_len); // Allocate storage for the value. } // BLEDescriptor - /** * @brief BLEDescriptor destructor. */ @@ -52,12 +48,11 @@ BLEDescriptor::~BLEDescriptor() { free(m_value.attr_value); // Release the storage we created in the constructor. } // ~BLEDescriptor - /** * @brief Execute the creation of the descriptor with the BLE runtime in ESP. * @param [in] pCharacteristic The characteristic to which to register this descriptor. */ -void BLEDescriptor::executeCreate(BLECharacteristic* pCharacteristic) { +void BLEDescriptor::executeCreate(BLECharacteristic *pCharacteristic) { log_v(">> executeCreate(): %s", toString().c_str()); if (m_handle != NULL_HANDLE) { @@ -70,12 +65,8 @@ void BLEDescriptor::executeCreate(BLECharacteristic* pCharacteristic) { esp_attr_control_t control; control.auto_rsp = ESP_GATT_AUTO_RSP; m_semaphoreCreateEvt.take("executeCreate"); - esp_err_t errRc = ::esp_ble_gatts_add_char_descr( - pCharacteristic->getService()->getHandle(), - getUUID().getNative(), - (esp_gatt_perm_t)m_permissions, - &m_value, - &control); + esp_err_t errRc = + ::esp_ble_gatts_add_char_descr(pCharacteristic->getService()->getHandle(), getUUID().getNative(), (esp_gatt_perm_t)m_permissions, &m_value, &control); if (errRc != ESP_OK) { log_e("<< esp_ble_gatts_add_char_descr: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); return; @@ -85,7 +76,6 @@ void BLEDescriptor::executeCreate(BLECharacteristic* pCharacteristic) { log_v("<< executeCreate"); } // executeCreate - /** * @brief Get the BLE handle for this descriptor. * @return The handle for this descriptor. @@ -94,7 +84,6 @@ uint16_t BLEDescriptor::getHandle() { return m_handle; } // getHandle - /** * @brief Get the length of the value of this descriptor. * @return The length (in bytes) of the value of this descriptor. @@ -103,7 +92,6 @@ size_t BLEDescriptor::getLength() { return m_value.attr_len; } // getLength - /** * @brief Get the UUID of the descriptor. */ @@ -111,27 +99,21 @@ BLEUUID BLEDescriptor::getUUID() { return m_bleUUID; } // getUUID - - /** * @brief Get the value of this descriptor. * @return A pointer to the value of this descriptor. */ -uint8_t* BLEDescriptor::getValue() { +uint8_t *BLEDescriptor::getValue() { return m_value.attr_value; } // getValue - /** * @brief Handle GATT server events for the descripttor. * @param [in] event * @param [in] gatts_if * @param [in] param */ -void BLEDescriptor::handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param) { +void BLEDescriptor::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) { switch (event) { // ESP_GATTS_ADD_CHAR_DESCR_EVT // @@ -141,13 +123,15 @@ void BLEDescriptor::handleGATTServerEvent( // - uint16_t service_handle // - esp_bt_uuid_t char_uuid case ESP_GATTS_ADD_CHAR_DESCR_EVT: - { - if (m_pCharacteristic != nullptr && m_bleUUID.equals(BLEUUID(param->add_char_descr.descr_uuid)) && m_pCharacteristic->getService()->getHandle() == param->add_char_descr.service_handle && m_pCharacteristic == m_pCharacteristic->getService()->getLastCreatedCharacteristic()) { - setHandle(param->add_char_descr.attr_handle); - m_semaphoreCreateEvt.give(); - } - break; - } // ESP_GATTS_ADD_CHAR_DESCR_EVT + { + if (m_pCharacteristic != nullptr && m_bleUUID.equals(BLEUUID(param->add_char_descr.descr_uuid)) + && m_pCharacteristic->getService()->getHandle() == param->add_char_descr.service_handle + && m_pCharacteristic == m_pCharacteristic->getService()->getLastCreatedCharacteristic()) { + setHandle(param->add_char_descr.attr_handle); + m_semaphoreCreateEvt.give(); + } + break; + } // ESP_GATTS_ADD_CHAR_DESCR_EVT // ESP_GATTS_WRITE_EVT - A request to write the value of a descriptor has arrived. // @@ -162,17 +146,17 @@ void BLEDescriptor::handleGATTServerEvent( // - uint16_t len // - uint8_t *value case ESP_GATTS_WRITE_EVT: - { - if (param->write.handle == m_handle) { - setValue(param->write.value, param->write.len); // Set the value of the descriptor. + { + if (param->write.handle == m_handle) { + setValue(param->write.value, param->write.len); // Set the value of the descriptor. - if (m_pCallback != nullptr) { // We have completed the write, if there is a user supplied callback handler, invoke it now. - m_pCallback->onWrite(this); // Invoke the onWrite callback handler. - } - } // End of ... this is our handle. + if (m_pCallback != nullptr) { // We have completed the write, if there is a user supplied callback handler, invoke it now. + m_pCallback->onWrite(this); // Invoke the onWrite callback handler. + } + } // End of ... this is our handle. - break; - } // ESP_GATTS_WRITE_EVT + break; + } // ESP_GATTS_WRITE_EVT // ESP_GATTS_READ_EVT - A request to read the value of a descriptor has arrived. // @@ -186,34 +170,31 @@ void BLEDescriptor::handleGATTServerEvent( // - bool need_rsp // case ESP_GATTS_READ_EVT: - { - if (param->read.handle == m_handle) { // If this event is for this descriptor ... process it + { + if (param->read.handle == m_handle) { // If this event is for this descriptor ... process it - if (m_pCallback != nullptr) { // If we have a user supplied callback, invoke it now. - m_pCallback->onRead(this); // Invoke the onRead callback method in the callback handler. - } + if (m_pCallback != nullptr) { // If we have a user supplied callback, invoke it now. + m_pCallback->onRead(this); // Invoke the onRead callback method in the callback handler. + } - } // End of this is our handle - break; - } // ESP_GATTS_READ_EVT - - default: + } // End of this is our handle break; + } // ESP_GATTS_READ_EVT + + default: break; } // switch event } // handleGATTServerEvent - /** * @brief Set the callback handlers for this descriptor. * @param [in] pCallbacks An instance of a callback structure used to define any callbacks for the descriptor. */ -void BLEDescriptor::setCallbacks(BLEDescriptorCallbacks* pCallback) { +void BLEDescriptor::setCallbacks(BLEDescriptorCallbacks *pCallback) { log_v(">> setCallbacks: 0x%x", (uint32_t)pCallback); m_pCallback = pCallback; log_v("<< setCallbacks"); } // setCallbacks - /** * @brief Set the handle of this descriptor. * Set the handle of this descriptor to be the supplied value. @@ -226,13 +207,12 @@ void BLEDescriptor::setHandle(uint16_t handle) { log_v("<< setHandle()"); } // setHandle - /** * @brief Set the value of the descriptor. * @param [in] data The data to set for the descriptor. * @param [in] length The length of the data in bytes. */ -void BLEDescriptor::setValue(uint8_t* data, size_t length) { +void BLEDescriptor::setValue(uint8_t *data, size_t length) { if (length > ESP_GATT_MAX_ATTR_LEN) { log_e("Size %d too large, must be no bigger than %d", length, ESP_GATT_MAX_ATTR_LEN); return; @@ -240,18 +220,17 @@ void BLEDescriptor::setValue(uint8_t* data, size_t length) { m_value.attr_len = length; memcpy(m_value.attr_value, data, length); if (m_handle != NULL_HANDLE) { - esp_ble_gatts_set_attr_value(m_handle, length, (const uint8_t*)data); + esp_ble_gatts_set_attr_value(m_handle, length, (const uint8_t *)data); log_d("Set the value in the GATTS database using handle 0x%x", m_handle); } } // setValue - /** * @brief Set the value of the descriptor. * @param [in] value The value of the descriptor in string form. */ void BLEDescriptor::setValue(String value) { - setValue((uint8_t*)value.c_str(), value.length()); + setValue((uint8_t *)value.c_str(), value.length()); } // setValue void BLEDescriptor::setAccessPermissions(esp_gatt_perm_t perm) { @@ -269,28 +248,25 @@ String BLEDescriptor::toString() { return res; } // toString - BLEDescriptorCallbacks::~BLEDescriptorCallbacks() {} /** * @brief Callback function to support a read request. * @param [in] pDescriptor The descriptor that is the source of the event. */ -void BLEDescriptorCallbacks::onRead(BLEDescriptor* pDescriptor) { +void BLEDescriptorCallbacks::onRead(BLEDescriptor *pDescriptor) { log_d("BLEDescriptorCallbacks", ">> onRead: default"); log_d("BLEDescriptorCallbacks", "<< onRead"); } // onRead - /** * @brief Callback function to support a write request. * @param [in] pDescriptor The descriptor that is the source of the event. */ -void BLEDescriptorCallbacks::onWrite(BLEDescriptor* pDescriptor) { +void BLEDescriptorCallbacks::onWrite(BLEDescriptor *pDescriptor) { log_d("BLEDescriptorCallbacks", ">> onWrite: default"); log_d("BLEDescriptorCallbacks", "<< onWrite"); } // onWrite - #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ diff --git a/libraries/BLE/src/BLEDescriptor.h b/libraries/BLE/src/BLEDescriptor.h index 07dfd0dfb..e155a1f29 100644 --- a/libraries/BLE/src/BLEDescriptor.h +++ b/libraries/BLE/src/BLEDescriptor.h @@ -27,22 +27,19 @@ class BLEDescriptorCallbacks; */ class BLEDescriptor { public: - BLEDescriptor(const char* uuid, uint16_t max_len = 100); + BLEDescriptor(const char *uuid, uint16_t max_len = 100); BLEDescriptor(BLEUUID uuid, uint16_t max_len = 100); virtual ~BLEDescriptor(); uint16_t getHandle(); // Get the handle of the descriptor. size_t getLength(); // Get the length of the value of the descriptor. BLEUUID getUUID(); // Get the UUID of the descriptor. - uint8_t* getValue(); // Get a pointer to the value of the descriptor. - void handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param); + uint8_t *getValue(); // Get a pointer to the value of the descriptor. + void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); void setAccessPermissions(esp_gatt_perm_t perm); // Set the permissions of the descriptor. - void setCallbacks(BLEDescriptorCallbacks* pCallbacks); // Set callbacks to be invoked for the descriptor. - void setValue(uint8_t* data, size_t size); // Set the value of the descriptor as a pointer to data. + void setCallbacks(BLEDescriptorCallbacks *pCallbacks); // Set callbacks to be invoked for the descriptor. + void setValue(uint8_t *data, size_t size); // Set the value of the descriptor as a pointer to data. void setValue(String value); // Set the value of the descriptor as a data buffer. String toString(); // Convert the descriptor to a string representation. @@ -52,17 +49,16 @@ private: friend class BLECharacteristic; BLEUUID m_bleUUID; uint16_t m_handle; - BLEDescriptorCallbacks* m_pCallback; - BLECharacteristic* m_pCharacteristic; + BLEDescriptorCallbacks *m_pCallback; + BLECharacteristic *m_pCharacteristic; esp_gatt_perm_t m_permissions = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE; FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt"); esp_attr_value_t m_value; - void executeCreate(BLECharacteristic* pCharacteristic); + void executeCreate(BLECharacteristic *pCharacteristic); void setHandle(uint16_t handle); }; // BLEDescriptor - /** * @brief Callbacks that can be associated with a %BLE descriptors to inform of events. * @@ -73,8 +69,8 @@ private: class BLEDescriptorCallbacks { public: virtual ~BLEDescriptorCallbacks(); - virtual void onRead(BLEDescriptor* pDescriptor); - virtual void onWrite(BLEDescriptor* pDescriptor); + virtual void onRead(BLEDescriptor *pDescriptor); + virtual void onWrite(BLEDescriptor *pDescriptor); }; #endif /* CONFIG_BLUEDROID_ENABLED */ diff --git a/libraries/BLE/src/BLEDescriptorMap.cpp b/libraries/BLE/src/BLEDescriptorMap.cpp index 3f2ffaaa8..732fb62cd 100644 --- a/libraries/BLE/src/BLEDescriptorMap.cpp +++ b/libraries/BLE/src/BLEDescriptorMap.cpp @@ -23,18 +23,17 @@ * @param [in] UUID The UUID to look up the descriptor. * @return The descriptor. If not present, then nullptr is returned. */ -BLEDescriptor* BLEDescriptorMap::getByUUID(const char* uuid) { +BLEDescriptor *BLEDescriptorMap::getByUUID(const char *uuid) { return getByUUID(BLEUUID(uuid)); } - /** * @brief Return the descriptor by UUID. * @param [in] UUID The UUID to look up the descriptor. * @return The descriptor. If not present, then nullptr is returned. */ -BLEDescriptor* BLEDescriptorMap::getByUUID(BLEUUID uuid) { - for (auto& myPair : m_uuidMap) { +BLEDescriptor *BLEDescriptorMap::getByUUID(BLEUUID uuid) { + for (auto &myPair : m_uuidMap) { if (myPair.first->getUUID().equals(uuid)) { return myPair.first; } @@ -43,16 +42,24 @@ BLEDescriptor* BLEDescriptorMap::getByUUID(BLEUUID uuid) { return nullptr; } // getByUUID - /** * @brief Return the descriptor by handle. * @param [in] handle The handle to look up the descriptor. * @return The descriptor. */ -BLEDescriptor* BLEDescriptorMap::getByHandle(uint16_t handle) { +BLEDescriptor *BLEDescriptorMap::getByHandle(uint16_t handle) { return m_handleMap.at(handle); } // getByHandle +/** + * @brief Set the descriptor by UUID. + * @param [in] uuid The uuid of the descriptor. + * @param [in] characteristic The descriptor to cache. + * @return N/A. + */ +void BLEDescriptorMap::setByUUID(const char *uuid, BLEDescriptor *pDescriptor) { + m_uuidMap.insert(std::pair(pDescriptor, uuid)); +} // setByUUID /** * @brief Set the descriptor by UUID. @@ -60,34 +67,20 @@ BLEDescriptor* BLEDescriptorMap::getByHandle(uint16_t handle) { * @param [in] characteristic The descriptor to cache. * @return N/A. */ -void BLEDescriptorMap::setByUUID(const char* uuid, BLEDescriptor* pDescriptor) { - m_uuidMap.insert(std::pair(pDescriptor, uuid)); +void BLEDescriptorMap::setByUUID(BLEUUID uuid, BLEDescriptor *pDescriptor) { + m_uuidMap.insert(std::pair(pDescriptor, uuid.toString())); } // setByUUID - - -/** - * @brief Set the descriptor by UUID. - * @param [in] uuid The uuid of the descriptor. - * @param [in] characteristic The descriptor to cache. - * @return N/A. - */ -void BLEDescriptorMap::setByUUID(BLEUUID uuid, BLEDescriptor* pDescriptor) { - m_uuidMap.insert(std::pair(pDescriptor, uuid.toString())); -} // setByUUID - - /** * @brief Set the descriptor by handle. * @param [in] handle The handle of the descriptor. * @param [in] descriptor The descriptor to cache. * @return N/A. */ -void BLEDescriptorMap::setByHandle(uint16_t handle, BLEDescriptor* pDescriptor) { - m_handleMap.insert(std::pair(handle, pDescriptor)); +void BLEDescriptorMap::setByHandle(uint16_t handle, BLEDescriptor *pDescriptor) { + m_handleMap.insert(std::pair(handle, pDescriptor)); } // setByHandle - /** * @brief Return a string representation of the descriptor map. * @return A string representation of the descriptor map. @@ -96,8 +89,10 @@ String BLEDescriptorMap::toString() { String res; char hex[5]; int count = 0; - for (auto& myPair : m_uuidMap) { - if (count > 0) { res += "\n"; } + for (auto &myPair : m_uuidMap) { + if (count > 0) { + res += "\n"; + } snprintf(hex, sizeof(hex), "%04x", myPair.first->getHandle()); count++; res += "handle: 0x"; @@ -107,44 +102,42 @@ String BLEDescriptorMap::toString() { return res; } // toString - /** * @brief Pass the GATT server event onwards to each of the descriptors found in the mapping * @param [in] event * @param [in] gatts_if * @param [in] param */ -void BLEDescriptorMap::handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param) { +void BLEDescriptorMap::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) { // Invoke the handler for every descriptor we have. - for (auto& myPair : m_uuidMap) { + for (auto &myPair : m_uuidMap) { myPair.first->handleGATTServerEvent(event, gatts_if, param); } } // handleGATTServerEvent - /** * @brief Get the first descriptor in the map. * @return The first descriptor in the map. */ -BLEDescriptor* BLEDescriptorMap::getFirst() { +BLEDescriptor *BLEDescriptorMap::getFirst() { m_iterator = m_uuidMap.begin(); - if (m_iterator == m_uuidMap.end()) return nullptr; - BLEDescriptor* pRet = m_iterator->first; + if (m_iterator == m_uuidMap.end()) { + return nullptr; + } + BLEDescriptor *pRet = m_iterator->first; m_iterator++; return pRet; } // getFirst - /** * @brief Get the next descriptor in the map. * @return The next descriptor in the map. */ -BLEDescriptor* BLEDescriptorMap::getNext() { - if (m_iterator == m_uuidMap.end()) return nullptr; - BLEDescriptor* pRet = m_iterator->first; +BLEDescriptor *BLEDescriptorMap::getNext() { + if (m_iterator == m_uuidMap.end()) { + return nullptr; + } + BLEDescriptor *pRet = m_iterator->first; m_iterator++; return pRet; } // getNext diff --git a/libraries/BLE/src/BLEDevice.cpp b/libraries/BLE/src/BLEDevice.cpp index d20bc141d..186b36d6a 100644 --- a/libraries/BLE/src/BLEDevice.cpp +++ b/libraries/BLE/src/BLEDevice.cpp @@ -37,18 +37,17 @@ #include "esp32-hal-log.h" - /** * Singletons for the BLEDevice. */ -BLEServer* BLEDevice::m_pServer = nullptr; -BLEScan* BLEDevice::m_pScan = nullptr; -BLEClient* BLEDevice::m_pClient = nullptr; +BLEServer *BLEDevice::m_pServer = nullptr; +BLEScan *BLEDevice::m_pScan = nullptr; +BLEClient *BLEDevice::m_pClient = nullptr; bool initialized = false; esp_ble_sec_act_t BLEDevice::m_securityLevel = (esp_ble_sec_act_t)0; -BLESecurityCallbacks* BLEDevice::m_securityCallbacks = nullptr; +BLESecurityCallbacks *BLEDevice::m_securityCallbacks = nullptr; uint16_t BLEDevice::m_localMTU = 23; // not sure if this variable is useful -BLEAdvertising* BLEDevice::m_bleAdvertising = nullptr; +BLEAdvertising *BLEDevice::m_bleAdvertising = nullptr; uint16_t BLEDevice::m_appId = 0; std::map BLEDevice::m_connectedClientsMap; gap_event_handler BLEDevice::m_customGapHandler = nullptr; @@ -59,7 +58,7 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; * @brief Create a new instance of a client. * @return A new instance of the client. */ -/* STATIC */ BLEClient* BLEDevice::createClient() { +/* STATIC */ BLEClient *BLEDevice::createClient() { log_v(">> createClient"); #ifndef CONFIG_GATTC_ENABLE // Check that BLE GATTC is enabled in make menuconfig log_e("BLE GATTC is not enabled - CONFIG_GATTC_ENABLE not defined"); @@ -70,12 +69,11 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; return m_pClient; } // createClient - /** * @brief Create a new instance of a server. * @return A new instance of the server. */ -/* STATIC */ BLEServer* BLEDevice::createServer() { +/* STATIC */ BLEServer *BLEDevice::createServer() { log_v(">> createServer"); #ifndef CONFIG_GATTS_ENABLE // Check that BLE GATTS is enabled in make menuconfig log_e("BLE GATTS is not enabled - CONFIG_GATTS_ENABLE not defined"); @@ -87,7 +85,6 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; return m_pServer; } // createServer - /** * @brief Handle GATT server events. * @@ -95,34 +92,28 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; * @param [in] gatts_if The connection to the GATT interface. * @param [in] param Parameters for the event. */ -/* STATIC */ void BLEDevice::gattServerEventHandler( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param) { - log_d("gattServerEventHandler [esp_gatt_if: %d] ... %s", - gatts_if, - BLEUtils::gattServerEventTypeToString(event).c_str()); +/* STATIC */ void BLEDevice::gattServerEventHandler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) { + log_d("gattServerEventHandler [esp_gatt_if: %d] ... %s", gatts_if, BLEUtils::gattServerEventTypeToString(event).c_str()); BLEUtils::dumpGattServerEvent(event, gatts_if, param); switch (event) { case ESP_GATTS_CONNECT_EVT: - { + { #ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if (BLEDevice::m_securityLevel) { - esp_ble_set_encryption(param->connect.remote_bda, BLEDevice::m_securityLevel); - } + if (BLEDevice::m_securityLevel) { + esp_ble_set_encryption(param->connect.remote_bda, BLEDevice::m_securityLevel); + } #endif // CONFIG_BLE_SMP_ENABLE - break; - } // ESP_GATTS_CONNECT_EVT + break; + } // ESP_GATTS_CONNECT_EVT default: - { - break; - } + { + break; + } } // switch - if (BLEDevice::m_pServer != nullptr) { BLEDevice::m_pServer->handleGATTServerEvent(event, gatts_if, param); } @@ -133,7 +124,6 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; } // gattServerEventHandler - /** * @brief Handle GATT client events. * @@ -143,33 +133,29 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; * @param [in] gattc_if * @param [in] param */ -/* STATIC */ void BLEDevice::gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* param) { +/* STATIC */ void BLEDevice::gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) { - log_d("gattClientEventHandler [esp_gatt_if: %d] ... %s", - gattc_if, BLEUtils::gattClientEventTypeToString(event).c_str()); + log_d("gattClientEventHandler [esp_gatt_if: %d] ... %s", gattc_if, BLEUtils::gattClientEventTypeToString(event).c_str()); BLEUtils::dumpGattClientEvent(event, gattc_if, param); switch (event) { case ESP_GATTC_CONNECT_EVT: - { + { #ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig - if (BLEDevice::m_securityLevel) { - esp_ble_set_encryption(param->connect.remote_bda, BLEDevice::m_securityLevel); - } + if (BLEDevice::m_securityLevel) { + esp_ble_set_encryption(param->connect.remote_bda, BLEDevice::m_securityLevel); + } #endif // CONFIG_BLE_SMP_ENABLE - break; - } // ESP_GATTS_CONNECT_EVT - - default: break; + } // ESP_GATTS_CONNECT_EVT + + default: break; } // switch - for (auto& myPair : BLEDevice::getPeerDevices(true)) { + for (auto &myPair : BLEDevice::getPeerDevices(true)) { conn_status_t conn_status = (conn_status_t)myPair.second; - if (((BLEClient*)conn_status.peer_device)->getGattcIf() == gattc_if || ((BLEClient*)conn_status.peer_device)->getGattcIf() == ESP_GATT_IF_NONE || gattc_if == ESP_GATT_IF_NONE) { - ((BLEClient*)conn_status.peer_device)->gattClientEventHandler(event, gattc_if, param); + if (((BLEClient *)conn_status.peer_device)->getGattcIf() == gattc_if || ((BLEClient *)conn_status.peer_device)->getGattcIf() == ESP_GATT_IF_NONE + || gattc_if == ESP_GATT_IF_NONE) { + ((BLEClient *)conn_status.peer_device)->gattClientEventHandler(event, gattc_if, param); } } @@ -177,32 +163,21 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; m_customGattcHandler(event, gattc_if, param); } - } // gattClientEventHandler - /** * @brief Handle GAP events. */ -/* STATIC */ void BLEDevice::gapEventHandler( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param) { +/* STATIC */ void BLEDevice::gapEventHandler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { BLEUtils::dumpGapEvent(event, param); switch (event) { - case ESP_GAP_BLE_OOB_REQ_EVT: /* OOB request event */ - log_i("ESP_GAP_BLE_OOB_REQ_EVT"); - break; - case ESP_GAP_BLE_LOCAL_IR_EVT: /* BLE local IR event */ - log_i("ESP_GAP_BLE_LOCAL_IR_EVT"); - break; - case ESP_GAP_BLE_LOCAL_ER_EVT: /* BLE local ER event */ - log_i("ESP_GAP_BLE_LOCAL_ER_EVT"); - break; - case ESP_GAP_BLE_NC_REQ_EVT: /* NUMERIC CONFIRMATION */ - log_i("ESP_GAP_BLE_NC_REQ_EVT"); + case ESP_GAP_BLE_OOB_REQ_EVT: /* OOB request event */ log_i("ESP_GAP_BLE_OOB_REQ_EVT"); break; + case ESP_GAP_BLE_LOCAL_IR_EVT: /* BLE local IR event */ log_i("ESP_GAP_BLE_LOCAL_IR_EVT"); break; + case ESP_GAP_BLE_LOCAL_ER_EVT: /* BLE local ER event */ log_i("ESP_GAP_BLE_LOCAL_ER_EVT"); break; + case ESP_GAP_BLE_NC_REQ_EVT: /* NUMERIC CONFIRMATION */ log_i("ESP_GAP_BLE_NC_REQ_EVT"); #ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig if (BLEDevice::m_securityCallbacks != nullptr) { esp_ble_confirm_reply(param->ble_security.ble_req.bd_addr, BLEDevice::m_securityCallbacks->onConfirmPIN(param->ble_security.key_notif.passkey)); @@ -253,8 +228,7 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; log_i("key type = %s", BLESecurity::esp_key_type_to_str(param->ble_security.ble_key.key_type)); #endif // CONFIG_BLE_SMP_ENABLE break; - case ESP_GAP_BLE_AUTH_CMPL_EVT: - log_i("ESP_GAP_BLE_AUTH_CMPL_EVT"); + case ESP_GAP_BLE_AUTH_CMPL_EVT: log_i("ESP_GAP_BLE_AUTH_CMPL_EVT"); #ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig if (BLEDevice::m_securityCallbacks != nullptr) { BLEDevice::m_securityCallbacks->onAuthenticationComplete(param->ble_security.auth_cmpl); @@ -262,9 +236,9 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; #endif // CONFIG_BLE_SMP_ENABLE break; default: - { - break; - } + { + break; + } } // switch if (BLEDevice::m_pClient != nullptr) { @@ -285,25 +259,23 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; } // gapEventHandler - /** * @brief Get the BLE device address. * @return The BLE device address. */ /* STATIC*/ BLEAddress BLEDevice::getAddress() { - const uint8_t* bdAddr = esp_bt_dev_get_address(); + const uint8_t *bdAddr = esp_bt_dev_get_address(); esp_bd_addr_t addr; memcpy(addr, bdAddr, sizeof(addr)); return BLEAddress(addr); } // getAddress - /** * @brief Retrieve the Scan object that we use for scanning. * @return The scanning object reference. This is a singleton object. The caller should not * try and release/delete it. */ -/* STATIC */ BLEScan* BLEDevice::getScan() { +/* STATIC */ BLEScan *BLEDevice::getScan() { //log_v(">> getScan"); if (m_pScan == nullptr) { m_pScan = new BLEScan(); @@ -313,7 +285,6 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; return m_pScan; } // getScan - /** * @brief Get the value of a characteristic of a service on a remote device. * @param [in] bdAddress @@ -321,8 +292,11 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; * @param [in] characteristicUUID */ /* STATIC */ String BLEDevice::getValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID) { - log_v(">> getValue: bdAddress: %s, serviceUUID: %s, characteristicUUID: %s", bdAddress.toString().c_str(), serviceUUID.toString().c_str(), characteristicUUID.toString().c_str()); - BLEClient* pClient = createClient(); + log_v( + ">> getValue: bdAddress: %s, serviceUUID: %s, characteristicUUID: %s", bdAddress.toString().c_str(), serviceUUID.toString().c_str(), + characteristicUUID.toString().c_str() + ); + BLEClient *pClient = createClient(); pClient->connect(bdAddress); String ret = pClient->getValue(serviceUUID, characteristicUUID); pClient->disconnect(); @@ -330,7 +304,6 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; return ret; } // getValue - /** * @brief Initialize the %BLE environment. * @param deviceName The device name of the device. @@ -434,7 +407,6 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; vTaskDelay(200 / portTICK_PERIOD_MS); // Delay for 200 msecs as a workaround to an apparent Arduino environment issue. } // init - /** * @brief Set the transmission power. * The power level can be one of: @@ -472,7 +444,6 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; log_v("<< setPower"); } // setPower - /** * @brief Set the value of a characteristic of a service on a remote device. * @param [in] bdAddress @@ -480,14 +451,16 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; * @param [in] characteristicUUID */ /* STATIC */ void BLEDevice::setValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID, String value) { - log_v(">> setValue: bdAddress: %s, serviceUUID: %s, characteristicUUID: %s", bdAddress.toString().c_str(), serviceUUID.toString().c_str(), characteristicUUID.toString().c_str()); - BLEClient* pClient = createClient(); + log_v( + ">> setValue: bdAddress: %s, serviceUUID: %s, characteristicUUID: %s", bdAddress.toString().c_str(), serviceUUID.toString().c_str(), + characteristicUUID.toString().c_str() + ); + BLEClient *pClient = createClient(); pClient->connect(bdAddress); pClient->setValue(serviceUUID, characteristicUUID, value); pClient->disconnect(); } // setValue - /** * @brief Return a string representation of the nature of this device. * @return A string representation of the nature of this device. @@ -497,7 +470,6 @@ gatts_event_handler BLEDevice::m_customGattsHandler = nullptr; return res; } // toString - /** * @brief Add an entry to the BLE white list. * @param [in] address The address to add to the white list. @@ -507,7 +479,7 @@ void BLEDevice::whiteListAdd(BLEAddress address) { #ifdef ESP_IDF_VERSION_MAJOR esp_err_t errRc = esp_ble_gap_update_whitelist(true, *address.getNative(), BLE_WL_ADDR_TYPE_PUBLIC); // HACK!!! True to add an entry. #else - esp_err_t errRc = esp_ble_gap_update_whitelist(true, *address.getNative()); // True to add an entry. + esp_err_t errRc = esp_ble_gap_update_whitelist(true, *address.getNative()); // True to add an entry. #endif if (errRc != ESP_OK) { log_e("esp_ble_gap_update_whitelist: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); @@ -515,7 +487,6 @@ void BLEDevice::whiteListAdd(BLEAddress address) { log_v("<< whiteListAdd"); } // whiteListAdd - /** * @brief Remove an entry from the BLE white list. * @param [in] address The address to remove from the white list. @@ -545,7 +516,7 @@ void BLEDevice::setEncryptionLevel(esp_ble_sec_act_t level) { * @brief Set callbacks that will be used to handle encryption negotiation events and authentication events * @param [in] cllbacks Pointer to BLESecurityCallbacks class callback */ -void BLEDevice::setSecurityCallbacks(BLESecurityCallbacks* callbacks) { +void BLEDevice::setSecurityCallbacks(BLESecurityCallbacks *callbacks) { BLEDevice::m_securityCallbacks = callbacks; } @@ -576,7 +547,7 @@ bool BLEDevice::getInitialized() { return initialized; } -BLEAdvertising* BLEDevice::getAdvertising() { +BLEAdvertising *BLEDevice::getAdvertising() { if (m_bleAdvertising == nullptr) { m_bleAdvertising = new BLEAdvertising(); log_i("create advertising"); @@ -603,11 +574,11 @@ std::map BLEDevice::getPeerDevices(bool _client) { return m_connectedClientsMap; } -BLEClient* BLEDevice::getClientByGattIf(uint16_t conn_id) { - return (BLEClient*)m_connectedClientsMap.find(conn_id)->second.peer_device; +BLEClient *BLEDevice::getClientByGattIf(uint16_t conn_id) { + return (BLEClient *)m_connectedClientsMap.find(conn_id)->second.peer_device; } -void BLEDevice::updatePeerDevice(void* peer, bool _client, uint16_t conn_id) { +void BLEDevice::updatePeerDevice(void *peer, bool _client, uint16_t conn_id) { log_d("update conn_id: %d, GATT role: %s", conn_id, _client ? "client" : "server"); std::map::iterator it = m_connectedClientsMap.find(ESP_GATT_IF_NONE); if (it != m_connectedClientsMap.end()) { @@ -623,13 +594,9 @@ void BLEDevice::updatePeerDevice(void* peer, bool _client, uint16_t conn_id) { } } -void BLEDevice::addPeerDevice(void* peer, bool _client, uint16_t conn_id) { +void BLEDevice::addPeerDevice(void *peer, bool _client, uint16_t conn_id) { log_i("add conn_id: %d, GATT role: %s", conn_id, _client ? "client" : "server"); - conn_status_t status = { - .peer_device = peer, - .connected = true, - .mtu = 23 - }; + conn_status_t status = {.peer_device = peer, .connected = true, .mtu = 23}; m_connectedClientsMap.insert(std::pair(conn_id, status)); } @@ -640,8 +607,9 @@ portMUX_TYPE BLEDevice::mux = portMUX_INITIALIZER_UNLOCKED; void BLEDevice::removePeerDevice(uint16_t conn_id, bool _client) { portENTER_CRITICAL(&mux); log_i("remove: %d, GATT role %s", conn_id, _client ? "client" : "server"); - if (m_connectedClientsMap.find(conn_id) != m_connectedClientsMap.end()) + if (m_connectedClientsMap.find(conn_id) != m_connectedClientsMap.end()) { m_connectedClientsMap.erase(conn_id); + } portEXIT_CRITICAL(&mux); } @@ -652,7 +620,9 @@ void BLEDevice::removePeerDevice(uint16_t conn_id, bool _client) { * @param release_memory release the internal BT stack memory */ /* STATIC */ void BLEDevice::deinit(bool release_memory) { - if (!initialized) return; + if (!initialized) { + return; + } esp_bluedroid_disable(); esp_bluedroid_deinit(); @@ -660,7 +630,8 @@ void BLEDevice::removePeerDevice(uint16_t conn_id, bool _client) { esp_bt_controller_deinit(); #ifdef ARDUINO_ARCH_ESP32 if (release_memory) { - esp_bt_controller_mem_release(ESP_BT_MODE_BTDM); // <-- require tests because we released classic BT memory and this can cause crash (most likely not, esp-idf takes care of it) + esp_bt_controller_mem_release(ESP_BT_MODE_BTDM + ); // <-- require tests because we released classic BT memory and this can cause crash (most likely not, esp-idf takes care of it) } else { initialized = false; } diff --git a/libraries/BLE/src/BLEDevice.h b/libraries/BLE/src/BLEDevice.h index 80b0e2ac8..01bf143c1 100644 --- a/libraries/BLE/src/BLEDevice.h +++ b/libraries/BLE/src/BLEDevice.h @@ -27,40 +27,41 @@ /** * @brief BLE functions. */ -typedef void (*gap_event_handler)(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param); -typedef void (*gattc_event_handler)(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t* param); -typedef void (*gatts_event_handler)(esp_gatts_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gatts_cb_param_t* param); +typedef void (*gap_event_handler)(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param); +typedef void (*gattc_event_handler)(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param); +typedef void (*gatts_event_handler)(esp_gatts_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gatts_cb_param_t *param); class BLEDevice { public: - - static BLEClient* createClient(); // Create a new BLE client. - static BLEServer* createServer(); // Create a new BLE server. - static BLEAddress getAddress(); // Retrieve our own local BD address. - static BLEScan* getScan(); // Get the scan object - static String getValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID); // Get the value of a characteristic of a service on a server. - static void init(String deviceName); // Initialize the local BLE environment. + static BLEClient *createClient(); // Create a new BLE client. + static BLEServer *createServer(); // Create a new BLE server. + static BLEAddress getAddress(); // Retrieve our own local BD address. + static BLEScan *getScan(); // Get the scan object + static String getValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID); // Get the value of a characteristic of a service on a server. + static void init(String deviceName); // Initialize the local BLE environment. static void setPower(esp_power_level_t powerLevel, esp_ble_power_type_t powerType = ESP_BLE_PWR_TYPE_DEFAULT); // Set our power level. - static void setValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID, String value); // Set the value of a characteristic on a service on a server. - static String toString(); // Return a string representation of our device. - static void whiteListAdd(BLEAddress address); // Add an entry to the BLE white list. - static void whiteListRemove(BLEAddress address); // Remove an entry from the BLE white list. + static void setValue( + BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID, String value + ); // Set the value of a characteristic on a service on a server. + static String toString(); // Return a string representation of our device. + static void whiteListAdd(BLEAddress address); // Add an entry to the BLE white list. + static void whiteListRemove(BLEAddress address); // Remove an entry from the BLE white list. static void setEncryptionLevel(esp_ble_sec_act_t level); - static void setSecurityCallbacks(BLESecurityCallbacks* pCallbacks); + static void setSecurityCallbacks(BLESecurityCallbacks *pCallbacks); static esp_err_t setMTU(uint16_t mtu); static uint16_t getMTU(); static bool getInitialized(); // Returns the state of the device, is it initialized or not? /* move advertising to BLEDevice for saving ram and flash in beacons */ - static BLEAdvertising* getAdvertising(); + static BLEAdvertising *getAdvertising(); static void startAdvertising(); static void stopAdvertising(); static uint16_t m_appId; /* multi connect */ static std::map getPeerDevices(bool client); - static void addPeerDevice(void* peer, bool is_client, uint16_t conn_id); - static void updatePeerDevice(void* peer, bool _client, uint16_t conn_id); + static void addPeerDevice(void *peer, bool is_client, uint16_t conn_id); + static void updatePeerDevice(void *peer, bool _client, uint16_t conn_id); static void removePeerDevice(uint16_t conn_id, bool client); - static BLEClient* getClientByGattIf(uint16_t conn_id); + static BLEClient *getClientByGattIf(uint16_t conn_id); static void setCustomGapHandler(gap_event_handler handler); static void setCustomGattcHandler(gattc_event_handler handler); static void setCustomGattsHandler(gatts_event_handler handler); @@ -69,28 +70,20 @@ public: static esp_ble_sec_act_t m_securityLevel; private: - static BLEServer* m_pServer; - static BLEScan* m_pScan; - static BLEClient* m_pClient; - static BLESecurityCallbacks* m_securityCallbacks; - static BLEAdvertising* m_bleAdvertising; + static BLEServer *m_pServer; + static BLEScan *m_pScan; + static BLEClient *m_pClient; + static BLESecurityCallbacks *m_securityCallbacks; + static BLEAdvertising *m_bleAdvertising; static esp_gatt_if_t getGattcIF(); static std::map m_connectedClientsMap; static portMUX_TYPE mux; - static void gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* param); + static void gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param); - static void gattServerEventHandler( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param); + static void gattServerEventHandler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); - static void gapEventHandler( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param); + static void gapEventHandler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param); public: /* custom gap and gatt handlers for flexibility */ diff --git a/libraries/BLE/src/BLEEddystoneTLM.cpp b/libraries/BLE/src/BLEEddystoneTLM.cpp index 67081361f..1a301f090 100644 --- a/libraries/BLE/src/BLEEddystoneTLM.cpp +++ b/libraries/BLE/src/BLEEddystoneTLM.cpp @@ -30,10 +30,11 @@ BLEEddystoneTLM::BLEEddystoneTLM() { m_eddystoneData.tmil = 0; } // BLEEddystoneTLM -BLEEddystoneTLM::BLEEddystoneTLM(BLEAdvertisedDevice* advertisedDevice) { - char* payload = (char*)advertisedDevice->getPayload(); +BLEEddystoneTLM::BLEEddystoneTLM(BLEAdvertisedDevice *advertisedDevice) { + char *payload = (char *)advertisedDevice->getPayload(); for (int i = 0; i < advertisedDevice->getPayloadLength(); ++i) { - if (payload[i] == 0x16 && advertisedDevice->getPayloadLength() >= i + 2 + sizeof(m_eddystoneData) && payload[i + 1] == 0xAA && payload[i + 2] == 0xFE && payload[i + 3] == 0x20) { + if (payload[i] == 0x16 && advertisedDevice->getPayloadLength() >= i + 2 + sizeof(m_eddystoneData) && payload[i + 1] == 0xAA && payload[i + 2] == 0xFE + && payload[i + 3] == 0x20) { log_d("Eddystone TLM data frame starting at byte [%d]", i + 3); setData(String(payload + i + 3, sizeof(m_eddystoneData))); break; @@ -42,7 +43,7 @@ BLEEddystoneTLM::BLEEddystoneTLM(BLEAdvertisedDevice* advertisedDevice) { } String BLEEddystoneTLM::getData() { - return String((char*)&m_eddystoneData, sizeof(m_eddystoneData)); + return String((char *)&m_eddystoneData, sizeof(m_eddystoneData)); } // getData BLEUUID BLEEddystoneTLM::getUUID() { diff --git a/libraries/BLE/src/BLEEddystoneTLM.h b/libraries/BLE/src/BLEEddystoneTLM.h index 1126ef94b..3981af4a4 100644 --- a/libraries/BLE/src/BLEEddystoneTLM.h +++ b/libraries/BLE/src/BLEEddystoneTLM.h @@ -13,11 +13,11 @@ #include "BLEUUID.h" #include -#define EDDYSTONE_TLM_FRAME_TYPE 0x20 -#define ENDIAN_CHANGE_U16(x) ((((x)&0xFF00) >> 8) + (((x)&0xFF) << 8)) -#define ENDIAN_CHANGE_U32(x) ((((x)&0xFF000000) >> 24) + (((x)&0x00FF0000) >> 8)) + ((((x)&0xFF00) << 8) + (((x)&0xFF) << 24)) -#define EDDYSTONE_TEMP_U16_TO_FLOAT(tempU16) (((int16_t)ENDIAN_CHANGE_U16(tempU16)) / 256.0f) -#define EDDYSTONE_TEMP_FLOAT_TO_U16(tempFloat) (ENDIAN_CHANGE_U16(((int)((tempFloat)*256)))) +#define EDDYSTONE_TLM_FRAME_TYPE 0x20 +#define ENDIAN_CHANGE_U16(x) ((((x) & 0xFF00) >> 8) + (((x) & 0xFF) << 8)) +#define ENDIAN_CHANGE_U32(x) ((((x) & 0xFF000000) >> 24) + (((x) & 0x00FF0000) >> 8)) + ((((x) & 0xFF00) << 8) + (((x) & 0xFF) << 24)) +#define EDDYSTONE_TEMP_U16_TO_FLOAT(tempU16) (((int16_t)ENDIAN_CHANGE_U16(tempU16)) / 256.0f) +#define EDDYSTONE_TEMP_FLOAT_TO_U16(tempFloat) (ENDIAN_CHANGE_U16(((int)((tempFloat) * 256)))) /** * @brief Representation of a beacon. diff --git a/libraries/BLE/src/BLEEddystoneURL.cpp b/libraries/BLE/src/BLEEddystoneURL.cpp index cd04d6277..ddee8af0b 100644 --- a/libraries/BLE/src/BLEEddystoneURL.cpp +++ b/libraries/BLE/src/BLEEddystoneURL.cpp @@ -54,7 +54,8 @@ BLEEddystoneURL::BLEEddystoneURL(BLEAdvertisedDevice *advertisedDevice) { lengthURL = 0; m_eddystoneData.advertisedTxPower = 0; for (int i = 0; i < advertisedDevice->getPayloadLength(); ++i) { - if (payload[i] == 0x16 && advertisedDevice->getPayloadLength() >= i + 2 + sizeof(m_eddystoneData) && payload[i + 1] == 0xAA && payload[i + 2] == 0xFE && payload[i + 3] == 0x10) { + if (payload[i] == 0x16 && advertisedDevice->getPayloadLength() >= i + 2 + sizeof(m_eddystoneData) && payload[i + 1] == 0xAA && payload[i + 2] == 0xFE + && payload[i + 3] == 0x10) { lengthURL = payload[i - 1] - 5; // Subtracting 5 Bytes containing header and other data which are not actual URL data m_eddystoneData.advertisedTxPower = payload[i + 1]; if (lengthURL <= 18) { @@ -162,7 +163,6 @@ void BLEEddystoneURL::setUUID(BLEUUID l_uuid) { BLEHeadder[9] = beaconUUID & 0x00FF; } // setUUID - void BLEEddystoneURL::setPower(esp_power_level_t advertisedTxPower) { int tx_power; switch (advertisedTxPower) { @@ -195,7 +195,6 @@ void BLEEddystoneURL::setPower(esp_power_level_t advertisedTxPower) { m_eddystoneData.advertisedTxPower = int8_t((tx_power - -100) / 2); } // setPower - void BLEEddystoneURL::setPower(int8_t advertisedTxPower) { m_eddystoneData.advertisedTxPower = advertisedTxPower; } // setPower @@ -241,7 +240,8 @@ int BLEEddystoneURL::setSmartURL(String url) { } if (hasPrefix == false) { - log_w("Prefix not found - using default prefix \"http://www.\" = 0x00\n\tNote: URL must contain one of the prefixes: \"http://www.\", \"https://www.\", \"http://\", \"https://\""); + log_w("Prefix not found - using default prefix \"http://www.\" = 0x00\n\tNote: URL must contain one of the prefixes: \"http://www.\", \"https://www.\", " + "\"http://\", \"https://\""); } for (uint8_t i = 0; i < 0x0E; ++i) { @@ -261,7 +261,10 @@ int BLEEddystoneURL::setSmartURL(String url) { log_e("Encoded URL is too long %d B - max 18 B", lengthURL); return 0; // ERROR } - String baseUrl = url.substring((hasPrefix ? EDDYSTONE_URL_PREFIX[m_eddystoneData.url[0]].length() : 0), baseUrlLen + (hasPrefix ? EDDYSTONE_URL_PREFIX[m_eddystoneData.url[0]].length() : 0)); + String baseUrl = url.substring( + (hasPrefix ? EDDYSTONE_URL_PREFIX[m_eddystoneData.url[0]].length() : 0), + baseUrlLen + (hasPrefix ? EDDYSTONE_URL_PREFIX[m_eddystoneData.url[0]].length() : 0) + ); memcpy((void *)(m_eddystoneData.url + 1), (void *)baseUrl.c_str(), baseUrl.length()); // substr for Arduino String if (hasSuffix) { diff --git a/libraries/BLE/src/BLEEddystoneURL.h b/libraries/BLE/src/BLEEddystoneURL.h index b3289a348..92668eb68 100644 --- a/libraries/BLE/src/BLEEddystoneURL.h +++ b/libraries/BLE/src/BLEEddystoneURL.h @@ -47,7 +47,8 @@ public: int setSmartURL(String url); private: - uint8_t lengthURL; // Describes the length of the URL part including prefix and optional suffix - max 18 B (excluding TX power, frame type and preceding header) + uint8_t + lengthURL; // Describes the length of the URL part including prefix and optional suffix - max 18 B (excluding TX power, frame type and preceding header) struct { int8_t advertisedTxPower; uint8_t url[18]; // Byte [0] is for prefix. Last valid byte **can** contain suffix - i.e. the next byte after the URL diff --git a/libraries/BLE/src/BLEExceptions.h b/libraries/BLE/src/BLEExceptions.h index ea2b8c975..15b4ef93d 100644 --- a/libraries/BLE/src/BLEExceptions.h +++ b/libraries/BLE/src/BLEExceptions.h @@ -18,15 +18,14 @@ #include - class BLEDisconnectedException : public std::exception { - const char* what() const throw() { + const char *what() const throw() { return "BLE Disconnected"; } }; class BLEUuidNotFoundException : public std::exception { - const char* what() const throw() { + const char *what() const throw() { return "No such UUID"; } }; diff --git a/libraries/BLE/src/BLEHIDDevice.cpp b/libraries/BLE/src/BLEHIDDevice.cpp index 3ceae347c..0873aa104 100644 --- a/libraries/BLE/src/BLEHIDDevice.cpp +++ b/libraries/BLE/src/BLEHIDDevice.cpp @@ -13,8 +13,7 @@ #include "BLEHIDDevice.h" #include "BLE2904.h" - -BLEHIDDevice::BLEHIDDevice(BLEServer* server) { +BLEHIDDevice::BLEHIDDevice(BLEServer *server) { /* * Here we create mandatory services described in bluetooth specification */ @@ -38,14 +37,15 @@ BLEHIDDevice::BLEHIDDevice(BLEServer* server) { /* * Mandatory battery level characteristic with notification and presence descriptor */ - BLE2904* batteryLevelDescriptor = new BLE2904(); + BLE2904 *batteryLevelDescriptor = new BLE2904(); batteryLevelDescriptor->setFormat(BLE2904::FORMAT_UINT8); batteryLevelDescriptor->setNamespace(1); batteryLevelDescriptor->setUnit(0x27ad); - m_batteryLevelCharacteristic = m_batteryService->createCharacteristic((uint16_t)0x2a19, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY); + m_batteryLevelCharacteristic = + m_batteryService->createCharacteristic((uint16_t)0x2a19, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY); m_batteryLevelCharacteristic->addDescriptor(batteryLevelDescriptor); - BLE2902* batLevelIndicator = new BLE2902(); + BLE2902 *batLevelIndicator = new BLE2902(); // Battery Level Notification is ON by default, making it work always on BLE Pairing and Bonding batLevelIndicator->setNotifications(true); m_batteryLevelCharacteristic->addDescriptor(batLevelIndicator); @@ -54,17 +54,16 @@ BLEHIDDevice::BLEHIDDevice(BLEServer* server) { * This value is setup here because its default value in most usage cases, its very rare to use boot mode * and we want to simplify library using as much as possible */ - const uint8_t pMode[] = { 0x01 }; - protocolMode()->setValue((uint8_t*)pMode, 1); + const uint8_t pMode[] = {0x01}; + protocolMode()->setValue((uint8_t *)pMode, 1); } -BLEHIDDevice::~BLEHIDDevice() { -} +BLEHIDDevice::~BLEHIDDevice() {} /* * @brief */ -void BLEHIDDevice::reportMap(uint8_t* map, uint16_t size) { +void BLEHIDDevice::reportMap(uint8_t *map, uint16_t size) { m_reportMapCharacteristic->setValue(map, size); } @@ -80,7 +79,7 @@ void BLEHIDDevice::startServices() { /* * @brief Create manufacturer characteristic (this characteristic is optional) */ -BLECharacteristic* BLEHIDDevice::manufacturer() { +BLECharacteristic *BLEHIDDevice::manufacturer() { m_manufacturerCharacteristic = m_deviceInfoService->createCharacteristic((uint16_t)0x2a29, BLECharacteristic::PROPERTY_READ); return m_manufacturerCharacteristic; } @@ -97,7 +96,7 @@ void BLEHIDDevice::manufacturer(String name) { * @brief */ void BLEHIDDevice::pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version) { - uint8_t pnp[] = { sig, (uint8_t)(vid >> 8), (uint8_t)vid, (uint8_t)(pid >> 8), (uint8_t)pid, (uint8_t)(version >> 8), (uint8_t)version }; + uint8_t pnp[] = {sig, (uint8_t)(vid >> 8), (uint8_t)vid, (uint8_t)(pid >> 8), (uint8_t)pid, (uint8_t)(version >> 8), (uint8_t)version}; m_pnpCharacteristic->setValue(pnp, sizeof(pnp)); } @@ -105,7 +104,7 @@ void BLEHIDDevice::pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version * @brief */ void BLEHIDDevice::hidInfo(uint8_t country, uint8_t flags) { - uint8_t info[] = { 0x11, 0x1, country, flags }; + uint8_t info[] = {0x11, 0x1, country, flags}; m_hidInfoCharacteristic->setValue(info, sizeof(info)); } @@ -114,16 +113,17 @@ void BLEHIDDevice::hidInfo(uint8_t country, uint8_t flags) { * @param [in] reportID input report ID, the same as in report map for input object related to created characteristic * @return pointer to new input report characteristic */ -BLECharacteristic* BLEHIDDevice::inputReport(uint8_t reportID) { - BLECharacteristic* inputReportCharacteristic = m_hidService->createCharacteristic((uint16_t)0x2a4d, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY); - BLEDescriptor* inputReportDescriptor = new BLEDescriptor(BLEUUID((uint16_t)0x2908)); - BLE2902* p2902 = new BLE2902(); +BLECharacteristic *BLEHIDDevice::inputReport(uint8_t reportID) { + BLECharacteristic *inputReportCharacteristic = + m_hidService->createCharacteristic((uint16_t)0x2a4d, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY); + BLEDescriptor *inputReportDescriptor = new BLEDescriptor(BLEUUID((uint16_t)0x2908)); + BLE2902 *p2902 = new BLE2902(); inputReportCharacteristic->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); inputReportDescriptor->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); p2902->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - uint8_t desc1_val[] = { reportID, 0x01 }; - inputReportDescriptor->setValue((uint8_t*)desc1_val, 2); + uint8_t desc1_val[] = {reportID, 0x01}; + inputReportDescriptor->setValue((uint8_t *)desc1_val, 2); inputReportCharacteristic->addDescriptor(p2902); inputReportCharacteristic->addDescriptor(inputReportDescriptor); @@ -135,14 +135,16 @@ BLECharacteristic* BLEHIDDevice::inputReport(uint8_t reportID) { * @param [in] reportID Output report ID, the same as in report map for output object related to created characteristic * @return Pointer to new output report characteristic */ -BLECharacteristic* BLEHIDDevice::outputReport(uint8_t reportID) { - BLECharacteristic* outputReportCharacteristic = m_hidService->createCharacteristic((uint16_t)0x2a4d, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR); - BLEDescriptor* outputReportDescriptor = new BLEDescriptor(BLEUUID((uint16_t)0x2908)); +BLECharacteristic *BLEHIDDevice::outputReport(uint8_t reportID) { + BLECharacteristic *outputReportCharacteristic = m_hidService->createCharacteristic( + (uint16_t)0x2a4d, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR + ); + BLEDescriptor *outputReportDescriptor = new BLEDescriptor(BLEUUID((uint16_t)0x2908)); outputReportCharacteristic->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); outputReportDescriptor->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - uint8_t desc1_val[] = { reportID, 0x02 }; - outputReportDescriptor->setValue((uint8_t*)desc1_val, 2); + uint8_t desc1_val[] = {reportID, 0x02}; + outputReportDescriptor->setValue((uint8_t *)desc1_val, 2); outputReportCharacteristic->addDescriptor(outputReportDescriptor); return outputReportCharacteristic; @@ -153,15 +155,16 @@ BLECharacteristic* BLEHIDDevice::outputReport(uint8_t reportID) { * @param [in] reportID Feature report ID, the same as in report map for feature object related to created characteristic * @return Pointer to new feature report characteristic */ -BLECharacteristic* BLEHIDDevice::featureReport(uint8_t reportID) { - BLECharacteristic* featureReportCharacteristic = m_hidService->createCharacteristic((uint16_t)0x2a4d, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE); - BLEDescriptor* featureReportDescriptor = new BLEDescriptor(BLEUUID((uint16_t)0x2908)); +BLECharacteristic *BLEHIDDevice::featureReport(uint8_t reportID) { + BLECharacteristic *featureReportCharacteristic = + m_hidService->createCharacteristic((uint16_t)0x2a4d, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE); + BLEDescriptor *featureReportDescriptor = new BLEDescriptor(BLEUUID((uint16_t)0x2908)); featureReportCharacteristic->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); featureReportDescriptor->setAccessPermissions(ESP_GATT_PERM_READ_ENCRYPTED | ESP_GATT_PERM_WRITE_ENCRYPTED); - uint8_t desc1_val[] = { reportID, 0x03 }; - featureReportDescriptor->setValue((uint8_t*)desc1_val, 2); + uint8_t desc1_val[] = {reportID, 0x03}; + featureReportDescriptor->setValue((uint8_t *)desc1_val, 2); featureReportCharacteristic->addDescriptor(featureReportDescriptor); return featureReportCharacteristic; @@ -170,8 +173,8 @@ BLECharacteristic* BLEHIDDevice::featureReport(uint8_t reportID) { /* * @brief */ -BLECharacteristic* BLEHIDDevice::bootInput() { - BLECharacteristic* bootInputCharacteristic = m_hidService->createCharacteristic((uint16_t)0x2a22, BLECharacteristic::PROPERTY_NOTIFY); +BLECharacteristic *BLEHIDDevice::bootInput() { + BLECharacteristic *bootInputCharacteristic = m_hidService->createCharacteristic((uint16_t)0x2a22, BLECharacteristic::PROPERTY_NOTIFY); bootInputCharacteristic->addDescriptor(new BLE2902()); return bootInputCharacteristic; @@ -180,21 +183,23 @@ BLECharacteristic* BLEHIDDevice::bootInput() { /* * @brief */ -BLECharacteristic* BLEHIDDevice::bootOutput() { - return m_hidService->createCharacteristic((uint16_t)0x2a32, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR); +BLECharacteristic *BLEHIDDevice::bootOutput() { + return m_hidService->createCharacteristic( + (uint16_t)0x2a32, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR + ); } /* * @brief */ -BLECharacteristic* BLEHIDDevice::hidControl() { +BLECharacteristic *BLEHIDDevice::hidControl() { return m_hidControlCharacteristic; } /* * @brief */ -BLECharacteristic* BLEHIDDevice::protocolMode() { +BLECharacteristic *BLEHIDDevice::protocolMode() { return m_protocolModeCharacteristic; } @@ -229,21 +234,21 @@ BLECharacteristic* BLEHIDDevice::hidInfo() { /* * @brief */ -BLEService* BLEHIDDevice::deviceInfo() { +BLEService *BLEHIDDevice::deviceInfo() { return m_deviceInfoService; } /* * @brief */ -BLEService* BLEHIDDevice::hidService() { +BLEService *BLEHIDDevice::hidService() { return m_hidService; } /* * @brief */ -BLEService* BLEHIDDevice::batteryService() { +BLEService *BLEHIDDevice::batteryService() { return m_batteryService; } diff --git a/libraries/BLE/src/BLEHIDDevice.h b/libraries/BLE/src/BLEHIDDevice.h index 143f4421a..a92a23c21 100644 --- a/libraries/BLE/src/BLEHIDDevice.h +++ b/libraries/BLE/src/BLEHIDDevice.h @@ -20,30 +20,30 @@ #include "BLE2902.h" #include "HIDTypes.h" -#define GENERIC_HID 0x03C0 -#define HID_KEYBOARD 0x03C1 -#define HID_MOUSE 0x03C2 -#define HID_JOYSTICK 0x03C3 -#define HID_GAMEPAD 0x03C4 -#define HID_TABLET 0x03C5 -#define HID_CARD_READER 0x03C6 -#define HID_DIGITAL_PEN 0x03C7 -#define HID_BARCODE 0x03C8 +#define GENERIC_HID 0x03C0 +#define HID_KEYBOARD 0x03C1 +#define HID_MOUSE 0x03C2 +#define HID_JOYSTICK 0x03C3 +#define HID_GAMEPAD 0x03C4 +#define HID_TABLET 0x03C5 +#define HID_CARD_READER 0x03C6 +#define HID_DIGITAL_PEN 0x03C7 +#define HID_BARCODE 0x03C8 #define HID_BRAILLE_DISPLAY 0x03C9 class BLEHIDDevice { public: - BLEHIDDevice(BLEServer*); + BLEHIDDevice(BLEServer *); virtual ~BLEHIDDevice(); - void reportMap(uint8_t* map, uint16_t); + void reportMap(uint8_t *map, uint16_t); void startServices(); - BLEService* deviceInfo(); - BLEService* hidService(); - BLEService* batteryService(); + BLEService *deviceInfo(); + BLEService *hidService(); + BLEService *batteryService(); - BLECharacteristic* manufacturer(); + BLECharacteristic *manufacturer(); void manufacturer(String name); //BLECharacteristic* pnp(); void pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version); @@ -52,28 +52,27 @@ public: //BLECharacteristic* batteryLevel(); void setBatteryLevel(uint8_t level); - //BLECharacteristic* reportMap(); - BLECharacteristic* hidControl(); - BLECharacteristic* inputReport(uint8_t reportID); - BLECharacteristic* outputReport(uint8_t reportID); - BLECharacteristic* featureReport(uint8_t reportID); - BLECharacteristic* protocolMode(); - BLECharacteristic* bootInput(); - BLECharacteristic* bootOutput(); + BLECharacteristic *hidControl(); + BLECharacteristic *inputReport(uint8_t reportID); + BLECharacteristic *outputReport(uint8_t reportID); + BLECharacteristic *featureReport(uint8_t reportID); + BLECharacteristic *protocolMode(); + BLECharacteristic *bootInput(); + BLECharacteristic *bootOutput(); private: - BLEService* m_deviceInfoService; //0x180a - BLEService* m_hidService; //0x1812 - BLEService* m_batteryService = 0; //0x180f + BLEService *m_deviceInfoService; //0x180a + BLEService *m_hidService; //0x1812 + BLEService *m_batteryService = 0; //0x180f - BLECharacteristic* m_manufacturerCharacteristic; //0x2a29 - BLECharacteristic* m_pnpCharacteristic; //0x2a50 - BLECharacteristic* m_hidInfoCharacteristic; //0x2a4a - BLECharacteristic* m_reportMapCharacteristic; //0x2a4b - BLECharacteristic* m_hidControlCharacteristic; //0x2a4c - BLECharacteristic* m_protocolModeCharacteristic; //0x2a4e - BLECharacteristic* m_batteryLevelCharacteristic; //0x2a19 + BLECharacteristic *m_manufacturerCharacteristic; //0x2a29 + BLECharacteristic *m_pnpCharacteristic; //0x2a50 + BLECharacteristic *m_hidInfoCharacteristic; //0x2a4a + BLECharacteristic *m_reportMapCharacteristic; //0x2a4b + BLECharacteristic *m_hidControlCharacteristic; //0x2a4c + BLECharacteristic *m_protocolModeCharacteristic; //0x2a4e + BLECharacteristic *m_batteryLevelCharacteristic; //0x2a19 }; #endif /* CONFIG_BLUEDROID_ENABLED */ diff --git a/libraries/BLE/src/BLERemoteCharacteristic.cpp b/libraries/BLE/src/BLERemoteCharacteristic.cpp index 44d6954f1..3e066de34 100644 --- a/libraries/BLE/src/BLERemoteCharacteristic.cpp +++ b/libraries/BLE/src/BLERemoteCharacteristic.cpp @@ -23,7 +23,6 @@ #include "BLERemoteDescriptor.h" #include "esp32-hal-log.h" - /** * @brief Constructor. * @param [in] handle The BLE server side handle of this characteristic. @@ -31,11 +30,7 @@ * @param [in] charProp The properties of this characteristic. * @param [in] pRemoteService A reference to the remote service to which this remote characteristic pertains. */ -BLERemoteCharacteristic::BLERemoteCharacteristic( - uint16_t handle, - BLEUUID uuid, - esp_gatt_char_prop_t charProp, - BLERemoteService* pRemoteService) { +BLERemoteCharacteristic::BLERemoteCharacteristic(uint16_t handle, BLEUUID uuid, esp_gatt_char_prop_t charProp, BLERemoteService *pRemoteService) { log_v(">> BLERemoteCharacteristic: handle: %d 0x%d, uuid: %s", handle, handle, uuid.toString().c_str()); m_handle = handle; m_uuid = uuid; @@ -49,7 +44,6 @@ BLERemoteCharacteristic::BLERemoteCharacteristic( log_v("<< BLERemoteCharacteristic"); } // BLERemoteCharacteristic - /** *@brief Destructor. */ @@ -58,7 +52,6 @@ BLERemoteCharacteristic::~BLERemoteCharacteristic() { free(m_rawData); } // ~BLERemoteCharacteristic - /** * @brief Does the characteristic support broadcasting? * @return True if the characteristic supports broadcasting. @@ -67,7 +60,6 @@ bool BLERemoteCharacteristic::canBroadcast() { return (m_charProp & ESP_GATT_CHAR_PROP_BIT_BROADCAST) != 0; } // canBroadcast - /** * @brief Does the characteristic support indications? * @return True if the characteristic supports indications. @@ -76,7 +68,6 @@ bool BLERemoteCharacteristic::canIndicate() { return (m_charProp & ESP_GATT_CHAR_PROP_BIT_INDICATE) != 0; } // canIndicate - /** * @brief Does the characteristic support notifications? * @return True if the characteristic supports notifications. @@ -85,7 +76,6 @@ bool BLERemoteCharacteristic::canNotify() { return (m_charProp & ESP_GATT_CHAR_PROP_BIT_NOTIFY) != 0; } // canNotify - /** * @brief Does the characteristic support reading? * @return True if the characteristic supports reading. @@ -94,7 +84,6 @@ bool BLERemoteCharacteristic::canRead() { return (m_charProp & ESP_GATT_CHAR_PROP_BIT_READ) != 0; } // canRead - /** * @brief Does the characteristic support writing? * @return True if the characteristic supports writing. @@ -103,7 +92,6 @@ bool BLERemoteCharacteristic::canWrite() { return (m_charProp & ESP_GATT_CHAR_PROP_BIT_WRITE) != 0; } // canWrite - /** * @brief Does the characteristic support writing with no response? * @return True if the characteristic supports writing with no response. @@ -112,7 +100,6 @@ bool BLERemoteCharacteristic::canWriteNoResponse() { return (m_charProp & ESP_GATT_CHAR_PROP_BIT_WRITE_NR) != 0; } // canWriteNoResponse - /* static bool compareSrvcId(esp_gatt_srvc_id_t id1, esp_gatt_srvc_id_t id2) { if (id1.id.inst_id != id2.id.inst_id) { @@ -137,7 +124,6 @@ static bool compareGattId(esp_gatt_id_t id1, esp_gatt_id_t id2) { } // compareCharId */ - /** * @brief Handle GATT Client events. * When an event arrives for a GATT client we give this characteristic the opportunity to @@ -147,7 +133,7 @@ static bool compareGattId(esp_gatt_id_t id1, esp_gatt_id_t id2) { * @param [in] evtParam Payload data for the event. * @returns N/A */ -void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t* evtParam) { +void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *evtParam) { switch (event) { // ESP_GATTC_NOTIFY_EVT // @@ -163,14 +149,16 @@ void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, // piece of data. What we must now do is find the characteristic with the associated handle and then // invoke its notification callback (if it has one). case ESP_GATTC_NOTIFY_EVT: - { - if (evtParam->notify.handle != getHandle()) break; - if (m_notifyCallback != nullptr) { - log_d("Invoking callback for notification on characteristic %s", toString().c_str()); - m_notifyCallback(this, evtParam->notify.value, evtParam->notify.value_len, evtParam->notify.is_notify); - } // End we have a callback function ... + { + if (evtParam->notify.handle != getHandle()) { break; - } // ESP_GATTC_NOTIFY_EVT + } + if (m_notifyCallback != nullptr) { + log_d("Invoking callback for notification on characteristic %s", toString().c_str()); + m_notifyCallback(this, evtParam->notify.value, evtParam->notify.value_len, evtParam->notify.is_notify); + } // End we have a callback function ... + break; + } // ESP_GATTC_NOTIFY_EVT // ESP_GATTC_READ_CHAR_EVT // This event indicates that the server has responded to the read request. @@ -182,24 +170,28 @@ void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, // - uint8_t* value // - uint16_t value_len case ESP_GATTC_READ_CHAR_EVT: - { - // If this event is not for us, then nothing further to do. - if (evtParam->read.handle != getHandle()) break; - - // At this point, we have determined that the event is for us, so now we save the value - // and unlock the semaphore to ensure that the requestor of the data can continue. - if (evtParam->read.status == ESP_GATT_OK) { - m_value = String((char*)evtParam->read.value, evtParam->read.value_len); - if (m_rawData != nullptr) free(m_rawData); - m_rawData = (uint8_t*)calloc(evtParam->read.value_len, sizeof(uint8_t)); - memcpy(m_rawData, evtParam->read.value, evtParam->read.value_len); - } else { - m_value = ""; - } - - m_semaphoreReadCharEvt.give(); + { + // If this event is not for us, then nothing further to do. + if (evtParam->read.handle != getHandle()) { break; - } // ESP_GATTC_READ_CHAR_EVT + } + + // At this point, we have determined that the event is for us, so now we save the value + // and unlock the semaphore to ensure that the requestor of the data can continue. + if (evtParam->read.status == ESP_GATT_OK) { + m_value = String((char *)evtParam->read.value, evtParam->read.value_len); + if (m_rawData != nullptr) { + free(m_rawData); + } + m_rawData = (uint8_t *)calloc(evtParam->read.value_len, sizeof(uint8_t)); + memcpy(m_rawData, evtParam->read.value, evtParam->read.value_len); + } else { + m_value = ""; + } + + m_semaphoreReadCharEvt.give(); + break; + } // ESP_GATTC_READ_CHAR_EVT // ESP_GATTC_REG_FOR_NOTIFY_EVT // @@ -207,14 +199,16 @@ void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, // - esp_gatt_status_t status // - uint16_t handle case ESP_GATTC_REG_FOR_NOTIFY_EVT: - { - // If the request is not for this BLERemoteCharacteristic then move on to the next. - if (evtParam->reg_for_notify.handle != getHandle()) break; - - // We have processed the notify registration and can unlock the semaphore. - m_semaphoreRegForNotifyEvt.give(); + { + // If the request is not for this BLERemoteCharacteristic then move on to the next. + if (evtParam->reg_for_notify.handle != getHandle()) { break; - } // ESP_GATTC_REG_FOR_NOTIFY_EVT + } + + // We have processed the notify registration and can unlock the semaphore. + m_semaphoreRegForNotifyEvt.give(); + break; + } // ESP_GATTC_REG_FOR_NOTIFY_EVT // ESP_GATTC_UNREG_FOR_NOTIFY_EVT // @@ -222,12 +216,14 @@ void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, // - esp_gatt_status_t status // - uint16_t handle case ESP_GATTC_UNREG_FOR_NOTIFY_EVT: - { - if (evtParam->unreg_for_notify.handle != getHandle()) break; - // We have processed the notify un-registration and can unlock the semaphore. - m_semaphoreRegForNotifyEvt.give(); + { + if (evtParam->unreg_for_notify.handle != getHandle()) { break; - } // ESP_GATTC_UNREG_FOR_NOTIFY_EVT: + } + // We have processed the notify un-registration and can unlock the semaphore. + m_semaphoreRegForNotifyEvt.give(); + break; + } // ESP_GATTC_UNREG_FOR_NOTIFY_EVT: // ESP_GATTC_WRITE_CHAR_EVT // @@ -236,21 +232,22 @@ void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, // - uint16_t conn_id // - uint16_t handle case ESP_GATTC_WRITE_CHAR_EVT: - { - // Determine if this event is for us and, if not, pass onwards. - if (evtParam->write.handle != getHandle()) break; - - // There is nothing further we need to do here. This is merely an indication - // that the write has completed and we can unlock the caller. - m_semaphoreWriteCharEvt.give(); + { + // Determine if this event is for us and, if not, pass onwards. + if (evtParam->write.handle != getHandle()) { break; - } // ESP_GATTC_WRITE_CHAR_EVT + } + + // There is nothing further we need to do here. This is merely an indication + // that the write has completed and we can unlock the caller. + m_semaphoreWriteCharEvt.give(); + break; + } // ESP_GATTC_WRITE_CHAR_EVT case ESP_GATTC_READ_DESCR_EVT: case ESP_GATTC_WRITE_DESCR_EVT: - for (auto& myPair : m_descriptorMap) { - myPair.second->gattClientEventHandler( - event, gattc_if, evtParam); + for (auto &myPair : m_descriptorMap) { + myPair.second->gattClientEventHandler(event, gattc_if, evtParam); } break; @@ -260,11 +257,9 @@ void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, m_semaphoreWriteCharEvt.give(1); break; - default: - break; + default: break; } // End switch -}; // gattClientEventHandler - +}; // gattClientEventHandler /** * @brief Populate the descriptors (if any) for this characteristic. @@ -281,12 +276,8 @@ void BLERemoteCharacteristic::retrieveDescriptors() { while (true) { uint16_t count = 10; esp_gatt_status_t status = ::esp_ble_gattc_get_all_descr( - getRemoteService()->getClient()->getGattcIf(), - getRemoteService()->getClient()->getConnId(), - getHandle(), - &result, - &count, - offset); + getRemoteService()->getClient()->getGattcIf(), getRemoteService()->getClient()->getConnId(), getHandle(), &result, &count, offset + ); if (status == ESP_GATT_INVALID_OFFSET) { // We have reached the end of the entries. break; @@ -297,17 +288,16 @@ void BLERemoteCharacteristic::retrieveDescriptors() { break; } - if (count == 0) break; + if (count == 0) { + break; + } log_d("Found a descriptor: Handle: %d, UUID: %s", result.handle, BLEUUID(result.uuid).toString().c_str()); // We now have a new characteristic ... let us add that to our set of known characteristics - BLERemoteDescriptor* pNewRemoteDescriptor = new BLERemoteDescriptor( - result.handle, - BLEUUID(result.uuid), - this); + BLERemoteDescriptor *pNewRemoteDescriptor = new BLERemoteDescriptor(result.handle, BLEUUID(result.uuid), this); - m_descriptorMap.insert(std::pair(pNewRemoteDescriptor->getUUID().toString(), pNewRemoteDescriptor)); + m_descriptorMap.insert(std::pair(pNewRemoteDescriptor->getUUID().toString(), pNewRemoteDescriptor)); offset++; } // while true @@ -315,15 +305,13 @@ void BLERemoteCharacteristic::retrieveDescriptors() { log_v("<< retrieveDescriptors(): Found %d descriptors.", offset); } // getDescriptors - /** * @brief Retrieve the map of descriptors keyed by UUID. */ -std::map* BLERemoteCharacteristic::getDescriptors() { +std::map *BLERemoteCharacteristic::getDescriptors() { return &m_descriptorMap; } // getDescriptors - /** * @brief Get the handle for this characteristic. * @return The handle for this characteristic. @@ -334,16 +322,15 @@ uint16_t BLERemoteCharacteristic::getHandle() { return m_handle; } // getHandle - /** * @brief Get the descriptor instance with the given UUID that belongs to this characteristic. * @param [in] uuid The UUID of the descriptor to find. * @return The Remote descriptor (if present) or null if not present. */ -BLERemoteDescriptor* BLERemoteCharacteristic::getDescriptor(BLEUUID uuid) { +BLERemoteDescriptor *BLERemoteCharacteristic::getDescriptor(BLEUUID uuid) { log_v(">> getDescriptor: uuid: %s", uuid.toString().c_str()); String v = uuid.toString(); - for (auto& myPair : m_descriptorMap) { + for (auto &myPair : m_descriptorMap) { if (myPair.first == v) { log_v("<< getDescriptor: found"); return myPair.second; @@ -353,16 +340,14 @@ BLERemoteDescriptor* BLERemoteCharacteristic::getDescriptor(BLEUUID uuid) { return nullptr; } // getDescriptor - /** * @brief Get the remote service associated with this characteristic. * @return The remote service associated with this characteristic. */ -BLERemoteService* BLERemoteCharacteristic::getRemoteService() { +BLERemoteService *BLERemoteCharacteristic::getRemoteService() { return m_pRemoteService; } // getRemoteService - /** * @brief Get the UUID for this characteristic. * @return The UUID for this characteristic. @@ -371,7 +356,6 @@ BLEUUID BLERemoteCharacteristic::getUUID() { return m_uuid; } // getUUID - /** * @brief Read an unsigned 16 bit value * @return The unsigned 16 bit value. @@ -379,12 +363,11 @@ BLEUUID BLERemoteCharacteristic::getUUID() { uint16_t BLERemoteCharacteristic::readUInt16() { String value = readValue(); if (value.length() >= 2) { - return *(uint16_t*)(value.c_str()); + return *(uint16_t *)(value.c_str()); } return 0; } // readUInt16 - /** * @brief Read an unsigned 32 bit value. * @return the unsigned 32 bit value. @@ -392,12 +375,11 @@ uint16_t BLERemoteCharacteristic::readUInt16() { uint32_t BLERemoteCharacteristic::readUInt32() { String value = readValue(); if (value.length() >= 4) { - return *(uint32_t*)(value.c_str()); + return *(uint32_t *)(value.c_str()); } return 0; } // readUInt32 - /** * @brief Read a byte value * @return The value as a byte @@ -417,7 +399,7 @@ uint8_t BLERemoteCharacteristic::readUInt8() { float BLERemoteCharacteristic::readFloat() { String value = readValue(); if (value.length() >= 4) { - return *(float*)(value.c_str()); + return *(float *)(value.c_str()); } return 0.0; } // readFloat @@ -444,7 +426,8 @@ String BLERemoteCharacteristic::readValue() { m_pRemoteService->getClient()->getGattcIf(), m_pRemoteService->getClient()->getConnId(), // The connection ID to the BLE server getHandle(), // The handle of this characteristic - m_auth); // Security + m_auth + ); // Security if (errRc != ESP_OK) { log_e("esp_ble_gattc_read_char: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); @@ -459,7 +442,6 @@ String BLERemoteCharacteristic::readValue() { return m_value; } // readValue - /** * @brief Register for notifications. * @param [in] notifyCallback A callback to be invoked for a notification. If NULL is provided then we are @@ -475,34 +457,36 @@ void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback, if (notifyCallback != nullptr) { // If we have a callback function, then this is a registration. esp_err_t errRc = ::esp_ble_gattc_register_for_notify( - m_pRemoteService->getClient()->getGattcIf(), - *m_pRemoteService->getClient()->getPeerAddress().getNative(), - getHandle()); + m_pRemoteService->getClient()->getGattcIf(), *m_pRemoteService->getClient()->getPeerAddress().getNative(), getHandle() + ); if (errRc != ESP_OK) { log_e("esp_ble_gattc_register_for_notify: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); } - uint8_t val[] = { 0x01, 0x00 }; - if (!notifications) val[0] = 0x02; - BLERemoteDescriptor* desc = getDescriptor(BLEUUID((uint16_t)0x2902)); - if (desc != nullptr && descriptorRequiresRegistration) + uint8_t val[] = {0x01, 0x00}; + if (!notifications) { + val[0] = 0x02; + } + BLERemoteDescriptor *desc = getDescriptor(BLEUUID((uint16_t)0x2902)); + if (desc != nullptr && descriptorRequiresRegistration) { desc->writeValue(val, 2, true); - } // End Register + } + } // End Register else { // If we weren't passed a callback function, then this is an unregistration. esp_err_t errRc = ::esp_ble_gattc_unregister_for_notify( - m_pRemoteService->getClient()->getGattcIf(), - *m_pRemoteService->getClient()->getPeerAddress().getNative(), - getHandle()); + m_pRemoteService->getClient()->getGattcIf(), *m_pRemoteService->getClient()->getPeerAddress().getNative(), getHandle() + ); if (errRc != ESP_OK) { log_e("esp_ble_gattc_unregister_for_notify: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); } - uint8_t val[] = { 0x00, 0x00 }; - BLERemoteDescriptor* desc = getDescriptor((uint16_t)0x2902); - if (desc != nullptr && descriptorRequiresRegistration) + uint8_t val[] = {0x00, 0x00}; + BLERemoteDescriptor *desc = getDescriptor((uint16_t)0x2902); + if (desc != nullptr && descriptorRequiresRegistration) { desc->writeValue(val, 2, true); + } } // End Unregister m_semaphoreRegForNotifyEvt.wait("registerForNotify"); @@ -510,7 +494,6 @@ void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback, log_v("<< registerForNotify()"); } // registerForNotify - /** * @brief Delete the descriptors in the descriptor map. * We maintain a map called m_descriptorMap that contains pointers to BLERemoteDescriptors @@ -520,13 +503,12 @@ void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback, */ void BLERemoteCharacteristic::removeDescriptors() { // Iterate through all the descriptors releasing their storage and erasing them from the map. - for (auto& myPair : m_descriptorMap) { + for (auto &myPair : m_descriptorMap) { delete myPair.second; } m_descriptorMap.clear(); } // removeCharacteristics - /** * @brief Convert a BLERemoteCharacteristic to a string representation; * @return a String representation. @@ -544,7 +526,6 @@ String BLERemoteCharacteristic::toString() { return res; } // toString - /** * @brief Write the new value for the characteristic. * @param [in] newValue The new value to write. @@ -552,10 +533,9 @@ String BLERemoteCharacteristic::toString() { * @return N/A. */ void BLERemoteCharacteristic::writeValue(String newValue, bool response) { - writeValue((uint8_t*)newValue.c_str(), newValue.length(), response); + writeValue((uint8_t *)newValue.c_str(), newValue.length(), response); } // writeValue - /** * @brief Write the new value for the characteristic. * @@ -568,14 +548,13 @@ void BLERemoteCharacteristic::writeValue(uint8_t newValue, bool response) { writeValue(&newValue, 1, response); } // writeValue - /** * @brief Write the new value for the characteristic from a data buffer. * @param [in] data A pointer to a data buffer. * @param [in] length The length of the data in the data buffer. * @param [in] response Whether we require a response from the write. */ -void BLERemoteCharacteristic::writeValue(uint8_t* data, size_t length, bool response) { +void BLERemoteCharacteristic::writeValue(uint8_t *data, size_t length, bool response) { // writeValue(String((char*)data, length), response); log_v(">> writeValue(), length: %d", length); @@ -588,13 +567,9 @@ void BLERemoteCharacteristic::writeValue(uint8_t* data, size_t length, bool resp m_semaphoreWriteCharEvt.take("writeValue"); // Invoke the ESP-IDF API to perform the write. esp_err_t errRc = ::esp_ble_gattc_write_char( - m_pRemoteService->getClient()->getGattcIf(), - m_pRemoteService->getClient()->getConnId(), - getHandle(), - length, - data, - response ? ESP_GATT_WRITE_TYPE_RSP : ESP_GATT_WRITE_TYPE_NO_RSP, - m_auth); + m_pRemoteService->getClient()->getGattcIf(), m_pRemoteService->getClient()->getConnId(), getHandle(), length, data, + response ? ESP_GATT_WRITE_TYPE_RSP : ESP_GATT_WRITE_TYPE_NO_RSP, m_auth + ); if (errRc != ESP_OK) { log_e("esp_ble_gattc_write_char: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); @@ -610,7 +585,7 @@ void BLERemoteCharacteristic::writeValue(uint8_t* data, size_t length, bool resp * @brief Read raw data from remote characteristic as hex bytes * @return return pointer data read */ -uint8_t* BLERemoteCharacteristic::readRawData() { +uint8_t *BLERemoteCharacteristic::readRawData() { return m_rawData; } diff --git a/libraries/BLE/src/BLERemoteCharacteristic.h b/libraries/BLE/src/BLERemoteCharacteristic.h index 086bb2aab..97a7966ab 100644 --- a/libraries/BLE/src/BLERemoteCharacteristic.h +++ b/libraries/BLE/src/BLERemoteCharacteristic.h @@ -23,7 +23,7 @@ class BLERemoteService; class BLERemoteDescriptor; -typedef std::function notify_callback; +typedef std::function notify_callback; /** * @brief A model of a remote %BLE characteristic. */ @@ -38,9 +38,9 @@ public: bool canRead(); bool canWrite(); bool canWriteNoResponse(); - BLERemoteDescriptor* getDescriptor(BLEUUID uuid); - std::map* getDescriptors(); - BLERemoteService* getRemoteService(); + BLERemoteDescriptor *getDescriptor(BLEUUID uuid); + std::map *getDescriptors(); + BLERemoteService *getRemoteService(); uint16_t getHandle(); BLEUUID getUUID(); String readValue(); @@ -49,21 +49,21 @@ public: uint32_t readUInt32(); float readFloat(); void registerForNotify(notify_callback _callback, bool notifications = true, bool descriptorRequiresRegistration = true); - void writeValue(uint8_t* data, size_t length, bool response = false); + void writeValue(uint8_t *data, size_t length, bool response = false); void writeValue(String newValue, bool response = false); void writeValue(uint8_t newValue, bool response = false); String toString(); - uint8_t* readRawData(); + uint8_t *readRawData(); void setAuth(esp_gatt_auth_req_t auth); private: - BLERemoteCharacteristic(uint16_t handle, BLEUUID uuid, esp_gatt_char_prop_t charProp, BLERemoteService* pRemoteService); + BLERemoteCharacteristic(uint16_t handle, BLEUUID uuid, esp_gatt_char_prop_t charProp, BLERemoteService *pRemoteService); friend class BLEClient; friend class BLERemoteService; friend class BLERemoteDescriptor; // Private member functions - void gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t* evtParam); + void gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *evtParam); void removeDescriptors(); void retrieveDescriptors(); @@ -73,16 +73,16 @@ private: esp_gatt_char_prop_t m_charProp; esp_gatt_auth_req_t m_auth; uint16_t m_handle; - BLERemoteService* m_pRemoteService; + BLERemoteService *m_pRemoteService; FreeRTOS::Semaphore m_semaphoreReadCharEvt = FreeRTOS::Semaphore("ReadCharEvt"); FreeRTOS::Semaphore m_semaphoreRegForNotifyEvt = FreeRTOS::Semaphore("RegForNotifyEvt"); FreeRTOS::Semaphore m_semaphoreWriteCharEvt = FreeRTOS::Semaphore("WriteCharEvt"); String m_value; - uint8_t* m_rawData; + uint8_t *m_rawData; notify_callback m_notifyCallback; // We maintain a map of descriptors owned by this characteristic keyed by a string representation of the UUID. - std::map m_descriptorMap; + std::map m_descriptorMap; }; // BLERemoteCharacteristic #endif /* CONFIG_BLUEDROID_ENABLED */ diff --git a/libraries/BLE/src/BLERemoteDescriptor.cpp b/libraries/BLE/src/BLERemoteDescriptor.cpp index a67694e71..d57f11eb8 100644 --- a/libraries/BLE/src/BLERemoteDescriptor.cpp +++ b/libraries/BLE/src/BLERemoteDescriptor.cpp @@ -14,10 +14,7 @@ #include "GeneralUtils.h" #include "esp32-hal-log.h" -BLERemoteDescriptor::BLERemoteDescriptor( - uint16_t handle, - BLEUUID uuid, - BLERemoteCharacteristic* pRemoteCharacteristic) { +BLERemoteDescriptor::BLERemoteDescriptor(uint16_t handle, BLEUUID uuid, BLERemoteCharacteristic *pRemoteCharacteristic) { m_handle = handle; m_uuid = uuid; @@ -25,7 +22,6 @@ BLERemoteDescriptor::BLERemoteDescriptor( m_auth = ESP_GATT_AUTH_REQ_NONE; } - /** * @brief Retrieve the handle associated with this remote descriptor. * @return The handle associated with this remote descriptor. @@ -34,16 +30,14 @@ uint16_t BLERemoteDescriptor::getHandle() { return m_handle; } // getHandle - /** * @brief Get the characteristic that owns this descriptor. * @return The characteristic that owns this descriptor. */ -BLERemoteCharacteristic* BLERemoteDescriptor::getRemoteCharacteristic() { +BLERemoteCharacteristic *BLERemoteDescriptor::getRemoteCharacteristic() { return m_pRemoteCharacteristic; } // getRemoteCharacteristic - /** * @brief Retrieve the UUID associated this remote descriptor. * @return The UUID associated this remote descriptor. @@ -52,7 +46,7 @@ BLEUUID BLERemoteDescriptor::getUUID() { return m_uuid; } // getUUID -void BLERemoteDescriptor::gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t* evtParam) { +void BLERemoteDescriptor::gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *evtParam) { switch (event) { // ESP_GATTC_READ_DESCR_EVT // This event indicates that the server has responded to the read request. @@ -65,11 +59,13 @@ void BLERemoteDescriptor::gattClientEventHandler(esp_gattc_cb_event_t event, esp // - uint16_t value_len case ESP_GATTC_READ_DESCR_EVT: // If this event is not for us, then nothing further to do. - if (evtParam->read.handle != getHandle()) break; + if (evtParam->read.handle != getHandle()) { + break; + } // At this point, we have determined that the event is for us, so now we save the value if (evtParam->read.status == ESP_GATT_OK) { // it will read the cached value of the descriptor - m_value = String((char*)evtParam->read.value, evtParam->read.value_len); + m_value = String((char *)evtParam->read.value, evtParam->read.value_len); } else { m_value = ""; } @@ -78,12 +74,12 @@ void BLERemoteDescriptor::gattClientEventHandler(esp_gattc_cb_event_t event, esp break; case ESP_GATTC_WRITE_DESCR_EVT: - if (evtParam->write.handle != getHandle()) + if (evtParam->write.handle != getHandle()) { break; + } m_semaphoreWriteDescrEvt.give(); break; - default: - break; + default: break; } } @@ -103,7 +99,8 @@ String BLERemoteDescriptor::readValue() { m_pRemoteCharacteristic->getRemoteService()->getClient()->getGattcIf(), m_pRemoteCharacteristic->getRemoteService()->getClient()->getConnId(), // The connection ID to the BLE server getHandle(), // The handle of this characteristic - m_auth); // Security + m_auth + ); // Security if (errRc != ESP_OK) { log_e("esp_ble_gattc_read_char: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); @@ -118,7 +115,6 @@ String BLERemoteDescriptor::readValue() { return m_value; } // readValue - uint8_t BLERemoteDescriptor::readUInt8() { String value = readValue(); if (value.length() >= 1) { @@ -127,25 +123,22 @@ uint8_t BLERemoteDescriptor::readUInt8() { return 0; } // readUInt8 - uint16_t BLERemoteDescriptor::readUInt16() { String value = readValue(); if (value.length() >= 2) { - return *(uint16_t*)value.c_str(); + return *(uint16_t *)value.c_str(); } return 0; } // readUInt16 - uint32_t BLERemoteDescriptor::readUInt32() { String value = readValue(); if (value.length() >= 4) { - return *(uint32_t*)value.c_str(); + return *(uint32_t *)value.c_str(); } return 0; } // readUInt32 - /** * @brief Return a string representation of this BLE Remote Descriptor. * @return A string representation of this BLE Remote Descriptor. @@ -159,14 +152,13 @@ String BLERemoteDescriptor::toString() { return res; } // toString - /** * @brief Write data to the BLE Remote Descriptor. * @param [in] data The data to send to the remote descriptor. * @param [in] length The length of the data to send. * @param [in] response True if we expect a response. */ -void BLERemoteDescriptor::writeValue(uint8_t* data, size_t length, bool response) { +void BLERemoteDescriptor::writeValue(uint8_t *data, size_t length, bool response) { log_v(">> writeValue: %s", toString().c_str()); // Check to see that we are connected. if (!getRemoteCharacteristic()->getRemoteService()->getClient()->isConnected()) { @@ -177,13 +169,11 @@ void BLERemoteDescriptor::writeValue(uint8_t* data, size_t length, bool response m_semaphoreWriteDescrEvt.take("writeValue"); esp_err_t errRc = ::esp_ble_gattc_write_char_descr( - m_pRemoteCharacteristic->getRemoteService()->getClient()->getGattcIf(), - m_pRemoteCharacteristic->getRemoteService()->getClient()->getConnId(), - getHandle(), + m_pRemoteCharacteristic->getRemoteService()->getClient()->getGattcIf(), m_pRemoteCharacteristic->getRemoteService()->getClient()->getConnId(), getHandle(), length, // Data length data, // Data - response ? ESP_GATT_WRITE_TYPE_RSP : ESP_GATT_WRITE_TYPE_NO_RSP, - m_auth); + response ? ESP_GATT_WRITE_TYPE_RSP : ESP_GATT_WRITE_TYPE_NO_RSP, m_auth + ); if (errRc != ESP_OK) { log_e("esp_ble_gattc_write_char_descr: %d", errRc); } @@ -192,17 +182,15 @@ void BLERemoteDescriptor::writeValue(uint8_t* data, size_t length, bool response log_v("<< writeValue"); } // writeValue - /** * @brief Write data represented as a string to the BLE Remote Descriptor. * @param [in] newValue The data to send to the remote descriptor. * @param [in] response True if we expect a response. */ void BLERemoteDescriptor::writeValue(String newValue, bool response) { - writeValue((uint8_t*)newValue.c_str(), newValue.length(), response); + writeValue((uint8_t *)newValue.c_str(), newValue.length(), response); } // writeValue - /** * @brief Write a byte value to the Descriptor. * @param [in] The single byte to write. diff --git a/libraries/BLE/src/BLERemoteDescriptor.h b/libraries/BLE/src/BLERemoteDescriptor.h index be23431a4..94b11f149 100644 --- a/libraries/BLE/src/BLERemoteDescriptor.h +++ b/libraries/BLE/src/BLERemoteDescriptor.h @@ -27,29 +27,26 @@ class BLERemoteCharacteristic; class BLERemoteDescriptor { public: uint16_t getHandle(); - BLERemoteCharacteristic* getRemoteCharacteristic(); + BLERemoteCharacteristic *getRemoteCharacteristic(); BLEUUID getUUID(); String readValue(void); uint8_t readUInt8(void); uint16_t readUInt16(void); uint32_t readUInt32(void); String toString(void); - void writeValue(uint8_t* data, size_t length, bool response = false); + void writeValue(uint8_t *data, size_t length, bool response = false); void writeValue(String newValue, bool response = false); void writeValue(uint8_t newValue, bool response = false); void setAuth(esp_gatt_auth_req_t auth); - void gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t* evtParam); + void gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *evtParam); private: friend class BLERemoteCharacteristic; - BLERemoteDescriptor( - uint16_t handle, - BLEUUID uuid, - BLERemoteCharacteristic* pRemoteCharacteristic); + BLERemoteDescriptor(uint16_t handle, BLEUUID uuid, BLERemoteCharacteristic *pRemoteCharacteristic); uint16_t m_handle; // Server handle of this descriptor. BLEUUID m_uuid; // UUID of this descriptor. String m_value; // Last received value of the descriptor. - BLERemoteCharacteristic* m_pRemoteCharacteristic; // Reference to the Remote characteristic of which this descriptor is associated. + BLERemoteCharacteristic *m_pRemoteCharacteristic; // Reference to the Remote characteristic of which this descriptor is associated. FreeRTOS::Semaphore m_semaphoreReadDescrEvt = FreeRTOS::Semaphore("ReadDescrEvt"); FreeRTOS::Semaphore m_semaphoreWriteDescrEvt = FreeRTOS::Semaphore("WriteDescrEvt"); esp_gatt_auth_req_t m_auth; diff --git a/libraries/BLE/src/BLERemoteService.cpp b/libraries/BLE/src/BLERemoteService.cpp index dfe6f2aca..0ae12e03d 100644 --- a/libraries/BLE/src/BLERemoteService.cpp +++ b/libraries/BLE/src/BLERemoteService.cpp @@ -19,11 +19,7 @@ #pragma GCC diagnostic warning "-Wunused-but-set-parameter" -BLERemoteService::BLERemoteService( - esp_gatt_id_t srvcId, - BLEClient* pClient, - uint16_t startHandle, - uint16_t endHandle) { +BLERemoteService::BLERemoteService(esp_gatt_id_t srvcId, BLEClient *pClient, uint16_t startHandle, uint16_t endHandle) { log_v(">> BLERemoteService()"); m_srvcId = srvcId; @@ -36,7 +32,6 @@ BLERemoteService::BLERemoteService( log_v("<< BLERemoteService()"); } - BLERemoteService::~BLERemoteService() { removeCharacteristics(); } @@ -56,10 +51,7 @@ static bool compareSrvcId(esp_gatt_srvc_id_t id1, esp_gatt_srvc_id_t id2) { /** * @brief Handle GATT Client events */ -void BLERemoteService::gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam) { +void BLERemoteService::gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *evtParam) { switch (event) { // // ESP_GATTC_GET_CHAR_EVT @@ -107,24 +99,22 @@ void BLERemoteService::gattClientEventHandler( break; } // ESP_GATTC_GET_CHAR_EVT */ - default: - break; + default: break; } // switch // Send the event to each of the characteristics owned by this service. - for (auto& myPair : m_characteristicMapByHandle) { + for (auto &myPair : m_characteristicMapByHandle) { myPair.second->gattClientEventHandler(event, gattc_if, evtParam); } } // gattClientEventHandler - /** * @brief Get the remote characteristic object for the characteristic UUID. * @param [in] uuid Remote characteristic uuid. * @return Reference to the remote characteristic object. * @throws BLEUuidNotFoundException */ -BLERemoteCharacteristic* BLERemoteService::getCharacteristic(const char* uuid) { +BLERemoteCharacteristic *BLERemoteService::getCharacteristic(const char *uuid) { return getCharacteristic(BLEUUID(uuid)); } // getCharacteristic @@ -134,7 +124,7 @@ BLERemoteCharacteristic* BLERemoteService::getCharacteristic(const char* uuid) { * @return Reference to the characteristic object. * @throws BLEUuidNotFoundException */ -BLERemoteCharacteristic* BLERemoteService::getCharacteristic(BLEUUID uuid) { +BLERemoteCharacteristic *BLERemoteService::getCharacteristic(BLEUUID uuid) { // Design // ------ // We wish to retrieve the characteristic given its UUID. It is possible that we have not yet asked the @@ -145,7 +135,7 @@ BLERemoteCharacteristic* BLERemoteService::getCharacteristic(BLEUUID uuid) { retrieveCharacteristics(); } String v = uuid.toString(); - for (auto& myPair : m_characteristicMap) { + for (auto &myPair : m_characteristicMap) { if (myPair.first == v) { return myPair.second; } @@ -154,7 +144,6 @@ BLERemoteCharacteristic* BLERemoteService::getCharacteristic(BLEUUID uuid) { return nullptr; } // getCharacteristic - /** * @brief Retrieve all the characteristics for this service. * This function will not return until we have all the characteristics. @@ -169,14 +158,8 @@ void BLERemoteService::retrieveCharacteristics() { esp_gattc_char_elem_t result; while (true) { uint16_t count = 1; // only room for 1 result allocated, so go one by one - esp_gatt_status_t status = ::esp_ble_gattc_get_all_char( - getClient()->getGattcIf(), - getClient()->getConnId(), - m_startHandle, - m_endHandle, - &result, - &count, - offset); + esp_gatt_status_t status = + ::esp_ble_gattc_get_all_char(getClient()->getGattcIf(), getClient()->getConnId(), m_startHandle, m_endHandle, &result, &count, offset); if (status == ESP_GATT_INVALID_OFFSET) { // We have reached the end of the entries. break; @@ -194,27 +177,22 @@ void BLERemoteService::retrieveCharacteristics() { log_d("Found a characteristic: Handle: %d, UUID: %s", result.char_handle, BLEUUID(result.uuid).toString().c_str()); // We now have a new characteristic ... let us add that to our set of known characteristics - BLERemoteCharacteristic* pNewRemoteCharacteristic = new BLERemoteCharacteristic( - result.char_handle, - BLEUUID(result.uuid), - result.properties, - this); + BLERemoteCharacteristic *pNewRemoteCharacteristic = new BLERemoteCharacteristic(result.char_handle, BLEUUID(result.uuid), result.properties, this); - m_characteristicMap.insert(std::pair(pNewRemoteCharacteristic->getUUID().toString(), pNewRemoteCharacteristic)); - m_characteristicMapByHandle.insert(std::pair(result.char_handle, pNewRemoteCharacteristic)); + m_characteristicMap.insert(std::pair(pNewRemoteCharacteristic->getUUID().toString(), pNewRemoteCharacteristic)); + m_characteristicMapByHandle.insert(std::pair(result.char_handle, pNewRemoteCharacteristic)); offset++; // Increment our count of number of descriptors found. - } // Loop forever (until we break inside the loop). + } // Loop forever (until we break inside the loop). m_haveCharacteristics = true; // Remember that we have received the characteristics. log_v("<< getCharacteristics()"); } // getCharacteristics - /** * @brief Retrieve a map of all the characteristics of this service. * @return A map of all the characteristics of this service. */ -std::map* BLERemoteService::getCharacteristics() { +std::map *BLERemoteService::getCharacteristics() { log_v(">> getCharacteristics() for service: %s", getUUID().toString().c_str()); // If is possible that we have not read the characteristics associated with the service so do that // now. The request to retrieve the characteristics by calling "retrieveCharacteristics" is a blocking @@ -230,7 +208,7 @@ std::map* BLERemoteService::getCharacteristics * @brief Retrieve a map of all the characteristics of this service. * @return A map of all the characteristics of this service. */ -std::map* BLERemoteService::getCharacteristicsByHandle() { +std::map *BLERemoteService::getCharacteristicsByHandle() { // If is possible that we have not read the characteristics associated with the service so do that // now. The request to retrieve the characteristics by calling "retrieveCharacteristics" is a blocking // call and does not return until all the characteristics are available. @@ -243,7 +221,7 @@ std::map* BLERemoteService::getCharacteristi /** * @brief This function is designed to get characteristics map when we have multiple characteristics with the same UUID */ -void BLERemoteService::getCharacteristics(std::map** pCharacteristicMap) { +void BLERemoteService::getCharacteristics(std::map **pCharacteristicMap) { log_v(">> getCharacteristics() for service: %s", getUUID().toString().c_str()); (void)pCharacteristicMap; // If is possible that we have not read the characteristics associated with the service so do that @@ -260,33 +238,28 @@ void BLERemoteService::getCharacteristics(std::map> getHandle: service: %s", getUUID().toString().c_str()); log_v("<< getHandle: %d 0x%.2x", getStartHandle(), getStartHandle()); return getStartHandle(); } // getHandle - BLEUUID BLERemoteService::getUUID() { return m_uuid; } @@ -301,8 +274,6 @@ String BLERemoteService::getValue(BLEUUID characteristicUuid) { return ret; } // readValue - - /** * @brief Delete the characteristics in the characteristics map. * We maintain a map called m_characteristicsMap that contains pointers to BLERemoteCharacteristic @@ -312,14 +283,13 @@ String BLERemoteService::getValue(BLEUUID characteristicUuid) { */ void BLERemoteService::removeCharacteristics() { m_characteristicMap.clear(); // Clear the map - for (auto& myPair : m_characteristicMapByHandle) { + for (auto &myPair : m_characteristicMapByHandle) { delete myPair.second; // delete the characteristics only once } m_characteristicMapByHandle.clear(); // Clear the map } // removeCharacteristics - /** * @brief Set the value of a characteristic. * @param [in] characteristicUuid The characteristic to set. @@ -332,7 +302,6 @@ void BLERemoteService::setValue(BLEUUID characteristicUuid, String value) { log_v("<< setValue"); } // setValue - /** * @brief Create a string representation of this remote service. * @return A string representation of this remote service. @@ -352,13 +321,12 @@ String BLERemoteService::toString() { snprintf(val, sizeof(val), "%04x", m_endHandle); res += " 0x"; res += val; - for (auto& myPair : m_characteristicMap) { + for (auto &myPair : m_characteristicMap) { res += "\n" + myPair.second->toString(); // myPair.second is the value } return res; } // toString - #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ diff --git a/libraries/BLE/src/BLERemoteService.h b/libraries/BLE/src/BLERemoteService.h index dd55b0a03..0dbd68230 100644 --- a/libraries/BLE/src/BLERemoteService.h +++ b/libraries/BLE/src/BLERemoteService.h @@ -23,7 +23,6 @@ class BLEClient; class BLERemoteCharacteristic; - /** * @brief A model of a remote %BLE service. */ @@ -32,14 +31,14 @@ public: virtual ~BLERemoteService(); // Public methods - BLERemoteCharacteristic* getCharacteristic(const char* uuid); // Get the specified characteristic reference. - BLERemoteCharacteristic* getCharacteristic(BLEUUID uuid); // Get the specified characteristic reference. - BLERemoteCharacteristic* getCharacteristic(uint16_t uuid); // Get the specified characteristic reference. - std::map* getCharacteristics(); - std::map* getCharacteristicsByHandle(); // Get the characteristics map. - void getCharacteristics(std::map** pCharacteristicMap); + BLERemoteCharacteristic *getCharacteristic(const char *uuid); // Get the specified characteristic reference. + BLERemoteCharacteristic *getCharacteristic(BLEUUID uuid); // Get the specified characteristic reference. + BLERemoteCharacteristic *getCharacteristic(uint16_t uuid); // Get the specified characteristic reference. + std::map *getCharacteristics(); + std::map *getCharacteristicsByHandle(); // Get the characteristics map. + void getCharacteristics(std::map **pCharacteristicMap); - BLEClient* getClient(void); // Get a reference to the client associated with this service. + BLEClient *getClient(void); // Get a reference to the client associated with this service. uint16_t getHandle(); // Get the handle of this service. BLEUUID getUUID(void); // Get the UUID of this service. String getValue(BLEUUID characteristicUuid); // Get the value of a characteristic. @@ -48,7 +47,7 @@ public: private: // Private constructor ... never meant to be created by a user application. - BLERemoteService(esp_gatt_id_t srvcId, BLEClient* pClient, uint16_t startHandle, uint16_t endHandle); + BLERemoteService(esp_gatt_id_t srvcId, BLEClient *pClient, uint16_t startHandle, uint16_t endHandle); // Friends friend class BLEClient; @@ -56,33 +55,30 @@ private: // Private methods void retrieveCharacteristics(void); // Retrieve the characteristics from the BLE Server. - esp_gatt_id_t* getSrvcId(void); + esp_gatt_id_t *getSrvcId(void); uint16_t getStartHandle(); // Get the start handle for this service. uint16_t getEndHandle(); // Get the end handle for this service. - void gattClientEventHandler( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam); + void gattClientEventHandler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *evtParam); void removeCharacteristics(); // Properties // We maintain a map of characteristics owned by this service keyed by a string representation of the UUID. - std::map m_characteristicMap; + std::map m_characteristicMap; // We maintain a map of characteristics owned by this service keyed by a handle. - std::map m_characteristicMapByHandle; + std::map m_characteristicMapByHandle; bool m_haveCharacteristics; // Have we previously obtained the characteristics. - BLEClient* m_pClient; + BLEClient *m_pClient; FreeRTOS::Semaphore m_semaphoreGetCharEvt = FreeRTOS::Semaphore("GetCharEvt"); esp_gatt_id_t m_srvcId; BLEUUID m_uuid; // The UUID of this service. uint16_t m_startHandle; // The starting handle of this service. uint16_t m_endHandle; // The ending handle of this service. -}; // BLERemoteService +}; // BLERemoteService #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ diff --git a/libraries/BLE/src/BLEScan.cpp b/libraries/BLE/src/BLEScan.cpp index 1ba0f3a05..689ce557f 100644 --- a/libraries/BLE/src/BLEScan.cpp +++ b/libraries/BLE/src/BLEScan.cpp @@ -40,15 +40,12 @@ BLEScan::BLEScan() { setWindow(100); } // BLEScan - /** * @brief Handle GAP events related to scans. * @param [in] event The event type for this event. * @param [in] param Parameter data for this event. */ -void BLEScan::handleGAPEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param) { +void BLEScan::handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { switch (event) { @@ -66,117 +63,119 @@ void BLEScan::handleGAPEvent( // uint8_t adv_data_len // uint8_t scan_rsp_len case ESP_GAP_BLE_SCAN_RESULT_EVT: - { + { - switch (param->scan_rst.search_evt) { - // - // ESP_GAP_SEARCH_INQ_CMPL_EVT - // - // Event that indicates that the duration allowed for the search has completed or that we have been - // asked to stop. - case ESP_GAP_SEARCH_INQ_CMPL_EVT: - { - log_w("ESP_GAP_SEARCH_INQ_CMPL_EVT"); - m_stopped = true; - m_semaphoreScanEnd.give(); - if (m_scanCompleteCB != nullptr) { - m_scanCompleteCB(m_scanResults); - } - break; - } // ESP_GAP_SEARCH_INQ_CMPL_EVT + switch (param->scan_rst.search_evt) { + // + // ESP_GAP_SEARCH_INQ_CMPL_EVT + // + // Event that indicates that the duration allowed for the search has completed or that we have been + // asked to stop. + case ESP_GAP_SEARCH_INQ_CMPL_EVT: + { + log_w("ESP_GAP_SEARCH_INQ_CMPL_EVT"); + m_stopped = true; + m_semaphoreScanEnd.give(); + if (m_scanCompleteCB != nullptr) { + m_scanCompleteCB(m_scanResults); + } + break; + } // ESP_GAP_SEARCH_INQ_CMPL_EVT - // - // ESP_GAP_SEARCH_INQ_RES_EVT - // - // Result that has arrived back from a Scan inquiry. - case ESP_GAP_SEARCH_INQ_RES_EVT: - { - if (m_stopped) { // If we are not scanning, nothing to do with the extra results. - break; - } + // + // ESP_GAP_SEARCH_INQ_RES_EVT + // + // Result that has arrived back from a Scan inquiry. + case ESP_GAP_SEARCH_INQ_RES_EVT: + { + if (m_stopped) { // If we are not scanning, nothing to do with the extra results. + break; + } - // Examine our list of previously scanned addresses and, if we found this one already, - // ignore it. - BLEAddress advertisedAddress(param->scan_rst.bda); - bool found = false; - bool shouldDelete = true; + // Examine our list of previously scanned addresses and, if we found this one already, + // ignore it. + BLEAddress advertisedAddress(param->scan_rst.bda); + bool found = false; + bool shouldDelete = true; - if (!m_wantDuplicates) { - if (m_scanResults.m_vectorAdvertisedDevices.count(advertisedAddress.toString()) != 0) { - found = true; - } + if (!m_wantDuplicates) { + if (m_scanResults.m_vectorAdvertisedDevices.count(advertisedAddress.toString()) != 0) { + found = true; + } - if (found) { // If we found a previous entry AND we don't want duplicates, then we are done. - log_d("Ignoring %s, already seen it.", advertisedAddress.toString().c_str()); - vTaskDelay(1); // <--- allow to switch task in case we scan infinity and dont have new devices to report, or we are blocked here - break; - } - } - - // We now construct a model of the advertised device that we have just found for the first - // time. - // ESP_LOG_BUFFER_HEXDUMP((uint8_t*)param->scan_rst.ble_adv, param->scan_rst.adv_data_len + param->scan_rst.scan_rsp_len, ESP_LOG_DEBUG); - // log_w("bytes length: %d + %d, addr type: %d", param->scan_rst.adv_data_len, param->scan_rst.scan_rsp_len, param->scan_rst.ble_addr_type); - BLEAdvertisedDevice* advertisedDevice = new BLEAdvertisedDevice(); - advertisedDevice->setAddress(advertisedAddress); - advertisedDevice->setRSSI(param->scan_rst.rssi); - advertisedDevice->setAdFlag(param->scan_rst.flag); - if (m_shouldParse) { - advertisedDevice->parseAdvertisement((uint8_t*)param->scan_rst.ble_adv, param->scan_rst.adv_data_len + param->scan_rst.scan_rsp_len); - } else { - advertisedDevice->setPayload((uint8_t*)param->scan_rst.ble_adv, param->scan_rst.adv_data_len + param->scan_rst.scan_rsp_len); - } - advertisedDevice->setScan(this); - advertisedDevice->setAddressType(param->scan_rst.ble_addr_type); - - if (m_pAdvertisedDeviceCallbacks) { // if has callback, no need to record to vector - m_pAdvertisedDeviceCallbacks->onResult(*advertisedDevice); - } - if (!m_wantDuplicates && !found) { // if no callback and not want duplicate, and not already in vector, record it - m_scanResults.m_vectorAdvertisedDevices.insert(std::pair(advertisedAddress.toString(), advertisedDevice)); - shouldDelete = false; - } - if (shouldDelete) { - delete advertisedDevice; - } - - break; - } // ESP_GAP_SEARCH_INQ_RES_EVT - - default: - { + if (found) { // If we found a previous entry AND we don't want duplicates, then we are done. + log_d("Ignoring %s, already seen it.", advertisedAddress.toString().c_str()); + vTaskDelay(1); // <--- allow to switch task in case we scan infinity and dont have new devices to report, or we are blocked here break; } - } // switch - search_evt + } + // We now construct a model of the advertised device that we have just found for the first + // time. + // ESP_LOG_BUFFER_HEXDUMP((uint8_t*)param->scan_rst.ble_adv, param->scan_rst.adv_data_len + param->scan_rst.scan_rsp_len, ESP_LOG_DEBUG); + // log_w("bytes length: %d + %d, addr type: %d", param->scan_rst.adv_data_len, param->scan_rst.scan_rsp_len, param->scan_rst.ble_addr_type); + BLEAdvertisedDevice *advertisedDevice = new BLEAdvertisedDevice(); + advertisedDevice->setAddress(advertisedAddress); + advertisedDevice->setRSSI(param->scan_rst.rssi); + advertisedDevice->setAdFlag(param->scan_rst.flag); + if (m_shouldParse) { + advertisedDevice->parseAdvertisement((uint8_t *)param->scan_rst.ble_adv, param->scan_rst.adv_data_len + param->scan_rst.scan_rsp_len); + } else { + advertisedDevice->setPayload((uint8_t *)param->scan_rst.ble_adv, param->scan_rst.adv_data_len + param->scan_rst.scan_rsp_len); + } + advertisedDevice->setScan(this); + advertisedDevice->setAddressType(param->scan_rst.ble_addr_type); - break; - } // ESP_GAP_BLE_SCAN_RESULT_EVT -#ifdef SOC_BLE_50_SUPPORTED - case ESP_GAP_BLE_EXT_ADV_REPORT_EVT: - { - if (param->ext_adv_report.params.event_type & ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY) { - log_v("legacy adv, adv type 0x%x data len %d", param->ext_adv_report.params.event_type, param->ext_adv_report.params.adv_data_len); - } else { - log_v("extend adv, adv type 0x%x data len %d, data status: %d", param->ext_adv_report.params.event_type, param->ext_adv_report.params.adv_data_len, param->ext_adv_report.params.data_status); - } + if (m_pAdvertisedDeviceCallbacks) { // if has callback, no need to record to vector + m_pAdvertisedDeviceCallbacks->onResult(*advertisedDevice); + } + if (!m_wantDuplicates && !found) { // if no callback and not want duplicate, and not already in vector, record it + m_scanResults.m_vectorAdvertisedDevices.insert(std::pair(advertisedAddress.toString(), advertisedDevice)); + shouldDelete = false; + } + if (shouldDelete) { + delete advertisedDevice; + } - if (m_pExtendedScanCb != nullptr) { - m_pExtendedScanCb->onResult(param->ext_adv_report.params); - } + break; + } // ESP_GAP_SEARCH_INQ_RES_EVT - break; - } - - case ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT: - { - if (param->set_ext_scan_params.status != ESP_BT_STATUS_SUCCESS) { - log_e("extend scan parameters set failed, error status = %x", param->set_ext_scan_params.status); + default: + { break; } - log_v("extend scan params set successfully"); + } // switch - search_evt + + break; + } // ESP_GAP_BLE_SCAN_RESULT_EVT +#ifdef SOC_BLE_50_SUPPORTED + case ESP_GAP_BLE_EXT_ADV_REPORT_EVT: + { + if (param->ext_adv_report.params.event_type & ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY) { + log_v("legacy adv, adv type 0x%x data len %d", param->ext_adv_report.params.event_type, param->ext_adv_report.params.adv_data_len); + } else { + log_v( + "extend adv, adv type 0x%x data len %d, data status: %d", param->ext_adv_report.params.event_type, param->ext_adv_report.params.adv_data_len, + param->ext_adv_report.params.data_status + ); + } + + if (m_pExtendedScanCb != nullptr) { + m_pExtendedScanCb->onResult(param->ext_adv_report.params); + } + + break; + } + + case ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT: + { + if (param->set_ext_scan_params.status != ESP_BT_STATUS_SUCCESS) { + log_e("extend scan parameters set failed, error status = %x", param->set_ext_scan_params.status); break; } + log_v("extend scan params set successfully"); + break; + } case ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT: if (param->ext_scan_start.status != ESP_BT_STATUS_SUCCESS) { @@ -225,7 +224,7 @@ void BLEScan::handleGAPEvent( break; case ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT: if (m_pPeriodicScanCb != nullptr) { - m_pPeriodicScanCb->onSync(*(esp_ble_periodic_adv_sync_estab_param_t*)¶m->periodic_adv_sync_estab); + m_pPeriodicScanCb->onSync(*(esp_ble_periodic_adv_sync_estab_param_t *)¶m->periodic_adv_sync_estab); } log_v("ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, status %d", param->periodic_adv_sync_estab.status); break; @@ -239,13 +238,12 @@ void BLEScan::handleGAPEvent( #endif // SOC_BLE_50_SUPPORTED default: - { - break; - } // default - } // End switch + { + break; + } // default + } // End switch } // gapEventHandler - /** * @brief Should we perform an active or passive scan? * The default is a passive scan. An active scan means that we will wish a scan response. @@ -260,14 +258,13 @@ void BLEScan::setActiveScan(bool active) { } } // setActiveScan - /** * @brief Set the call backs to be invoked. * @param [in] pAdvertisedDeviceCallbacks Call backs to be invoked. * @param [in] wantDuplicates True if we wish to be called back with duplicates. Default is false. * @param [in] shouldParse True if we wish to parse advertised package or raw payload. Default is true. */ -void BLEScan::setAdvertisedDeviceCallbacks(BLEAdvertisedDeviceCallbacks* pAdvertisedDeviceCallbacks, bool wantDuplicates, bool shouldParse) { +void BLEScan::setAdvertisedDeviceCallbacks(BLEAdvertisedDeviceCallbacks *pAdvertisedDeviceCallbacks, bool wantDuplicates, bool shouldParse) { m_wantDuplicates = wantDuplicates; m_pAdvertisedDeviceCallbacks = pAdvertisedDeviceCallbacks; m_shouldParse = shouldParse; @@ -275,7 +272,7 @@ void BLEScan::setAdvertisedDeviceCallbacks(BLEAdvertisedDeviceCallbacks* pAdvert #ifdef SOC_BLE_50_SUPPORTED -void BLEScan::setExtendedScanCallback(BLEExtAdvertisingCallbacks* cb) { +void BLEScan::setExtendedScanCallback(BLEExtAdvertisingCallbacks *cb) { m_pExtendedScanCb = cb; } @@ -293,8 +290,8 @@ esp_err_t BLEScan::setExtScanParams() { .filter_policy = BLE_SCAN_FILTER_ALLOW_ALL, .scan_duplicate = BLE_SCAN_DUPLICATE_DISABLE, .cfg_mask = ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK | ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK, - .uncoded_cfg = { BLE_SCAN_TYPE_ACTIVE, 40, 40 }, - .coded_cfg = { BLE_SCAN_TYPE_ACTIVE, 40, 40 }, + .uncoded_cfg = {BLE_SCAN_TYPE_ACTIVE, 40, 40}, + .coded_cfg = {BLE_SCAN_TYPE_ACTIVE, 40, 40}, }; esp_err_t rc = esp_ble_gap_set_ext_scan_params(&ext_scan_params); @@ -313,7 +310,7 @@ esp_err_t BLEScan::setExtScanParams() { * - other : failed * */ -esp_err_t BLEScan::setExtScanParams(esp_ble_ext_scan_params_t* ext_scan_params) { +esp_err_t BLEScan::setExtScanParams(esp_ble_ext_scan_params_t *ext_scan_params) { esp_err_t rc = esp_ble_gap_set_ext_scan_params(ext_scan_params); if (rc) { log_e("set extend scan params error, error code = %x", rc); @@ -333,11 +330,12 @@ esp_err_t BLEScan::setExtScanParams(esp_ble_ext_scan_params_t* ext_scan_params) */ esp_err_t BLEScan::startExtScan(uint32_t duration, uint16_t period) { esp_err_t rc = esp_ble_gap_start_ext_scan(duration, period); - if (rc) log_e("extended scan start failed: %d", rc); + if (rc) { + log_e("extended scan start failed: %d", rc); + } return rc; } - esp_err_t BLEScan::stopExtScan() { esp_err_t rc; rc = esp_ble_gap_stop_ext_scan(); @@ -345,7 +343,7 @@ esp_err_t BLEScan::stopExtScan() { return rc; } -void BLEScan::setPeriodicScanCallback(BLEPeriodicScanCallbacks* cb) { +void BLEScan::setPeriodicScanCallback(BLEPeriodicScanCallbacks *cb) { m_pPeriodicScanCb = cb; } @@ -358,7 +356,6 @@ void BLEScan::setInterval(uint16_t intervalMSecs) { m_scan_params.scan_interval = intervalMSecs / 0.625; } // setInterval - /** * @brief Set the window to actively scan. * @param [in] windowMSecs How long to actively scan. @@ -367,7 +364,6 @@ void BLEScan::setWindow(uint16_t windowMSecs) { m_scan_params.scan_window = windowMSecs / 0.625; } // setWindow - /** * @brief Start scanning. * @param [in] duration The duration in seconds for which to scan. @@ -412,20 +408,18 @@ bool BLEScan::start(uint32_t duration, void (*scanCompleteCB)(BLEScanResults), b return true; } // start - /** * @brief Start scanning and block until scanning has been completed. * @param [in] duration The duration in seconds for which to scan. * @return The BLEScanResults. */ -BLEScanResults* BLEScan::start(uint32_t duration, bool is_continue) { +BLEScanResults *BLEScan::start(uint32_t duration, bool is_continue) { if (start(duration, nullptr, is_continue)) { m_semaphoreScanEnd.wait("start"); // Wait for the semaphore to release. } return &m_scanResults; } // start - /** * @brief Stop an in progress scan. * @return N/A. @@ -449,12 +443,11 @@ void BLEScan::stop() { // delete peer device from cache after disconnecting, it is required in case we are connecting to devices with not public address void BLEScan::erase(BLEAddress address) { log_i("erase device: %s", address.toString().c_str()); - BLEAdvertisedDevice* advertisedDevice = m_scanResults.m_vectorAdvertisedDevices.find(address.toString())->second; + BLEAdvertisedDevice *advertisedDevice = m_scanResults.m_vectorAdvertisedDevices.find(address.toString())->second; m_scanResults.m_vectorAdvertisedDevices.erase(address.toString()); delete advertisedDevice; } - /** * @brief Dump the scan results to the log. */ @@ -465,7 +458,6 @@ void BLEScanResults::dump() { } } // dump - /** * @brief Return the count of devices found in the last scan. * @return The number of devices found in the last scan. @@ -474,7 +466,6 @@ int BLEScanResults::getCount() { return m_vectorAdvertisedDevices.size(); } // getCount - /** * @brief Return the specified device at the given index. * The index should be between 0 and getCount()-1. @@ -486,13 +477,15 @@ BLEAdvertisedDevice BLEScanResults::getDevice(uint32_t i) { BLEAdvertisedDevice dev = *m_vectorAdvertisedDevices.begin()->second; for (auto it = m_vectorAdvertisedDevices.begin(); it != m_vectorAdvertisedDevices.end(); it++) { dev = *it->second; - if (x == i) break; + if (x == i) { + break; + } x++; } return dev; } -BLEScanResults* BLEScan::getResults() { +BLEScanResults *BLEScan::getResults() { return &m_scanResults; } diff --git a/libraries/BLE/src/BLEScan.h b/libraries/BLE/src/BLEScan.h index 2620909cb..1c2c0f406 100644 --- a/libraries/BLE/src/BLEScan.h +++ b/libraries/BLE/src/BLEScan.h @@ -53,7 +53,7 @@ public: private: friend BLEScan; - std::map m_vectorAdvertisedDevices; + std::map m_vectorAdvertisedDevices; }; /** @@ -64,42 +64,37 @@ private: class BLEScan { public: void setActiveScan(bool active); - void setAdvertisedDeviceCallbacks( - BLEAdvertisedDeviceCallbacks* pAdvertisedDeviceCallbacks, - bool wantDuplicates = false, - bool shouldParse = true); + void setAdvertisedDeviceCallbacks(BLEAdvertisedDeviceCallbacks *pAdvertisedDeviceCallbacks, bool wantDuplicates = false, bool shouldParse = true); void setInterval(uint16_t intervalMSecs); void setWindow(uint16_t windowMSecs); bool start(uint32_t duration, void (*scanCompleteCB)(BLEScanResults), bool is_continue = false); - BLEScanResults* start(uint32_t duration, bool is_continue = false); + BLEScanResults *start(uint32_t duration, bool is_continue = false); void stop(); void erase(BLEAddress address); - BLEScanResults* getResults(); + BLEScanResults *getResults(); void clearResults(); #ifdef SOC_BLE_50_SUPPORTED - void setExtendedScanCallback(BLEExtAdvertisingCallbacks* cb); - void setPeriodicScanCallback(BLEPeriodicScanCallbacks* cb); + void setExtendedScanCallback(BLEExtAdvertisingCallbacks *cb); + void setPeriodicScanCallback(BLEPeriodicScanCallbacks *cb); esp_err_t stopExtScan(); esp_err_t setExtScanParams(); - esp_err_t setExtScanParams(esp_ble_ext_scan_params_t* ext_scan_params); + esp_err_t setExtScanParams(esp_ble_ext_scan_params_t *ext_scan_params); esp_err_t startExtScan(uint32_t duration, uint16_t period); + private: - BLEExtAdvertisingCallbacks* m_pExtendedScanCb = nullptr; - BLEPeriodicScanCallbacks* m_pPeriodicScanCb = nullptr; + BLEExtAdvertisingCallbacks *m_pExtendedScanCb = nullptr; + BLEPeriodicScanCallbacks *m_pPeriodicScanCb = nullptr; #endif // SOC_BLE_50_SUPPORTED private: BLEScan(); // One doesn't create a new instance instead one asks the BLEDevice for the singleton. friend class BLEDevice; - void handleGAPEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param); - + void handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param); esp_ble_scan_params_t m_scan_params; - BLEAdvertisedDeviceCallbacks* m_pAdvertisedDeviceCallbacks = nullptr; + BLEAdvertisedDeviceCallbacks *m_pAdvertisedDeviceCallbacks = nullptr; bool m_stopped = true; bool m_shouldParse = true; FreeRTOS::Semaphore m_semaphoreScanEnd = FreeRTOS::Semaphore("ScanEnd"); diff --git a/libraries/BLE/src/BLESecurity.cpp b/libraries/BLE/src/BLESecurity.cpp index 37f72ffa0..34fc3e69e 100644 --- a/libraries/BLE/src/BLESecurity.cpp +++ b/libraries/BLE/src/BLESecurity.cpp @@ -12,11 +12,9 @@ #include "sdkconfig.h" #if defined(CONFIG_BLUEDROID_ENABLED) -BLESecurity::BLESecurity() { -} +BLESecurity::BLESecurity() {} -BLESecurity::~BLESecurity() { -} +BLESecurity::~BLESecurity() {} /* * @brief Set requested authentication mode */ @@ -34,7 +32,6 @@ void BLESecurity::setCapability(esp_ble_io_cap_t iocap) { esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &iocap, sizeof(uint8_t)); } // setCapability - /** * @brief Init encryption key by server * @param key_size is value between 7 and 16 @@ -44,7 +41,6 @@ void BLESecurity::setInitEncryptionKey(uint8_t init_key) { esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &m_initKey, sizeof(uint8_t)); } // setInitEncryptionKey - /** * @brief Init encryption key by client * @param key_size is value between 7 and 16 @@ -54,7 +50,6 @@ void BLESecurity::setRespEncryptionKey(uint8_t resp_key) { esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &m_respKey, sizeof(uint8_t)); } // setRespEncryptionKey - /** * * @@ -79,39 +74,19 @@ void BLESecurity::setStaticPIN(uint32_t pin) { /** * @brief Debug function to display what keys are exchanged by peers */ -char* BLESecurity::esp_key_type_to_str(esp_ble_key_type_t key_type) { - char* key_str = nullptr; +char *BLESecurity::esp_key_type_to_str(esp_ble_key_type_t key_type) { + char *key_str = nullptr; switch (key_type) { - case ESP_LE_KEY_NONE: - key_str = (char*)"ESP_LE_KEY_NONE"; - break; - case ESP_LE_KEY_PENC: - key_str = (char*)"ESP_LE_KEY_PENC"; - break; - case ESP_LE_KEY_PID: - key_str = (char*)"ESP_LE_KEY_PID"; - break; - case ESP_LE_KEY_PCSRK: - key_str = (char*)"ESP_LE_KEY_PCSRK"; - break; - case ESP_LE_KEY_PLK: - key_str = (char*)"ESP_LE_KEY_PLK"; - break; - case ESP_LE_KEY_LLK: - key_str = (char*)"ESP_LE_KEY_LLK"; - break; - case ESP_LE_KEY_LENC: - key_str = (char*)"ESP_LE_KEY_LENC"; - break; - case ESP_LE_KEY_LID: - key_str = (char*)"ESP_LE_KEY_LID"; - break; - case ESP_LE_KEY_LCSRK: - key_str = (char*)"ESP_LE_KEY_LCSRK"; - break; - default: - key_str = (char*)"INVALID BLE KEY TYPE"; - break; + case ESP_LE_KEY_NONE: key_str = (char *)"ESP_LE_KEY_NONE"; break; + case ESP_LE_KEY_PENC: key_str = (char *)"ESP_LE_KEY_PENC"; break; + case ESP_LE_KEY_PID: key_str = (char *)"ESP_LE_KEY_PID"; break; + case ESP_LE_KEY_PCSRK: key_str = (char *)"ESP_LE_KEY_PCSRK"; break; + case ESP_LE_KEY_PLK: key_str = (char *)"ESP_LE_KEY_PLK"; break; + case ESP_LE_KEY_LLK: key_str = (char *)"ESP_LE_KEY_LLK"; break; + case ESP_LE_KEY_LENC: key_str = (char *)"ESP_LE_KEY_LENC"; break; + case ESP_LE_KEY_LID: key_str = (char *)"ESP_LE_KEY_LID"; break; + case ESP_LE_KEY_LCSRK: key_str = (char *)"ESP_LE_KEY_LCSRK"; break; + default: key_str = (char *)"INVALID BLE KEY TYPE"; break; } return key_str; } // esp_key_type_to_str diff --git a/libraries/BLE/src/BLESecurity.h b/libraries/BLE/src/BLESecurity.h index 9b555c64e..2e3a44b42 100644 --- a/libraries/BLE/src/BLESecurity.h +++ b/libraries/BLE/src/BLESecurity.h @@ -25,7 +25,7 @@ public: void setRespEncryptionKey(uint8_t resp_key); void setKeySize(uint8_t key_size = 16); void setStaticPIN(uint32_t pin); - static char* esp_key_type_to_str(esp_ble_key_type_t key_type); + static char *esp_key_type_to_str(esp_ble_key_type_t key_type); private: esp_ble_auth_req_t m_authReq; @@ -36,7 +36,6 @@ private: }; // BLESecurity - /* * @brief Callbacks to handle GAP events related to authorization */ diff --git a/libraries/BLE/src/BLEServer.cpp b/libraries/BLE/src/BLEServer.cpp index 8324a60cc..a338cf614 100644 --- a/libraries/BLE/src/BLEServer.cpp +++ b/libraries/BLE/src/BLEServer.cpp @@ -35,13 +35,11 @@ BLEServer::BLEServer() { m_pServerCallbacks = nullptr; } // BLEServer - void BLEServer::createApp(uint16_t appId) { m_appId = appId; registerApp(appId); } // createApp - /** * @brief Create a %BLE Service. * @@ -50,11 +48,10 @@ void BLEServer::createApp(uint16_t appId) { * @param [in] uuid The UUID of the new service. * @return A reference to the new service object. */ -BLEService* BLEServer::createService(const char* uuid) { +BLEService *BLEServer::createService(const char *uuid) { return createService(BLEUUID(uuid)); } - /** * @brief Create a %BLE Service. * @@ -65,17 +62,16 @@ BLEService* BLEServer::createService(const char* uuid) { * @param [in] inst_id With multiple services with the same UUID we need to provide inst_id value different for each service. * @return A reference to the new service object. */ -BLEService* BLEServer::createService(BLEUUID uuid, uint32_t numHandles, uint8_t inst_id) { +BLEService *BLEServer::createService(BLEUUID uuid, uint32_t numHandles, uint8_t inst_id) { log_v(">> createService - %s", uuid.toString().c_str()); m_semaphoreCreateEvt.take("createService"); // Check that a service with the supplied UUID does not already exist. if (m_serviceMap.getByUUID(uuid) != nullptr) { - log_w("<< Attempt to create a new service with uuid %s but a service with that UUID already exists.", - uuid.toString().c_str()); + log_w("<< Attempt to create a new service with uuid %s but a service with that UUID already exists.", uuid.toString().c_str()); } - BLEService* pService = new BLEService(uuid, numHandles); + BLEService *pService = new BLEService(uuid, numHandles); pService->m_instId = inst_id; m_serviceMap.setByUUID(uuid, pService); // Save a reference to this service being on this server. pService->executeCreate(this); // Perform the API calls to actually create the service. @@ -86,13 +82,12 @@ BLEService* BLEServer::createService(BLEUUID uuid, uint32_t numHandles, uint8_t return pService; } // createService - /** * @brief Get a %BLE Service by its UUID * @param [in] uuid The UUID of the new service. * @return A reference to the service object. */ -BLEService* BLEServer::getServiceByUUID(const char* uuid) { +BLEService *BLEServer::getServiceByUUID(const char *uuid) { return m_serviceMap.getByUUID(uuid); } @@ -101,7 +96,7 @@ BLEService* BLEServer::getServiceByUUID(const char* uuid) { * @param [in] uuid The UUID of the new service. * @return A reference to the service object. */ -BLEService* BLEServer::getServiceByUUID(BLEUUID uuid) { +BLEService *BLEServer::getServiceByUUID(BLEUUID uuid) { return m_serviceMap.getByUUID(uuid); } @@ -110,7 +105,7 @@ BLEService* BLEServer::getServiceByUUID(BLEUUID uuid) { * * @return An advertising object. */ -BLEAdvertising* BLEServer::getAdvertising() { +BLEAdvertising *BLEServer::getAdvertising() { return BLEDevice::getAdvertising(); } @@ -118,7 +113,6 @@ uint16_t BLEServer::getConnId() { return m_connId; } - /** * @brief Return the number of connected clients. * @return The number of connected clients. @@ -127,12 +121,10 @@ uint32_t BLEServer::getConnectedCount() { return m_connectedCount; } // getConnectedCount - uint16_t BLEServer::getGattsIf() { return m_gatts_if; } - /** * @brief Handle a GATT Server Event. * @@ -141,9 +133,8 @@ uint16_t BLEServer::getGattsIf() { * @param [in] param * */ -void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param) { - log_v(">> handleGATTServerEvent: %s", - BLEUtils::gattServerEventTypeToString(event).c_str()); +void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) { + log_v(">> handleGATTServerEvent: %s", BLEUtils::gattServerEventTypeToString(event).c_str()); switch (event) { // ESP_GATTS_ADD_CHAR_EVT - Indicate that a characteristic was added to the service. @@ -154,9 +145,9 @@ void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // - esp_bt_uuid_t char_uuid // case ESP_GATTS_ADD_CHAR_EVT: - { - break; - } // ESP_GATTS_ADD_CHAR_EVT + { + break; + } // ESP_GATTS_ADD_CHAR_EVT case ESP_GATTS_MTU_EVT: updatePeerMTU(param->mtu.conn_id, param->mtu.mtu); @@ -171,17 +162,16 @@ void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // - esp_bd_addr_t remote_bda // case ESP_GATTS_CONNECT_EVT: - { - m_connId = param->connect.conn_id; - addPeerDevice((void*)this, false, m_connId); - if (m_pServerCallbacks != nullptr) { - m_pServerCallbacks->onConnect(this); - m_pServerCallbacks->onConnect(this, param); - } - m_connectedCount++; // Increment the number of connected devices count. - break; - } // ESP_GATTS_CONNECT_EVT - + { + m_connId = param->connect.conn_id; + addPeerDevice((void *)this, false, m_connId); + if (m_pServerCallbacks != nullptr) { + m_pServerCallbacks->onConnect(this); + m_pServerCallbacks->onConnect(this, param); + } + m_connectedCount++; // Increment the number of connected devices count. + break; + } // ESP_GATTS_CONNECT_EVT // ESP_GATTS_CREATE_EVT // Called when a new service is registered as having been created. @@ -192,13 +182,14 @@ void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // * esp_gatt_srvc_id_t service_id // case ESP_GATTS_CREATE_EVT: - { - BLEService* pService = m_serviceMap.getByUUID(param->create.service_id.id.uuid, param->create.service_id.id.inst_id); // <--- very big bug for multi services with the same uuid - m_serviceMap.setByHandle(param->create.service_handle, pService); - m_semaphoreCreateEvt.give(); - break; - } // ESP_GATTS_CREATE_EVT - + { + BLEService *pService = m_serviceMap.getByUUID( + param->create.service_id.id.uuid, param->create.service_id.id.inst_id + ); // <--- very big bug for multi services with the same uuid + m_serviceMap.setByHandle(param->create.service_handle, pService); + m_semaphoreCreateEvt.give(); + break; + } // ESP_GATTS_CREATE_EVT // ESP_GATTS_DISCONNECT_EVT // @@ -210,23 +201,22 @@ void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // If we receive a disconnect event then invoke the callback for disconnects (if one is present). // we also want to start advertising again. case ESP_GATTS_DISCONNECT_EVT: - { - if (m_pServerCallbacks != nullptr) { // If we have callbacks, call now. - m_pServerCallbacks->onDisconnect(this); - m_pServerCallbacks->onDisconnect(this, param); - } - if (m_connId == ESP_GATT_IF_NONE) { - return; - } - - // only decrement if connection is found in map and removed - // sometimes this event triggers w/o a valid connection - if (removePeerDevice(param->disconnect.conn_id, false)) { - m_connectedCount--; // Decrement the number of connected devices count. - } - break; - } // ESP_GATTS_DISCONNECT_EVT + { + if (m_pServerCallbacks != nullptr) { // If we have callbacks, call now. + m_pServerCallbacks->onDisconnect(this); + m_pServerCallbacks->onDisconnect(this, param); + } + if (m_connId == ESP_GATT_IF_NONE) { + return; + } + // only decrement if connection is found in map and removed + // sometimes this event triggers w/o a valid connection + if (removePeerDevice(param->disconnect.conn_id, false)) { + m_connectedCount--; // Decrement the number of connected devices count. + } + break; + } // ESP_GATTS_DISCONNECT_EVT // ESP_GATTS_READ_EVT - A request to read the value of a characteristic has arrived. // @@ -240,10 +230,9 @@ void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // - bool need_rsp // case ESP_GATTS_READ_EVT: - { - break; - } // ESP_GATTS_READ_EVT - + { + break; + } // ESP_GATTS_READ_EVT // ESP_GATTS_REG_EVT // reg: @@ -251,12 +240,11 @@ void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // - uint16_t app_id // case ESP_GATTS_REG_EVT: - { - m_gatts_if = gatts_if; - m_semaphoreRegisterAppEvt.give(); // Unlock the mutex waiting for the registration of the app. - break; - } // ESP_GATTS_REG_EVT - + { + m_gatts_if = gatts_if; + m_semaphoreRegisterAppEvt.give(); // Unlock the mutex waiting for the registration of the app. + break; + } // ESP_GATTS_REG_EVT // ESP_GATTS_WRITE_EVT - A request to write the value of a characteristic has arrived. // @@ -272,16 +260,13 @@ void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // - uint8_t* value // case ESP_GATTS_WRITE_EVT: - { - break; - } - - case ESP_GATTS_OPEN_EVT: - m_semaphoreOpenEvt.give(param->open.status); + { break; + } - default: - break; + case ESP_GATTS_OPEN_EVT: m_semaphoreOpenEvt.give(param->open.status); break; + + default: break; } // Invoke the handler for every Service we have. @@ -290,7 +275,6 @@ void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t log_v("<< handleGATTServerEvent"); } // handleGATTServerEvent - /** * @brief Register the app. * @@ -304,7 +288,6 @@ void BLEServer::registerApp(uint16_t m_appId) { log_v("<< registerApp"); } // registerApp - /** * @brief Set the server callbacks. * @@ -314,14 +297,14 @@ void BLEServer::registerApp(uint16_t m_appId) { * * @param [in] pCallbacks The callbacks to be invoked. */ -void BLEServer::setCallbacks(BLEServerCallbacks* pCallbacks) { +void BLEServer::setCallbacks(BLEServerCallbacks *pCallbacks) { m_pServerCallbacks = pCallbacks; } // setCallbacks /* * Remove service */ -void BLEServer::removeService(BLEService* service) { +void BLEServer::removeService(BLEService *service) { service->stop(); service->executeDelete(); m_serviceMap.removeService(service); @@ -363,34 +346,31 @@ bool BLEServer::connect(BLEAddress address) { return rc == ESP_GATT_OK; } // connect - - -void BLEServerCallbacks::onConnect(BLEServer* pServer) { +void BLEServerCallbacks::onConnect(BLEServer *pServer) { log_d("BLEServerCallbacks", ">> onConnect(): Default"); log_d("BLEServerCallbacks", "Device: %s", BLEDevice::toString().c_str()); log_d("BLEServerCallbacks", "<< onConnect()"); } // onConnect -void BLEServerCallbacks::onConnect(BLEServer* pServer, esp_ble_gatts_cb_param_t* param) { +void BLEServerCallbacks::onConnect(BLEServer *pServer, esp_ble_gatts_cb_param_t *param) { log_d("BLEServerCallbacks", ">> onConnect(): Default"); log_d("BLEServerCallbacks", "Device: %s", BLEDevice::toString().c_str()); log_d("BLEServerCallbacks", "<< onConnect()"); } // onConnect - -void BLEServerCallbacks::onDisconnect(BLEServer* pServer) { +void BLEServerCallbacks::onDisconnect(BLEServer *pServer) { log_d("BLEServerCallbacks", ">> onDisconnect(): Default"); log_d("BLEServerCallbacks", "Device: %s", BLEDevice::toString().c_str()); log_d("BLEServerCallbacks", "<< onDisconnect()"); } // onDisconnect -void BLEServerCallbacks::onDisconnect(BLEServer* pServer, esp_ble_gatts_cb_param_t* param) { +void BLEServerCallbacks::onDisconnect(BLEServer *pServer, esp_ble_gatts_cb_param_t *param) { log_d("BLEServerCallbacks", ">> onDisconnect(): Default"); log_d("BLEServerCallbacks", "Device: %s", BLEDevice::toString().c_str()); log_d("BLEServerCallbacks", "<< onDisconnect()"); } // onDisconnect -void BLEServerCallbacks::onMtuChanged(BLEServer* pServer, esp_ble_gatts_cb_param_t* param) { +void BLEServerCallbacks::onMtuChanged(BLEServer *pServer, esp_ble_gatts_cb_param_t *param) { log_d("BLEServerCallbacks", ">> onMtuChanged(): Default"); log_d("BLEServerCallbacks", "Device: %s MTU: %d", BLEDevice::toString().c_str(), param->mtu.mtu); log_d("BLEServerCallbacks", "<< onMtuChanged()"); @@ -411,17 +391,12 @@ std::map BLEServer::getPeerDevices(bool _client) { return m_connectedServersMap; } - uint16_t BLEServer::getPeerMTU(uint16_t conn_id) { return m_connectedServersMap.find(conn_id)->second.mtu; } -void BLEServer::addPeerDevice(void* peer, bool _client, uint16_t conn_id) { - conn_status_t status = { - .peer_device = peer, - .connected = true, - .mtu = 23 - }; +void BLEServer::addPeerDevice(void *peer, bool _client, uint16_t conn_id) { + conn_status_t status = {.peer_device = peer, .connected = true, .mtu = 23}; m_connectedServersMap.insert(std::pair(conn_id, status)); } diff --git a/libraries/BLE/src/BLEServer.h b/libraries/BLE/src/BLEServer.h index 1f5b377a3..aa10f2210 100644 --- a/libraries/BLE/src/BLEServer.h +++ b/libraries/BLE/src/BLEServer.h @@ -29,51 +29,49 @@ class BLEServerCallbacks; /* TODO possibly refactor this struct */ typedef struct { - void* peer_device; // peer device BLEClient or BLEServer - maybe its better to have 2 structures or union here + void *peer_device; // peer device BLEClient or BLEServer - maybe its better to have 2 structures or union here bool connected; // do we need it? uint16_t mtu; // every peer device negotiate own mtu } conn_status_t; - /** * @brief A data structure that manages the %BLE servers owned by a BLE server. */ class BLEServiceMap { public: - BLEService* getByHandle(uint16_t handle); - BLEService* getByUUID(const char* uuid); - BLEService* getByUUID(BLEUUID uuid, uint8_t inst_id = 0); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param); - void setByHandle(uint16_t handle, BLEService* service); - void setByUUID(const char* uuid, BLEService* service); - void setByUUID(BLEUUID uuid, BLEService* service); + BLEService *getByHandle(uint16_t handle); + BLEService *getByUUID(const char *uuid); + BLEService *getByUUID(BLEUUID uuid, uint8_t inst_id = 0); + void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); + void setByHandle(uint16_t handle, BLEService *service); + void setByUUID(const char *uuid, BLEService *service); + void setByUUID(BLEUUID uuid, BLEService *service); String toString(); - BLEService* getFirst(); - BLEService* getNext(); - void removeService(BLEService* service); + BLEService *getFirst(); + BLEService *getNext(); + void removeService(BLEService *service); int getRegisteredServiceCount(); private: - std::map m_handleMap; - std::map m_uuidMap; - std::map::iterator m_iterator; + std::map m_handleMap; + std::map m_uuidMap; + std::map::iterator m_iterator; }; - /** * @brief The model of a %BLE server. */ class BLEServer { public: uint32_t getConnectedCount(); - BLEService* createService(const char* uuid); - BLEService* createService(BLEUUID uuid, uint32_t numHandles = 15, uint8_t inst_id = 0); - BLEAdvertising* getAdvertising(); - void setCallbacks(BLEServerCallbacks* pCallbacks); + BLEService *createService(const char *uuid); + BLEService *createService(BLEUUID uuid, uint32_t numHandles = 15, uint8_t inst_id = 0); + BLEAdvertising *getAdvertising(); + void setCallbacks(BLEServerCallbacks *pCallbacks); void startAdvertising(); - void removeService(BLEService* service); - BLEService* getServiceByUUID(const char* uuid); - BLEService* getServiceByUUID(BLEUUID uuid); + void removeService(BLEService *service); + BLEService *getServiceByUUID(const char *uuid); + BLEService *getServiceByUUID(BLEUUID uuid); bool connect(BLEAddress address); void disconnect(uint16_t connId); uint16_t m_appId; @@ -81,14 +79,13 @@ public: /* multi connection support */ std::map getPeerDevices(bool client); - void addPeerDevice(void* peer, bool is_client, uint16_t conn_id); + void addPeerDevice(void *peer, bool is_client, uint16_t conn_id); bool removePeerDevice(uint16_t conn_id, bool client); - BLEServer* getServerByConnId(uint16_t conn_id); + BLEServer *getServerByConnId(uint16_t conn_id); void updatePeerMTU(uint16_t connId, uint16_t mtu); uint16_t getPeerMTU(uint16_t conn_id); uint16_t getConnId(); - private: BLEServer(); friend class BLEService; @@ -105,15 +102,14 @@ private: FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt"); FreeRTOS::Semaphore m_semaphoreOpenEvt = FreeRTOS::Semaphore("OpenEvt"); BLEServiceMap m_serviceMap; - BLEServerCallbacks* m_pServerCallbacks = nullptr; + BLEServerCallbacks *m_pServerCallbacks = nullptr; void createApp(uint16_t appId); uint16_t getGattsIf(); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param); + void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); void registerApp(uint16_t); }; // BLEServer - /** * @brief Callbacks associated with the operation of a %BLE server. */ @@ -127,8 +123,8 @@ public: * * @param [in] pServer A reference to the %BLE server that received the client connection. */ - virtual void onConnect(BLEServer* pServer); - virtual void onConnect(BLEServer* pServer, esp_ble_gatts_cb_param_t* param); + virtual void onConnect(BLEServer *pServer); + virtual void onConnect(BLEServer *pServer, esp_ble_gatts_cb_param_t *param); /** * @brief Handle an existing client disconnection. * @@ -136,8 +132,8 @@ public: * * @param [in] pServer A reference to the %BLE server that received the existing client disconnection. */ - virtual void onDisconnect(BLEServer* pServer); - virtual void onDisconnect(BLEServer* pServer, esp_ble_gatts_cb_param_t* param); + virtual void onDisconnect(BLEServer *pServer); + virtual void onDisconnect(BLEServer *pServer, esp_ble_gatts_cb_param_t *param); /** * @brief Handle a new client connection. @@ -147,10 +143,9 @@ public: * @param [in] pServer A reference to the %BLE server that received the client connection. * @param [in] param A reference to esp_ble_gatts_cb_param_t. */ - virtual void onMtuChanged(BLEServer* pServer, esp_ble_gatts_cb_param_t* param); + virtual void onMtuChanged(BLEServer *pServer, esp_ble_gatts_cb_param_t *param); }; // BLEServerCallbacks - #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ #endif /* COMPONENTS_CPP_UTILS_BLESERVER_H_ */ diff --git a/libraries/BLE/src/BLEService.cpp b/libraries/BLE/src/BLEService.cpp index 8ea939e75..58c5d4eb9 100644 --- a/libraries/BLE/src/BLEService.cpp +++ b/libraries/BLE/src/BLEService.cpp @@ -27,16 +27,12 @@ #define NULL_HANDLE (0xffff) - /** * @brief Construct an instance of the BLEService * @param [in] uuid The UUID of the service. * @param [in] numHandles The maximum number of handles associated with the service. */ -BLEService::BLEService(const char* uuid, uint16_t numHandles) - : BLEService(BLEUUID(uuid), numHandles) { -} - +BLEService::BLEService(const char *uuid, uint16_t numHandles) : BLEService(BLEUUID(uuid), numHandles) {} /** * @brief Construct an instance of the BLEService @@ -52,7 +48,6 @@ BLEService::BLEService(BLEUUID uuid, uint16_t numHandles) { m_numHandles = numHandles; } // BLEService - /** * @brief Create the service. * Create the service. @@ -60,7 +55,7 @@ BLEService::BLEService(BLEUUID uuid, uint16_t numHandles) { * @return N/A. */ -void BLEService::executeCreate(BLEServer* pServer) { +void BLEService::executeCreate(BLEServer *pServer) { log_v(">> executeCreate() - Creating service (esp_ble_gatts_create_service) service uuid: %s", getUUID().toString().c_str()); m_pServer = pServer; m_semaphoreCreateEvt.take("executeCreate"); // Take the mutex and release at event ESP_GATTS_CREATE_EVT @@ -69,7 +64,8 @@ void BLEService::executeCreate(BLEServer* pServer) { srvc_id.is_primary = true; srvc_id.id.inst_id = m_instId; srvc_id.id.uuid = *m_uuid.getNative(); - esp_err_t errRc = ::esp_ble_gatts_create_service(getServer()->getGattsIf(), &srvc_id, m_numHandles); // The maximum number of handles associated with the service. + esp_err_t errRc = + ::esp_ble_gatts_create_service(getServer()->getGattsIf(), &srvc_id, m_numHandles); // The maximum number of handles associated with the service. if (errRc != ESP_OK) { log_e("esp_ble_gatts_create_service: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); @@ -80,7 +76,6 @@ void BLEService::executeCreate(BLEServer* pServer) { log_v("<< executeCreate"); } // executeCreate - /** * @brief Delete the service. * Delete the service. @@ -102,19 +97,15 @@ void BLEService::executeDelete() { log_v("<< executeDelete"); } // executeDelete - /** * @brief Dump details of this BLE GATT service. * @return N/A. */ void BLEService::dump() { - log_d("Service: uuid:%s, handle: 0x%.2x", - m_uuid.toString().c_str(), - m_handle); + log_d("Service: uuid:%s, handle: 0x%.2x", m_uuid.toString().c_str(), m_handle); log_d("Characteristics:\n%s", m_characteristicMap.toString().c_str()); } // dump - /** * @brief Get the UUID of the service. * @return the UUID of the service. @@ -123,7 +114,6 @@ BLEUUID BLEService::getUUID() { return m_uuid; } // getUUID - /** * @brief Start the service. * Here we wish to start the service which means that we will respond to partner requests about it. @@ -141,7 +131,7 @@ void BLEService::start() { return; } - BLECharacteristic* pCharacteristic = m_characteristicMap.getFirst(); + BLECharacteristic *pCharacteristic = m_characteristicMap.getFirst(); while (pCharacteristic != nullptr) { m_lastCreatedCharacteristic = pCharacteristic; @@ -163,7 +153,6 @@ void BLEService::start() { log_v("<< start()"); } // start - /** * @brief Stop the service. */ @@ -189,7 +178,6 @@ void BLEService::stop() { log_v("<< stop()"); } // start - /** * @brief Set the handle associated with this service. * @param [in] handle The handle associated with the service. @@ -204,7 +192,6 @@ void BLEService::setHandle(uint16_t handle) { log_v("<< setHandle"); } // setHandle - /** * @brief Get the handle associated with this service. * @return The handle associated with this service. @@ -213,20 +200,17 @@ uint16_t BLEService::getHandle() { return m_handle; } // getHandle - /** * @brief Add a characteristic to the service. * @param [in] pCharacteristic A pointer to the characteristic to be added. */ -void BLEService::addCharacteristic(BLECharacteristic* pCharacteristic) { +void BLEService::addCharacteristic(BLECharacteristic *pCharacteristic) { // We maintain a mapping of characteristics owned by this service. These are managed by the // BLECharacteristicMap class instance found in m_characteristicMap. We add the characteristic // to the map and then ask the service to add the characteristic at the BLE level (ESP-IDF). log_v(">> addCharacteristic()"); - log_d("Adding characteristic: uuid=%s to service: %s", - pCharacteristic->getUUID().toString().c_str(), - toString().c_str()); + log_d("Adding characteristic: uuid=%s to service: %s", pCharacteristic->getUUID().toString().c_str(), toString().c_str()); // Check that we don't add the same characteristic twice. if (m_characteristicMap.getByUUID(pCharacteristic->getUUID()) != nullptr) { @@ -241,35 +225,32 @@ void BLEService::addCharacteristic(BLECharacteristic* pCharacteristic) { log_v("<< addCharacteristic()"); } // addCharacteristic - /** * @brief Create a new BLE Characteristic associated with this service. * @param [in] uuid - The UUID of the characteristic. * @param [in] properties - The properties of the characteristic. * @return The new BLE characteristic. */ -BLECharacteristic* BLEService::createCharacteristic(const char* uuid, uint32_t properties) { +BLECharacteristic *BLEService::createCharacteristic(const char *uuid, uint32_t properties) { return createCharacteristic(BLEUUID(uuid), properties); } - /** * @brief Create a new BLE Characteristic associated with this service. * @param [in] uuid - The UUID of the characteristic. * @param [in] properties - The properties of the characteristic. * @return The new BLE characteristic. */ -BLECharacteristic* BLEService::createCharacteristic(BLEUUID uuid, uint32_t properties) { - BLECharacteristic* pCharacteristic = new BLECharacteristic(uuid, properties); +BLECharacteristic *BLEService::createCharacteristic(BLEUUID uuid, uint32_t properties) { + BLECharacteristic *pCharacteristic = new BLECharacteristic(uuid, properties); addCharacteristic(pCharacteristic); return pCharacteristic; } // createCharacteristic - /** * @brief Handle a GATTS server event. */ -void BLEService::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param) { +void BLEService::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) { switch (event) { // ESP_GATTS_ADD_CHAR_EVT - Indicate that a characteristic was added to the service. // add_char: @@ -281,22 +262,20 @@ void BLEService::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // If we have reached the correct service, then locate the characteristic and remember the handle // for that characteristic. case ESP_GATTS_ADD_CHAR_EVT: - { - if (m_handle == param->add_char.service_handle) { - BLECharacteristic* pCharacteristic = getLastCreatedCharacteristic(); - if (pCharacteristic == nullptr) { - log_e("Expected to find characteristic with UUID: %s, but didn't!", - BLEUUID(param->add_char.char_uuid).toString().c_str()); - dump(); - break; - } - pCharacteristic->setHandle(param->add_char.attr_handle); - m_characteristicMap.setByHandle(param->add_char.attr_handle, pCharacteristic); + { + if (m_handle == param->add_char.service_handle) { + BLECharacteristic *pCharacteristic = getLastCreatedCharacteristic(); + if (pCharacteristic == nullptr) { + log_e("Expected to find characteristic with UUID: %s, but didn't!", BLEUUID(param->add_char.char_uuid).toString().c_str()); + dump(); break; - } // Reached the correct service. + } + pCharacteristic->setHandle(param->add_char.attr_handle); + m_characteristicMap.setByHandle(param->add_char.attr_handle, pCharacteristic); break; - } // ESP_GATTS_ADD_CHAR_EVT - + } // Reached the correct service. + break; + } // ESP_GATTS_ADD_CHAR_EVT // ESP_GATTS_START_EVT // @@ -304,12 +283,12 @@ void BLEService::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // esp_gatt_status_t status // uint16_t service_handle case ESP_GATTS_START_EVT: - { - if (param->start.service_handle == getHandle()) { - m_semaphoreStartEvt.give(); - } - break; - } // ESP_GATTS_START_EVT + { + if (param->start.service_handle == getHandle()) { + m_semaphoreStartEvt.give(); + } + break; + } // ESP_GATTS_START_EVT // ESP_GATTS_STOP_EVT // @@ -318,13 +297,12 @@ void BLEService::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // uint16_t service_handle // case ESP_GATTS_STOP_EVT: - { - if (param->stop.service_handle == getHandle()) { - m_semaphoreStopEvt.give(); - } - break; - } // ESP_GATTS_STOP_EVT - + { + if (param->stop.service_handle == getHandle()) { + m_semaphoreStopEvt.give(); + } + break; + } // ESP_GATTS_STOP_EVT // ESP_GATTS_CREATE_EVT // Called when a new service is registered as having been created. @@ -339,14 +317,13 @@ void BLEService::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // * - bool is_primary // case ESP_GATTS_CREATE_EVT: - { - if (getUUID().equals(BLEUUID(param->create.service_id.id.uuid)) && m_instId == param->create.service_id.id.inst_id) { - setHandle(param->create.service_handle); - m_semaphoreCreateEvt.give(); - } - break; - } // ESP_GATTS_CREATE_EVT - + { + if (getUUID().equals(BLEUUID(param->create.service_id.id.uuid)) && m_instId == param->create.service_id.id.inst_id) { + setHandle(param->create.service_handle); + m_semaphoreCreateEvt.give(); + } + break; + } // ESP_GATTS_CREATE_EVT // ESP_GATTS_DELETE_EVT // Called when a service is deleted. @@ -356,32 +333,28 @@ void BLEService::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t // * uint16_t service_handle // case ESP_GATTS_DELETE_EVT: - { - if (param->del.service_handle == getHandle()) { - m_semaphoreDeleteEvt.give(); - } - break; - } // ESP_GATTS_DELETE_EVT - - default: + { + if (param->del.service_handle == getHandle()) { + m_semaphoreDeleteEvt.give(); + } break; + } // ESP_GATTS_DELETE_EVT + + default: break; } // Switch // Invoke the GATTS handler in each of the associated characteristics. m_characteristicMap.handleGATTServerEvent(event, gatts_if, param); } // handleGATTServerEvent - -BLECharacteristic* BLEService::getCharacteristic(const char* uuid) { +BLECharacteristic *BLEService::getCharacteristic(const char *uuid) { return getCharacteristic(BLEUUID(uuid)); } - -BLECharacteristic* BLEService::getCharacteristic(BLEUUID uuid) { +BLECharacteristic *BLEService::getCharacteristic(BLEUUID uuid) { return m_characteristicMap.getByUUID(uuid); } - /** * @brief Return a string representation of this service. * A service is defined by: @@ -398,7 +371,6 @@ String BLEService::toString() { return res; } // toString - /** * @brief Get the last created characteristic. * It is lamentable that this function has to exist. It returns the last created characteristic. @@ -406,16 +378,15 @@ String BLEService::toString() { * is associated with the last characteristics created and we need that information. * @return The last created characteristic. */ -BLECharacteristic* BLEService::getLastCreatedCharacteristic() { +BLECharacteristic *BLEService::getLastCreatedCharacteristic() { return m_lastCreatedCharacteristic; } // getLastCreatedCharacteristic - /** * @brief Get the BLE server associated with this service. * @return The BLEServer associated with this service. */ -BLEServer* BLEService::getServer() { +BLEServer *BLEService::getServer() { return m_pServer; } // getServer diff --git a/libraries/BLE/src/BLEService.h b/libraries/BLE/src/BLEService.h index b65981ef2..61f867b2a 100644 --- a/libraries/BLE/src/BLEService.h +++ b/libraries/BLE/src/BLEService.h @@ -27,40 +27,39 @@ class BLEServer; */ class BLECharacteristicMap { public: - void setByUUID(BLECharacteristic* pCharacteristic, const char* uuid); - void setByUUID(BLECharacteristic* pCharacteristic, BLEUUID uuid); - void setByHandle(uint16_t handle, BLECharacteristic* pCharacteristic); - BLECharacteristic* getByUUID(const char* uuid); - BLECharacteristic* getByUUID(BLEUUID uuid); - BLECharacteristic* getByHandle(uint16_t handle); - BLECharacteristic* getFirst(); - BLECharacteristic* getNext(); + void setByUUID(BLECharacteristic *pCharacteristic, const char *uuid); + void setByUUID(BLECharacteristic *pCharacteristic, BLEUUID uuid); + void setByHandle(uint16_t handle, BLECharacteristic *pCharacteristic); + BLECharacteristic *getByUUID(const char *uuid); + BLECharacteristic *getByUUID(BLEUUID uuid); + BLECharacteristic *getByHandle(uint16_t handle); + BLECharacteristic *getFirst(); + BLECharacteristic *getNext(); String toString(); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param); + void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); private: - std::map m_uuidMap; - std::map m_handleMap; - std::map::iterator m_iterator; + std::map m_uuidMap; + std::map m_handleMap; + std::map::iterator m_iterator; }; - /** * @brief The model of a %BLE service. * */ class BLEService { public: - void addCharacteristic(BLECharacteristic* pCharacteristic); - BLECharacteristic* createCharacteristic(const char* uuid, uint32_t properties); - BLECharacteristic* createCharacteristic(BLEUUID uuid, uint32_t properties); + void addCharacteristic(BLECharacteristic *pCharacteristic); + BLECharacteristic *createCharacteristic(const char *uuid, uint32_t properties); + BLECharacteristic *createCharacteristic(BLEUUID uuid, uint32_t properties); void dump(); - void executeCreate(BLEServer* pServer); + void executeCreate(BLEServer *pServer); void executeDelete(); - BLECharacteristic* getCharacteristic(const char* uuid); - BLECharacteristic* getCharacteristic(BLEUUID uuid); + BLECharacteristic *getCharacteristic(const char *uuid); + BLECharacteristic *getCharacteristic(BLEUUID uuid); BLEUUID getUUID(); - BLEServer* getServer(); + BLEServer *getServer(); void start(); void stop(); String toString(); @@ -68,7 +67,7 @@ public: uint8_t m_instId = 0; private: - BLEService(const char* uuid, uint16_t numHandles); + BLEService(const char *uuid, uint16_t numHandles); BLEService(BLEUUID uuid, uint16_t numHandles); friend class BLEServer; friend class BLEServiceMap; @@ -78,8 +77,8 @@ private: BLECharacteristicMap m_characteristicMap; uint16_t m_handle; - BLECharacteristic* m_lastCreatedCharacteristic = nullptr; - BLEServer* m_pServer = nullptr; + BLECharacteristic *m_lastCreatedCharacteristic = nullptr; + BLEServer *m_pServer = nullptr; BLEUUID m_uuid; FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt"); @@ -89,13 +88,12 @@ private: uint16_t m_numHandles; - BLECharacteristic* getLastCreatedCharacteristic(); - void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param); + BLECharacteristic *getLastCreatedCharacteristic(); + void handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); void setHandle(uint16_t handle); //void setService(esp_gatt_srvc_id_t srvc_id); }; // BLEService - #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ #endif /* COMPONENTS_CPP_UTILS_BLESERVICE_H_ */ diff --git a/libraries/BLE/src/BLEServiceMap.cpp b/libraries/BLE/src/BLEServiceMap.cpp index 0e36ef68d..30a9db499 100644 --- a/libraries/BLE/src/BLEServiceMap.cpp +++ b/libraries/BLE/src/BLEServiceMap.cpp @@ -13,13 +13,12 @@ #include #include "BLEService.h" - /** * @brief Return the service by UUID. * @param [in] UUID The UUID to look up the service. * @return The characteristic. */ -BLEService* BLEServiceMap::getByUUID(const char* uuid) { +BLEService *BLEServiceMap::getByUUID(const char *uuid) { return getByUUID(BLEUUID(uuid)); } @@ -28,8 +27,8 @@ BLEService* BLEServiceMap::getByUUID(const char* uuid) { * @param [in] UUID The UUID to look up the service. * @return The characteristic. */ -BLEService* BLEServiceMap::getByUUID(BLEUUID uuid, uint8_t inst_id) { - for (auto& myPair : m_uuidMap) { +BLEService *BLEServiceMap::getByUUID(BLEUUID uuid, uint8_t inst_id) { + for (auto &myPair : m_uuidMap) { if (myPair.first->getUUID().equals(uuid)) { return myPair.first; } @@ -38,39 +37,35 @@ BLEService* BLEServiceMap::getByUUID(BLEUUID uuid, uint8_t inst_id) { return nullptr; } // getByUUID - /** * @brief Return the service by handle. * @param [in] handle The handle to look up the service. * @return The service. */ -BLEService* BLEServiceMap::getByHandle(uint16_t handle) { +BLEService *BLEServiceMap::getByHandle(uint16_t handle) { return m_handleMap.at(handle); } // getByHandle - /** * @brief Set the service by UUID. * @param [in] uuid The uuid of the service. * @param [in] characteristic The service to cache. * @return N/A. */ -void BLEServiceMap::setByUUID(BLEUUID uuid, BLEService* service) { - m_uuidMap.insert(std::pair(service, uuid.toString())); +void BLEServiceMap::setByUUID(BLEUUID uuid, BLEService *service) { + m_uuidMap.insert(std::pair(service, uuid.toString())); } // setByUUID - /** * @brief Set the service by handle. * @param [in] handle The handle of the service. * @param [in] service The service to cache. * @return N/A. */ -void BLEServiceMap::setByHandle(uint16_t handle, BLEService* service) { - m_handleMap.insert(std::pair(handle, service)); +void BLEServiceMap::setByHandle(uint16_t handle, BLEService *service) { + m_handleMap.insert(std::pair(handle, service)); } // setByHandle - /** * @brief Return a string representation of the service map. * @return A string representation of the service map. @@ -78,7 +73,7 @@ void BLEServiceMap::setByHandle(uint16_t handle, BLEService* service) { String BLEServiceMap::toString() { String res; char hex[5]; - for (auto& myPair : m_handleMap) { + for (auto &myPair : m_handleMap) { res += "handle: 0x"; snprintf(hex, sizeof(hex), "%04x", myPair.first); res += hex; @@ -87,12 +82,9 @@ String BLEServiceMap::toString() { return res; } // toString -void BLEServiceMap::handleGATTServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* param) { +void BLEServiceMap::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) { // Invoke the handler for every Service we have. - for (auto& myPair : m_uuidMap) { + for (auto &myPair : m_uuidMap) { myPair.first->handleGATTServerEvent(event, gatts_if, param); } } @@ -101,10 +93,12 @@ void BLEServiceMap::handleGATTServerEvent( * @brief Get the first service in the map. * @return The first service in the map. */ -BLEService* BLEServiceMap::getFirst() { +BLEService *BLEServiceMap::getFirst() { m_iterator = m_uuidMap.begin(); - if (m_iterator == m_uuidMap.end()) return nullptr; - BLEService* pRet = m_iterator->first; + if (m_iterator == m_uuidMap.end()) { + return nullptr; + } + BLEService *pRet = m_iterator->first; m_iterator++; return pRet; } // getFirst @@ -113,9 +107,11 @@ BLEService* BLEServiceMap::getFirst() { * @brief Get the next service in the map. * @return The next service in the map. */ -BLEService* BLEServiceMap::getNext() { - if (m_iterator == m_uuidMap.end()) return nullptr; - BLEService* pRet = m_iterator->first; +BLEService *BLEServiceMap::getNext() { + if (m_iterator == m_uuidMap.end()) { + return nullptr; + } + BLEService *pRet = m_iterator->first; m_iterator++; return pRet; } // getNext @@ -124,7 +120,7 @@ BLEService* BLEServiceMap::getNext() { * @brief Removes service from maps. * @return N/A. */ -void BLEServiceMap::removeService(BLEService* service) { +void BLEServiceMap::removeService(BLEService *service) { m_handleMap.erase(service->getHandle()); m_uuidMap.erase(service); } // removeService diff --git a/libraries/BLE/src/BLEUUID.cpp b/libraries/BLE/src/BLEUUID.cpp index 134d55333..8074ea82f 100644 --- a/libraries/BLE/src/BLEUUID.cpp +++ b/libraries/BLE/src/BLEUUID.cpp @@ -37,7 +37,7 @@ * @param [in] source The source of the copy * @param [in] size The number of bytes to copy */ -static void memrcpy(uint8_t* target, uint8_t* source, uint32_t size) { +static void memrcpy(uint8_t *target, uint8_t *source, uint32_t size) { assert(size > 0); target += (size - 1); // Point target to the last byte of the target data while (size > 0) { @@ -48,7 +48,6 @@ static void memrcpy(uint8_t* target, uint8_t* source, uint32_t size) { } } // memrcpy - /** * @brief Create a UUID from a string. * @@ -76,8 +75,12 @@ BLEUUID::BLEUUID(String value) { uint8_t MSB = value.c_str()[i]; uint8_t LSB = value.c_str()[i + 1]; - if (MSB > '9') MSB -= 7; - if (LSB > '9') LSB -= 7; + if (MSB > '9') { + MSB -= 7; + } + if (LSB > '9') { + LSB -= 7; + } m_uuid.uuid.uuid16 += (((MSB & 0x0F) << 4) | (LSB & 0x0F)) << (2 - i) * 4; i += 2; } @@ -88,14 +91,19 @@ BLEUUID::BLEUUID(String value) { uint8_t MSB = value.c_str()[i]; uint8_t LSB = value.c_str()[i + 1]; - if (MSB > '9') MSB -= 7; - if (LSB > '9') LSB -= 7; + if (MSB > '9') { + MSB -= 7; + } + if (LSB > '9') { + LSB -= 7; + } m_uuid.uuid.uuid32 += (((MSB & 0x0F) << 4) | (LSB & 0x0F)) << (6 - i) * 4; i += 2; } - } else if (value.length() == 16) { // How we can have 16 byte length string representing 128 bit uuid??? needs to be investigated (lack of time) - maybe raw data encoded as String (128b==16B)? + } else if (value.length() + == 16) { // How we can have 16 byte length string representing 128 bit uuid??? needs to be investigated (lack of time) - maybe raw data encoded as String (128b==16B)? m_uuid.len = ESP_UUID_LEN_128; - memrcpy(m_uuid.uuid.uuid128, (uint8_t*)value.c_str(), 16); + memrcpy(m_uuid.uuid.uuid128, (uint8_t *)value.c_str(), 16); } else if (value.length() == 36) { //log_d("36 characters:"); // If the length of the string is 36 bytes then we will assume it is a long hex string in @@ -103,13 +111,18 @@ BLEUUID::BLEUUID(String value) { m_uuid.len = ESP_UUID_LEN_128; int n = 0; for (int i = 0; i < value.length();) { - if (value.c_str()[i] == '-') + if (value.c_str()[i] == '-') { i++; + } uint8_t MSB = value.c_str()[i]; uint8_t LSB = value.c_str()[i + 1]; - if (MSB > '9') MSB -= 7; - if (LSB > '9') LSB -= 7; + if (MSB > '9') { + MSB -= 7; + } + if (LSB > '9') { + LSB -= 7; + } m_uuid.uuid.uuid128[15 - n++] = ((MSB & 0x0F) << 4) | (LSB & 0x0F); i += 2; } @@ -132,7 +145,7 @@ BLEUUID::BLEUUID(String value) { * @param [in] size The size of the data. * @param [in] msbFirst Is the MSB first in pData memory? */ -BLEUUID::BLEUUID(uint8_t* pData, size_t size, bool msbFirst) { +BLEUUID::BLEUUID(uint8_t *pData, size_t size, bool msbFirst) { if (size != 16) { log_e("ERROR: UUID length not 16 bytes"); return; @@ -146,7 +159,6 @@ BLEUUID::BLEUUID(uint8_t* pData, size_t size, bool msbFirst) { m_valueSet = true; } // BLEUUID - /** * @brief Create a UUID from the 16bit value. * @@ -158,7 +170,6 @@ BLEUUID::BLEUUID(uint16_t uuid) { m_valueSet = true; } // BLEUUID - /** * @brief Create a UUID from the 32bit value. * @@ -170,7 +181,6 @@ BLEUUID::BLEUUID(uint32_t uuid) { m_valueSet = true; } // BLEUUID - /** * @brief Create a UUID from the native UUID. * @@ -181,42 +191,33 @@ BLEUUID::BLEUUID(esp_bt_uuid_t uuid) { m_valueSet = true; } // BLEUUID - /** * @brief Create a UUID from the ESP32 esp_gat_id_t. * * @param [in] gattId The data to create the UUID from. */ -BLEUUID::BLEUUID(esp_gatt_id_t gattId) - : BLEUUID(gattId.uuid) { -} // BLEUUID - +BLEUUID::BLEUUID(esp_gatt_id_t gattId) : BLEUUID(gattId.uuid) {} // BLEUUID BLEUUID::BLEUUID() { m_valueSet = false; } // BLEUUID - /** * @brief Get the number of bits in this uuid. * @return The number of bits in the UUID. One of 16, 32 or 128. */ uint8_t BLEUUID::bitSize() { - if (!m_valueSet) return 0; + if (!m_valueSet) { + return 0; + } switch (m_uuid.len) { - case ESP_UUID_LEN_16: - return 16; - case ESP_UUID_LEN_32: - return 32; - case ESP_UUID_LEN_128: - return 128; - default: - log_e("Unknown UUID length: %d", m_uuid.len); - return 0; + case ESP_UUID_LEN_16: return 16; + case ESP_UUID_LEN_32: return 32; + case ESP_UUID_LEN_128: return 128; + default: log_e("Unknown UUID length: %d", m_uuid.len); return 0; } // End of switch } // bitSize - /** * @brief Compare a UUID against this UUID. * @@ -225,7 +226,9 @@ uint8_t BLEUUID::bitSize() { */ bool BLEUUID::equals(BLEUUID uuid) { //log_d("Comparing: %s to %s", toString().c_str(), uuid.toString().c_str()); - if (!m_valueSet || !uuid.m_valueSet) return false; + if (!m_valueSet || !uuid.m_valueSet) { + return false; + } if (uuid.m_uuid.len != m_uuid.len) { return uuid.toString() == toString(); @@ -242,7 +245,6 @@ bool BLEUUID::equals(BLEUUID uuid) { return memcmp(uuid.m_uuid.uuid.uuid128, m_uuid.uuid.uuid128, 16) == 0; } // equals - /** * Create a BLEUUID from a string of the form: * 0xNNNN @@ -271,13 +273,12 @@ BLEUUID BLEUUID::fromString(String _uuid) { return BLEUUID(); } // fromString - /** * @brief Get the native UUID value. * * @return The native UUID value or NULL if not set. */ -esp_bt_uuid_t* BLEUUID::getNative() { +esp_bt_uuid_t *BLEUUID::getNative() { //log_d(">> getNative()") if (m_valueSet == false) { log_v("<< Return of un-initialized UUID!"); @@ -287,7 +288,6 @@ esp_bt_uuid_t* BLEUUID::getNative() { return &m_uuid; } // getNative - /** * @brief Convert a UUID to its 128 bit representation. * @@ -340,9 +340,6 @@ BLEUUID BLEUUID::to128() { return *this; } // to128 - - - /** * @brief Get a string representation of the UUID. * @@ -354,7 +351,9 @@ BLEUUID BLEUUID::to128() { * @return A string representation of the UUID. */ String BLEUUID::toString() { - if (!m_valueSet) return ""; // If we have no value, nothing to format. + if (!m_valueSet) { + return ""; // If we have no value, nothing to format. + } // If the UUIDs are 16 or 32 bit, pad correctly. if (m_uuid.len == ESP_UUID_LEN_16) { // If the UUID is 16bit, pad correctly. @@ -374,16 +373,13 @@ String BLEUUID::toString() { // UUID string format: // AABBCCDD-EEFF-GGHH-IIJJ-KKLLMMNNOOPP auto size = 37; // 32 for UUID data, 4 for '-' delimiters and one for a terminator == 37 chars - char* hex = (char*)malloc(size); - snprintf(hex, size, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", - m_uuid.uuid.uuid128[15], m_uuid.uuid.uuid128[14], - m_uuid.uuid.uuid128[13], m_uuid.uuid.uuid128[12], - m_uuid.uuid.uuid128[11], m_uuid.uuid.uuid128[10], - m_uuid.uuid.uuid128[9], m_uuid.uuid.uuid128[8], - m_uuid.uuid.uuid128[7], m_uuid.uuid.uuid128[6], - m_uuid.uuid.uuid128[5], m_uuid.uuid.uuid128[4], - m_uuid.uuid.uuid128[3], m_uuid.uuid.uuid128[2], - m_uuid.uuid.uuid128[1], m_uuid.uuid.uuid128[0]); + char *hex = (char *)malloc(size); + snprintf( + hex, size, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", m_uuid.uuid.uuid128[15], m_uuid.uuid.uuid128[14], + m_uuid.uuid.uuid128[13], m_uuid.uuid.uuid128[12], m_uuid.uuid.uuid128[11], m_uuid.uuid.uuid128[10], m_uuid.uuid.uuid128[9], m_uuid.uuid.uuid128[8], + m_uuid.uuid.uuid128[7], m_uuid.uuid.uuid128[6], m_uuid.uuid.uuid128[5], m_uuid.uuid.uuid128[4], m_uuid.uuid.uuid128[3], m_uuid.uuid.uuid128[2], + m_uuid.uuid.uuid128[1], m_uuid.uuid.uuid128[0] + ); String res(hex); free(hex); return res; diff --git a/libraries/BLE/src/BLEUUID.h b/libraries/BLE/src/BLEUUID.h index b86779848..1be013942 100644 --- a/libraries/BLE/src/BLEUUID.h +++ b/libraries/BLE/src/BLEUUID.h @@ -24,12 +24,12 @@ public: BLEUUID(uint16_t uuid); BLEUUID(uint32_t uuid); BLEUUID(esp_bt_uuid_t uuid); - BLEUUID(uint8_t* pData, size_t size, bool msbFirst); + BLEUUID(uint8_t *pData, size_t size, bool msbFirst); BLEUUID(esp_gatt_id_t gattId); BLEUUID(); uint8_t bitSize(); // Get the number of bits in this uuid. bool equals(BLEUUID uuid); - esp_bt_uuid_t* getNative(); + esp_bt_uuid_t *getNative(); BLEUUID to128(); String toString(); static BLEUUID fromString(String uuid); // Create a BLEUUID from a string @@ -37,7 +37,7 @@ public: private: esp_bt_uuid_t m_uuid; // The underlying UUID structure that this class wraps. bool m_valueSet = false; // Is there a value set for this instance. -}; // BLEUUID +}; // BLEUUID #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ diff --git a/libraries/BLE/src/BLEUtils.cpp b/libraries/BLE/src/BLEUtils.cpp index 6ad4dae3c..05e1e32de 100644 --- a/libraries/BLE/src/BLEUtils.cpp +++ b/libraries/BLE/src/BLEUtils.cpp @@ -30,572 +30,570 @@ typedef struct { uint32_t assignedNumber; - const char* name; + const char *name; } member_t; static const member_t members_ids[] = { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - { 0xFE08, "Microsoft" }, - { 0xFE09, "Pillsy, Inc." }, - { 0xFE0A, "ruwido austria gmbh" }, - { 0xFE0B, "ruwido austria gmbh" }, - { 0xFE0C, "Procter & Gamble" }, - { 0xFE0D, "Procter & Gamble" }, - { 0xFE0E, "Setec Pty Ltd" }, - { 0xFE0F, "Philips Lighting B.V." }, - { 0xFE10, "Lapis Semiconductor Co., Ltd." }, - { 0xFE11, "GMC-I Messtechnik GmbH" }, - { 0xFE12, "M-Way Solutions GmbH" }, - { 0xFE13, "Apple Inc." }, - { 0xFE14, "Flextronics International USA Inc." }, - { 0xFE15, "Amazon Fulfillment Services, Inc." }, - { 0xFE16, "Footmarks, Inc." }, - { 0xFE17, "Telit Wireless Solutions GmbH" }, - { 0xFE18, "Runtime, Inc." }, - { 0xFE19, "Google Inc." }, - { 0xFE1A, "Tyto Life LLC" }, - { 0xFE1B, "Tyto Life LLC" }, - { 0xFE1C, "NetMedia, Inc." }, - { 0xFE1D, "Illuminati Instrument Corporation" }, - { 0xFE1E, "Smart Innovations Co., Ltd" }, - { 0xFE1F, "Garmin International, Inc." }, - { 0xFE20, "Emerson" }, - { 0xFE21, "Bose Corporation" }, - { 0xFE22, "Zoll Medical Corporation" }, - { 0xFE23, "Zoll Medical Corporation" }, - { 0xFE24, "August Home Inc" }, - { 0xFE25, "Apple, Inc. " }, - { 0xFE26, "Google Inc." }, - { 0xFE27, "Google Inc." }, - { 0xFE28, "Ayla Networks" }, - { 0xFE29, "Gibson Innovations" }, - { 0xFE2A, "DaisyWorks, Inc." }, - { 0xFE2B, "ITT Industries" }, - { 0xFE2C, "Google Inc." }, - { 0xFE2D, "SMART INNOVATION Co.,Ltd" }, - { 0xFE2E, "ERi,Inc." }, - { 0xFE2F, "CRESCO Wireless, Inc" }, - { 0xFE30, "Volkswagen AG" }, - { 0xFE31, "Volkswagen AG" }, - { 0xFE32, "Pro-Mark, Inc." }, - { 0xFE33, "CHIPOLO d.o.o." }, - { 0xFE34, "SmallLoop LLC" }, - { 0xFE35, "HUAWEI Technologies Co., Ltd" }, - { 0xFE36, "HUAWEI Technologies Co., Ltd" }, - { 0xFE37, "Spaceek LTD" }, - { 0xFE38, "Spaceek LTD" }, - { 0xFE39, "TTS Tooltechnic Systems AG & Co. KG" }, - { 0xFE3A, "TTS Tooltechnic Systems AG & Co. KG" }, - { 0xFE3B, "Dolby Laboratories" }, - { 0xFE3C, "Alibaba" }, - { 0xFE3D, "BD Medical" }, - { 0xFE3E, "BD Medical" }, - { 0xFE3F, "Friday Labs Limited" }, - { 0xFE40, "Inugo Systems Limited" }, - { 0xFE41, "Inugo Systems Limited" }, - { 0xFE42, "Nets A/S " }, - { 0xFE43, "Andreas Stihl AG & Co. KG" }, - { 0xFE44, "SK Telecom " }, - { 0xFE45, "Snapchat Inc" }, - { 0xFE46, "B&O Play A/S " }, - { 0xFE47, "General Motors" }, - { 0xFE48, "General Motors" }, - { 0xFE49, "SenionLab AB" }, - { 0xFE4A, "OMRON HEALTHCARE Co., Ltd." }, - { 0xFE4B, "Philips Lighting B.V." }, - { 0xFE4C, "Volkswagen AG" }, - { 0xFE4D, "Casambi Technologies Oy" }, - { 0xFE4E, "NTT docomo" }, - { 0xFE4F, "Molekule, Inc." }, - { 0xFE50, "Google Inc." }, - { 0xFE51, "SRAM" }, - { 0xFE52, "SetPoint Medical" }, - { 0xFE53, "3M" }, - { 0xFE54, "Motiv, Inc." }, - { 0xFE55, "Google Inc." }, - { 0xFE56, "Google Inc." }, - { 0xFE57, "Dotted Labs" }, - { 0xFE58, "Nordic Semiconductor ASA" }, - { 0xFE59, "Nordic Semiconductor ASA" }, - { 0xFE5A, "Chronologics Corporation" }, - { 0xFE5B, "GT-tronics HK Ltd" }, - { 0xFE5C, "million hunters GmbH" }, - { 0xFE5D, "Grundfos A/S" }, - { 0xFE5E, "Plastc Corporation" }, - { 0xFE5F, "Eyefi, Inc." }, - { 0xFE60, "Lierda Science & Technology Group Co., Ltd." }, - { 0xFE61, "Logitech International SA" }, - { 0xFE62, "Indagem Tech LLC" }, - { 0xFE63, "Connected Yard, Inc." }, - { 0xFE64, "Siemens AG" }, - { 0xFE65, "CHIPOLO d.o.o." }, - { 0xFE66, "Intel Corporation" }, - { 0xFE67, "Lab Sensor Solutions" }, - { 0xFE68, "Qualcomm Life Inc" }, - { 0xFE69, "Qualcomm Life Inc" }, - { 0xFE6A, "Kontakt Micro-Location Sp. z o.o." }, - { 0xFE6B, "TASER International, Inc." }, - { 0xFE6C, "TASER International, Inc." }, - { 0xFE6D, "The University of Tokyo" }, - { 0xFE6E, "The University of Tokyo" }, - { 0xFE6F, "LINE Corporation" }, - { 0xFE70, "Beijing Jingdong Century Trading Co., Ltd." }, - { 0xFE71, "Plume Design Inc" }, - { 0xFE72, "St. Jude Medical, Inc." }, - { 0xFE73, "St. Jude Medical, Inc." }, - { 0xFE74, "unwire" }, - { 0xFE75, "TangoMe" }, - { 0xFE76, "TangoMe" }, - { 0xFE77, "Hewlett-Packard Company" }, - { 0xFE78, "Hewlett-Packard Company" }, - { 0xFE79, "Zebra Technologies" }, - { 0xFE7A, "Bragi GmbH" }, - { 0xFE7B, "Orion Labs, Inc." }, - { 0xFE7C, "Telit Wireless Solutions (Formerly Stollmann E+V GmbH)" }, - { 0xFE7D, "Aterica Health Inc." }, - { 0xFE7E, "Awear Solutions Ltd" }, - { 0xFE7F, "Doppler Lab" }, - { 0xFE80, "Doppler Lab" }, - { 0xFE81, "Medtronic Inc." }, - { 0xFE82, "Medtronic Inc." }, - { 0xFE83, "Blue Bite" }, - { 0xFE84, "RF Digital Corp" }, - { 0xFE85, "RF Digital Corp" }, - { 0xFE86, "HUAWEI Technologies Co., Ltd. ( )" }, - { 0xFE87, "Qingdao Yeelink Information Technology Co., Ltd. ( )" }, - { 0xFE88, "SALTO SYSTEMS S.L." }, - { 0xFE89, "B&O Play A/S" }, - { 0xFE8A, "Apple, Inc." }, - { 0xFE8B, "Apple, Inc." }, - { 0xFE8C, "TRON Forum" }, - { 0xFE8D, "Interaxon Inc." }, - { 0xFE8E, "ARM Ltd" }, - { 0xFE8F, "CSR" }, - { 0xFE90, "JUMA" }, - { 0xFE91, "Shanghai Imilab Technology Co.,Ltd" }, - { 0xFE92, "Jarden Safety & Security" }, - { 0xFE93, "OttoQ Inc." }, - { 0xFE94, "OttoQ Inc." }, - { 0xFE95, "Xiaomi Inc." }, - { 0xFE96, "Tesla Motor Inc." }, - { 0xFE97, "Tesla Motor Inc." }, - { 0xFE98, "Currant, Inc." }, - { 0xFE99, "Currant, Inc." }, - { 0xFE9A, "Estimote" }, - { 0xFE9B, "Samsara Networks, Inc" }, - { 0xFE9C, "GSI Laboratories, Inc." }, - { 0xFE9D, "Mobiquity Networks Inc" }, - { 0xFE9E, "Dialog Semiconductor B.V." }, - { 0xFE9F, "Google Inc." }, - { 0xFEA0, "Google Inc." }, - { 0xFEA1, "Intrepid Control Systems, Inc." }, - { 0xFEA2, "Intrepid Control Systems, Inc." }, - { 0xFEA3, "ITT Industries" }, - { 0xFEA4, "Paxton Access Ltd" }, - { 0xFEA5, "GoPro, Inc." }, - { 0xFEA6, "GoPro, Inc." }, - { 0xFEA7, "UTC Fire and Security" }, - { 0xFEA8, "Savant Systems LLC" }, - { 0xFEA9, "Savant Systems LLC" }, - { 0xFEAA, "Google Inc." }, - { 0xFEAB, "Nokia Corporation" }, - { 0xFEAC, "Nokia Corporation" }, - { 0xFEAD, "Nokia Corporation" }, - { 0xFEAE, "Nokia Corporation" }, - { 0xFEAF, "Nest Labs Inc." }, - { 0xFEB0, "Nest Labs Inc." }, - { 0xFEB1, "Electronics Tomorrow Limited" }, - { 0xFEB2, "Microsoft Corporation" }, - { 0xFEB3, "Taobao" }, - { 0xFEB4, "WiSilica Inc." }, - { 0xFEB5, "WiSilica Inc." }, - { 0xFEB6, "Vencer Co, Ltd" }, - { 0xFEB7, "Facebook, Inc." }, - { 0xFEB8, "Facebook, Inc." }, - { 0xFEB9, "LG Electronics" }, - { 0xFEBA, "Tencent Holdings Limited" }, - { 0xFEBB, "adafruit industries" }, - { 0xFEBC, "Dexcom, Inc. " }, - { 0xFEBD, "Clover Network, Inc." }, - { 0xFEBE, "Bose Corporation" }, - { 0xFEBF, "Nod, Inc." }, - { 0xFEC0, "KDDI Corporation" }, - { 0xFEC1, "KDDI Corporation" }, - { 0xFEC2, "Blue Spark Technologies, Inc." }, - { 0xFEC3, "360fly, Inc." }, - { 0xFEC4, "PLUS Location Systems" }, - { 0xFEC5, "Realtek Semiconductor Corp." }, - { 0xFEC6, "Kocomojo, LLC" }, - { 0xFEC7, "Apple, Inc." }, - { 0xFEC8, "Apple, Inc." }, - { 0xFEC9, "Apple, Inc." }, - { 0xFECA, "Apple, Inc." }, - { 0xFECB, "Apple, Inc." }, - { 0xFECC, "Apple, Inc." }, - { 0xFECD, "Apple, Inc." }, - { 0xFECE, "Apple, Inc." }, - { 0xFECF, "Apple, Inc." }, - { 0xFED0, "Apple, Inc." }, - { 0xFED1, "Apple, Inc." }, - { 0xFED2, "Apple, Inc." }, - { 0xFED3, "Apple, Inc." }, - { 0xFED4, "Apple, Inc." }, - { 0xFED5, "Plantronics Inc." }, - { 0xFED6, "Broadcom Corporation" }, - { 0xFED7, "Broadcom Corporation" }, - { 0xFED8, "Google Inc." }, - { 0xFED9, "Pebble Technology Corporation" }, - { 0xFEDA, "ISSC Technologies Corporation" }, - { 0xFEDB, "Perka, Inc." }, - { 0xFEDC, "Jawbone" }, - { 0xFEDD, "Jawbone" }, - { 0xFEDE, "Coin, Inc." }, - { 0xFEDF, "Design SHIFT" }, - { 0xFEE0, "Anhui Huami Information Technology Co." }, - { 0xFEE1, "Anhui Huami Information Technology Co." }, - { 0xFEE2, "Anki, Inc." }, - { 0xFEE3, "Anki, Inc." }, - { 0xFEE4, "Nordic Semiconductor ASA" }, - { 0xFEE5, "Nordic Semiconductor ASA" }, - { 0xFEE6, "Silvair, Inc." }, - { 0xFEE7, "Tencent Holdings Limited" }, - { 0xFEE8, "Quintic Corp." }, - { 0xFEE9, "Quintic Corp." }, - { 0xFEEA, "Swirl Networks, Inc." }, - { 0xFEEB, "Swirl Networks, Inc." }, - { 0xFEEC, "Tile, Inc." }, - { 0xFEED, "Tile, Inc." }, - { 0xFEEE, "Polar Electro Oy" }, - { 0xFEEF, "Polar Electro Oy" }, - { 0xFEF0, "Intel" }, - { 0xFEF1, "CSR" }, - { 0xFEF2, "CSR" }, - { 0xFEF3, "Google Inc." }, - { 0xFEF4, "Google Inc." }, - { 0xFEF5, "Dialog Semiconductor GmbH" }, - { 0xFEF6, "Wicentric, Inc." }, - { 0xFEF7, "Aplix Corporation" }, - { 0xFEF8, "Aplix Corporation" }, - { 0xFEF9, "PayPal, Inc." }, - { 0xFEFA, "PayPal, Inc." }, - { 0xFEFB, "Telit Wireless Solutions (Formerly Stollmann E+V GmbH)" }, - { 0xFEFC, "Gimbal, Inc." }, - { 0xFEFD, "Gimbal, Inc." }, - { 0xFEFE, "GN ReSound A/S" }, - { 0xFEFF, "GN Netcom" }, - { 0xFFFF, "Reserved" }, /*for testing purposes only*/ + {0xFE08, "Microsoft"}, + {0xFE09, "Pillsy, Inc."}, + {0xFE0A, "ruwido austria gmbh"}, + {0xFE0B, "ruwido austria gmbh"}, + {0xFE0C, "Procter & Gamble"}, + {0xFE0D, "Procter & Gamble"}, + {0xFE0E, "Setec Pty Ltd"}, + {0xFE0F, "Philips Lighting B.V."}, + {0xFE10, "Lapis Semiconductor Co., Ltd."}, + {0xFE11, "GMC-I Messtechnik GmbH"}, + {0xFE12, "M-Way Solutions GmbH"}, + {0xFE13, "Apple Inc."}, + {0xFE14, "Flextronics International USA Inc."}, + {0xFE15, "Amazon Fulfillment Services, Inc."}, + {0xFE16, "Footmarks, Inc."}, + {0xFE17, "Telit Wireless Solutions GmbH"}, + {0xFE18, "Runtime, Inc."}, + {0xFE19, "Google Inc."}, + {0xFE1A, "Tyto Life LLC"}, + {0xFE1B, "Tyto Life LLC"}, + {0xFE1C, "NetMedia, Inc."}, + {0xFE1D, "Illuminati Instrument Corporation"}, + {0xFE1E, "Smart Innovations Co., Ltd"}, + {0xFE1F, "Garmin International, Inc."}, + {0xFE20, "Emerson"}, + {0xFE21, "Bose Corporation"}, + {0xFE22, "Zoll Medical Corporation"}, + {0xFE23, "Zoll Medical Corporation"}, + {0xFE24, "August Home Inc"}, + {0xFE25, "Apple, Inc. "}, + {0xFE26, "Google Inc."}, + {0xFE27, "Google Inc."}, + {0xFE28, "Ayla Networks"}, + {0xFE29, "Gibson Innovations"}, + {0xFE2A, "DaisyWorks, Inc."}, + {0xFE2B, "ITT Industries"}, + {0xFE2C, "Google Inc."}, + {0xFE2D, "SMART INNOVATION Co.,Ltd"}, + {0xFE2E, "ERi,Inc."}, + {0xFE2F, "CRESCO Wireless, Inc"}, + {0xFE30, "Volkswagen AG"}, + {0xFE31, "Volkswagen AG"}, + {0xFE32, "Pro-Mark, Inc."}, + {0xFE33, "CHIPOLO d.o.o."}, + {0xFE34, "SmallLoop LLC"}, + {0xFE35, "HUAWEI Technologies Co., Ltd"}, + {0xFE36, "HUAWEI Technologies Co., Ltd"}, + {0xFE37, "Spaceek LTD"}, + {0xFE38, "Spaceek LTD"}, + {0xFE39, "TTS Tooltechnic Systems AG & Co. KG"}, + {0xFE3A, "TTS Tooltechnic Systems AG & Co. KG"}, + {0xFE3B, "Dolby Laboratories"}, + {0xFE3C, "Alibaba"}, + {0xFE3D, "BD Medical"}, + {0xFE3E, "BD Medical"}, + {0xFE3F, "Friday Labs Limited"}, + {0xFE40, "Inugo Systems Limited"}, + {0xFE41, "Inugo Systems Limited"}, + {0xFE42, "Nets A/S "}, + {0xFE43, "Andreas Stihl AG & Co. KG"}, + {0xFE44, "SK Telecom "}, + {0xFE45, "Snapchat Inc"}, + {0xFE46, "B&O Play A/S "}, + {0xFE47, "General Motors"}, + {0xFE48, "General Motors"}, + {0xFE49, "SenionLab AB"}, + {0xFE4A, "OMRON HEALTHCARE Co., Ltd."}, + {0xFE4B, "Philips Lighting B.V."}, + {0xFE4C, "Volkswagen AG"}, + {0xFE4D, "Casambi Technologies Oy"}, + {0xFE4E, "NTT docomo"}, + {0xFE4F, "Molekule, Inc."}, + {0xFE50, "Google Inc."}, + {0xFE51, "SRAM"}, + {0xFE52, "SetPoint Medical"}, + {0xFE53, "3M"}, + {0xFE54, "Motiv, Inc."}, + {0xFE55, "Google Inc."}, + {0xFE56, "Google Inc."}, + {0xFE57, "Dotted Labs"}, + {0xFE58, "Nordic Semiconductor ASA"}, + {0xFE59, "Nordic Semiconductor ASA"}, + {0xFE5A, "Chronologics Corporation"}, + {0xFE5B, "GT-tronics HK Ltd"}, + {0xFE5C, "million hunters GmbH"}, + {0xFE5D, "Grundfos A/S"}, + {0xFE5E, "Plastc Corporation"}, + {0xFE5F, "Eyefi, Inc."}, + {0xFE60, "Lierda Science & Technology Group Co., Ltd."}, + {0xFE61, "Logitech International SA"}, + {0xFE62, "Indagem Tech LLC"}, + {0xFE63, "Connected Yard, Inc."}, + {0xFE64, "Siemens AG"}, + {0xFE65, "CHIPOLO d.o.o."}, + {0xFE66, "Intel Corporation"}, + {0xFE67, "Lab Sensor Solutions"}, + {0xFE68, "Qualcomm Life Inc"}, + {0xFE69, "Qualcomm Life Inc"}, + {0xFE6A, "Kontakt Micro-Location Sp. z o.o."}, + {0xFE6B, "TASER International, Inc."}, + {0xFE6C, "TASER International, Inc."}, + {0xFE6D, "The University of Tokyo"}, + {0xFE6E, "The University of Tokyo"}, + {0xFE6F, "LINE Corporation"}, + {0xFE70, "Beijing Jingdong Century Trading Co., Ltd."}, + {0xFE71, "Plume Design Inc"}, + {0xFE72, "St. Jude Medical, Inc."}, + {0xFE73, "St. Jude Medical, Inc."}, + {0xFE74, "unwire"}, + {0xFE75, "TangoMe"}, + {0xFE76, "TangoMe"}, + {0xFE77, "Hewlett-Packard Company"}, + {0xFE78, "Hewlett-Packard Company"}, + {0xFE79, "Zebra Technologies"}, + {0xFE7A, "Bragi GmbH"}, + {0xFE7B, "Orion Labs, Inc."}, + {0xFE7C, "Telit Wireless Solutions (Formerly Stollmann E+V GmbH)"}, + {0xFE7D, "Aterica Health Inc."}, + {0xFE7E, "Awear Solutions Ltd"}, + {0xFE7F, "Doppler Lab"}, + {0xFE80, "Doppler Lab"}, + {0xFE81, "Medtronic Inc."}, + {0xFE82, "Medtronic Inc."}, + {0xFE83, "Blue Bite"}, + {0xFE84, "RF Digital Corp"}, + {0xFE85, "RF Digital Corp"}, + {0xFE86, "HUAWEI Technologies Co., Ltd. ( )"}, + {0xFE87, "Qingdao Yeelink Information Technology Co., Ltd. ( )"}, + {0xFE88, "SALTO SYSTEMS S.L."}, + {0xFE89, "B&O Play A/S"}, + {0xFE8A, "Apple, Inc."}, + {0xFE8B, "Apple, Inc."}, + {0xFE8C, "TRON Forum"}, + {0xFE8D, "Interaxon Inc."}, + {0xFE8E, "ARM Ltd"}, + {0xFE8F, "CSR"}, + {0xFE90, "JUMA"}, + {0xFE91, "Shanghai Imilab Technology Co.,Ltd"}, + {0xFE92, "Jarden Safety & Security"}, + {0xFE93, "OttoQ Inc."}, + {0xFE94, "OttoQ Inc."}, + {0xFE95, "Xiaomi Inc."}, + {0xFE96, "Tesla Motor Inc."}, + {0xFE97, "Tesla Motor Inc."}, + {0xFE98, "Currant, Inc."}, + {0xFE99, "Currant, Inc."}, + {0xFE9A, "Estimote"}, + {0xFE9B, "Samsara Networks, Inc"}, + {0xFE9C, "GSI Laboratories, Inc."}, + {0xFE9D, "Mobiquity Networks Inc"}, + {0xFE9E, "Dialog Semiconductor B.V."}, + {0xFE9F, "Google Inc."}, + {0xFEA0, "Google Inc."}, + {0xFEA1, "Intrepid Control Systems, Inc."}, + {0xFEA2, "Intrepid Control Systems, Inc."}, + {0xFEA3, "ITT Industries"}, + {0xFEA4, "Paxton Access Ltd"}, + {0xFEA5, "GoPro, Inc."}, + {0xFEA6, "GoPro, Inc."}, + {0xFEA7, "UTC Fire and Security"}, + {0xFEA8, "Savant Systems LLC"}, + {0xFEA9, "Savant Systems LLC"}, + {0xFEAA, "Google Inc."}, + {0xFEAB, "Nokia Corporation"}, + {0xFEAC, "Nokia Corporation"}, + {0xFEAD, "Nokia Corporation"}, + {0xFEAE, "Nokia Corporation"}, + {0xFEAF, "Nest Labs Inc."}, + {0xFEB0, "Nest Labs Inc."}, + {0xFEB1, "Electronics Tomorrow Limited"}, + {0xFEB2, "Microsoft Corporation"}, + {0xFEB3, "Taobao"}, + {0xFEB4, "WiSilica Inc."}, + {0xFEB5, "WiSilica Inc."}, + {0xFEB6, "Vencer Co, Ltd"}, + {0xFEB7, "Facebook, Inc."}, + {0xFEB8, "Facebook, Inc."}, + {0xFEB9, "LG Electronics"}, + {0xFEBA, "Tencent Holdings Limited"}, + {0xFEBB, "adafruit industries"}, + {0xFEBC, "Dexcom, Inc. "}, + {0xFEBD, "Clover Network, Inc."}, + {0xFEBE, "Bose Corporation"}, + {0xFEBF, "Nod, Inc."}, + {0xFEC0, "KDDI Corporation"}, + {0xFEC1, "KDDI Corporation"}, + {0xFEC2, "Blue Spark Technologies, Inc."}, + {0xFEC3, "360fly, Inc."}, + {0xFEC4, "PLUS Location Systems"}, + {0xFEC5, "Realtek Semiconductor Corp."}, + {0xFEC6, "Kocomojo, LLC"}, + {0xFEC7, "Apple, Inc."}, + {0xFEC8, "Apple, Inc."}, + {0xFEC9, "Apple, Inc."}, + {0xFECA, "Apple, Inc."}, + {0xFECB, "Apple, Inc."}, + {0xFECC, "Apple, Inc."}, + {0xFECD, "Apple, Inc."}, + {0xFECE, "Apple, Inc."}, + {0xFECF, "Apple, Inc."}, + {0xFED0, "Apple, Inc."}, + {0xFED1, "Apple, Inc."}, + {0xFED2, "Apple, Inc."}, + {0xFED3, "Apple, Inc."}, + {0xFED4, "Apple, Inc."}, + {0xFED5, "Plantronics Inc."}, + {0xFED6, "Broadcom Corporation"}, + {0xFED7, "Broadcom Corporation"}, + {0xFED8, "Google Inc."}, + {0xFED9, "Pebble Technology Corporation"}, + {0xFEDA, "ISSC Technologies Corporation"}, + {0xFEDB, "Perka, Inc."}, + {0xFEDC, "Jawbone"}, + {0xFEDD, "Jawbone"}, + {0xFEDE, "Coin, Inc."}, + {0xFEDF, "Design SHIFT"}, + {0xFEE0, "Anhui Huami Information Technology Co."}, + {0xFEE1, "Anhui Huami Information Technology Co."}, + {0xFEE2, "Anki, Inc."}, + {0xFEE3, "Anki, Inc."}, + {0xFEE4, "Nordic Semiconductor ASA"}, + {0xFEE5, "Nordic Semiconductor ASA"}, + {0xFEE6, "Silvair, Inc."}, + {0xFEE7, "Tencent Holdings Limited"}, + {0xFEE8, "Quintic Corp."}, + {0xFEE9, "Quintic Corp."}, + {0xFEEA, "Swirl Networks, Inc."}, + {0xFEEB, "Swirl Networks, Inc."}, + {0xFEEC, "Tile, Inc."}, + {0xFEED, "Tile, Inc."}, + {0xFEEE, "Polar Electro Oy"}, + {0xFEEF, "Polar Electro Oy"}, + {0xFEF0, "Intel"}, + {0xFEF1, "CSR"}, + {0xFEF2, "CSR"}, + {0xFEF3, "Google Inc."}, + {0xFEF4, "Google Inc."}, + {0xFEF5, "Dialog Semiconductor GmbH"}, + {0xFEF6, "Wicentric, Inc."}, + {0xFEF7, "Aplix Corporation"}, + {0xFEF8, "Aplix Corporation"}, + {0xFEF9, "PayPal, Inc."}, + {0xFEFA, "PayPal, Inc."}, + {0xFEFB, "Telit Wireless Solutions (Formerly Stollmann E+V GmbH)"}, + {0xFEFC, "Gimbal, Inc."}, + {0xFEFD, "Gimbal, Inc."}, + {0xFEFE, "GN ReSound A/S"}, + {0xFEFF, "GN Netcom"}, + {0xFFFF, "Reserved"}, /*for testing purposes only*/ #endif - { 0, "" } + {0, ""} }; typedef struct { uint32_t assignedNumber; - const char* name; + const char *name; } gattdescriptor_t; static const gattdescriptor_t g_descriptor_ids[] = { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - { 0x2905, "Characteristic Aggregate Format" }, - { 0x2900, "Characteristic Extended Properties" }, - { 0x2904, "Characteristic Presentation Format" }, - { 0x2901, "Characteristic User Description" }, - { 0x2902, "Client Characteristic Configuration" }, - { 0x290B, "Environmental Sensing Configuration" }, - { 0x290C, "Environmental Sensing Measurement" }, - { 0x290D, "Environmental Sensing Trigger Setting" }, - { 0x2907, "External Report Reference" }, - { 0x2909, "Number of Digitals" }, - { 0x2908, "Report Reference" }, - { 0x2903, "Server Characteristic Configuration" }, - { 0x290E, "Time Trigger Setting" }, - { 0x2906, "Valid Range" }, - { 0x290A, "Value Trigger Setting" }, + {0x2905, "Characteristic Aggregate Format"}, + {0x2900, "Characteristic Extended Properties"}, + {0x2904, "Characteristic Presentation Format"}, + {0x2901, "Characteristic User Description"}, + {0x2902, "Client Characteristic Configuration"}, + {0x290B, "Environmental Sensing Configuration"}, + {0x290C, "Environmental Sensing Measurement"}, + {0x290D, "Environmental Sensing Trigger Setting"}, + {0x2907, "External Report Reference"}, + {0x2909, "Number of Digitals"}, + {0x2908, "Report Reference"}, + {0x2903, "Server Characteristic Configuration"}, + {0x290E, "Time Trigger Setting"}, + {0x2906, "Valid Range"}, + {0x290A, "Value Trigger Setting"}, #endif - { 0, "" } + {0, ""} }; typedef struct { uint32_t assignedNumber; - const char* name; + const char *name; } characteristicMap_t; static const characteristicMap_t g_characteristicsMappings[] = { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - { 0x2A7E, "Aerobic Heart Rate Lower Limit" }, - { 0x2A84, "Aerobic Heart Rate Upper Limit" }, - { 0x2A7F, "Aerobic Threshold" }, - { 0x2A80, "Age" }, - { 0x2A5A, "Aggregate" }, - { 0x2A43, "Alert Category ID" }, - { 0x2A42, "Alert Category ID Bit Mask" }, - { 0x2A06, "Alert Level" }, - { 0x2A44, "Alert Notification Control Point" }, - { 0x2A3F, "Alert Status" }, - { 0x2AB3, "Altitude" }, - { 0x2A81, "Anaerobic Heart Rate Lower Limit" }, - { 0x2A82, "Anaerobic Heart Rate Upper Limit" }, - { 0x2A83, "Anaerobic Threshold" }, - { 0x2A58, "Analog" }, - { 0x2A59, "Analog Output" }, - { 0x2A73, "Apparent Wind Direction" }, - { 0x2A72, "Apparent Wind Speed" }, - { 0x2A01, "Appearance" }, - { 0x2AA3, "Barometric Pressure Trend" }, - { 0x2A19, "Battery Level" }, - { 0x2A1B, "Battery Level State" }, - { 0x2A1A, "Battery Power State" }, - { 0x2A49, "Blood Pressure Feature" }, - { 0x2A35, "Blood Pressure Measurement" }, - { 0x2A9B, "Body Composition Feature" }, - { 0x2A9C, "Body Composition Measurement" }, - { 0x2A38, "Body Sensor Location" }, - { 0x2AA4, "Bond Management Control Point" }, - { 0x2AA5, "Bond Management Features" }, - { 0x2A22, "Boot Keyboard Input Report" }, - { 0x2A32, "Boot Keyboard Output Report" }, - { 0x2A33, "Boot Mouse Input Report" }, - { 0x2AA6, "Central Address Resolution" }, - { 0x2AA8, "CGM Feature" }, - { 0x2AA7, "CGM Measurement" }, - { 0x2AAB, "CGM Session Run Time" }, - { 0x2AAA, "CGM Session Start Time" }, - { 0x2AAC, "CGM Specific Ops Control Point" }, - { 0x2AA9, "CGM Status" }, - { 0x2ACE, "Cross Trainer Data" }, - { 0x2A5C, "CSC Feature" }, - { 0x2A5B, "CSC Measurement" }, - { 0x2A2B, "Current Time" }, - { 0x2A66, "Cycling Power Control Point" }, - { 0x2A66, "Cycling Power Control Point" }, - { 0x2A65, "Cycling Power Feature" }, - { 0x2A65, "Cycling Power Feature" }, - { 0x2A63, "Cycling Power Measurement" }, - { 0x2A64, "Cycling Power Vector" }, - { 0x2A99, "Database Change Increment" }, - { 0x2A85, "Date of Birth" }, - { 0x2A86, "Date of Threshold Assessment" }, - { 0x2A08, "Date Time" }, - { 0x2A0A, "Day Date Time" }, - { 0x2A09, "Day of Week" }, - { 0x2A7D, "Descriptor Value Changed" }, - { 0x2A00, "Device Name" }, - { 0x2A7B, "Dew Point" }, - { 0x2A56, "Digital" }, - { 0x2A57, "Digital Output" }, - { 0x2A0D, "DST Offset" }, - { 0x2A6C, "Elevation" }, - { 0x2A87, "Email Address" }, - { 0x2A0B, "Exact Time 100" }, - { 0x2A0C, "Exact Time 256" }, - { 0x2A88, "Fat Burn Heart Rate Lower Limit" }, - { 0x2A89, "Fat Burn Heart Rate Upper Limit" }, - { 0x2A26, "Firmware Revision String" }, - { 0x2A8A, "First Name" }, - { 0x2AD9, "Fitness Machine Control Point" }, - { 0x2ACC, "Fitness Machine Feature" }, - { 0x2ADA, "Fitness Machine Status" }, - { 0x2A8B, "Five Zone Heart Rate Limits" }, - { 0x2AB2, "Floor Number" }, - { 0x2A8C, "Gender" }, - { 0x2A51, "Glucose Feature" }, - { 0x2A18, "Glucose Measurement" }, - { 0x2A34, "Glucose Measurement Context" }, - { 0x2A74, "Gust Factor" }, - { 0x2A27, "Hardware Revision String" }, - { 0x2A39, "Heart Rate Control Point" }, - { 0x2A8D, "Heart Rate Max" }, - { 0x2A37, "Heart Rate Measurement" }, - { 0x2A7A, "Heat Index" }, - { 0x2A8E, "Height" }, - { 0x2A4C, "HID Control Point" }, - { 0x2A4A, "HID Information" }, - { 0x2A8F, "Hip Circumference" }, - { 0x2ABA, "HTTP Control Point" }, - { 0x2AB9, "HTTP Entity Body" }, - { 0x2AB7, "HTTP Headers" }, - { 0x2AB8, "HTTP Status Code" }, - { 0x2ABB, "HTTPS Security" }, - { 0x2A6F, "Humidity" }, - { 0x2A2A, "IEEE 11073-20601 Regulatory Certification Data List" }, - { 0x2AD2, "Indoor Bike Data" }, - { 0x2AAD, "Indoor Positioning Configuration" }, - { 0x2A36, "Intermediate Cuff Pressure" }, - { 0x2A1E, "Intermediate Temperature" }, - { 0x2A77, "Irradiance" }, - { 0x2AA2, "Language" }, - { 0x2A90, "Last Name" }, - { 0x2AAE, "Latitude" }, - { 0x2A6B, "LN Control Point" }, - { 0x2A6A, "LN Feature" }, - { 0x2AB1, "Local East Coordinate" }, - { 0x2AB0, "Local North Coordinate" }, - { 0x2A0F, "Local Time Information" }, - { 0x2A67, "Location and Speed Characteristic" }, - { 0x2AB5, "Location Name" }, - { 0x2AAF, "Longitude" }, - { 0x2A2C, "Magnetic Declination" }, - { 0x2AA0, "Magnetic Flux Density - 2D" }, - { 0x2AA1, "Magnetic Flux Density - 3D" }, - { 0x2A29, "Manufacturer Name String" }, - { 0x2A91, "Maximum Recommended Heart Rate" }, - { 0x2A21, "Measurement Interval" }, - { 0x2A24, "Model Number String" }, - { 0x2A68, "Navigation" }, - { 0x2A3E, "Network Availability" }, - { 0x2A46, "New Alert" }, - { 0x2AC5, "Object Action Control Point" }, - { 0x2AC8, "Object Changed" }, - { 0x2AC1, "Object First-Created" }, - { 0x2AC3, "Object ID" }, - { 0x2AC2, "Object Last-Modified" }, - { 0x2AC6, "Object List Control Point" }, - { 0x2AC7, "Object List Filter" }, - { 0x2ABE, "Object Name" }, - { 0x2AC4, "Object Properties" }, - { 0x2AC0, "Object Size" }, - { 0x2ABF, "Object Type" }, - { 0x2ABD, "OTS Feature" }, - { 0x2A04, "Peripheral Preferred Connection Parameters" }, - { 0x2A02, "Peripheral Privacy Flag" }, - { 0x2A5F, "PLX Continuous Measurement Characteristic" }, - { 0x2A60, "PLX Features" }, - { 0x2A5E, "PLX Spot-Check Measurement" }, - { 0x2A50, "PnP ID" }, - { 0x2A75, "Pollen Concentration" }, - { 0x2A2F, "Position 2D" }, - { 0x2A30, "Position 3D" }, - { 0x2A69, "Position Quality" }, - { 0x2A6D, "Pressure" }, - { 0x2A4E, "Protocol Mode" }, - { 0x2A62, "Pulse Oximetry Control Point" }, - { 0x2A60, "Pulse Oximetry Pulsatile Event Characteristic" }, - { 0x2A78, "Rainfall" }, - { 0x2A03, "Reconnection Address" }, - { 0x2A52, "Record Access Control Point" }, - { 0x2A14, "Reference Time Information" }, - { 0x2A3A, "Removable" }, - { 0x2A4D, "Report" }, - { 0x2A4B, "Report Map" }, - { 0x2AC9, "Resolvable Private Address Only" }, - { 0x2A92, "Resting Heart Rate" }, - { 0x2A40, "Ringer Control point" }, - { 0x2A41, "Ringer Setting" }, - { 0x2AD1, "Rower Data" }, - { 0x2A54, "RSC Feature" }, - { 0x2A53, "RSC Measurement" }, - { 0x2A55, "SC Control Point" }, - { 0x2A4F, "Scan Interval Window" }, - { 0x2A31, "Scan Refresh" }, - { 0x2A3C, "Scientific Temperature Celsius" }, - { 0x2A10, "Secondary Time Zone" }, - { 0x2A5D, "Sensor Location" }, - { 0x2A25, "Serial Number String" }, - { 0x2A05, "Service Changed" }, - { 0x2A3B, "Service Required" }, - { 0x2A28, "Software Revision String" }, - { 0x2A93, "Sport Type for Aerobic and Anaerobic Thresholds" }, - { 0x2AD0, "Stair Climber Data" }, - { 0x2ACF, "Step Climber Data" }, - { 0x2A3D, "String" }, - { 0x2AD7, "Supported Heart Rate Range" }, - { 0x2AD5, "Supported Inclination Range" }, - { 0x2A47, "Supported New Alert Category" }, - { 0x2AD8, "Supported Power Range" }, - { 0x2AD6, "Supported Resistance Level Range" }, - { 0x2AD4, "Supported Speed Range" }, - { 0x2A48, "Supported Unread Alert Category" }, - { 0x2A23, "System ID" }, - { 0x2ABC, "TDS Control Point" }, - { 0x2A6E, "Temperature" }, - { 0x2A1F, "Temperature Celsius" }, - { 0x2A20, "Temperature Fahrenheit" }, - { 0x2A1C, "Temperature Measurement" }, - { 0x2A1D, "Temperature Type" }, - { 0x2A94, "Three Zone Heart Rate Limits" }, - { 0x2A12, "Time Accuracy" }, - { 0x2A15, "Time Broadcast" }, - { 0x2A13, "Time Source" }, - { 0x2A16, "Time Update Control Point" }, - { 0x2A17, "Time Update State" }, - { 0x2A11, "Time with DST" }, - { 0x2A0E, "Time Zone" }, - { 0x2AD3, "Training Status" }, - { 0x2ACD, "Treadmill Data" }, - { 0x2A71, "True Wind Direction" }, - { 0x2A70, "True Wind Speed" }, - { 0x2A95, "Two Zone Heart Rate Limit" }, - { 0x2A07, "Tx Power Level" }, - { 0x2AB4, "Uncertainty" }, - { 0x2A45, "Unread Alert Status" }, - { 0x2AB6, "URI" }, - { 0x2A9F, "User Control Point" }, - { 0x2A9A, "User Index" }, - { 0x2A76, "UV Index" }, - { 0x2A96, "VO2 Max" }, - { 0x2A97, "Waist Circumference" }, - { 0x2A98, "Weight" }, - { 0x2A9D, "Weight Measurement" }, - { 0x2A9E, "Weight Scale Feature" }, - { 0x2A79, "Wind Chill" }, + {0x2A7E, "Aerobic Heart Rate Lower Limit"}, + {0x2A84, "Aerobic Heart Rate Upper Limit"}, + {0x2A7F, "Aerobic Threshold"}, + {0x2A80, "Age"}, + {0x2A5A, "Aggregate"}, + {0x2A43, "Alert Category ID"}, + {0x2A42, "Alert Category ID Bit Mask"}, + {0x2A06, "Alert Level"}, + {0x2A44, "Alert Notification Control Point"}, + {0x2A3F, "Alert Status"}, + {0x2AB3, "Altitude"}, + {0x2A81, "Anaerobic Heart Rate Lower Limit"}, + {0x2A82, "Anaerobic Heart Rate Upper Limit"}, + {0x2A83, "Anaerobic Threshold"}, + {0x2A58, "Analog"}, + {0x2A59, "Analog Output"}, + {0x2A73, "Apparent Wind Direction"}, + {0x2A72, "Apparent Wind Speed"}, + {0x2A01, "Appearance"}, + {0x2AA3, "Barometric Pressure Trend"}, + {0x2A19, "Battery Level"}, + {0x2A1B, "Battery Level State"}, + {0x2A1A, "Battery Power State"}, + {0x2A49, "Blood Pressure Feature"}, + {0x2A35, "Blood Pressure Measurement"}, + {0x2A9B, "Body Composition Feature"}, + {0x2A9C, "Body Composition Measurement"}, + {0x2A38, "Body Sensor Location"}, + {0x2AA4, "Bond Management Control Point"}, + {0x2AA5, "Bond Management Features"}, + {0x2A22, "Boot Keyboard Input Report"}, + {0x2A32, "Boot Keyboard Output Report"}, + {0x2A33, "Boot Mouse Input Report"}, + {0x2AA6, "Central Address Resolution"}, + {0x2AA8, "CGM Feature"}, + {0x2AA7, "CGM Measurement"}, + {0x2AAB, "CGM Session Run Time"}, + {0x2AAA, "CGM Session Start Time"}, + {0x2AAC, "CGM Specific Ops Control Point"}, + {0x2AA9, "CGM Status"}, + {0x2ACE, "Cross Trainer Data"}, + {0x2A5C, "CSC Feature"}, + {0x2A5B, "CSC Measurement"}, + {0x2A2B, "Current Time"}, + {0x2A66, "Cycling Power Control Point"}, + {0x2A66, "Cycling Power Control Point"}, + {0x2A65, "Cycling Power Feature"}, + {0x2A65, "Cycling Power Feature"}, + {0x2A63, "Cycling Power Measurement"}, + {0x2A64, "Cycling Power Vector"}, + {0x2A99, "Database Change Increment"}, + {0x2A85, "Date of Birth"}, + {0x2A86, "Date of Threshold Assessment"}, + {0x2A08, "Date Time"}, + {0x2A0A, "Day Date Time"}, + {0x2A09, "Day of Week"}, + {0x2A7D, "Descriptor Value Changed"}, + {0x2A00, "Device Name"}, + {0x2A7B, "Dew Point"}, + {0x2A56, "Digital"}, + {0x2A57, "Digital Output"}, + {0x2A0D, "DST Offset"}, + {0x2A6C, "Elevation"}, + {0x2A87, "Email Address"}, + {0x2A0B, "Exact Time 100"}, + {0x2A0C, "Exact Time 256"}, + {0x2A88, "Fat Burn Heart Rate Lower Limit"}, + {0x2A89, "Fat Burn Heart Rate Upper Limit"}, + {0x2A26, "Firmware Revision String"}, + {0x2A8A, "First Name"}, + {0x2AD9, "Fitness Machine Control Point"}, + {0x2ACC, "Fitness Machine Feature"}, + {0x2ADA, "Fitness Machine Status"}, + {0x2A8B, "Five Zone Heart Rate Limits"}, + {0x2AB2, "Floor Number"}, + {0x2A8C, "Gender"}, + {0x2A51, "Glucose Feature"}, + {0x2A18, "Glucose Measurement"}, + {0x2A34, "Glucose Measurement Context"}, + {0x2A74, "Gust Factor"}, + {0x2A27, "Hardware Revision String"}, + {0x2A39, "Heart Rate Control Point"}, + {0x2A8D, "Heart Rate Max"}, + {0x2A37, "Heart Rate Measurement"}, + {0x2A7A, "Heat Index"}, + {0x2A8E, "Height"}, + {0x2A4C, "HID Control Point"}, + {0x2A4A, "HID Information"}, + {0x2A8F, "Hip Circumference"}, + {0x2ABA, "HTTP Control Point"}, + {0x2AB9, "HTTP Entity Body"}, + {0x2AB7, "HTTP Headers"}, + {0x2AB8, "HTTP Status Code"}, + {0x2ABB, "HTTPS Security"}, + {0x2A6F, "Humidity"}, + {0x2A2A, "IEEE 11073-20601 Regulatory Certification Data List"}, + {0x2AD2, "Indoor Bike Data"}, + {0x2AAD, "Indoor Positioning Configuration"}, + {0x2A36, "Intermediate Cuff Pressure"}, + {0x2A1E, "Intermediate Temperature"}, + {0x2A77, "Irradiance"}, + {0x2AA2, "Language"}, + {0x2A90, "Last Name"}, + {0x2AAE, "Latitude"}, + {0x2A6B, "LN Control Point"}, + {0x2A6A, "LN Feature"}, + {0x2AB1, "Local East Coordinate"}, + {0x2AB0, "Local North Coordinate"}, + {0x2A0F, "Local Time Information"}, + {0x2A67, "Location and Speed Characteristic"}, + {0x2AB5, "Location Name"}, + {0x2AAF, "Longitude"}, + {0x2A2C, "Magnetic Declination"}, + {0x2AA0, "Magnetic Flux Density - 2D"}, + {0x2AA1, "Magnetic Flux Density - 3D"}, + {0x2A29, "Manufacturer Name String"}, + {0x2A91, "Maximum Recommended Heart Rate"}, + {0x2A21, "Measurement Interval"}, + {0x2A24, "Model Number String"}, + {0x2A68, "Navigation"}, + {0x2A3E, "Network Availability"}, + {0x2A46, "New Alert"}, + {0x2AC5, "Object Action Control Point"}, + {0x2AC8, "Object Changed"}, + {0x2AC1, "Object First-Created"}, + {0x2AC3, "Object ID"}, + {0x2AC2, "Object Last-Modified"}, + {0x2AC6, "Object List Control Point"}, + {0x2AC7, "Object List Filter"}, + {0x2ABE, "Object Name"}, + {0x2AC4, "Object Properties"}, + {0x2AC0, "Object Size"}, + {0x2ABF, "Object Type"}, + {0x2ABD, "OTS Feature"}, + {0x2A04, "Peripheral Preferred Connection Parameters"}, + {0x2A02, "Peripheral Privacy Flag"}, + {0x2A5F, "PLX Continuous Measurement Characteristic"}, + {0x2A60, "PLX Features"}, + {0x2A5E, "PLX Spot-Check Measurement"}, + {0x2A50, "PnP ID"}, + {0x2A75, "Pollen Concentration"}, + {0x2A2F, "Position 2D"}, + {0x2A30, "Position 3D"}, + {0x2A69, "Position Quality"}, + {0x2A6D, "Pressure"}, + {0x2A4E, "Protocol Mode"}, + {0x2A62, "Pulse Oximetry Control Point"}, + {0x2A60, "Pulse Oximetry Pulsatile Event Characteristic"}, + {0x2A78, "Rainfall"}, + {0x2A03, "Reconnection Address"}, + {0x2A52, "Record Access Control Point"}, + {0x2A14, "Reference Time Information"}, + {0x2A3A, "Removable"}, + {0x2A4D, "Report"}, + {0x2A4B, "Report Map"}, + {0x2AC9, "Resolvable Private Address Only"}, + {0x2A92, "Resting Heart Rate"}, + {0x2A40, "Ringer Control point"}, + {0x2A41, "Ringer Setting"}, + {0x2AD1, "Rower Data"}, + {0x2A54, "RSC Feature"}, + {0x2A53, "RSC Measurement"}, + {0x2A55, "SC Control Point"}, + {0x2A4F, "Scan Interval Window"}, + {0x2A31, "Scan Refresh"}, + {0x2A3C, "Scientific Temperature Celsius"}, + {0x2A10, "Secondary Time Zone"}, + {0x2A5D, "Sensor Location"}, + {0x2A25, "Serial Number String"}, + {0x2A05, "Service Changed"}, + {0x2A3B, "Service Required"}, + {0x2A28, "Software Revision String"}, + {0x2A93, "Sport Type for Aerobic and Anaerobic Thresholds"}, + {0x2AD0, "Stair Climber Data"}, + {0x2ACF, "Step Climber Data"}, + {0x2A3D, "String"}, + {0x2AD7, "Supported Heart Rate Range"}, + {0x2AD5, "Supported Inclination Range"}, + {0x2A47, "Supported New Alert Category"}, + {0x2AD8, "Supported Power Range"}, + {0x2AD6, "Supported Resistance Level Range"}, + {0x2AD4, "Supported Speed Range"}, + {0x2A48, "Supported Unread Alert Category"}, + {0x2A23, "System ID"}, + {0x2ABC, "TDS Control Point"}, + {0x2A6E, "Temperature"}, + {0x2A1F, "Temperature Celsius"}, + {0x2A20, "Temperature Fahrenheit"}, + {0x2A1C, "Temperature Measurement"}, + {0x2A1D, "Temperature Type"}, + {0x2A94, "Three Zone Heart Rate Limits"}, + {0x2A12, "Time Accuracy"}, + {0x2A15, "Time Broadcast"}, + {0x2A13, "Time Source"}, + {0x2A16, "Time Update Control Point"}, + {0x2A17, "Time Update State"}, + {0x2A11, "Time with DST"}, + {0x2A0E, "Time Zone"}, + {0x2AD3, "Training Status"}, + {0x2ACD, "Treadmill Data"}, + {0x2A71, "True Wind Direction"}, + {0x2A70, "True Wind Speed"}, + {0x2A95, "Two Zone Heart Rate Limit"}, + {0x2A07, "Tx Power Level"}, + {0x2AB4, "Uncertainty"}, + {0x2A45, "Unread Alert Status"}, + {0x2AB6, "URI"}, + {0x2A9F, "User Control Point"}, + {0x2A9A, "User Index"}, + {0x2A76, "UV Index"}, + {0x2A96, "VO2 Max"}, + {0x2A97, "Waist Circumference"}, + {0x2A98, "Weight"}, + {0x2A9D, "Weight Measurement"}, + {0x2A9E, "Weight Scale Feature"}, + {0x2A79, "Wind Chill"}, #endif - { 0, "" } + {0, ""} }; /** * @brief Mapping from service ids to names */ typedef struct { - const char* name; - const char* type; + const char *name; + const char *type; uint32_t assignedNumber; } gattService_t; - /** * Definition of the service ids to names that we know about. */ static const gattService_t g_gattServices[] = { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - { "Alert Notification Service", "org.bluetooth.service.alert_notification", 0x1811 }, - { "Automation IO", "org.bluetooth.service.automation_io", 0x1815 }, - { "Battery Service", "org.bluetooth.service.battery_service", 0x180F }, - { "Blood Pressure", "org.bluetooth.service.blood_pressure", 0x1810 }, - { "Body Composition", "org.bluetooth.service.body_composition", 0x181B }, - { "Bond Management", "org.bluetooth.service.bond_management", 0x181E }, - { "Continuous Glucose Monitoring", "org.bluetooth.service.continuous_glucose_monitoring", 0x181F }, - { "Current Time Service", "org.bluetooth.service.current_time", 0x1805 }, - { "Cycling Power", "org.bluetooth.service.cycling_power", 0x1818 }, - { "Cycling Speed and Cadence", "org.bluetooth.service.cycling_speed_and_cadence", 0x1816 }, - { "Device Information", "org.bluetooth.service.device_information", 0x180A }, - { "Environmental Sensing", "org.bluetooth.service.environmental_sensing", 0x181A }, - { "Generic Access", "org.bluetooth.service.generic_access", 0x1800 }, - { "Generic Attribute", "org.bluetooth.service.generic_attribute", 0x1801 }, - { "Glucose", "org.bluetooth.service.glucose", 0x1808 }, - { "Health Thermometer", "org.bluetooth.service.health_thermometer", 0x1809 }, - { "Heart Rate", "org.bluetooth.service.heart_rate", 0x180D }, - { "HTTP Proxy", "org.bluetooth.service.http_proxy", 0x1823 }, - { "Human Interface Device", "org.bluetooth.service.human_interface_device", 0x1812 }, - { "Immediate Alert", "org.bluetooth.service.immediate_alert", 0x1802 }, - { "Indoor Positioning", "org.bluetooth.service.indoor_positioning", 0x1821 }, - { "Internet Protocol Support", "org.bluetooth.service.internet_protocol_support", 0x1820 }, - { "Link Loss", "org.bluetooth.service.link_loss", 0x1803 }, - { "Location and Navigation", "org.bluetooth.service.location_and_navigation", 0x1819 }, - { "Next DST Change Service", "org.bluetooth.service.next_dst_change", 0x1807 }, - { "Object Transfer", "org.bluetooth.service.object_transfer", 0x1825 }, - { "Phone Alert Status Service", "org.bluetooth.service.phone_alert_status", 0x180E }, - { "Pulse Oximeter", "org.bluetooth.service.pulse_oximeter", 0x1822 }, - { "Reference Time Update Service", "org.bluetooth.service.reference_time_update", 0x1806 }, - { "Running Speed and Cadence", "org.bluetooth.service.running_speed_and_cadence", 0x1814 }, - { "Scan Parameters", "org.bluetooth.service.scan_parameters", 0x1813 }, - { "Transport Discovery", "org.bluetooth.service.transport_discovery", 0x1824 }, - { "Tx Power", "org.bluetooth.service.tx_power", 0x1804 }, - { "User Data", "org.bluetooth.service.user_data", 0x181C }, - { "Weight Scale", "org.bluetooth.service.weight_scale", 0x181D }, + {"Alert Notification Service", "org.bluetooth.service.alert_notification", 0x1811}, + {"Automation IO", "org.bluetooth.service.automation_io", 0x1815}, + {"Battery Service", "org.bluetooth.service.battery_service", 0x180F}, + {"Blood Pressure", "org.bluetooth.service.blood_pressure", 0x1810}, + {"Body Composition", "org.bluetooth.service.body_composition", 0x181B}, + {"Bond Management", "org.bluetooth.service.bond_management", 0x181E}, + {"Continuous Glucose Monitoring", "org.bluetooth.service.continuous_glucose_monitoring", 0x181F}, + {"Current Time Service", "org.bluetooth.service.current_time", 0x1805}, + {"Cycling Power", "org.bluetooth.service.cycling_power", 0x1818}, + {"Cycling Speed and Cadence", "org.bluetooth.service.cycling_speed_and_cadence", 0x1816}, + {"Device Information", "org.bluetooth.service.device_information", 0x180A}, + {"Environmental Sensing", "org.bluetooth.service.environmental_sensing", 0x181A}, + {"Generic Access", "org.bluetooth.service.generic_access", 0x1800}, + {"Generic Attribute", "org.bluetooth.service.generic_attribute", 0x1801}, + {"Glucose", "org.bluetooth.service.glucose", 0x1808}, + {"Health Thermometer", "org.bluetooth.service.health_thermometer", 0x1809}, + {"Heart Rate", "org.bluetooth.service.heart_rate", 0x180D}, + {"HTTP Proxy", "org.bluetooth.service.http_proxy", 0x1823}, + {"Human Interface Device", "org.bluetooth.service.human_interface_device", 0x1812}, + {"Immediate Alert", "org.bluetooth.service.immediate_alert", 0x1802}, + {"Indoor Positioning", "org.bluetooth.service.indoor_positioning", 0x1821}, + {"Internet Protocol Support", "org.bluetooth.service.internet_protocol_support", 0x1820}, + {"Link Loss", "org.bluetooth.service.link_loss", 0x1803}, + {"Location and Navigation", "org.bluetooth.service.location_and_navigation", 0x1819}, + {"Next DST Change Service", "org.bluetooth.service.next_dst_change", 0x1807}, + {"Object Transfer", "org.bluetooth.service.object_transfer", 0x1825}, + {"Phone Alert Status Service", "org.bluetooth.service.phone_alert_status", 0x180E}, + {"Pulse Oximeter", "org.bluetooth.service.pulse_oximeter", 0x1822}, + {"Reference Time Update Service", "org.bluetooth.service.reference_time_update", 0x1806}, + {"Running Speed and Cadence", "org.bluetooth.service.running_speed_and_cadence", 0x1814}, + {"Scan Parameters", "org.bluetooth.service.scan_parameters", 0x1813}, + {"Transport Discovery", "org.bluetooth.service.transport_discovery", 0x1824}, + {"Tx Power", "org.bluetooth.service.tx_power", 0x1804}, + {"User Data", "org.bluetooth.service.user_data", 0x181C}, + {"Weight Scale", "org.bluetooth.service.weight_scale", 0x181D}, #endif - { "", "", 0 } + {"", "", 0} }; - /** * @brief Convert characteristic properties into a string representation. * @param [in] prop Characteristic properties. @@ -630,28 +628,21 @@ static String gattIdToString(esp_gatt_id_t gattId) { return res; } // gattIdToString - /** * @brief Convert an esp_ble_addr_type_t to a string representation. */ -const char* BLEUtils::addressTypeToString(esp_ble_addr_type_t type) { +const char *BLEUtils::addressTypeToString(esp_ble_addr_type_t type) { switch (type) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case BLE_ADDR_TYPE_PUBLIC: - return "BLE_ADDR_TYPE_PUBLIC"; - case BLE_ADDR_TYPE_RANDOM: - return "BLE_ADDR_TYPE_RANDOM"; - case BLE_ADDR_TYPE_RPA_PUBLIC: - return "BLE_ADDR_TYPE_RPA_PUBLIC"; - case BLE_ADDR_TYPE_RPA_RANDOM: - return "BLE_ADDR_TYPE_RPA_RANDOM"; + case BLE_ADDR_TYPE_PUBLIC: return "BLE_ADDR_TYPE_PUBLIC"; + case BLE_ADDR_TYPE_RANDOM: return "BLE_ADDR_TYPE_RANDOM"; + case BLE_ADDR_TYPE_RPA_PUBLIC: return "BLE_ADDR_TYPE_RPA_PUBLIC"; + case BLE_ADDR_TYPE_RPA_RANDOM: return "BLE_ADDR_TYPE_RPA_RANDOM"; #endif - default: - return " esp_ble_addr_type_t"; + default: return " esp_ble_addr_type_t"; } } // addressTypeToString - /** * @brief Convert the BLE Advertising Data flags to a string. * @param adFlags The flags to convert @@ -677,7 +668,6 @@ String BLEUtils::adFlagsToString(uint8_t adFlags) { return res; } // adFlagsToString - /** * @brief Given an advertising type, return a string representation of the type. * @@ -686,7 +676,7 @@ String BLEUtils::adFlagsToString(uint8_t adFlags) { * * @return A string representation of the type. */ -const char* BLEUtils::advTypeToString(uint8_t advType) { +const char *BLEUtils::advTypeToString(uint8_t advType) { switch (advType) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG case ESP_BLE_AD_TYPE_FLAG: // 0x01 @@ -731,8 +721,7 @@ const char* BLEUtils::advTypeToString(uint8_t advType) { return "ESP_BLE_AD_TYPE_APPEARANCE"; case ESP_BLE_AD_TYPE_ADV_INT: // 0x1a return "ESP_BLE_AD_TYPE_ADV_INT"; - case ESP_BLE_AD_TYPE_32SOL_SRV_UUID: - return "ESP_BLE_AD_TYPE_32SOL_SRV_UUID"; + case ESP_BLE_AD_TYPE_32SOL_SRV_UUID: return "ESP_BLE_AD_TYPE_32SOL_SRV_UUID"; case ESP_BLE_AD_TYPE_32SERVICE_DATA: // 0x20 return "ESP_BLE_AD_TYPE_32SERVICE_DATA"; case ESP_BLE_AD_TYPE_128SERVICE_DATA: // 0x21 @@ -740,13 +729,10 @@ const char* BLEUtils::advTypeToString(uint8_t advType) { case ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE: // 0xff return "ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE"; #endif - default: - log_v(" adv data type: 0x%x", advType); - return ""; + default: log_v(" adv data type: 0x%x", advType); return ""; } // End switch } // advTypeToString - esp_gatt_id_t BLEUtils::buildGattId(esp_bt_uuid_t uuid, uint8_t inst_id) { esp_gatt_id_t retGattId; retGattId.uuid = uuid; @@ -769,21 +755,23 @@ esp_gatt_srvc_id_t BLEUtils::buildGattSrvcId(esp_gatt_id_t gattId, bool is_prima * @param [in] length The length of the data to convert. * @return A pointer to the formatted buffer. */ -char* BLEUtils::buildHexData(uint8_t* target, uint8_t* source, uint8_t length) { +char *BLEUtils::buildHexData(uint8_t *target, uint8_t *source, uint8_t length) { // Guard against too much data. - if (length > 100) length = 100; + if (length > 100) { + length = 100; + } if (target == nullptr) { - target = (uint8_t*)malloc(length * 2 + 1); + target = (uint8_t *)malloc(length * 2 + 1); if (target == nullptr) { log_e("buildHexData: malloc failed"); return nullptr; } } - char* startOfData = (char*)target; + char *startOfData = (char *)target; for (int i = 0; i < length; i++) { - sprintf((char*)target, "%.2x", (char)*source); + sprintf((char *)target, "%.2x", (char)*source); source++; target += 2; } @@ -796,7 +784,6 @@ char* BLEUtils::buildHexData(uint8_t* target, uint8_t* source, uint8_t length) { return startOfData; } // buildHexData - /** * @brief Build a printable string of memory range. * Create a string representation of a piece of memory. Only printable characters will be included @@ -805,7 +792,7 @@ char* BLEUtils::buildHexData(uint8_t* target, uint8_t* source, uint8_t length) { * @param [in] length Length of memory. * @return A string representation of a piece of memory. */ -String BLEUtils::buildPrintData(uint8_t* source, size_t length) { +String BLEUtils::buildPrintData(uint8_t *source, size_t length) { String res; for (int i = 0; i < length; i++) { char c = *source; @@ -815,7 +802,6 @@ String BLEUtils::buildPrintData(uint8_t* source, size_t length) { return res; } // buildPrintData - /** * @brief Convert a close/disconnect reason to a string. * @param [in] reason The close reason. @@ -825,85 +811,68 @@ String BLEUtils::gattCloseReasonToString(esp_gatt_conn_reason_t reason) { switch (reason) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG case ESP_GATT_CONN_UNKNOWN: - { - return "ESP_GATT_CONN_UNKNOWN"; - } + { + return "ESP_GATT_CONN_UNKNOWN"; + } case ESP_GATT_CONN_L2C_FAILURE: - { - return "ESP_GATT_CONN_L2C_FAILURE"; - } + { + return "ESP_GATT_CONN_L2C_FAILURE"; + } case ESP_GATT_CONN_TIMEOUT: - { - return "ESP_GATT_CONN_TIMEOUT"; - } + { + return "ESP_GATT_CONN_TIMEOUT"; + } case ESP_GATT_CONN_TERMINATE_PEER_USER: - { - return "ESP_GATT_CONN_TERMINATE_PEER_USER"; - } + { + return "ESP_GATT_CONN_TERMINATE_PEER_USER"; + } case ESP_GATT_CONN_TERMINATE_LOCAL_HOST: - { - return "ESP_GATT_CONN_TERMINATE_LOCAL_HOST"; - } + { + return "ESP_GATT_CONN_TERMINATE_LOCAL_HOST"; + } case ESP_GATT_CONN_FAIL_ESTABLISH: - { - return "ESP_GATT_CONN_FAIL_ESTABLISH"; - } + { + return "ESP_GATT_CONN_FAIL_ESTABLISH"; + } case ESP_GATT_CONN_LMP_TIMEOUT: - { - return "ESP_GATT_CONN_LMP_TIMEOUT"; - } + { + return "ESP_GATT_CONN_LMP_TIMEOUT"; + } case ESP_GATT_CONN_CONN_CANCEL: - { - return "ESP_GATT_CONN_CONN_CANCEL"; - } + { + return "ESP_GATT_CONN_CONN_CANCEL"; + } case ESP_GATT_CONN_NONE: - { - return "ESP_GATT_CONN_NONE"; - } + { + return "ESP_GATT_CONN_NONE"; + } #endif default: - { - return "Unknown"; - } + { + return "Unknown"; + } } } // gattCloseReasonToString - String BLEUtils::gattClientEventTypeToString(esp_gattc_cb_event_t eventType) { switch (eventType) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case ESP_GATTC_ACL_EVT: - return "ESP_GATTC_ACL_EVT"; - case ESP_GATTC_ADV_DATA_EVT: - return "ESP_GATTC_ADV_DATA_EVT"; - case ESP_GATTC_ADV_VSC_EVT: - return "ESP_GATTC_ADV_VSC_EVT"; - case ESP_GATTC_BTH_SCAN_CFG_EVT: - return "ESP_GATTC_BTH_SCAN_CFG_EVT"; - case ESP_GATTC_BTH_SCAN_DIS_EVT: - return "ESP_GATTC_BTH_SCAN_DIS_EVT"; - case ESP_GATTC_BTH_SCAN_ENB_EVT: - return "ESP_GATTC_BTH_SCAN_ENB_EVT"; - case ESP_GATTC_BTH_SCAN_PARAM_EVT: - return "ESP_GATTC_BTH_SCAN_PARAM_EVT"; - case ESP_GATTC_BTH_SCAN_RD_EVT: - return "ESP_GATTC_BTH_SCAN_RD_EVT"; - case ESP_GATTC_BTH_SCAN_THR_EVT: - return "ESP_GATTC_BTH_SCAN_THR_EVT"; - case ESP_GATTC_CANCEL_OPEN_EVT: - return "ESP_GATTC_CANCEL_OPEN_EVT"; - case ESP_GATTC_CFG_MTU_EVT: - return "ESP_GATTC_CFG_MTU_EVT"; - case ESP_GATTC_CLOSE_EVT: - return "ESP_GATTC_CLOSE_EVT"; - case ESP_GATTC_CONGEST_EVT: - return "ESP_GATTC_CONGEST_EVT"; - case ESP_GATTC_CONNECT_EVT: - return "ESP_GATTC_CONNECT_EVT"; - case ESP_GATTC_DISCONNECT_EVT: - return "ESP_GATTC_DISCONNECT_EVT"; - case ESP_GATTC_ENC_CMPL_CB_EVT: - return "ESP_GATTC_ENC_CMPL_CB_EVT"; + case ESP_GATTC_ACL_EVT: return "ESP_GATTC_ACL_EVT"; + case ESP_GATTC_ADV_DATA_EVT: return "ESP_GATTC_ADV_DATA_EVT"; + case ESP_GATTC_ADV_VSC_EVT: return "ESP_GATTC_ADV_VSC_EVT"; + case ESP_GATTC_BTH_SCAN_CFG_EVT: return "ESP_GATTC_BTH_SCAN_CFG_EVT"; + case ESP_GATTC_BTH_SCAN_DIS_EVT: return "ESP_GATTC_BTH_SCAN_DIS_EVT"; + case ESP_GATTC_BTH_SCAN_ENB_EVT: return "ESP_GATTC_BTH_SCAN_ENB_EVT"; + case ESP_GATTC_BTH_SCAN_PARAM_EVT: return "ESP_GATTC_BTH_SCAN_PARAM_EVT"; + case ESP_GATTC_BTH_SCAN_RD_EVT: return "ESP_GATTC_BTH_SCAN_RD_EVT"; + case ESP_GATTC_BTH_SCAN_THR_EVT: return "ESP_GATTC_BTH_SCAN_THR_EVT"; + case ESP_GATTC_CANCEL_OPEN_EVT: return "ESP_GATTC_CANCEL_OPEN_EVT"; + case ESP_GATTC_CFG_MTU_EVT: return "ESP_GATTC_CFG_MTU_EVT"; + case ESP_GATTC_CLOSE_EVT: return "ESP_GATTC_CLOSE_EVT"; + case ESP_GATTC_CONGEST_EVT: return "ESP_GATTC_CONGEST_EVT"; + case ESP_GATTC_CONNECT_EVT: return "ESP_GATTC_CONNECT_EVT"; + case ESP_GATTC_DISCONNECT_EVT: return "ESP_GATTC_DISCONNECT_EVT"; + case ESP_GATTC_ENC_CMPL_CB_EVT: return "ESP_GATTC_ENC_CMPL_CB_EVT"; case ESP_GATTC_EXEC_EVT: return "ESP_GATTC_EXEC_EVT"; //case ESP_GATTC_GET_CHAR_EVT: @@ -912,56 +881,32 @@ String BLEUtils::gattClientEventTypeToString(esp_gattc_cb_event_t eventType) { // return "ESP_GATTC_GET_DESCR_EVT"; //case ESP_GATTC_GET_INCL_SRVC_EVT: // return "ESP_GATTC_GET_INCL_SRVC_EVT"; - case ESP_GATTC_MULT_ADV_DATA_EVT: - return "ESP_GATTC_MULT_ADV_DATA_EVT"; - case ESP_GATTC_MULT_ADV_DIS_EVT: - return "ESP_GATTC_MULT_ADV_DIS_EVT"; - case ESP_GATTC_MULT_ADV_ENB_EVT: - return "ESP_GATTC_MULT_ADV_ENB_EVT"; - case ESP_GATTC_MULT_ADV_UPD_EVT: - return "ESP_GATTC_MULT_ADV_UPD_EVT"; - case ESP_GATTC_NOTIFY_EVT: - return "ESP_GATTC_NOTIFY_EVT"; - case ESP_GATTC_OPEN_EVT: - return "ESP_GATTC_OPEN_EVT"; - case ESP_GATTC_PREP_WRITE_EVT: - return "ESP_GATTC_PREP_WRITE_EVT"; - case ESP_GATTC_READ_CHAR_EVT: - return "ESP_GATTC_READ_CHAR_EVT"; - case ESP_GATTC_REG_EVT: - return "ESP_GATTC_REG_EVT"; - case ESP_GATTC_REG_FOR_NOTIFY_EVT: - return "ESP_GATTC_REG_FOR_NOTIFY_EVT"; - case ESP_GATTC_SCAN_FLT_CFG_EVT: - return "ESP_GATTC_SCAN_FLT_CFG_EVT"; - case ESP_GATTC_SCAN_FLT_PARAM_EVT: - return "ESP_GATTC_SCAN_FLT_PARAM_EVT"; - case ESP_GATTC_SCAN_FLT_STATUS_EVT: - return "ESP_GATTC_SCAN_FLT_STATUS_EVT"; - case ESP_GATTC_SEARCH_CMPL_EVT: - return "ESP_GATTC_SEARCH_CMPL_EVT"; - case ESP_GATTC_SEARCH_RES_EVT: - return "ESP_GATTC_SEARCH_RES_EVT"; - case ESP_GATTC_SRVC_CHG_EVT: - return "ESP_GATTC_SRVC_CHG_EVT"; - case ESP_GATTC_READ_DESCR_EVT: - return "ESP_GATTC_READ_DESCR_EVT"; - case ESP_GATTC_UNREG_EVT: - return "ESP_GATTC_UNREG_EVT"; - case ESP_GATTC_UNREG_FOR_NOTIFY_EVT: - return "ESP_GATTC_UNREG_FOR_NOTIFY_EVT"; - case ESP_GATTC_WRITE_CHAR_EVT: - return "ESP_GATTC_WRITE_CHAR_EVT"; - case ESP_GATTC_WRITE_DESCR_EVT: - return "ESP_GATTC_WRITE_DESCR_EVT"; + case ESP_GATTC_MULT_ADV_DATA_EVT: return "ESP_GATTC_MULT_ADV_DATA_EVT"; + case ESP_GATTC_MULT_ADV_DIS_EVT: return "ESP_GATTC_MULT_ADV_DIS_EVT"; + case ESP_GATTC_MULT_ADV_ENB_EVT: return "ESP_GATTC_MULT_ADV_ENB_EVT"; + case ESP_GATTC_MULT_ADV_UPD_EVT: return "ESP_GATTC_MULT_ADV_UPD_EVT"; + case ESP_GATTC_NOTIFY_EVT: return "ESP_GATTC_NOTIFY_EVT"; + case ESP_GATTC_OPEN_EVT: return "ESP_GATTC_OPEN_EVT"; + case ESP_GATTC_PREP_WRITE_EVT: return "ESP_GATTC_PREP_WRITE_EVT"; + case ESP_GATTC_READ_CHAR_EVT: return "ESP_GATTC_READ_CHAR_EVT"; + case ESP_GATTC_REG_EVT: return "ESP_GATTC_REG_EVT"; + case ESP_GATTC_REG_FOR_NOTIFY_EVT: return "ESP_GATTC_REG_FOR_NOTIFY_EVT"; + case ESP_GATTC_SCAN_FLT_CFG_EVT: return "ESP_GATTC_SCAN_FLT_CFG_EVT"; + case ESP_GATTC_SCAN_FLT_PARAM_EVT: return "ESP_GATTC_SCAN_FLT_PARAM_EVT"; + case ESP_GATTC_SCAN_FLT_STATUS_EVT: return "ESP_GATTC_SCAN_FLT_STATUS_EVT"; + case ESP_GATTC_SEARCH_CMPL_EVT: return "ESP_GATTC_SEARCH_CMPL_EVT"; + case ESP_GATTC_SEARCH_RES_EVT: return "ESP_GATTC_SEARCH_RES_EVT"; + case ESP_GATTC_SRVC_CHG_EVT: return "ESP_GATTC_SRVC_CHG_EVT"; + case ESP_GATTC_READ_DESCR_EVT: return "ESP_GATTC_READ_DESCR_EVT"; + case ESP_GATTC_UNREG_EVT: return "ESP_GATTC_UNREG_EVT"; + case ESP_GATTC_UNREG_FOR_NOTIFY_EVT: return "ESP_GATTC_UNREG_FOR_NOTIFY_EVT"; + case ESP_GATTC_WRITE_CHAR_EVT: return "ESP_GATTC_WRITE_CHAR_EVT"; + case ESP_GATTC_WRITE_DESCR_EVT: return "ESP_GATTC_WRITE_DESCR_EVT"; #endif - default: - log_v("Unknown GATT Client event type: %d", eventType); - return "Unknown"; + default: log_v("Unknown GATT Client event type: %d", eventType); return "Unknown"; } } // gattClientEventTypeToString - /** * @brief Return a string representation of a GATT server event code. * @param [in] eventType A GATT server event code. @@ -970,90 +915,55 @@ String BLEUtils::gattClientEventTypeToString(esp_gattc_cb_event_t eventType) { String BLEUtils::gattServerEventTypeToString(esp_gatts_cb_event_t eventType) { switch (eventType) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case ESP_GATTS_REG_EVT: - return "ESP_GATTS_REG_EVT"; - case ESP_GATTS_READ_EVT: - return "ESP_GATTS_READ_EVT"; - case ESP_GATTS_WRITE_EVT: - return "ESP_GATTS_WRITE_EVT"; - case ESP_GATTS_EXEC_WRITE_EVT: - return "ESP_GATTS_EXEC_WRITE_EVT"; - case ESP_GATTS_MTU_EVT: - return "ESP_GATTS_MTU_EVT"; - case ESP_GATTS_CONF_EVT: - return "ESP_GATTS_CONF_EVT"; - case ESP_GATTS_UNREG_EVT: - return "ESP_GATTS_UNREG_EVT"; - case ESP_GATTS_CREATE_EVT: - return "ESP_GATTS_CREATE_EVT"; - case ESP_GATTS_ADD_INCL_SRVC_EVT: - return "ESP_GATTS_ADD_INCL_SRVC_EVT"; - case ESP_GATTS_ADD_CHAR_EVT: - return "ESP_GATTS_ADD_CHAR_EVT"; - case ESP_GATTS_ADD_CHAR_DESCR_EVT: - return "ESP_GATTS_ADD_CHAR_DESCR_EVT"; - case ESP_GATTS_DELETE_EVT: - return "ESP_GATTS_DELETE_EVT"; - case ESP_GATTS_START_EVT: - return "ESP_GATTS_START_EVT"; - case ESP_GATTS_STOP_EVT: - return "ESP_GATTS_STOP_EVT"; - case ESP_GATTS_CONNECT_EVT: - return "ESP_GATTS_CONNECT_EVT"; - case ESP_GATTS_DISCONNECT_EVT: - return "ESP_GATTS_DISCONNECT_EVT"; - case ESP_GATTS_OPEN_EVT: - return "ESP_GATTS_OPEN_EVT"; - case ESP_GATTS_CANCEL_OPEN_EVT: - return "ESP_GATTS_CANCEL_OPEN_EVT"; - case ESP_GATTS_CLOSE_EVT: - return "ESP_GATTS_CLOSE_EVT"; - case ESP_GATTS_LISTEN_EVT: - return "ESP_GATTS_LISTEN_EVT"; - case ESP_GATTS_CONGEST_EVT: - return "ESP_GATTS_CONGEST_EVT"; - case ESP_GATTS_RESPONSE_EVT: - return "ESP_GATTS_RESPONSE_EVT"; - case ESP_GATTS_CREAT_ATTR_TAB_EVT: - return "ESP_GATTS_CREAT_ATTR_TAB_EVT"; - case ESP_GATTS_SET_ATTR_VAL_EVT: - return "ESP_GATTS_SET_ATTR_VAL_EVT"; - case ESP_GATTS_SEND_SERVICE_CHANGE_EVT: - return "ESP_GATTS_SEND_SERVICE_CHANGE_EVT"; + case ESP_GATTS_REG_EVT: return "ESP_GATTS_REG_EVT"; + case ESP_GATTS_READ_EVT: return "ESP_GATTS_READ_EVT"; + case ESP_GATTS_WRITE_EVT: return "ESP_GATTS_WRITE_EVT"; + case ESP_GATTS_EXEC_WRITE_EVT: return "ESP_GATTS_EXEC_WRITE_EVT"; + case ESP_GATTS_MTU_EVT: return "ESP_GATTS_MTU_EVT"; + case ESP_GATTS_CONF_EVT: return "ESP_GATTS_CONF_EVT"; + case ESP_GATTS_UNREG_EVT: return "ESP_GATTS_UNREG_EVT"; + case ESP_GATTS_CREATE_EVT: return "ESP_GATTS_CREATE_EVT"; + case ESP_GATTS_ADD_INCL_SRVC_EVT: return "ESP_GATTS_ADD_INCL_SRVC_EVT"; + case ESP_GATTS_ADD_CHAR_EVT: return "ESP_GATTS_ADD_CHAR_EVT"; + case ESP_GATTS_ADD_CHAR_DESCR_EVT: return "ESP_GATTS_ADD_CHAR_DESCR_EVT"; + case ESP_GATTS_DELETE_EVT: return "ESP_GATTS_DELETE_EVT"; + case ESP_GATTS_START_EVT: return "ESP_GATTS_START_EVT"; + case ESP_GATTS_STOP_EVT: return "ESP_GATTS_STOP_EVT"; + case ESP_GATTS_CONNECT_EVT: return "ESP_GATTS_CONNECT_EVT"; + case ESP_GATTS_DISCONNECT_EVT: return "ESP_GATTS_DISCONNECT_EVT"; + case ESP_GATTS_OPEN_EVT: return "ESP_GATTS_OPEN_EVT"; + case ESP_GATTS_CANCEL_OPEN_EVT: return "ESP_GATTS_CANCEL_OPEN_EVT"; + case ESP_GATTS_CLOSE_EVT: return "ESP_GATTS_CLOSE_EVT"; + case ESP_GATTS_LISTEN_EVT: return "ESP_GATTS_LISTEN_EVT"; + case ESP_GATTS_CONGEST_EVT: return "ESP_GATTS_CONGEST_EVT"; + case ESP_GATTS_RESPONSE_EVT: return "ESP_GATTS_RESPONSE_EVT"; + case ESP_GATTS_CREAT_ATTR_TAB_EVT: return "ESP_GATTS_CREAT_ATTR_TAB_EVT"; + case ESP_GATTS_SET_ATTR_VAL_EVT: return "ESP_GATTS_SET_ATTR_VAL_EVT"; + case ESP_GATTS_SEND_SERVICE_CHANGE_EVT: return "ESP_GATTS_SEND_SERVICE_CHANGE_EVT"; #endif - default: - return "Unknown"; + default: return "Unknown"; } } // gattServerEventTypeToString - - /** * @brief Convert a BLE device type to a string. * @param [in] type The device type. */ -const char* BLEUtils::devTypeToString(esp_bt_dev_type_t type) { +const char *BLEUtils::devTypeToString(esp_bt_dev_type_t type) { switch (type) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case ESP_BT_DEVICE_TYPE_BREDR: - return "ESP_BT_DEVICE_TYPE_BREDR"; - case ESP_BT_DEVICE_TYPE_BLE: - return "ESP_BT_DEVICE_TYPE_BLE"; - case ESP_BT_DEVICE_TYPE_DUMO: - return "ESP_BT_DEVICE_TYPE_DUMO"; + case ESP_BT_DEVICE_TYPE_BREDR: return "ESP_BT_DEVICE_TYPE_BREDR"; + case ESP_BT_DEVICE_TYPE_BLE: return "ESP_BT_DEVICE_TYPE_BLE"; + case ESP_BT_DEVICE_TYPE_DUMO: return "ESP_BT_DEVICE_TYPE_DUMO"; #endif - default: - return "Unknown"; + default: return "Unknown"; } } // devTypeToString - /** * @brief Dump the GAP event to the log. */ -void BLEUtils::dumpGapEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param) { +void BLEUtils::dumpGapEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { log_v("Received a GAP event: %s", gapEventToString(event)); switch (event) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG @@ -1061,40 +971,40 @@ void BLEUtils::dumpGapEvent( // adv_data_cmpl // - esp_bt_status_t case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT: - { - log_v("[status: %d]", param->adv_data_cmpl.status); - break; - } // ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT + { + log_v("[status: %d]", param->adv_data_cmpl.status); + break; + } // ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT // ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT // // adv_data_raw_cmpl // - esp_bt_status_t status case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT: - { - log_v("[status: %d]", param->adv_data_raw_cmpl.status); - break; - } // ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT + { + log_v("[status: %d]", param->adv_data_raw_cmpl.status); + break; + } // ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT // ESP_GAP_BLE_ADV_START_COMPLETE_EVT // // adv_start_cmpl // - esp_bt_status_t status case ESP_GAP_BLE_ADV_START_COMPLETE_EVT: - { - log_v("[status: %d]", param->adv_start_cmpl.status); - break; - } // ESP_GAP_BLE_ADV_START_COMPLETE_EVT + { + log_v("[status: %d]", param->adv_start_cmpl.status); + break; + } // ESP_GAP_BLE_ADV_START_COMPLETE_EVT // ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT // // adv_stop_cmpl // - esp_bt_status_t status case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT: - { - log_v("[status: %d]", param->adv_stop_cmpl.status); - break; - } // ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT + { + log_v("[status: %d]", param->adv_stop_cmpl.status); + break; + } // ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT // ESP_GAP_BLE_AUTH_CMPL_EVT // @@ -1107,47 +1017,43 @@ void BLEUtils::dumpGapEvent( // - esp_bd_addr_type_t addr_type // - esp_bt_dev_type_t dev_type case ESP_GAP_BLE_AUTH_CMPL_EVT: - { - log_v("[bd_addr: %s, key_present: %d, key: ***, key_type: %d, success: %d, fail_reason: %d, addr_type: ***, dev_type: %s]", - BLEAddress(param->ble_security.auth_cmpl.bd_addr).toString().c_str(), - param->ble_security.auth_cmpl.key_present, - param->ble_security.auth_cmpl.key_type, - param->ble_security.auth_cmpl.success, - param->ble_security.auth_cmpl.fail_reason, - BLEUtils::devTypeToString(param->ble_security.auth_cmpl.dev_type)); - break; - } // ESP_GAP_BLE_AUTH_CMPL_EVT + { + log_v( + "[bd_addr: %s, key_present: %d, key: ***, key_type: %d, success: %d, fail_reason: %d, addr_type: ***, dev_type: %s]", + BLEAddress(param->ble_security.auth_cmpl.bd_addr).toString().c_str(), param->ble_security.auth_cmpl.key_present, param->ble_security.auth_cmpl.key_type, + param->ble_security.auth_cmpl.success, param->ble_security.auth_cmpl.fail_reason, BLEUtils::devTypeToString(param->ble_security.auth_cmpl.dev_type) + ); + break; + } // ESP_GAP_BLE_AUTH_CMPL_EVT // ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT // // clear_bond_dev_cmpl // - esp_bt_status_t status case ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT: - { - log_v("[status: %d]", param->clear_bond_dev_cmpl.status); - break; - } // ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT + { + log_v("[status: %d]", param->clear_bond_dev_cmpl.status); + break; + } // ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT // ESP_GAP_BLE_LOCAL_IR_EVT case ESP_GAP_BLE_LOCAL_IR_EVT: - { - break; - } // ESP_GAP_BLE_LOCAL_IR_EVT + { + break; + } // ESP_GAP_BLE_LOCAL_IR_EVT // ESP_GAP_BLE_LOCAL_ER_EVT case ESP_GAP_BLE_LOCAL_ER_EVT: - { - break; - } // ESP_GAP_BLE_LOCAL_ER_EVT + { + break; + } // ESP_GAP_BLE_LOCAL_ER_EVT // ESP_GAP_BLE_NC_REQ_EVT case ESP_GAP_BLE_NC_REQ_EVT: - { - log_v("[bd_addr: %s, passkey: %d]", - BLEAddress(param->ble_security.key_notif.bd_addr).toString().c_str(), - param->ble_security.key_notif.passkey); - break; - } // ESP_GAP_BLE_NC_REQ_EVT + { + log_v("[bd_addr: %s, passkey: %d]", BLEAddress(param->ble_security.key_notif.bd_addr).toString().c_str(), param->ble_security.key_notif.passkey); + break; + } // ESP_GAP_BLE_NC_REQ_EVT // ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT // @@ -1156,23 +1062,23 @@ void BLEUtils::dumpGapEvent( // - int8_t rssi // - esp_bd_addr_t remote_addr case ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT: - { - log_v("[status: %d, rssi: %d, remote_addr: %s]", - param->read_rssi_cmpl.status, - param->read_rssi_cmpl.rssi, - BLEAddress(param->read_rssi_cmpl.remote_addr).toString().c_str()); - break; - } // ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT + { + log_v( + "[status: %d, rssi: %d, remote_addr: %s]", param->read_rssi_cmpl.status, param->read_rssi_cmpl.rssi, + BLEAddress(param->read_rssi_cmpl.remote_addr).toString().c_str() + ); + break; + } // ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT // ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT // // scan_param_cmpl. // - esp_bt_status_t status case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: - { - log_v("[status: %d]", param->scan_param_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT + { + log_v("[status: %d]", param->scan_param_cmpl.status); + break; + } // ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT // ESP_GAP_BLE_SCAN_RESULT_EVT // @@ -1189,70 +1095,65 @@ void BLEUtils::dumpGapEvent( // - adv_data_len // - scan_rsp_len case ESP_GAP_BLE_SCAN_RESULT_EVT: - { - switch (param->scan_rst.search_evt) { - case ESP_GAP_SEARCH_INQ_RES_EVT: - { - log_v("search_evt: %s, bda: %s, dev_type: %s, ble_addr_type: %s, ble_evt_type: %s, rssi: %d, ble_adv: ??, flag: %d (%s), num_resps: %d, adv_data_len: %d, scan_rsp_len: %d", - searchEventTypeToString(param->scan_rst.search_evt), - BLEAddress(param->scan_rst.bda).toString().c_str(), - devTypeToString(param->scan_rst.dev_type), - addressTypeToString(param->scan_rst.ble_addr_type), - eventTypeToString(param->scan_rst.ble_evt_type), - param->scan_rst.rssi, - param->scan_rst.flag, - adFlagsToString(param->scan_rst.flag).c_str(), - param->scan_rst.num_resps, - param->scan_rst.adv_data_len, - param->scan_rst.scan_rsp_len); - break; - } // ESP_GAP_SEARCH_INQ_RES_EVT + { + switch (param->scan_rst.search_evt) { + case ESP_GAP_SEARCH_INQ_RES_EVT: + { + log_v( + "search_evt: %s, bda: %s, dev_type: %s, ble_addr_type: %s, ble_evt_type: %s, rssi: %d, ble_adv: ??, flag: %d (%s), num_resps: %d, adv_data_len: " + "%d, scan_rsp_len: %d", + searchEventTypeToString(param->scan_rst.search_evt), BLEAddress(param->scan_rst.bda).toString().c_str(), devTypeToString(param->scan_rst.dev_type), + addressTypeToString(param->scan_rst.ble_addr_type), eventTypeToString(param->scan_rst.ble_evt_type), param->scan_rst.rssi, param->scan_rst.flag, + adFlagsToString(param->scan_rst.flag).c_str(), param->scan_rst.num_resps, param->scan_rst.adv_data_len, param->scan_rst.scan_rsp_len + ); + break; + } // ESP_GAP_SEARCH_INQ_RES_EVT - default: - { - log_v("search_evt: %s", searchEventTypeToString(param->scan_rst.search_evt)); - break; - } + default: + { + log_v("search_evt: %s", searchEventTypeToString(param->scan_rst.search_evt)); + break; } - break; - } // ESP_GAP_BLE_SCAN_RESULT_EVT + } + break; + } // ESP_GAP_BLE_SCAN_RESULT_EVT // ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT // // scan_rsp_data_cmpl // - esp_bt_status_t status case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT: - { - log_v("[status: %d]", param->scan_rsp_data_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT + { + log_v("[status: %d]", param->scan_rsp_data_cmpl.status); + break; + } // ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT // ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT: - { - log_v("[status: %d]", param->scan_rsp_data_raw_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT + { + log_v("[status: %d]", param->scan_rsp_data_raw_cmpl.status); + break; + } // ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT // ESP_GAP_BLE_SCAN_START_COMPLETE_EVT // // scan_start_cmpl // - esp_bt_status_t status case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT: - { - log_v("[status: %d]", param->scan_start_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_START_COMPLETE_EVT + { + log_v("[status: %d]", param->scan_start_cmpl.status); + break; + } // ESP_GAP_BLE_SCAN_START_COMPLETE_EVT // ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT // // scan_stop_cmpl // - esp_bt_status_t status case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT: - { - log_v("[status: %d]", param->scan_stop_cmpl.status); - break; - } // ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT + { + log_v("[status: %d]", param->scan_stop_cmpl.status); + break; + } // ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT // ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT // @@ -1265,44 +1166,37 @@ void BLEUtils::dumpGapEvent( // - uint16_t conn_int // - uint16_t timeout case ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT: - { - log_v("[status: %d, bd_addr: %s, min_int: %d, max_int: %d, latency: %d, conn_int: %d, timeout: %d]", - param->update_conn_params.status, - BLEAddress(param->update_conn_params.bda).toString().c_str(), - param->update_conn_params.min_int, - param->update_conn_params.max_int, - param->update_conn_params.latency, - param->update_conn_params.conn_int, - param->update_conn_params.timeout); - break; - } // ESP_GAP_BLE_SCAN_UPDATE_CONN_PARAMS_EVT + { + log_v( + "[status: %d, bd_addr: %s, min_int: %d, max_int: %d, latency: %d, conn_int: %d, timeout: %d]", param->update_conn_params.status, + BLEAddress(param->update_conn_params.bda).toString().c_str(), param->update_conn_params.min_int, param->update_conn_params.max_int, + param->update_conn_params.latency, param->update_conn_params.conn_int, param->update_conn_params.timeout + ); + break; + } // ESP_GAP_BLE_SCAN_UPDATE_CONN_PARAMS_EVT // ESP_GAP_BLE_SEC_REQ_EVT case ESP_GAP_BLE_SEC_REQ_EVT: - { - log_v("[bd_addr: %s]", BLEAddress(param->ble_security.ble_req.bd_addr).toString().c_str()); - break; - } // ESP_GAP_BLE_SEC_REQ_EVT + { + log_v("[bd_addr: %s]", BLEAddress(param->ble_security.ble_req.bd_addr).toString().c_str()); + break; + } // ESP_GAP_BLE_SEC_REQ_EVT #endif default: - { - log_v("*** dumpGapEvent: Logger not coded ***"); - break; - } // default - } // switch + { + log_v("*** dumpGapEvent: Logger not coded ***"); + break; + } // default + } // switch } // dumpGapEvent - /** * @brief Decode and dump a GATT client event * * @param [in] event The type of event received. * @param [in] evtParam The data associated with the event. */ -void BLEUtils::dumpGattClientEvent( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam) { +void BLEUtils::dumpGattClientEvent(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *evtParam) { //esp_ble_gattc_cb_param_t* evtParam = (esp_ble_gattc_cb_param_t*) param; log_v("GATT Event: %s", BLEUtils::gattClientEventTypeToString(event).c_str()); @@ -1316,13 +1210,13 @@ void BLEUtils::dumpGattClientEvent( // - esp_bd_addr_t remote_bda // - esp_gatt_conn_reason_t reason case ESP_GATTC_CLOSE_EVT: - { - log_v("[status: %s, reason:%s, conn_id: %d]", - BLEUtils::gattStatusToString(evtParam->close.status).c_str(), - BLEUtils::gattCloseReasonToString(evtParam->close.reason).c_str(), - evtParam->close.conn_id); - break; - } + { + log_v( + "[status: %s, reason:%s, conn_id: %d]", BLEUtils::gattStatusToString(evtParam->close.status).c_str(), + BLEUtils::gattCloseReasonToString(evtParam->close.reason).c_str(), evtParam->close.conn_id + ); + break; + } // ESP_GATTC_CONNECT_EVT // @@ -1331,12 +1225,10 @@ void BLEUtils::dumpGattClientEvent( // - uint16_t conn_id // - esp_bd_addr_t remote_bda case ESP_GATTC_CONNECT_EVT: - { - log_v("[conn_id: %d, remote_bda: %s]", - evtParam->connect.conn_id, - BLEAddress(evtParam->connect.remote_bda).toString().c_str()); - break; - } + { + log_v("[conn_id: %d, remote_bda: %s]", evtParam->connect.conn_id, BLEAddress(evtParam->connect.remote_bda).toString().c_str()); + break; + } // ESP_GATTC_DISCONNECT_EVT // @@ -1345,13 +1237,13 @@ void BLEUtils::dumpGattClientEvent( // - uint16_t conn_id // - esp_bd_addr_t remote_bda case ESP_GATTC_DISCONNECT_EVT: - { - log_v("[reason: %s, conn_id: %d, remote_bda: %s]", - BLEUtils::gattCloseReasonToString(evtParam->disconnect.reason).c_str(), - evtParam->disconnect.conn_id, - BLEAddress(evtParam->disconnect.remote_bda).toString().c_str()); - break; - } // ESP_GATTC_DISCONNECT_EVT + { + log_v( + "[reason: %s, conn_id: %d, remote_bda: %s]", BLEUtils::gattCloseReasonToString(evtParam->disconnect.reason).c_str(), evtParam->disconnect.conn_id, + BLEAddress(evtParam->disconnect.remote_bda).toString().c_str() + ); + break; + } // ESP_GATTC_DISCONNECT_EVT // ESP_GATTC_GET_CHAR_EVT // @@ -1401,16 +1293,14 @@ void BLEUtils::dumpGattClientEvent( // bool is_notify // case ESP_GATTC_NOTIFY_EVT: - { - log_v("[conn_id: %d, remote_bda: %s, handle: %d 0x%.2x, value_len: %d, is_notify: %d]", - evtParam->notify.conn_id, - BLEAddress(evtParam->notify.remote_bda).toString().c_str(), - evtParam->notify.handle, - evtParam->notify.handle, - evtParam->notify.value_len, - evtParam->notify.is_notify); - break; - } + { + log_v( + "[conn_id: %d, remote_bda: %s, handle: %d 0x%.2x, value_len: %d, is_notify: %d]", evtParam->notify.conn_id, + BLEAddress(evtParam->notify.remote_bda).toString().c_str(), evtParam->notify.handle, evtParam->notify.handle, evtParam->notify.value_len, + evtParam->notify.is_notify + ); + break; + } // ESP_GATTC_OPEN_EVT // @@ -1421,14 +1311,13 @@ void BLEUtils::dumpGattClientEvent( // - uint16_t mtu // case ESP_GATTC_OPEN_EVT: - { - log_v("[status: %s, conn_id: %d, remote_bda: %s, mtu: %d]", - BLEUtils::gattStatusToString(evtParam->open.status).c_str(), - evtParam->open.conn_id, - BLEAddress(evtParam->open.remote_bda).toString().c_str(), - evtParam->open.mtu); - break; - } // ESP_GATTC_OPEN_EVT + { + log_v( + "[status: %s, conn_id: %d, remote_bda: %s, mtu: %d]", BLEUtils::gattStatusToString(evtParam->open.status).c_str(), evtParam->open.conn_id, + BLEAddress(evtParam->open.remote_bda).toString().c_str(), evtParam->open.mtu + ); + break; + } // ESP_GATTC_OPEN_EVT // ESP_GATTC_READ_CHAR_EVT // @@ -1442,23 +1331,21 @@ void BLEUtils::dumpGattClientEvent( // uint16_t value_type // uint16_t value_len case ESP_GATTC_READ_CHAR_EVT: - { - log_v("[status: %s, conn_id: %d, handle: %d 0x%.2x, value_len: %d]", - BLEUtils::gattStatusToString(evtParam->read.status).c_str(), - evtParam->read.conn_id, - evtParam->read.handle, - evtParam->read.handle, - evtParam->read.value_len); - if (evtParam->read.status == ESP_GATT_OK) { - GeneralUtils::hexDump(evtParam->read.value, evtParam->read.value_len); - /* + { + log_v( + "[status: %s, conn_id: %d, handle: %d 0x%.2x, value_len: %d]", BLEUtils::gattStatusToString(evtParam->read.status).c_str(), evtParam->read.conn_id, + evtParam->read.handle, evtParam->read.handle, evtParam->read.value_len + ); + if (evtParam->read.status == ESP_GATT_OK) { + GeneralUtils::hexDump(evtParam->read.value, evtParam->read.value_len); + /* char* pHexData = BLEUtils::buildHexData(nullptr, evtParam->read.value, evtParam->read.value_len); log_v("value: %s \"%s\"", pHexData, BLEUtils::buildPrintData(evtParam->read.value, evtParam->read.value_len).c_str()); free(pHexData); */ - } - break; - } // ESP_GATTC_READ_CHAR_EVT + } + break; + } // ESP_GATTC_READ_CHAR_EVT // ESP_GATTC_REG_EVT // @@ -1466,12 +1353,10 @@ void BLEUtils::dumpGattClientEvent( // - esp_gatt_status_t status // - uint16_t app_id case ESP_GATTC_REG_EVT: - { - log_v("[status: %s, app_id: 0x%x]", - BLEUtils::gattStatusToString(evtParam->reg.status).c_str(), - evtParam->reg.app_id); - break; - } // ESP_GATTC_REG_EVT + { + log_v("[status: %s, app_id: 0x%x]", BLEUtils::gattStatusToString(evtParam->reg.status).c_str(), evtParam->reg.app_id); + break; + } // ESP_GATTC_REG_EVT // ESP_GATTC_REG_FOR_NOTIFY_EVT // @@ -1479,13 +1364,13 @@ void BLEUtils::dumpGattClientEvent( // - esp_gatt_status_t status // - uint16_t handle case ESP_GATTC_REG_FOR_NOTIFY_EVT: - { - log_v("[status: %s, handle: %d 0x%.2x]", - BLEUtils::gattStatusToString(evtParam->reg_for_notify.status).c_str(), - evtParam->reg_for_notify.handle, - evtParam->reg_for_notify.handle); - break; - } // ESP_GATTC_REG_FOR_NOTIFY_EVT + { + log_v( + "[status: %s, handle: %d 0x%.2x]", BLEUtils::gattStatusToString(evtParam->reg_for_notify.status).c_str(), evtParam->reg_for_notify.handle, + evtParam->reg_for_notify.handle + ); + break; + } // ESP_GATTC_REG_FOR_NOTIFY_EVT // ESP_GATTC_SEARCH_CMPL_EVT // @@ -1493,12 +1378,10 @@ void BLEUtils::dumpGattClientEvent( // - esp_gatt_status_t status // - uint16_t conn_id case ESP_GATTC_SEARCH_CMPL_EVT: - { - log_v("[status: %s, conn_id: %d]", - BLEUtils::gattStatusToString(evtParam->search_cmpl.status).c_str(), - evtParam->search_cmpl.conn_id); - break; - } // ESP_GATTC_SEARCH_CMPL_EVT + { + log_v("[status: %s, conn_id: %d]", BLEUtils::gattStatusToString(evtParam->search_cmpl.status).c_str(), evtParam->search_cmpl.conn_id); + break; + } // ESP_GATTC_SEARCH_CMPL_EVT // ESP_GATTC_SEARCH_RES_EVT // @@ -1508,16 +1391,14 @@ void BLEUtils::dumpGattClientEvent( // - uint16_t end_handle // - esp_gatt_id_t srvc_id case ESP_GATTC_SEARCH_RES_EVT: - { - log_v("[conn_id: %d, start_handle: %d 0x%.2x, end_handle: %d 0x%.2x, srvc_id: %s", - evtParam->search_res.conn_id, - evtParam->search_res.start_handle, - evtParam->search_res.start_handle, - evtParam->search_res.end_handle, - evtParam->search_res.end_handle, - gattIdToString(evtParam->search_res.srvc_id).c_str()); - break; - } // ESP_GATTC_SEARCH_RES_EVT + { + log_v( + "[conn_id: %d, start_handle: %d 0x%.2x, end_handle: %d 0x%.2x, srvc_id: %s", evtParam->search_res.conn_id, evtParam->search_res.start_handle, + evtParam->search_res.start_handle, evtParam->search_res.end_handle, evtParam->search_res.end_handle, + gattIdToString(evtParam->search_res.srvc_id).c_str() + ); + break; + } // ESP_GATTC_SEARCH_RES_EVT // ESP_GATTC_WRITE_CHAR_EVT // @@ -1527,22 +1408,18 @@ void BLEUtils::dumpGattClientEvent( // - uint16_t handle // - uint16_t offset case ESP_GATTC_WRITE_CHAR_EVT: - { - log_v("[status: %s, conn_id: %d, handle: %d 0x%.2x, offset: %d]", - BLEUtils::gattStatusToString(evtParam->write.status).c_str(), - evtParam->write.conn_id, - evtParam->write.handle, - evtParam->write.handle, - evtParam->write.offset); - break; - } // ESP_GATTC_WRITE_CHAR_EVT -#endif - default: + { + log_v( + "[status: %s, conn_id: %d, handle: %d 0x%.2x, offset: %d]", BLEUtils::gattStatusToString(evtParam->write.status).c_str(), evtParam->write.conn_id, + evtParam->write.handle, evtParam->write.handle, evtParam->write.offset + ); break; + } // ESP_GATTC_WRITE_CHAR_EVT +#endif + default: break; } } // dumpGattClientEvent - /** * @brief Dump the details of a GATT server event. * A GATT Server event is a callback received from the BLE subsystem when we are acting as a BLE @@ -1553,48 +1430,38 @@ void BLEUtils::dumpGattClientEvent( * @param [in] event The event type that was posted. * @param [in] evtParam A union of structures only one of which is populated. */ -void BLEUtils::dumpGattServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* evtParam) { +void BLEUtils::dumpGattServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *evtParam) { log_v("GATT ServerEvent: %s", BLEUtils::gattServerEventTypeToString(event).c_str()); switch (event) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG case ESP_GATTS_ADD_CHAR_DESCR_EVT: - { - log_v("[status: %s, attr_handle: %d 0x%.2x, service_handle: %d 0x%.2x, char_uuid: %s]", - gattStatusToString(evtParam->add_char_descr.status).c_str(), - evtParam->add_char_descr.attr_handle, - evtParam->add_char_descr.attr_handle, - evtParam->add_char_descr.service_handle, - evtParam->add_char_descr.service_handle, - BLEUUID(evtParam->add_char_descr.descr_uuid).toString().c_str()); - break; - } // ESP_GATTS_ADD_CHAR_DESCR_EVT + { + log_v( + "[status: %s, attr_handle: %d 0x%.2x, service_handle: %d 0x%.2x, char_uuid: %s]", gattStatusToString(evtParam->add_char_descr.status).c_str(), + evtParam->add_char_descr.attr_handle, evtParam->add_char_descr.attr_handle, evtParam->add_char_descr.service_handle, + evtParam->add_char_descr.service_handle, BLEUUID(evtParam->add_char_descr.descr_uuid).toString().c_str() + ); + break; + } // ESP_GATTS_ADD_CHAR_DESCR_EVT case ESP_GATTS_ADD_CHAR_EVT: - { - if (evtParam->add_char.status == ESP_GATT_OK) { - log_v("[status: %s, attr_handle: %d 0x%.2x, service_handle: %d 0x%.2x, char_uuid: %s]", - gattStatusToString(evtParam->add_char.status).c_str(), - evtParam->add_char.attr_handle, - evtParam->add_char.attr_handle, - evtParam->add_char.service_handle, - evtParam->add_char.service_handle, - BLEUUID(evtParam->add_char.char_uuid).toString().c_str()); - } else { - log_e("[status: %s, attr_handle: %d 0x%.2x, service_handle: %d 0x%.2x, char_uuid: %s]", - gattStatusToString(evtParam->add_char.status).c_str(), - evtParam->add_char.attr_handle, - evtParam->add_char.attr_handle, - evtParam->add_char.service_handle, - evtParam->add_char.service_handle, - BLEUUID(evtParam->add_char.char_uuid).toString().c_str()); - } - break; - } // ESP_GATTS_ADD_CHAR_EVT - + { + if (evtParam->add_char.status == ESP_GATT_OK) { + log_v( + "[status: %s, attr_handle: %d 0x%.2x, service_handle: %d 0x%.2x, char_uuid: %s]", gattStatusToString(evtParam->add_char.status).c_str(), + evtParam->add_char.attr_handle, evtParam->add_char.attr_handle, evtParam->add_char.service_handle, evtParam->add_char.service_handle, + BLEUUID(evtParam->add_char.char_uuid).toString().c_str() + ); + } else { + log_e( + "[status: %s, attr_handle: %d 0x%.2x, service_handle: %d 0x%.2x, char_uuid: %s]", gattStatusToString(evtParam->add_char.status).c_str(), + evtParam->add_char.attr_handle, evtParam->add_char.attr_handle, evtParam->add_char.service_handle, evtParam->add_char.service_handle, + BLEUUID(evtParam->add_char.char_uuid).toString().c_str() + ); + } + break; + } // ESP_GATTS_ADD_CHAR_EVT // ESP_GATTS_CONF_EVT // @@ -1602,123 +1469,98 @@ void BLEUtils::dumpGattServerEvent( // - esp_gatt_status_t status – The status code. // - uint16_t conn_id – The connection used. case ESP_GATTS_CONF_EVT: - { - log_v("[status: %s, conn_id: 0x%.2x]", - gattStatusToString(evtParam->conf.status).c_str(), - evtParam->conf.conn_id); - break; - } // ESP_GATTS_CONF_EVT - + { + log_v("[status: %s, conn_id: 0x%.2x]", gattStatusToString(evtParam->conf.status).c_str(), evtParam->conf.conn_id); + break; + } // ESP_GATTS_CONF_EVT case ESP_GATTS_CONGEST_EVT: - { - log_v("[conn_id: %d, congested: %d]", - evtParam->congest.conn_id, - evtParam->congest.congested); - break; - } // ESP_GATTS_CONGEST_EVT + { + log_v("[conn_id: %d, congested: %d]", evtParam->congest.conn_id, evtParam->congest.congested); + break; + } // ESP_GATTS_CONGEST_EVT case ESP_GATTS_CONNECT_EVT: - { - log_v("[conn_id: %d, remote_bda: %s]", - evtParam->connect.conn_id, - BLEAddress(evtParam->connect.remote_bda).toString().c_str()); - break; - } // ESP_GATTS_CONNECT_EVT + { + log_v("[conn_id: %d, remote_bda: %s]", evtParam->connect.conn_id, BLEAddress(evtParam->connect.remote_bda).toString().c_str()); + break; + } // ESP_GATTS_CONNECT_EVT case ESP_GATTS_CREATE_EVT: - { - log_v("[status: %s, service_handle: %d 0x%.2x, service_id: [%s]]", - gattStatusToString(evtParam->create.status).c_str(), - evtParam->create.service_handle, - evtParam->create.service_handle, - gattServiceIdToString(evtParam->create.service_id).c_str()); - break; - } // ESP_GATTS_CREATE_EVT + { + log_v( + "[status: %s, service_handle: %d 0x%.2x, service_id: [%s]]", gattStatusToString(evtParam->create.status).c_str(), evtParam->create.service_handle, + evtParam->create.service_handle, gattServiceIdToString(evtParam->create.service_id).c_str() + ); + break; + } // ESP_GATTS_CREATE_EVT case ESP_GATTS_DISCONNECT_EVT: - { - log_v("[conn_id: %d, remote_bda: %s]", - evtParam->connect.conn_id, - BLEAddress(evtParam->connect.remote_bda).toString().c_str()); - break; - } // ESP_GATTS_DISCONNECT_EVT + { + log_v("[conn_id: %d, remote_bda: %s]", evtParam->connect.conn_id, BLEAddress(evtParam->connect.remote_bda).toString().c_str()); + break; + } // ESP_GATTS_DISCONNECT_EVT - - // ESP_GATTS_EXEC_WRITE_EVT - // exec_write: - // - uint16_t conn_id - // - uint32_t trans_id - // - esp_bd_addr_t bda - // - uint8_t exec_write_flag + // ESP_GATTS_EXEC_WRITE_EVT + // exec_write: + // - uint16_t conn_id + // - uint32_t trans_id + // - esp_bd_addr_t bda + // - uint8_t exec_write_flag #ifdef ARDUHAL_LOG_LEVEL_VERBOSE case ESP_GATTS_EXEC_WRITE_EVT: - { - char* pWriteFlagText; - switch (evtParam->exec_write.exec_write_flag) { - case ESP_GATT_PREP_WRITE_EXEC: - { - pWriteFlagText = (char*)"WRITE"; - break; - } - - case ESP_GATT_PREP_WRITE_CANCEL: - { - pWriteFlagText = (char*)"CANCEL"; - break; - } - - default: - pWriteFlagText = (char*)""; - break; + { + char *pWriteFlagText; + switch (evtParam->exec_write.exec_write_flag) { + case ESP_GATT_PREP_WRITE_EXEC: + { + pWriteFlagText = (char *)"WRITE"; + break; } - log_v("[conn_id: %d, trans_id: %d, bda: %s, exec_write_flag: 0x%.2x=%s]", - evtParam->exec_write.conn_id, - evtParam->exec_write.trans_id, - BLEAddress(evtParam->exec_write.bda).toString().c_str(), - evtParam->exec_write.exec_write_flag, - pWriteFlagText); - break; - } // ESP_GATTS_DISCONNECT_EVT + case ESP_GATT_PREP_WRITE_CANCEL: + { + pWriteFlagText = (char *)"CANCEL"; + break; + } + + default: pWriteFlagText = (char *)""; break; + } + + log_v( + "[conn_id: %d, trans_id: %d, bda: %s, exec_write_flag: 0x%.2x=%s]", evtParam->exec_write.conn_id, evtParam->exec_write.trans_id, + BLEAddress(evtParam->exec_write.bda).toString().c_str(), evtParam->exec_write.exec_write_flag, pWriteFlagText + ); + break; + } // ESP_GATTS_DISCONNECT_EVT #endif case ESP_GATTS_MTU_EVT: - { - log_v("[conn_id: %d, mtu: %d]", - evtParam->mtu.conn_id, - evtParam->mtu.mtu); - break; - } // ESP_GATTS_MTU_EVT + { + log_v("[conn_id: %d, mtu: %d]", evtParam->mtu.conn_id, evtParam->mtu.mtu); + break; + } // ESP_GATTS_MTU_EVT case ESP_GATTS_READ_EVT: - { - log_v("[conn_id: %d, trans_id: %d, bda: %s, handle: 0x%.2x, is_long: %d, need_rsp:%d]", - evtParam->read.conn_id, - evtParam->read.trans_id, - BLEAddress(evtParam->read.bda).toString().c_str(), - evtParam->read.handle, - evtParam->read.is_long, - evtParam->read.need_rsp); - break; - } // ESP_GATTS_READ_EVT + { + log_v( + "[conn_id: %d, trans_id: %d, bda: %s, handle: 0x%.2x, is_long: %d, need_rsp:%d]", evtParam->read.conn_id, evtParam->read.trans_id, + BLEAddress(evtParam->read.bda).toString().c_str(), evtParam->read.handle, evtParam->read.is_long, evtParam->read.need_rsp + ); + break; + } // ESP_GATTS_READ_EVT case ESP_GATTS_RESPONSE_EVT: - { - log_v("[status: %s, handle: 0x%.2x]", - gattStatusToString(evtParam->rsp.status).c_str(), - evtParam->rsp.handle); - break; - } // ESP_GATTS_RESPONSE_EVT + { + log_v("[status: %s, handle: 0x%.2x]", gattStatusToString(evtParam->rsp.status).c_str(), evtParam->rsp.handle); + break; + } // ESP_GATTS_RESPONSE_EVT case ESP_GATTS_REG_EVT: - { - log_v("[status: %s, app_id: %d]", - gattStatusToString(evtParam->reg.status).c_str(), - evtParam->reg.app_id); - break; - } // ESP_GATTS_REG_EVT - + { + log_v("[status: %s, app_id: %d]", gattStatusToString(evtParam->reg.status).c_str(), evtParam->reg.app_id); + break; + } // ESP_GATTS_REG_EVT // ESP_GATTS_START_EVT // @@ -1726,13 +1568,10 @@ void BLEUtils::dumpGattServerEvent( // - esp_gatt_status_t status // - uint16_t service_handle case ESP_GATTS_START_EVT: - { - log_v("[status: %s, service_handle: 0x%.2x]", - gattStatusToString(evtParam->start.status).c_str(), - evtParam->start.service_handle); - break; - } // ESP_GATTS_START_EVT - + { + log_v("[status: %s, service_handle: 0x%.2x]", gattStatusToString(evtParam->start.status).c_str(), evtParam->start.service_handle); + break; + } // ESP_GATTS_START_EVT // ESP_GATTS_WRITE_EVT // @@ -1747,128 +1586,82 @@ void BLEUtils::dumpGattServerEvent( // - uint16_t len – The length of the incoming value part. // - uint8_t* value – The data for this value part. case ESP_GATTS_WRITE_EVT: - { - log_v("[conn_id: %d, trans_id: %d, bda: %s, handle: 0x%.2x, offset: %d, need_rsp: %d, is_prep: %d, len: %d]", - evtParam->write.conn_id, - evtParam->write.trans_id, - BLEAddress(evtParam->write.bda).toString().c_str(), - evtParam->write.handle, - evtParam->write.offset, - evtParam->write.need_rsp, - evtParam->write.is_prep, - evtParam->write.len); - char* pHex = buildHexData(nullptr, evtParam->write.value, evtParam->write.len); - log_v("[Data: %s]", pHex); - free(pHex); - break; - } // ESP_GATTS_WRITE_EVT -#endif - default: - log_v("dumpGattServerEvent: *** NOT CODED ***"); + { + log_v( + "[conn_id: %d, trans_id: %d, bda: %s, handle: 0x%.2x, offset: %d, need_rsp: %d, is_prep: %d, len: %d]", evtParam->write.conn_id, + evtParam->write.trans_id, BLEAddress(evtParam->write.bda).toString().c_str(), evtParam->write.handle, evtParam->write.offset, evtParam->write.need_rsp, + evtParam->write.is_prep, evtParam->write.len + ); + char *pHex = buildHexData(nullptr, evtParam->write.value, evtParam->write.len); + log_v("[Data: %s]", pHex); + free(pHex); break; + } // ESP_GATTS_WRITE_EVT +#endif + default: log_v("dumpGattServerEvent: *** NOT CODED ***"); break; } } // dumpGattServerEvent - /** * @brief Convert a BLE event type to a string. * @param [in] eventType The event type. * @return The event type as a string. */ -const char* BLEUtils::eventTypeToString(esp_ble_evt_type_t eventType) { +const char *BLEUtils::eventTypeToString(esp_ble_evt_type_t eventType) { switch (eventType) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case ESP_BLE_EVT_CONN_ADV: - return "ESP_BLE_EVT_CONN_ADV"; - case ESP_BLE_EVT_CONN_DIR_ADV: - return "ESP_BLE_EVT_CONN_DIR_ADV"; - case ESP_BLE_EVT_DISC_ADV: - return "ESP_BLE_EVT_DISC_ADV"; - case ESP_BLE_EVT_NON_CONN_ADV: - return "ESP_BLE_EVT_NON_CONN_ADV"; - case ESP_BLE_EVT_SCAN_RSP: - return "ESP_BLE_EVT_SCAN_RSP"; + case ESP_BLE_EVT_CONN_ADV: return "ESP_BLE_EVT_CONN_ADV"; + case ESP_BLE_EVT_CONN_DIR_ADV: return "ESP_BLE_EVT_CONN_DIR_ADV"; + case ESP_BLE_EVT_DISC_ADV: return "ESP_BLE_EVT_DISC_ADV"; + case ESP_BLE_EVT_NON_CONN_ADV: return "ESP_BLE_EVT_NON_CONN_ADV"; + case ESP_BLE_EVT_SCAN_RSP: return "ESP_BLE_EVT_SCAN_RSP"; #endif - default: - log_v("Unknown esp_ble_evt_type_t: %d (0x%.2x)", eventType, eventType); - return "*** Unknown ***"; + default: log_v("Unknown esp_ble_evt_type_t: %d (0x%.2x)", eventType, eventType); return "*** Unknown ***"; } } // eventTypeToString - - /** * @brief Convert a BT GAP event type to a string representation. * @param [in] eventType The type of event. * @return A string representation of the event type. */ -const char* BLEUtils::gapEventToString(uint32_t eventType) { +const char *BLEUtils::gapEventToString(uint32_t eventType) { switch (eventType) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_ADV_START_COMPLETE_EVT: - return "ESP_GAP_BLE_ADV_START_COMPLETE_EVT"; - case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT: /* !< When stop adv complete, the event comes */ - return "ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT"; - case ESP_GAP_BLE_AUTH_CMPL_EVT: /* Authentication complete indication. */ - return "ESP_GAP_BLE_AUTH_CMPL_EVT"; - case ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT: - return "ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT"; - case ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT: - return "ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT"; - case ESP_GAP_BLE_KEY_EVT: /* BLE key event for peer device keys */ - return "ESP_GAP_BLE_KEY_EVT"; - case ESP_GAP_BLE_LOCAL_IR_EVT: /* BLE local IR event */ - return "ESP_GAP_BLE_LOCAL_IR_EVT"; - case ESP_GAP_BLE_LOCAL_ER_EVT: /* BLE local ER event */ - return "ESP_GAP_BLE_LOCAL_ER_EVT"; - case ESP_GAP_BLE_NC_REQ_EVT: /* Numeric Comparison request event */ - return "ESP_GAP_BLE_NC_REQ_EVT"; - case ESP_GAP_BLE_OOB_REQ_EVT: /* OOB request event */ - return "ESP_GAP_BLE_OOB_REQ_EVT"; - case ESP_GAP_BLE_PASSKEY_NOTIF_EVT: /* passkey notification event */ - return "ESP_GAP_BLE_PASSKEY_NOTIF_EVT"; - case ESP_GAP_BLE_PASSKEY_REQ_EVT: /* passkey request event */ - return "ESP_GAP_BLE_PASSKEY_REQ_EVT"; - case ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT: - return "ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT"; - case ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT: - return "ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_RESULT_EVT: - return "ESP_GAP_BLE_SCAN_RESULT_EVT"; - case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_START_COMPLETE_EVT"; - case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT: - return "ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT"; - case ESP_GAP_BLE_SEC_REQ_EVT: /* BLE security request */ - return "ESP_GAP_BLE_SEC_REQ_EVT"; - case ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT: - return "ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT"; - case ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT: - return "ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT"; - case ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT: - return "ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT"; - case ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT: - return "ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT"; + case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT: return "ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT"; + case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT: return "ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT"; + case ESP_GAP_BLE_ADV_START_COMPLETE_EVT: return "ESP_GAP_BLE_ADV_START_COMPLETE_EVT"; + case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT: /* !< When stop adv complete, the event comes */ return "ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT"; + case ESP_GAP_BLE_AUTH_CMPL_EVT: /* Authentication complete indication. */ return "ESP_GAP_BLE_AUTH_CMPL_EVT"; + case ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT: return "ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT"; + case ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT: return "ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT"; + case ESP_GAP_BLE_KEY_EVT: /* BLE key event for peer device keys */ return "ESP_GAP_BLE_KEY_EVT"; + case ESP_GAP_BLE_LOCAL_IR_EVT: /* BLE local IR event */ return "ESP_GAP_BLE_LOCAL_IR_EVT"; + case ESP_GAP_BLE_LOCAL_ER_EVT: /* BLE local ER event */ return "ESP_GAP_BLE_LOCAL_ER_EVT"; + case ESP_GAP_BLE_NC_REQ_EVT: /* Numeric Comparison request event */ return "ESP_GAP_BLE_NC_REQ_EVT"; + case ESP_GAP_BLE_OOB_REQ_EVT: /* OOB request event */ return "ESP_GAP_BLE_OOB_REQ_EVT"; + case ESP_GAP_BLE_PASSKEY_NOTIF_EVT: /* passkey notification event */ return "ESP_GAP_BLE_PASSKEY_NOTIF_EVT"; + case ESP_GAP_BLE_PASSKEY_REQ_EVT: /* passkey request event */ return "ESP_GAP_BLE_PASSKEY_REQ_EVT"; + case ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT: return "ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT"; + case ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT: return "ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT"; + case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: return "ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT"; + case ESP_GAP_BLE_SCAN_RESULT_EVT: return "ESP_GAP_BLE_SCAN_RESULT_EVT"; + case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT: return "ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT"; + case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT: return "ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT"; + case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT: return "ESP_GAP_BLE_SCAN_START_COMPLETE_EVT"; + case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT: return "ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT"; + case ESP_GAP_BLE_SEC_REQ_EVT: /* BLE security request */ return "ESP_GAP_BLE_SEC_REQ_EVT"; + case ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT: return "ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT"; + case ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT: return "ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT"; + case ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT: return "ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT"; + case ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT: return "ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT"; #endif - default: - log_v("gapEventToString: Unknown event type %d 0x%.2x", eventType, eventType); - return "Unknown event type"; + default: log_v("gapEventToString: Unknown event type %d 0x%.2x", eventType, eventType); return "Unknown event type"; } } // gapEventToString - String BLEUtils::gattCharacteristicUUIDToString(uint32_t characteristicUUID) { - const characteristicMap_t* p = g_characteristicsMappings; + const characteristicMap_t *p = g_characteristicsMappings; while (strlen(p->name) > 0) { if (p->assignedNumber == characteristicUUID) { return String(p->name); @@ -1878,14 +1671,13 @@ String BLEUtils::gattCharacteristicUUIDToString(uint32_t characteristicUUID) { return "Unknown"; } // gattCharacteristicUUIDToString - /** * @brief Given the UUID for a BLE defined descriptor, return its string representation. * @param [in] descriptorUUID UUID of the descriptor to be returned as a string. * @return The string representation of a descriptor UUID. */ String BLEUtils::gattDescriptorUUIDToString(uint32_t descriptorUUID) { - gattdescriptor_t* p = (gattdescriptor_t*)g_descriptor_ids; + gattdescriptor_t *p = (gattdescriptor_t *)g_descriptor_ids; while (strlen(p->name) > 0) { if (p->assignedNumber == descriptorUUID) { return String(p->name); @@ -1895,12 +1687,11 @@ String BLEUtils::gattDescriptorUUIDToString(uint32_t descriptorUUID) { return ""; } // gattDescriptorUUIDToString - /** * @brief Return a string representation of an esp_gattc_service_elem_t. * @return A string representation of an esp_gattc_service_elem_t. */ -String BLEUtils::gattcServiceElementToString(esp_gattc_service_elem_t* pGATTCServiceElement) { +String BLEUtils::gattcServiceElementToString(esp_gattc_service_elem_t *pGATTCServiceElement) { String res; char val[6]; res += "[uuid: " + BLEUUID(pGATTCServiceElement->uuid).toString() + ", start_handle: "; @@ -1919,7 +1710,6 @@ String BLEUtils::gattcServiceElementToString(esp_gattc_service_elem_t* pGATTCSer return res; } // gattcServiceElementToString - /** * @brief Convert an esp_gatt_srvc_id_t to a string. */ @@ -1927,9 +1717,8 @@ String BLEUtils::gattServiceIdToString(esp_gatt_srvc_id_t srvcId) { return gattIdToString(srvcId.id); } // gattServiceIdToString - String BLEUtils::gattServiceToString(uint32_t serviceId) { - gattService_t* p = (gattService_t*)g_gattServices; + gattService_t *p = (gattService_t *)g_gattServices; while (strlen(p->name) > 0) { if (p->assignedNumber == serviceId) { return String(p->name); @@ -1939,7 +1728,6 @@ String BLEUtils::gattServiceToString(uint32_t serviceId) { return "Unknown"; } // gattServiceToString - /** * @brief Convert a GATT status to a string. * @@ -1949,102 +1737,56 @@ String BLEUtils::gattServiceToString(uint32_t serviceId) { String BLEUtils::gattStatusToString(esp_gatt_status_t status) { switch (status) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case ESP_GATT_OK: - return "ESP_GATT_OK"; - case ESP_GATT_INVALID_HANDLE: - return "ESP_GATT_INVALID_HANDLE"; - case ESP_GATT_READ_NOT_PERMIT: - return "ESP_GATT_READ_NOT_PERMIT"; - case ESP_GATT_WRITE_NOT_PERMIT: - return "ESP_GATT_WRITE_NOT_PERMIT"; - case ESP_GATT_INVALID_PDU: - return "ESP_GATT_INVALID_PDU"; - case ESP_GATT_INSUF_AUTHENTICATION: - return "ESP_GATT_INSUF_AUTHENTICATION"; - case ESP_GATT_REQ_NOT_SUPPORTED: - return "ESP_GATT_REQ_NOT_SUPPORTED"; - case ESP_GATT_INVALID_OFFSET: - return "ESP_GATT_INVALID_OFFSET"; - case ESP_GATT_INSUF_AUTHORIZATION: - return "ESP_GATT_INSUF_AUTHORIZATION"; - case ESP_GATT_PREPARE_Q_FULL: - return "ESP_GATT_PREPARE_Q_FULL"; - case ESP_GATT_NOT_FOUND: - return "ESP_GATT_NOT_FOUND"; - case ESP_GATT_NOT_LONG: - return "ESP_GATT_NOT_LONG"; - case ESP_GATT_INSUF_KEY_SIZE: - return "ESP_GATT_INSUF_KEY_SIZE"; - case ESP_GATT_INVALID_ATTR_LEN: - return "ESP_GATT_INVALID_ATTR_LEN"; - case ESP_GATT_ERR_UNLIKELY: - return "ESP_GATT_ERR_UNLIKELY"; - case ESP_GATT_INSUF_ENCRYPTION: - return "ESP_GATT_INSUF_ENCRYPTION"; - case ESP_GATT_UNSUPPORT_GRP_TYPE: - return "ESP_GATT_UNSUPPORT_GRP_TYPE"; - case ESP_GATT_INSUF_RESOURCE: - return "ESP_GATT_INSUF_RESOURCE"; - case ESP_GATT_NO_RESOURCES: - return "ESP_GATT_NO_RESOURCES"; - case ESP_GATT_INTERNAL_ERROR: - return "ESP_GATT_INTERNAL_ERROR"; - case ESP_GATT_WRONG_STATE: - return "ESP_GATT_WRONG_STATE"; - case ESP_GATT_DB_FULL: - return "ESP_GATT_DB_FULL"; - case ESP_GATT_BUSY: - return "ESP_GATT_BUSY"; - case ESP_GATT_ERROR: - return "ESP_GATT_ERROR"; - case ESP_GATT_CMD_STARTED: - return "ESP_GATT_CMD_STARTED"; - case ESP_GATT_ILLEGAL_PARAMETER: - return "ESP_GATT_ILLEGAL_PARAMETER"; - case ESP_GATT_PENDING: - return "ESP_GATT_PENDING"; - case ESP_GATT_AUTH_FAIL: - return "ESP_GATT_AUTH_FAIL"; - case ESP_GATT_MORE: - return "ESP_GATT_MORE"; - case ESP_GATT_INVALID_CFG: - return "ESP_GATT_INVALID_CFG"; - case ESP_GATT_SERVICE_STARTED: - return "ESP_GATT_SERVICE_STARTED"; - case ESP_GATT_ENCRYPTED_NO_MITM: - return "ESP_GATT_ENCRYPTED_NO_MITM"; - case ESP_GATT_NOT_ENCRYPTED: - return "ESP_GATT_NOT_ENCRYPTED"; - case ESP_GATT_CONGESTED: - return "ESP_GATT_CONGESTED"; - case ESP_GATT_DUP_REG: - return "ESP_GATT_DUP_REG"; - case ESP_GATT_ALREADY_OPEN: - return "ESP_GATT_ALREADY_OPEN"; - case ESP_GATT_CANCEL: - return "ESP_GATT_CANCEL"; - case ESP_GATT_STACK_RSP: - return "ESP_GATT_STACK_RSP"; - case ESP_GATT_APP_RSP: - return "ESP_GATT_APP_RSP"; - case ESP_GATT_UNKNOWN_ERROR: - return "ESP_GATT_UNKNOWN_ERROR"; - case ESP_GATT_CCC_CFG_ERR: - return "ESP_GATT_CCC_CFG_ERR"; - case ESP_GATT_PRC_IN_PROGRESS: - return "ESP_GATT_PRC_IN_PROGRESS"; - case ESP_GATT_OUT_OF_RANGE: - return "ESP_GATT_OUT_OF_RANGE"; + case ESP_GATT_OK: return "ESP_GATT_OK"; + case ESP_GATT_INVALID_HANDLE: return "ESP_GATT_INVALID_HANDLE"; + case ESP_GATT_READ_NOT_PERMIT: return "ESP_GATT_READ_NOT_PERMIT"; + case ESP_GATT_WRITE_NOT_PERMIT: return "ESP_GATT_WRITE_NOT_PERMIT"; + case ESP_GATT_INVALID_PDU: return "ESP_GATT_INVALID_PDU"; + case ESP_GATT_INSUF_AUTHENTICATION: return "ESP_GATT_INSUF_AUTHENTICATION"; + case ESP_GATT_REQ_NOT_SUPPORTED: return "ESP_GATT_REQ_NOT_SUPPORTED"; + case ESP_GATT_INVALID_OFFSET: return "ESP_GATT_INVALID_OFFSET"; + case ESP_GATT_INSUF_AUTHORIZATION: return "ESP_GATT_INSUF_AUTHORIZATION"; + case ESP_GATT_PREPARE_Q_FULL: return "ESP_GATT_PREPARE_Q_FULL"; + case ESP_GATT_NOT_FOUND: return "ESP_GATT_NOT_FOUND"; + case ESP_GATT_NOT_LONG: return "ESP_GATT_NOT_LONG"; + case ESP_GATT_INSUF_KEY_SIZE: return "ESP_GATT_INSUF_KEY_SIZE"; + case ESP_GATT_INVALID_ATTR_LEN: return "ESP_GATT_INVALID_ATTR_LEN"; + case ESP_GATT_ERR_UNLIKELY: return "ESP_GATT_ERR_UNLIKELY"; + case ESP_GATT_INSUF_ENCRYPTION: return "ESP_GATT_INSUF_ENCRYPTION"; + case ESP_GATT_UNSUPPORT_GRP_TYPE: return "ESP_GATT_UNSUPPORT_GRP_TYPE"; + case ESP_GATT_INSUF_RESOURCE: return "ESP_GATT_INSUF_RESOURCE"; + case ESP_GATT_NO_RESOURCES: return "ESP_GATT_NO_RESOURCES"; + case ESP_GATT_INTERNAL_ERROR: return "ESP_GATT_INTERNAL_ERROR"; + case ESP_GATT_WRONG_STATE: return "ESP_GATT_WRONG_STATE"; + case ESP_GATT_DB_FULL: return "ESP_GATT_DB_FULL"; + case ESP_GATT_BUSY: return "ESP_GATT_BUSY"; + case ESP_GATT_ERROR: return "ESP_GATT_ERROR"; + case ESP_GATT_CMD_STARTED: return "ESP_GATT_CMD_STARTED"; + case ESP_GATT_ILLEGAL_PARAMETER: return "ESP_GATT_ILLEGAL_PARAMETER"; + case ESP_GATT_PENDING: return "ESP_GATT_PENDING"; + case ESP_GATT_AUTH_FAIL: return "ESP_GATT_AUTH_FAIL"; + case ESP_GATT_MORE: return "ESP_GATT_MORE"; + case ESP_GATT_INVALID_CFG: return "ESP_GATT_INVALID_CFG"; + case ESP_GATT_SERVICE_STARTED: return "ESP_GATT_SERVICE_STARTED"; + case ESP_GATT_ENCRYPTED_NO_MITM: return "ESP_GATT_ENCRYPTED_NO_MITM"; + case ESP_GATT_NOT_ENCRYPTED: return "ESP_GATT_NOT_ENCRYPTED"; + case ESP_GATT_CONGESTED: return "ESP_GATT_CONGESTED"; + case ESP_GATT_DUP_REG: return "ESP_GATT_DUP_REG"; + case ESP_GATT_ALREADY_OPEN: return "ESP_GATT_ALREADY_OPEN"; + case ESP_GATT_CANCEL: return "ESP_GATT_CANCEL"; + case ESP_GATT_STACK_RSP: return "ESP_GATT_STACK_RSP"; + case ESP_GATT_APP_RSP: return "ESP_GATT_APP_RSP"; + case ESP_GATT_UNKNOWN_ERROR: return "ESP_GATT_UNKNOWN_ERROR"; + case ESP_GATT_CCC_CFG_ERR: return "ESP_GATT_CCC_CFG_ERR"; + case ESP_GATT_PRC_IN_PROGRESS: return "ESP_GATT_PRC_IN_PROGRESS"; + case ESP_GATT_OUT_OF_RANGE: return "ESP_GATT_OUT_OF_RANGE"; #endif - default: - return "Unknown"; + default: return "Unknown"; } } // gattStatusToString - - String BLEUtils::getMember(uint32_t memberId) { - member_t* p = (member_t*)members_ids; + member_t *p = (member_t *)members_ids; while (strlen(p->name) > 0) { if (p->assignedNumber == memberId) { @@ -2060,27 +1802,18 @@ String BLEUtils::getMember(uint32_t memberId) { * @param [in] searchEvt * @return The search event type as a string. */ -const char* BLEUtils::searchEventTypeToString(esp_gap_search_evt_t searchEvt) { +const char *BLEUtils::searchEventTypeToString(esp_gap_search_evt_t searchEvt) { switch (searchEvt) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case ESP_GAP_SEARCH_INQ_RES_EVT: - return "ESP_GAP_SEARCH_INQ_RES_EVT"; - case ESP_GAP_SEARCH_INQ_CMPL_EVT: - return "ESP_GAP_SEARCH_INQ_CMPL_EVT"; - case ESP_GAP_SEARCH_DISC_RES_EVT: - return "ESP_GAP_SEARCH_DISC_RES_EVT"; - case ESP_GAP_SEARCH_DISC_BLE_RES_EVT: - return "ESP_GAP_SEARCH_DISC_BLE_RES_EVT"; - case ESP_GAP_SEARCH_DISC_CMPL_EVT: - return "ESP_GAP_SEARCH_DISC_CMPL_EVT"; - case ESP_GAP_SEARCH_DI_DISC_CMPL_EVT: - return "ESP_GAP_SEARCH_DI_DISC_CMPL_EVT"; - case ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT: - return "ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT"; + case ESP_GAP_SEARCH_INQ_RES_EVT: return "ESP_GAP_SEARCH_INQ_RES_EVT"; + case ESP_GAP_SEARCH_INQ_CMPL_EVT: return "ESP_GAP_SEARCH_INQ_CMPL_EVT"; + case ESP_GAP_SEARCH_DISC_RES_EVT: return "ESP_GAP_SEARCH_DISC_RES_EVT"; + case ESP_GAP_SEARCH_DISC_BLE_RES_EVT: return "ESP_GAP_SEARCH_DISC_BLE_RES_EVT"; + case ESP_GAP_SEARCH_DISC_CMPL_EVT: return "ESP_GAP_SEARCH_DISC_CMPL_EVT"; + case ESP_GAP_SEARCH_DI_DISC_CMPL_EVT: return "ESP_GAP_SEARCH_DI_DISC_CMPL_EVT"; + case ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT: return "ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT"; #endif - default: - log_v("Unknown event type: 0x%x", searchEvt); - return "Unknown event type"; + default: log_v("Unknown event type: 0x%x", searchEvt); return "Unknown event type"; } } // searchEventTypeToString diff --git a/libraries/BLE/src/BLEUtils.h b/libraries/BLE/src/BLEUtils.h index 4dcea2e02..7c6f58d28 100644 --- a/libraries/BLE/src/BLEUtils.h +++ b/libraries/BLE/src/BLEUtils.h @@ -23,43 +23,35 @@ */ class BLEUtils { public: - static const char* addressTypeToString(esp_ble_addr_type_t type); + static const char *addressTypeToString(esp_ble_addr_type_t type); static String adFlagsToString(uint8_t adFlags); - static const char* advTypeToString(uint8_t advType); - static char* buildHexData(uint8_t* target, uint8_t* source, uint8_t length); - static String buildPrintData(uint8_t* source, size_t length); + static const char *advTypeToString(uint8_t advType); + static char *buildHexData(uint8_t *target, uint8_t *source, uint8_t length); + static String buildPrintData(uint8_t *source, size_t length); static String characteristicPropertiesToString(esp_gatt_char_prop_t prop); - static const char* devTypeToString(esp_bt_dev_type_t type); + static const char *devTypeToString(esp_bt_dev_type_t type); static esp_gatt_id_t buildGattId(esp_bt_uuid_t uuid, uint8_t inst_id = 0); static esp_gatt_srvc_id_t buildGattSrvcId(esp_gatt_id_t gattId, bool is_primary = true); - static void dumpGapEvent( - esp_gap_ble_cb_event_t event, - esp_ble_gap_cb_param_t* param); - static void dumpGattClientEvent( - esp_gattc_cb_event_t event, - esp_gatt_if_t gattc_if, - esp_ble_gattc_cb_param_t* evtParam); - static void dumpGattServerEvent( - esp_gatts_cb_event_t event, - esp_gatt_if_t gatts_if, - esp_ble_gatts_cb_param_t* evtParam); - static const char* eventTypeToString(esp_ble_evt_type_t eventType); - static BLEClient* findByAddress(BLEAddress address); - static BLEClient* findByConnId(uint16_t conn_id); - static const char* gapEventToString(uint32_t eventType); + static void dumpGapEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param); + static void dumpGattClientEvent(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *evtParam); + static void dumpGattServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *evtParam); + static const char *eventTypeToString(esp_ble_evt_type_t eventType); + static BLEClient *findByAddress(BLEAddress address); + static BLEClient *findByConnId(uint16_t conn_id); + static const char *gapEventToString(uint32_t eventType); static String gattCharacteristicUUIDToString(uint32_t characteristicUUID); static String gattClientEventTypeToString(esp_gattc_cb_event_t eventType); static String gattCloseReasonToString(esp_gatt_conn_reason_t reason); - static String gattcServiceElementToString(esp_gattc_service_elem_t* pGATTCServiceElement); + static String gattcServiceElementToString(esp_gattc_service_elem_t *pGATTCServiceElement); static String gattDescriptorUUIDToString(uint32_t descriptorUUID); static String gattServerEventTypeToString(esp_gatts_cb_event_t eventType); static String gattServiceIdToString(esp_gatt_srvc_id_t srvcId); static String gattServiceToString(uint32_t serviceId); static String gattStatusToString(esp_gatt_status_t status); static String getMember(uint32_t memberId); - static void registerByAddress(BLEAddress address, BLEClient* pDevice); - static void registerByConnId(uint16_t conn_id, BLEClient* pDevice); - static const char* searchEventTypeToString(esp_gap_search_evt_t searchEvt); + static void registerByAddress(BLEAddress address, BLEClient *pDevice); + static void registerByConnId(uint16_t conn_id, BLEClient *pDevice); + static const char *searchEventTypeToString(esp_gap_search_evt_t searchEvt); }; #endif /* CONFIG_BLUEDROID_ENABLED */ diff --git a/libraries/BLE/src/BLEValue.cpp b/libraries/BLE/src/BLEValue.cpp index 08a564fd7..26811c985 100644 --- a/libraries/BLE/src/BLEValue.cpp +++ b/libraries/BLE/src/BLEValue.cpp @@ -18,7 +18,6 @@ BLEValue::BLEValue() { m_readOffset = 0; } // BLEValue - /** * @brief Add a message part to the accumulation. * The accumulation is a growing set of data that is added to until a commit or cancel. @@ -29,19 +28,17 @@ void BLEValue::addPart(String part) { m_accumulation += part; } // addPart - /** * @brief Add a message part to the accumulation. * The accumulation is a growing set of data that is added to until a commit or cancel. * @param [in] pData A message part being added. * @param [in] length The number of bytes being added. */ -void BLEValue::addPart(uint8_t* pData, size_t length) { +void BLEValue::addPart(uint8_t *pData, size_t length) { log_v(">> addPart: length=%d", length); - m_accumulation += String((char*)pData, length); + m_accumulation += String((char *)pData, length); } // addPart - /** * @brief Cancel the current accumulation. */ @@ -51,7 +48,6 @@ void BLEValue::cancel() { m_readOffset = 0; } // cancel - /** * @brief Commit the current accumulation. * When writing a value, we may find that we write it in "parts" meaning that the writes come in in pieces @@ -61,22 +57,22 @@ void BLEValue::cancel() { void BLEValue::commit() { log_v(">> commit"); // If there is nothing to commit, do nothing. - if (m_accumulation.length() == 0) return; + if (m_accumulation.length() == 0) { + return; + } setValue(m_accumulation); m_accumulation = ""; m_readOffset = 0; } // commit - /** * @brief Get a pointer to the data. * @return A pointer to the data. */ -uint8_t* BLEValue::getData() { - return (uint8_t*)m_value.c_str(); +uint8_t *BLEValue::getData() { + return (uint8_t *)m_value.c_str(); } - /** * @brief Get the length of the data in bytes. * @return The length of the data in bytes. @@ -85,7 +81,6 @@ size_t BLEValue::getLength() { return m_value.length(); } // getLength - /** * @brief Get the read offset. * @return The read offset into the read. @@ -94,7 +89,6 @@ uint16_t BLEValue::getReadOffset() { return m_readOffset; } // getReadOffset - /** * @brief Get the current value. */ @@ -102,7 +96,6 @@ String BLEValue::getValue() { return m_value; } // getValue - /** * @brief Set the read offset * @param [in] readOffset The offset into the read. @@ -111,7 +104,6 @@ void BLEValue::setReadOffset(uint16_t readOffset) { m_readOffset = readOffset; } // setReadOffset - /** * @brief Set the current value. */ @@ -119,16 +111,14 @@ void BLEValue::setValue(String value) { m_value = value; } // setValue - /** * @brief Set the current value. * @param [in] pData The data for the current value. * @param [in] The length of the new current value. */ -void BLEValue::setValue(uint8_t* pData, size_t length) { - m_value = String((char*)pData, length); +void BLEValue::setValue(uint8_t *pData, size_t length) { + m_value = String((char *)pData, length); } // setValue - #endif /* CONFIG_BLUEDROID_ENABLED */ #endif /* SOC_BLE_SUPPORTED */ diff --git a/libraries/BLE/src/BLEValue.h b/libraries/BLE/src/BLEValue.h index ba1e08e5b..f9c91bdcd 100644 --- a/libraries/BLE/src/BLEValue.h +++ b/libraries/BLE/src/BLEValue.h @@ -21,16 +21,16 @@ class BLEValue { public: BLEValue(); void addPart(String part); - void addPart(uint8_t* pData, size_t length); + void addPart(uint8_t *pData, size_t length); void cancel(); void commit(); - uint8_t* getData(); + uint8_t *getData(); size_t getLength(); uint16_t getReadOffset(); String getValue(); void setReadOffset(uint16_t readOffset); void setValue(String value); - void setValue(uint8_t* pData, size_t length); + void setValue(uint8_t *pData, size_t length); private: String m_accumulation; diff --git a/libraries/BLE/src/FreeRTOS.cpp b/libraries/BLE/src/FreeRTOS.cpp index ce716395d..b1f876018 100644 --- a/libraries/BLE/src/FreeRTOS.cpp +++ b/libraries/BLE/src/FreeRTOS.cpp @@ -22,7 +22,6 @@ void FreeRTOS::sleep(uint32_t ms) { ::vTaskDelay(ms / portTICK_PERIOD_MS); } // sleep - /** * Start a new task. * @param[in] task The function pointer to the function to be run in the task. @@ -30,11 +29,10 @@ void FreeRTOS::sleep(uint32_t ms) { * @param[in] param An optional parameter to be passed to the started task. * @param[in] stackSize An optional parameter supplying the size of the stack in which to run the task. */ -void FreeRTOS::startTask(void task(void*), String taskName, void* param, uint32_t stackSize) { +void FreeRTOS::startTask(void task(void *), String taskName, void *param, uint32_t stackSize) { ::xTaskCreate(task, taskName.c_str(), stackSize, param, 5, NULL); } // startTask - /** * Delete the task. * @param[in] pTask An optional handle to the task to be deleted. If not supplied the calling task will be deleted. @@ -43,7 +41,6 @@ void FreeRTOS::deleteTask(TaskHandle_t pTask) { ::vTaskDelete(pTask); } // deleteTask - /** * Get the time in milliseconds since the %FreeRTOS scheduler started. * @return The time in milliseconds since the %FreeRTOS scheduler started. @@ -52,7 +49,6 @@ uint32_t FreeRTOS::getTimeSinceStart() { return (uint32_t)(xTaskGetTickCount() * portTICK_PERIOD_MS); } // getTimeSinceStart - /** * @brief Wait for a semaphore to be released by trying to take it and * then releasing it again. @@ -110,7 +106,6 @@ bool FreeRTOS::Semaphore::timedWait(String owner, uint32_t timeoutMs) { return ret; } // wait - FreeRTOS::Semaphore::Semaphore(String name) { m_usePthreads = false; // Are we using pThreads or FreeRTOS? if (m_usePthreads) { @@ -125,7 +120,6 @@ FreeRTOS::Semaphore::Semaphore(String name) { m_value = 0; } - FreeRTOS::Semaphore::~Semaphore() { if (m_usePthreads) { pthread_mutex_destroy(&m_pthread_mutex); @@ -134,7 +128,6 @@ FreeRTOS::Semaphore::~Semaphore() { } } - /** * @brief Give a semaphore. * The Semaphore is given. @@ -154,7 +147,6 @@ void FreeRTOS::Semaphore::give() { } // Semaphore::give - /** * @brief Give a semaphore. * The Semaphore is given with an associated value. @@ -165,7 +157,6 @@ void FreeRTOS::Semaphore::give(uint32_t value) { give(); } // give - /** * @brief Give a semaphore from an ISR. */ @@ -178,7 +169,6 @@ void FreeRTOS::Semaphore::giveFromISR() { } } // giveFromISR - /** * @brief Take a semaphore. * Take a semaphore and wait indefinitely. @@ -202,7 +192,6 @@ bool FreeRTOS::Semaphore::take(String owner) { return rc; } // Semaphore::take - /** * @brief Take a semaphore. * Take a semaphore but return if we haven't obtained it in the given period of milliseconds. @@ -227,8 +216,6 @@ bool FreeRTOS::Semaphore::take(uint32_t timeoutMs, String owner) { return rc; } // Semaphore::take - - /** * @brief Create a string representation of the semaphore. * @return A string representation of the semaphore. @@ -242,7 +229,6 @@ String FreeRTOS::Semaphore::toString() { return res; } // toString - /** * @brief Set the name of the semaphore. * @param [in] name The name of the semaphore. @@ -251,7 +237,6 @@ void FreeRTOS::Semaphore::setName(String name) { m_name = name; } // setName - /** * @brief Create a ring buffer. * @param [in] length The amount of storage to allocate for the ring buffer. @@ -266,32 +251,28 @@ Ringbuffer::Ringbuffer(size_t length, ringbuf_type_t type) m_handle = ::xRingbufferCreate(length, type); } // Ringbuffer - Ringbuffer::~Ringbuffer() { ::vRingbufferDelete(m_handle); } // ~Ringbuffer - /** * @brief Receive data from the buffer. * @param [out] size On return, the size of data returned. * @param [in] wait How long to wait. * @return A pointer to the storage retrieved. */ -void* Ringbuffer::receive(size_t* size, TickType_t wait) { +void *Ringbuffer::receive(size_t *size, TickType_t wait) { return ::xRingbufferReceive(m_handle, size, wait); } // receive - /** * @brief Return an item. * @param [in] item The item to be returned/released. */ -void Ringbuffer::returnItem(void* item) { +void Ringbuffer::returnItem(void *item) { ::vRingbufferReturnItem(m_handle, item); } // returnItem - /** * @brief Send data to the buffer. * @param [in] data The data to place into the buffer. @@ -299,6 +280,6 @@ void Ringbuffer::returnItem(void* item) { * @param [in] wait How long to wait before giving up. The default is to wait indefinitely. * @return */ -bool Ringbuffer::send(void* data, size_t length, TickType_t wait) { +bool Ringbuffer::send(void *data, size_t length, TickType_t wait) { return ::xRingbufferSend(m_handle, data, length, wait) == pdTRUE; } // send diff --git a/libraries/BLE/src/GeneralUtils.cpp b/libraries/BLE/src/GeneralUtils.cpp index 1ee40db78..1bb474fba 100644 --- a/libraries/BLE/src/GeneralUtils.cpp +++ b/libraries/BLE/src/GeneralUtils.cpp @@ -29,33 +29,29 @@ static int base64EncodedLength(size_t length) { return (length + 2 - ((length + 2) % 3)) / 3 * 4; } // base64EncodedLength - -static int base64EncodedLength(const String& in) { +static int base64EncodedLength(const String &in) { return base64EncodedLength(in.length()); } // base64EncodedLength - -static void a3_to_a4(unsigned char* a4, unsigned char* a3) { +static void a3_to_a4(unsigned char *a4, unsigned char *a3) { a4[0] = (a3[0] & 0xfc) >> 2; a4[1] = ((a3[0] & 0x03) << 4) + ((a3[1] & 0xf0) >> 4); a4[2] = ((a3[1] & 0x0f) << 2) + ((a3[2] & 0xc0) >> 6); a4[3] = (a3[2] & 0x3f); } // a3_to_a4 - -static void a4_to_a3(unsigned char* a3, unsigned char* a4) { +static void a4_to_a3(unsigned char *a3, unsigned char *a4) { a3[0] = (a4[0] << 2) + ((a4[1] & 0x30) >> 4); a3[1] = ((a4[1] & 0xf) << 4) + ((a4[2] & 0x3c) >> 2); a3[2] = ((a4[2] & 0x3) << 6) + a4[3]; } // a4_to_a3 - /** * @brief Encode a string into base 64. * @param [in] in * @param [out] out */ -bool GeneralUtils::base64Encode(const String& in, String* out) { +bool GeneralUtils::base64Encode(const String &in, String *out) { std::string std_in(in.c_str()); std::string std_out(out->c_str()); int i = 0, j = 0; @@ -100,7 +96,6 @@ bool GeneralUtils::base64Encode(const String& in, String* out) { return (enc_len == out->length()); } // base64Encode - /** * @brief Dump general info to the log. * Data includes: @@ -116,7 +111,6 @@ void GeneralUtils::dumpInfo() { log_v("---"); } // dumpInfo - /** * @brief Does the string end with a specific character? * @param [in] str The string to examine. @@ -147,21 +141,30 @@ static int DecodedLength(const String& in) { */ static unsigned char b64_lookup(unsigned char c) { - if (c >= 'A' && c <= 'Z') return c - 'A'; - if (c >= 'a' && c <= 'z') return c - 71; - if (c >= '0' && c <= '9') return c + 4; - if (c == '+') return 62; - if (c == '/') return 63; + if (c >= 'A' && c <= 'Z') { + return c - 'A'; + } + if (c >= 'a' && c <= 'z') { + return c - 71; + } + if (c >= '0' && c <= '9') { + return c + 4; + } + if (c == '+') { + return 62; + } + if (c == '/') { + return 63; + } return 255; }; // b64_lookup - /** * @brief Decode a chunk of data that is base64 encoded. * @param [in] in The string to be decoded. * @param [out] out The resulting data. */ -bool GeneralUtils::base64Decode(const String& in, String* out) { +bool GeneralUtils::base64Decode(const String &in, String *out) { int i = 0, j = 0; size_t dec_len = 0; unsigned char a3[3]; @@ -285,7 +288,6 @@ void GeneralUtils::hexDump(uint8_t* pData, uint32_t length) { } */ - /** * @brief Dump a representation of binary data to the console. * @@ -293,7 +295,7 @@ void GeneralUtils::hexDump(uint8_t* pData, uint32_t length) { * @param [in] length Length of the data (in bytes) to be logged. * @return N/A. */ -void GeneralUtils::hexDump(const uint8_t* pData, uint32_t length) { +void GeneralUtils::hexDump(const uint8_t *pData, uint32_t length) { char ascii[80]; char hex[80]; char tempBuf[80]; @@ -330,22 +332,20 @@ void GeneralUtils::hexDump(const uint8_t* pData, uint32_t length) { } } // hexDump - /** * @brief Convert an IP address to string. * @param ip The 4 byte IP address. * @return A string representation of the IP address. */ -String GeneralUtils::ipToString(uint8_t* ip) { +String GeneralUtils::ipToString(uint8_t *ip) { auto size = 16; - char* val = (char*)malloc(size); + char *val = (char *)malloc(size); snprintf(val, size, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); String res(val); free(val); return res; } // ipToString - /** * @brief Split a string into parts based on a delimiter. * @param [in] source The source string to split. @@ -367,84 +367,50 @@ std::vector GeneralUtils::split(String source, char delimiter) { return strings; } // split - /** * @brief Convert an ESP error code to a string. * @param [in] errCode The errCode to be converted. * @return A string representation of the error code. */ -const char* GeneralUtils::errorToString(esp_err_t errCode) { +const char *GeneralUtils::errorToString(esp_err_t errCode) { switch (errCode) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case ESP_OK: - return "ESP_OK"; - case ESP_FAIL: - return "ESP_FAIL"; - case ESP_ERR_NO_MEM: - return "ESP_ERR_NO_MEM"; - case ESP_ERR_INVALID_ARG: - return "ESP_ERR_INVALID_ARG"; - case ESP_ERR_INVALID_SIZE: - return "ESP_ERR_INVALID_SIZE"; - case ESP_ERR_INVALID_STATE: - return "ESP_ERR_INVALID_STATE"; - case ESP_ERR_NOT_FOUND: - return "ESP_ERR_NOT_FOUND"; - case ESP_ERR_NOT_SUPPORTED: - return "ESP_ERR_NOT_SUPPORTED"; - case ESP_ERR_TIMEOUT: - return "ESP_ERR_TIMEOUT"; - case ESP_ERR_NVS_NOT_INITIALIZED: - return "ESP_ERR_NVS_NOT_INITIALIZED"; - case ESP_ERR_NVS_NOT_FOUND: - return "ESP_ERR_NVS_NOT_FOUND"; - case ESP_ERR_NVS_TYPE_MISMATCH: - return "ESP_ERR_NVS_TYPE_MISMATCH"; - case ESP_ERR_NVS_READ_ONLY: - return "ESP_ERR_NVS_READ_ONLY"; - case ESP_ERR_NVS_NOT_ENOUGH_SPACE: - return "ESP_ERR_NVS_NOT_ENOUGH_SPACE"; - case ESP_ERR_NVS_INVALID_NAME: - return "ESP_ERR_NVS_INVALID_NAME"; - case ESP_ERR_NVS_INVALID_HANDLE: - return "ESP_ERR_NVS_INVALID_HANDLE"; - case ESP_ERR_NVS_REMOVE_FAILED: - return "ESP_ERR_NVS_REMOVE_FAILED"; - case ESP_ERR_NVS_KEY_TOO_LONG: - return "ESP_ERR_NVS_KEY_TOO_LONG"; - case ESP_ERR_NVS_PAGE_FULL: - return "ESP_ERR_NVS_PAGE_FULL"; - case ESP_ERR_NVS_INVALID_STATE: - return "ESP_ERR_NVS_INVALID_STATE"; - case ESP_ERR_NVS_INVALID_LENGTH: - return "ESP_ERR_NVS_INVALID_LENGTH"; - case ESP_ERR_WIFI_NOT_INIT: - return "ESP_ERR_WIFI_NOT_INIT"; + case ESP_OK: return "ESP_OK"; + case ESP_FAIL: return "ESP_FAIL"; + case ESP_ERR_NO_MEM: return "ESP_ERR_NO_MEM"; + case ESP_ERR_INVALID_ARG: return "ESP_ERR_INVALID_ARG"; + case ESP_ERR_INVALID_SIZE: return "ESP_ERR_INVALID_SIZE"; + case ESP_ERR_INVALID_STATE: return "ESP_ERR_INVALID_STATE"; + case ESP_ERR_NOT_FOUND: return "ESP_ERR_NOT_FOUND"; + case ESP_ERR_NOT_SUPPORTED: return "ESP_ERR_NOT_SUPPORTED"; + case ESP_ERR_TIMEOUT: return "ESP_ERR_TIMEOUT"; + case ESP_ERR_NVS_NOT_INITIALIZED: return "ESP_ERR_NVS_NOT_INITIALIZED"; + case ESP_ERR_NVS_NOT_FOUND: return "ESP_ERR_NVS_NOT_FOUND"; + case ESP_ERR_NVS_TYPE_MISMATCH: return "ESP_ERR_NVS_TYPE_MISMATCH"; + case ESP_ERR_NVS_READ_ONLY: return "ESP_ERR_NVS_READ_ONLY"; + case ESP_ERR_NVS_NOT_ENOUGH_SPACE: return "ESP_ERR_NVS_NOT_ENOUGH_SPACE"; + case ESP_ERR_NVS_INVALID_NAME: return "ESP_ERR_NVS_INVALID_NAME"; + case ESP_ERR_NVS_INVALID_HANDLE: return "ESP_ERR_NVS_INVALID_HANDLE"; + case ESP_ERR_NVS_REMOVE_FAILED: return "ESP_ERR_NVS_REMOVE_FAILED"; + case ESP_ERR_NVS_KEY_TOO_LONG: return "ESP_ERR_NVS_KEY_TOO_LONG"; + case ESP_ERR_NVS_PAGE_FULL: return "ESP_ERR_NVS_PAGE_FULL"; + case ESP_ERR_NVS_INVALID_STATE: return "ESP_ERR_NVS_INVALID_STATE"; + case ESP_ERR_NVS_INVALID_LENGTH: return "ESP_ERR_NVS_INVALID_LENGTH"; + case ESP_ERR_WIFI_NOT_INIT: return "ESP_ERR_WIFI_NOT_INIT"; //case ESP_ERR_WIFI_NOT_START: // return "ESP_ERR_WIFI_NOT_START"; - case ESP_ERR_WIFI_IF: - return "ESP_ERR_WIFI_IF"; - case ESP_ERR_WIFI_MODE: - return "ESP_ERR_WIFI_MODE"; - case ESP_ERR_WIFI_STATE: - return "ESP_ERR_WIFI_STATE"; - case ESP_ERR_WIFI_CONN: - return "ESP_ERR_WIFI_CONN"; - case ESP_ERR_WIFI_NVS: - return "ESP_ERR_WIFI_NVS"; - case ESP_ERR_WIFI_MAC: - return "ESP_ERR_WIFI_MAC"; - case ESP_ERR_WIFI_SSID: - return "ESP_ERR_WIFI_SSID"; - case ESP_ERR_WIFI_PASSWORD: - return "ESP_ERR_WIFI_PASSWORD"; - case ESP_ERR_WIFI_TIMEOUT: - return "ESP_ERR_WIFI_TIMEOUT"; - case ESP_ERR_WIFI_WAKE_FAIL: - return "ESP_ERR_WIFI_WAKE_FAIL"; + case ESP_ERR_WIFI_IF: return "ESP_ERR_WIFI_IF"; + case ESP_ERR_WIFI_MODE: return "ESP_ERR_WIFI_MODE"; + case ESP_ERR_WIFI_STATE: return "ESP_ERR_WIFI_STATE"; + case ESP_ERR_WIFI_CONN: return "ESP_ERR_WIFI_CONN"; + case ESP_ERR_WIFI_NVS: return "ESP_ERR_WIFI_NVS"; + case ESP_ERR_WIFI_MAC: return "ESP_ERR_WIFI_MAC"; + case ESP_ERR_WIFI_SSID: return "ESP_ERR_WIFI_SSID"; + case ESP_ERR_WIFI_PASSWORD: return "ESP_ERR_WIFI_PASSWORD"; + case ESP_ERR_WIFI_TIMEOUT: return "ESP_ERR_WIFI_TIMEOUT"; + case ESP_ERR_WIFI_WAKE_FAIL: return "ESP_ERR_WIFI_WAKE_FAIL"; #endif - default: - return "Unknown ESP_ERR error"; + default: return "Unknown ESP_ERR error"; } } // errorToString @@ -455,95 +421,70 @@ const char* GeneralUtils::errorToString(esp_err_t errCode) { * * @note: wifi_err_reason_t values as of April 2018 are: (1-24, 200-204) and are defined in ~/esp-idf/components/esp32/include/esp_wifi_types.h. */ -const char* GeneralUtils::wifiErrorToString(uint8_t errCode) { - if (errCode == ESP_OK) return "ESP_OK (received SYSTEM_EVENT_STA_GOT_IP event)"; - if (errCode == UINT8_MAX) return "Not Connected (default value)"; +const char *GeneralUtils::wifiErrorToString(uint8_t errCode) { + if (errCode == ESP_OK) { + return "ESP_OK (received SYSTEM_EVENT_STA_GOT_IP event)"; + } + if (errCode == UINT8_MAX) { + return "Not Connected (default value)"; + } switch ((wifi_err_reason_t)errCode) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG - case WIFI_REASON_UNSPECIFIED: - return "WIFI_REASON_UNSPECIFIED"; - case WIFI_REASON_AUTH_EXPIRE: - return "WIFI_REASON_AUTH_EXPIRE"; - case WIFI_REASON_AUTH_LEAVE: - return "WIFI_REASON_AUTH_LEAVE"; - case WIFI_REASON_ASSOC_EXPIRE: - return "WIFI_REASON_ASSOC_EXPIRE"; - case WIFI_REASON_ASSOC_TOOMANY: - return "WIFI_REASON_ASSOC_TOOMANY"; - case WIFI_REASON_NOT_AUTHED: - return "WIFI_REASON_NOT_AUTHED"; - case WIFI_REASON_NOT_ASSOCED: - return "WIFI_REASON_NOT_ASSOCED"; - case WIFI_REASON_ASSOC_LEAVE: - return "WIFI_REASON_ASSOC_LEAVE"; - case WIFI_REASON_ASSOC_NOT_AUTHED: - return "WIFI_REASON_ASSOC_NOT_AUTHED"; - case WIFI_REASON_DISASSOC_PWRCAP_BAD: - return "WIFI_REASON_DISASSOC_PWRCAP_BAD"; - case WIFI_REASON_DISASSOC_SUPCHAN_BAD: - return "WIFI_REASON_DISASSOC_SUPCHAN_BAD"; - case WIFI_REASON_IE_INVALID: - return "WIFI_REASON_IE_INVALID"; - case WIFI_REASON_MIC_FAILURE: - return "WIFI_REASON_MIC_FAILURE"; - case WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT: - return "WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT"; - case WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT: - return "WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT"; - case WIFI_REASON_IE_IN_4WAY_DIFFERS: - return "WIFI_REASON_IE_IN_4WAY_DIFFERS"; - case WIFI_REASON_GROUP_CIPHER_INVALID: - return "WIFI_REASON_GROUP_CIPHER_INVALID"; - case WIFI_REASON_PAIRWISE_CIPHER_INVALID: - return "WIFI_REASON_PAIRWISE_CIPHER_INVALID"; - case WIFI_REASON_AKMP_INVALID: - return "WIFI_REASON_AKMP_INVALID"; - case WIFI_REASON_UNSUPP_RSN_IE_VERSION: - return "WIFI_REASON_UNSUPP_RSN_IE_VERSION"; - case WIFI_REASON_INVALID_RSN_IE_CAP: - return "WIFI_REASON_INVALID_RSN_IE_CAP"; - case WIFI_REASON_802_1X_AUTH_FAILED: - return "WIFI_REASON_802_1X_AUTH_FAILED"; - case WIFI_REASON_CIPHER_SUITE_REJECTED: - return "WIFI_REASON_CIPHER_SUITE_REJECTED"; - case WIFI_REASON_BEACON_TIMEOUT: - return "WIFI_REASON_BEACON_TIMEOUT"; - case WIFI_REASON_NO_AP_FOUND: - return "WIFI_REASON_NO_AP_FOUND"; - case WIFI_REASON_AUTH_FAIL: - return "WIFI_REASON_AUTH_FAIL"; - case WIFI_REASON_ASSOC_FAIL: - return "WIFI_REASON_ASSOC_FAIL"; - case WIFI_REASON_HANDSHAKE_TIMEOUT: - return "WIFI_REASON_HANDSHAKE_TIMEOUT"; + case WIFI_REASON_UNSPECIFIED: return "WIFI_REASON_UNSPECIFIED"; + case WIFI_REASON_AUTH_EXPIRE: return "WIFI_REASON_AUTH_EXPIRE"; + case WIFI_REASON_AUTH_LEAVE: return "WIFI_REASON_AUTH_LEAVE"; + case WIFI_REASON_ASSOC_EXPIRE: return "WIFI_REASON_ASSOC_EXPIRE"; + case WIFI_REASON_ASSOC_TOOMANY: return "WIFI_REASON_ASSOC_TOOMANY"; + case WIFI_REASON_NOT_AUTHED: return "WIFI_REASON_NOT_AUTHED"; + case WIFI_REASON_NOT_ASSOCED: return "WIFI_REASON_NOT_ASSOCED"; + case WIFI_REASON_ASSOC_LEAVE: return "WIFI_REASON_ASSOC_LEAVE"; + case WIFI_REASON_ASSOC_NOT_AUTHED: return "WIFI_REASON_ASSOC_NOT_AUTHED"; + case WIFI_REASON_DISASSOC_PWRCAP_BAD: return "WIFI_REASON_DISASSOC_PWRCAP_BAD"; + case WIFI_REASON_DISASSOC_SUPCHAN_BAD: return "WIFI_REASON_DISASSOC_SUPCHAN_BAD"; + case WIFI_REASON_IE_INVALID: return "WIFI_REASON_IE_INVALID"; + case WIFI_REASON_MIC_FAILURE: return "WIFI_REASON_MIC_FAILURE"; + case WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT: return "WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT"; + case WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT: return "WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT"; + case WIFI_REASON_IE_IN_4WAY_DIFFERS: return "WIFI_REASON_IE_IN_4WAY_DIFFERS"; + case WIFI_REASON_GROUP_CIPHER_INVALID: return "WIFI_REASON_GROUP_CIPHER_INVALID"; + case WIFI_REASON_PAIRWISE_CIPHER_INVALID: return "WIFI_REASON_PAIRWISE_CIPHER_INVALID"; + case WIFI_REASON_AKMP_INVALID: return "WIFI_REASON_AKMP_INVALID"; + case WIFI_REASON_UNSUPP_RSN_IE_VERSION: return "WIFI_REASON_UNSUPP_RSN_IE_VERSION"; + case WIFI_REASON_INVALID_RSN_IE_CAP: return "WIFI_REASON_INVALID_RSN_IE_CAP"; + case WIFI_REASON_802_1X_AUTH_FAILED: return "WIFI_REASON_802_1X_AUTH_FAILED"; + case WIFI_REASON_CIPHER_SUITE_REJECTED: return "WIFI_REASON_CIPHER_SUITE_REJECTED"; + case WIFI_REASON_BEACON_TIMEOUT: return "WIFI_REASON_BEACON_TIMEOUT"; + case WIFI_REASON_NO_AP_FOUND: return "WIFI_REASON_NO_AP_FOUND"; + case WIFI_REASON_AUTH_FAIL: return "WIFI_REASON_AUTH_FAIL"; + case WIFI_REASON_ASSOC_FAIL: return "WIFI_REASON_ASSOC_FAIL"; + case WIFI_REASON_HANDSHAKE_TIMEOUT: return "WIFI_REASON_HANDSHAKE_TIMEOUT"; #endif - default: - return "Unknown ESP_ERR error"; + default: return "Unknown ESP_ERR error"; } } // wifiErrorToString - /** * @brief Convert a string to lower case. * @param [in] value The string to convert to lower case. * @return A lower case representation of the string. */ -String GeneralUtils::toLower(String& value) { +String GeneralUtils::toLower(String &value) { // Question: Could this be improved with a signature of: // String& GeneralUtils::toLower(String& value) std::transform(value.begin(), value.end(), value.begin(), ::tolower); return value; } // toLower - /** * @brief Remove white space from a string. */ -String GeneralUtils::trim(const String& str) { +String GeneralUtils::trim(const String &str) { std::string std_str(str.c_str()); size_t first = std_str.find_first_not_of(' '); - if (std::string::npos == first) return str; + if (std::string::npos == first) { + return str; + } size_t last = std_str.find_last_not_of(' '); return str.substring(first, (last + 1)); } // trim diff --git a/libraries/BLE/src/GeneralUtils.h b/libraries/BLE/src/GeneralUtils.h index 5e714f863..c22d6f98b 100644 --- a/libraries/BLE/src/GeneralUtils.h +++ b/libraries/BLE/src/GeneralUtils.h @@ -19,17 +19,17 @@ */ class GeneralUtils { public: - static bool base64Decode(const String& in, String* out); - static bool base64Encode(const String& in, String* out); + static bool base64Decode(const String &in, String *out); + static bool base64Encode(const String &in, String *out); static void dumpInfo(); static bool endsWith(String str, char c); - static const char* errorToString(esp_err_t errCode); - static const char* wifiErrorToString(uint8_t value); - static void hexDump(const uint8_t* pData, uint32_t length); - static String ipToString(uint8_t* ip); + static const char *errorToString(esp_err_t errCode); + static const char *wifiErrorToString(uint8_t value); + static void hexDump(const uint8_t *pData, uint32_t length); + static String ipToString(uint8_t *ip); static std::vector split(String source, char delimiter); - static String toLower(String& value); - static String trim(const String& str); + static String toLower(String &value); + static String trim(const String &str); }; #endif /* COMPONENTS_CPP_UTILS_GENERALUTILS_H_ */ diff --git a/libraries/BLE/src/HIDKeyboardTypes.h b/libraries/BLE/src/HIDKeyboardTypes.h index 74825da7b..971d637f9 100644 --- a/libraries/BLE/src/HIDKeyboardTypes.h +++ b/libraries/BLE/src/HIDKeyboardTypes.h @@ -22,7 +22,7 @@ #define KEYBOARD_DEFS_H #define REPORT_ID_KEYBOARD 1 -#define REPORT_ID_VOLUME 3 +#define REPORT_ID_VOLUME 3 /* Modifiers */ enum MODIFIER_KEY { @@ -31,7 +31,6 @@ enum MODIFIER_KEY { KEY_ALT = 4, }; - enum MEDIA_KEY { KEY_NEXT_TRACK, /*!< next Track Button */ KEY_PREVIOUS_TRACK, /*!< Previous track Button */ @@ -80,328 +79,328 @@ typedef struct { /* US keyboard (as HID standard) */ #define KEYMAP_SIZE (152) const KEYMAP keymap[KEYMAP_SIZE] = { - { 0, 0 }, /* NUL */ - { 0, 0 }, /* SOH */ - { 0, 0 }, /* STX */ - { 0, 0 }, /* ETX */ - { 0, 0 }, /* EOT */ - { 0, 0 }, /* ENQ */ - { 0, 0 }, /* ACK */ - { 0, 0 }, /* BEL */ - { 0x2a, 0 }, + {0, 0}, /* NUL */ + {0, 0}, /* SOH */ + {0, 0}, /* STX */ + {0, 0}, /* ETX */ + {0, 0}, /* EOT */ + {0, 0}, /* ENQ */ + {0, 0}, /* ACK */ + {0, 0}, /* BEL */ + {0x2a, 0}, /* BS */ /* Keyboard Delete (Backspace) */ - { 0x2b, 0 }, + {0x2b, 0}, /* TAB */ /* Keyboard Tab */ - { 0x28, 0 }, - /* LF */ /* Keyboard Return (Enter) */ - { 0, 0 }, /* VT */ - { 0, 0 }, /* FF */ - { 0, 0 }, /* CR */ - { 0, 0 }, /* SO */ - { 0, 0 }, /* SI */ - { 0, 0 }, /* DEL */ - { 0, 0 }, /* DC1 */ - { 0, 0 }, /* DC2 */ - { 0, 0 }, /* DC3 */ - { 0, 0 }, /* DC4 */ - { 0, 0 }, /* NAK */ - { 0, 0 }, /* SYN */ - { 0, 0 }, /* ETB */ - { 0, 0 }, /* CAN */ - { 0, 0 }, /* EM */ - { 0, 0 }, /* SUB */ - { 0, 0 }, /* ESC */ - { 0, 0 }, /* FS */ - { 0, 0 }, /* GS */ - { 0, 0 }, /* RS */ - { 0, 0 }, /* US */ - { 0x2c, 0 }, /* */ - { 0x1e, KEY_SHIFT }, /* ! */ - { 0x34, KEY_SHIFT }, /* " */ - { 0x20, KEY_SHIFT }, /* # */ - { 0x21, KEY_SHIFT }, /* $ */ - { 0x22, KEY_SHIFT }, /* % */ - { 0x24, KEY_SHIFT }, /* & */ - { 0x34, 0 }, /* ' */ - { 0x26, KEY_SHIFT }, /* ( */ - { 0x27, KEY_SHIFT }, /* ) */ - { 0x25, KEY_SHIFT }, /* * */ - { 0x2e, KEY_SHIFT }, /* + */ - { 0x36, 0 }, /* , */ - { 0x2d, 0 }, /* - */ - { 0x37, 0 }, /* . */ - { 0x38, 0 }, /* / */ - { 0x27, 0 }, /* 0 */ - { 0x1e, 0 }, /* 1 */ - { 0x1f, 0 }, /* 2 */ - { 0x20, 0 }, /* 3 */ - { 0x21, 0 }, /* 4 */ - { 0x22, 0 }, /* 5 */ - { 0x23, 0 }, /* 6 */ - { 0x24, 0 }, /* 7 */ - { 0x25, 0 }, /* 8 */ - { 0x26, 0 }, /* 9 */ - { 0x33, KEY_SHIFT }, /* : */ - { 0x33, 0 }, /* ; */ - { 0x36, KEY_SHIFT }, /* < */ - { 0x2e, 0 }, /* = */ - { 0x37, KEY_SHIFT }, /* > */ - { 0x38, KEY_SHIFT }, /* ? */ - { 0x1f, KEY_SHIFT }, /* @ */ - { 0x04, KEY_SHIFT }, /* A */ - { 0x05, KEY_SHIFT }, /* B */ - { 0x06, KEY_SHIFT }, /* C */ - { 0x07, KEY_SHIFT }, /* D */ - { 0x08, KEY_SHIFT }, /* E */ - { 0x09, KEY_SHIFT }, /* F */ - { 0x0a, KEY_SHIFT }, /* G */ - { 0x0b, KEY_SHIFT }, /* H */ - { 0x0c, KEY_SHIFT }, /* I */ - { 0x0d, KEY_SHIFT }, /* J */ - { 0x0e, KEY_SHIFT }, /* K */ - { 0x0f, KEY_SHIFT }, /* L */ - { 0x10, KEY_SHIFT }, /* M */ - { 0x11, KEY_SHIFT }, /* N */ - { 0x12, KEY_SHIFT }, /* O */ - { 0x13, KEY_SHIFT }, /* P */ - { 0x14, KEY_SHIFT }, /* Q */ - { 0x15, KEY_SHIFT }, /* R */ - { 0x16, KEY_SHIFT }, /* S */ - { 0x17, KEY_SHIFT }, /* T */ - { 0x18, KEY_SHIFT }, /* U */ - { 0x19, KEY_SHIFT }, /* V */ - { 0x1a, KEY_SHIFT }, /* W */ - { 0x1b, KEY_SHIFT }, /* X */ - { 0x1c, KEY_SHIFT }, /* Y */ - { 0x1d, KEY_SHIFT }, /* Z */ - { 0x2f, 0 }, /* [ */ - { 0x31, 0 }, /* \ */ - { 0x30, 0 }, /* ] */ - { 0x23, KEY_SHIFT }, /* ^ */ - { 0x2d, KEY_SHIFT }, /* _ */ - { 0x35, 0 }, /* ` */ - { 0x04, 0 }, /* a */ - { 0x05, 0 }, /* b */ - { 0x06, 0 }, /* c */ - { 0x07, 0 }, /* d */ - { 0x08, 0 }, /* e */ - { 0x09, 0 }, /* f */ - { 0x0a, 0 }, /* g */ - { 0x0b, 0 }, /* h */ - { 0x0c, 0 }, /* i */ - { 0x0d, 0 }, /* j */ - { 0x0e, 0 }, /* k */ - { 0x0f, 0 }, /* l */ - { 0x10, 0 }, /* m */ - { 0x11, 0 }, /* n */ - { 0x12, 0 }, /* o */ - { 0x13, 0 }, /* p */ - { 0x14, 0 }, /* q */ - { 0x15, 0 }, /* r */ - { 0x16, 0 }, /* s */ - { 0x17, 0 }, /* t */ - { 0x18, 0 }, /* u */ - { 0x19, 0 }, /* v */ - { 0x1a, 0 }, /* w */ - { 0x1b, 0 }, /* x */ - { 0x1c, 0 }, /* y */ - { 0x1d, 0 }, /* z */ - { 0x2f, KEY_SHIFT }, /* { */ - { 0x31, KEY_SHIFT }, /* | */ - { 0x30, KEY_SHIFT }, /* } */ - { 0x35, KEY_SHIFT }, /* ~ */ - { 0, 0 }, /* DEL */ + {0x28, 0}, + /* LF */ /* Keyboard Return (Enter) */ + {0, 0}, /* VT */ + {0, 0}, /* FF */ + {0, 0}, /* CR */ + {0, 0}, /* SO */ + {0, 0}, /* SI */ + {0, 0}, /* DEL */ + {0, 0}, /* DC1 */ + {0, 0}, /* DC2 */ + {0, 0}, /* DC3 */ + {0, 0}, /* DC4 */ + {0, 0}, /* NAK */ + {0, 0}, /* SYN */ + {0, 0}, /* ETB */ + {0, 0}, /* CAN */ + {0, 0}, /* EM */ + {0, 0}, /* SUB */ + {0, 0}, /* ESC */ + {0, 0}, /* FS */ + {0, 0}, /* GS */ + {0, 0}, /* RS */ + {0, 0}, /* US */ + {0x2c, 0}, /* */ + {0x1e, KEY_SHIFT}, /* ! */ + {0x34, KEY_SHIFT}, /* " */ + {0x20, KEY_SHIFT}, /* # */ + {0x21, KEY_SHIFT}, /* $ */ + {0x22, KEY_SHIFT}, /* % */ + {0x24, KEY_SHIFT}, /* & */ + {0x34, 0}, /* ' */ + {0x26, KEY_SHIFT}, /* ( */ + {0x27, KEY_SHIFT}, /* ) */ + {0x25, KEY_SHIFT}, /* * */ + {0x2e, KEY_SHIFT}, /* + */ + {0x36, 0}, /* , */ + {0x2d, 0}, /* - */ + {0x37, 0}, /* . */ + {0x38, 0}, /* / */ + {0x27, 0}, /* 0 */ + {0x1e, 0}, /* 1 */ + {0x1f, 0}, /* 2 */ + {0x20, 0}, /* 3 */ + {0x21, 0}, /* 4 */ + {0x22, 0}, /* 5 */ + {0x23, 0}, /* 6 */ + {0x24, 0}, /* 7 */ + {0x25, 0}, /* 8 */ + {0x26, 0}, /* 9 */ + {0x33, KEY_SHIFT}, /* : */ + {0x33, 0}, /* ; */ + {0x36, KEY_SHIFT}, /* < */ + {0x2e, 0}, /* = */ + {0x37, KEY_SHIFT}, /* > */ + {0x38, KEY_SHIFT}, /* ? */ + {0x1f, KEY_SHIFT}, /* @ */ + {0x04, KEY_SHIFT}, /* A */ + {0x05, KEY_SHIFT}, /* B */ + {0x06, KEY_SHIFT}, /* C */ + {0x07, KEY_SHIFT}, /* D */ + {0x08, KEY_SHIFT}, /* E */ + {0x09, KEY_SHIFT}, /* F */ + {0x0a, KEY_SHIFT}, /* G */ + {0x0b, KEY_SHIFT}, /* H */ + {0x0c, KEY_SHIFT}, /* I */ + {0x0d, KEY_SHIFT}, /* J */ + {0x0e, KEY_SHIFT}, /* K */ + {0x0f, KEY_SHIFT}, /* L */ + {0x10, KEY_SHIFT}, /* M */ + {0x11, KEY_SHIFT}, /* N */ + {0x12, KEY_SHIFT}, /* O */ + {0x13, KEY_SHIFT}, /* P */ + {0x14, KEY_SHIFT}, /* Q */ + {0x15, KEY_SHIFT}, /* R */ + {0x16, KEY_SHIFT}, /* S */ + {0x17, KEY_SHIFT}, /* T */ + {0x18, KEY_SHIFT}, /* U */ + {0x19, KEY_SHIFT}, /* V */ + {0x1a, KEY_SHIFT}, /* W */ + {0x1b, KEY_SHIFT}, /* X */ + {0x1c, KEY_SHIFT}, /* Y */ + {0x1d, KEY_SHIFT}, /* Z */ + {0x2f, 0}, /* [ */ + {0x31, 0}, /* \ */ + {0x30, 0}, /* ] */ + {0x23, KEY_SHIFT}, /* ^ */ + {0x2d, KEY_SHIFT}, /* _ */ + {0x35, 0}, /* ` */ + {0x04, 0}, /* a */ + {0x05, 0}, /* b */ + {0x06, 0}, /* c */ + {0x07, 0}, /* d */ + {0x08, 0}, /* e */ + {0x09, 0}, /* f */ + {0x0a, 0}, /* g */ + {0x0b, 0}, /* h */ + {0x0c, 0}, /* i */ + {0x0d, 0}, /* j */ + {0x0e, 0}, /* k */ + {0x0f, 0}, /* l */ + {0x10, 0}, /* m */ + {0x11, 0}, /* n */ + {0x12, 0}, /* o */ + {0x13, 0}, /* p */ + {0x14, 0}, /* q */ + {0x15, 0}, /* r */ + {0x16, 0}, /* s */ + {0x17, 0}, /* t */ + {0x18, 0}, /* u */ + {0x19, 0}, /* v */ + {0x1a, 0}, /* w */ + {0x1b, 0}, /* x */ + {0x1c, 0}, /* y */ + {0x1d, 0}, /* z */ + {0x2f, KEY_SHIFT}, /* { */ + {0x31, KEY_SHIFT}, /* | */ + {0x30, KEY_SHIFT}, /* } */ + {0x35, KEY_SHIFT}, /* ~ */ + {0, 0}, /* DEL */ - { 0x3a, 0 }, /* F1 */ - { 0x3b, 0 }, /* F2 */ - { 0x3c, 0 }, /* F3 */ - { 0x3d, 0 }, /* F4 */ - { 0x3e, 0 }, /* F5 */ - { 0x3f, 0 }, /* F6 */ - { 0x40, 0 }, /* F7 */ - { 0x41, 0 }, /* F8 */ - { 0x42, 0 }, /* F9 */ - { 0x43, 0 }, /* F10 */ - { 0x44, 0 }, /* F11 */ - { 0x45, 0 }, /* F12 */ + {0x3a, 0}, /* F1 */ + {0x3b, 0}, /* F2 */ + {0x3c, 0}, /* F3 */ + {0x3d, 0}, /* F4 */ + {0x3e, 0}, /* F5 */ + {0x3f, 0}, /* F6 */ + {0x40, 0}, /* F7 */ + {0x41, 0}, /* F8 */ + {0x42, 0}, /* F9 */ + {0x43, 0}, /* F10 */ + {0x44, 0}, /* F11 */ + {0x45, 0}, /* F12 */ - { 0x46, 0 }, /* PRINT_SCREEN */ - { 0x47, 0 }, /* SCROLL_LOCK */ - { 0x39, 0 }, /* CAPS_LOCK */ - { 0x53, 0 }, /* NUM_LOCK */ - { 0x49, 0 }, /* INSERT */ - { 0x4a, 0 }, /* HOME */ - { 0x4b, 0 }, /* PAGE_UP */ - { 0x4e, 0 }, /* PAGE_DOWN */ + {0x46, 0}, /* PRINT_SCREEN */ + {0x47, 0}, /* SCROLL_LOCK */ + {0x39, 0}, /* CAPS_LOCK */ + {0x53, 0}, /* NUM_LOCK */ + {0x49, 0}, /* INSERT */ + {0x4a, 0}, /* HOME */ + {0x4b, 0}, /* PAGE_UP */ + {0x4e, 0}, /* PAGE_DOWN */ - { 0x4f, 0 }, /* RIGHT_ARROW */ - { 0x50, 0 }, /* LEFT_ARROW */ - { 0x51, 0 }, /* DOWN_ARROW */ - { 0x52, 0 }, /* UP_ARROW */ + {0x4f, 0}, /* RIGHT_ARROW */ + {0x50, 0}, /* LEFT_ARROW */ + {0x51, 0}, /* DOWN_ARROW */ + {0x52, 0}, /* UP_ARROW */ }; #else /* UK keyboard */ #define KEYMAP_SIZE (152) const KEYMAP keymap[KEYMAP_SIZE] = { - { 0, 0 }, /* NUL */ - { 0, 0 }, /* SOH */ - { 0, 0 }, /* STX */ - { 0, 0 }, /* ETX */ - { 0, 0 }, /* EOT */ - { 0, 0 }, /* ENQ */ - { 0, 0 }, /* ACK */ - { 0, 0 }, /* BEL */ - { 0x2a, 0 }, + {0, 0}, /* NUL */ + {0, 0}, /* SOH */ + {0, 0}, /* STX */ + {0, 0}, /* ETX */ + {0, 0}, /* EOT */ + {0, 0}, /* ENQ */ + {0, 0}, /* ACK */ + {0, 0}, /* BEL */ + {0x2a, 0}, /* BS */ /* Keyboard Delete (Backspace) */ - { 0x2b, 0 }, + {0x2b, 0}, /* TAB */ /* Keyboard Tab */ - { 0x28, 0 }, - /* LF */ /* Keyboard Return (Enter) */ - { 0, 0 }, /* VT */ - { 0, 0 }, /* FF */ - { 0, 0 }, /* CR */ - { 0, 0 }, /* SO */ - { 0, 0 }, /* SI */ - { 0, 0 }, /* DEL */ - { 0, 0 }, /* DC1 */ - { 0, 0 }, /* DC2 */ - { 0, 0 }, /* DC3 */ - { 0, 0 }, /* DC4 */ - { 0, 0 }, /* NAK */ - { 0, 0 }, /* SYN */ - { 0, 0 }, /* ETB */ - { 0, 0 }, /* CAN */ - { 0, 0 }, /* EM */ - { 0, 0 }, /* SUB */ - { 0, 0 }, /* ESC */ - { 0, 0 }, /* FS */ - { 0, 0 }, /* GS */ - { 0, 0 }, /* RS */ - { 0, 0 }, /* US */ - { 0x2c, 0 }, /* */ - { 0x1e, KEY_SHIFT }, /* ! */ - { 0x1f, KEY_SHIFT }, /* " */ - { 0x32, 0 }, /* # */ - { 0x21, KEY_SHIFT }, /* $ */ - { 0x22, KEY_SHIFT }, /* % */ - { 0x24, KEY_SHIFT }, /* & */ - { 0x34, 0 }, /* ' */ - { 0x26, KEY_SHIFT }, /* ( */ - { 0x27, KEY_SHIFT }, /* ) */ - { 0x25, KEY_SHIFT }, /* * */ - { 0x2e, KEY_SHIFT }, /* + */ - { 0x36, 0 }, /* , */ - { 0x2d, 0 }, /* - */ - { 0x37, 0 }, /* . */ - { 0x38, 0 }, /* / */ - { 0x27, 0 }, /* 0 */ - { 0x1e, 0 }, /* 1 */ - { 0x1f, 0 }, /* 2 */ - { 0x20, 0 }, /* 3 */ - { 0x21, 0 }, /* 4 */ - { 0x22, 0 }, /* 5 */ - { 0x23, 0 }, /* 6 */ - { 0x24, 0 }, /* 7 */ - { 0x25, 0 }, /* 8 */ - { 0x26, 0 }, /* 9 */ - { 0x33, KEY_SHIFT }, /* : */ - { 0x33, 0 }, /* ; */ - { 0x36, KEY_SHIFT }, /* < */ - { 0x2e, 0 }, /* = */ - { 0x37, KEY_SHIFT }, /* > */ - { 0x38, KEY_SHIFT }, /* ? */ - { 0x34, KEY_SHIFT }, /* @ */ - { 0x04, KEY_SHIFT }, /* A */ - { 0x05, KEY_SHIFT }, /* B */ - { 0x06, KEY_SHIFT }, /* C */ - { 0x07, KEY_SHIFT }, /* D */ - { 0x08, KEY_SHIFT }, /* E */ - { 0x09, KEY_SHIFT }, /* F */ - { 0x0a, KEY_SHIFT }, /* G */ - { 0x0b, KEY_SHIFT }, /* H */ - { 0x0c, KEY_SHIFT }, /* I */ - { 0x0d, KEY_SHIFT }, /* J */ - { 0x0e, KEY_SHIFT }, /* K */ - { 0x0f, KEY_SHIFT }, /* L */ - { 0x10, KEY_SHIFT }, /* M */ - { 0x11, KEY_SHIFT }, /* N */ - { 0x12, KEY_SHIFT }, /* O */ - { 0x13, KEY_SHIFT }, /* P */ - { 0x14, KEY_SHIFT }, /* Q */ - { 0x15, KEY_SHIFT }, /* R */ - { 0x16, KEY_SHIFT }, /* S */ - { 0x17, KEY_SHIFT }, /* T */ - { 0x18, KEY_SHIFT }, /* U */ - { 0x19, KEY_SHIFT }, /* V */ - { 0x1a, KEY_SHIFT }, /* W */ - { 0x1b, KEY_SHIFT }, /* X */ - { 0x1c, KEY_SHIFT }, /* Y */ - { 0x1d, KEY_SHIFT }, /* Z */ - { 0x2f, 0 }, /* [ */ - { 0x64, 0 }, /* \ */ - { 0x30, 0 }, /* ] */ - { 0x23, KEY_SHIFT }, /* ^ */ - { 0x2d, KEY_SHIFT }, /* _ */ - { 0x35, 0 }, /* ` */ - { 0x04, 0 }, /* a */ - { 0x05, 0 }, /* b */ - { 0x06, 0 }, /* c */ - { 0x07, 0 }, /* d */ - { 0x08, 0 }, /* e */ - { 0x09, 0 }, /* f */ - { 0x0a, 0 }, /* g */ - { 0x0b, 0 }, /* h */ - { 0x0c, 0 }, /* i */ - { 0x0d, 0 }, /* j */ - { 0x0e, 0 }, /* k */ - { 0x0f, 0 }, /* l */ - { 0x10, 0 }, /* m */ - { 0x11, 0 }, /* n */ - { 0x12, 0 }, /* o */ - { 0x13, 0 }, /* p */ - { 0x14, 0 }, /* q */ - { 0x15, 0 }, /* r */ - { 0x16, 0 }, /* s */ - { 0x17, 0 }, /* t */ - { 0x18, 0 }, /* u */ - { 0x19, 0 }, /* v */ - { 0x1a, 0 }, /* w */ - { 0x1b, 0 }, /* x */ - { 0x1c, 0 }, /* y */ - { 0x1d, 0 }, /* z */ - { 0x2f, KEY_SHIFT }, /* { */ - { 0x64, KEY_SHIFT }, /* | */ - { 0x30, KEY_SHIFT }, /* } */ - { 0x32, KEY_SHIFT }, /* ~ */ - { 0, 0 }, /* DEL */ + {0x28, 0}, + /* LF */ /* Keyboard Return (Enter) */ + {0, 0}, /* VT */ + {0, 0}, /* FF */ + {0, 0}, /* CR */ + {0, 0}, /* SO */ + {0, 0}, /* SI */ + {0, 0}, /* DEL */ + {0, 0}, /* DC1 */ + {0, 0}, /* DC2 */ + {0, 0}, /* DC3 */ + {0, 0}, /* DC4 */ + {0, 0}, /* NAK */ + {0, 0}, /* SYN */ + {0, 0}, /* ETB */ + {0, 0}, /* CAN */ + {0, 0}, /* EM */ + {0, 0}, /* SUB */ + {0, 0}, /* ESC */ + {0, 0}, /* FS */ + {0, 0}, /* GS */ + {0, 0}, /* RS */ + {0, 0}, /* US */ + {0x2c, 0}, /* */ + {0x1e, KEY_SHIFT}, /* ! */ + {0x1f, KEY_SHIFT}, /* " */ + {0x32, 0}, /* # */ + {0x21, KEY_SHIFT}, /* $ */ + {0x22, KEY_SHIFT}, /* % */ + {0x24, KEY_SHIFT}, /* & */ + {0x34, 0}, /* ' */ + {0x26, KEY_SHIFT}, /* ( */ + {0x27, KEY_SHIFT}, /* ) */ + {0x25, KEY_SHIFT}, /* * */ + {0x2e, KEY_SHIFT}, /* + */ + {0x36, 0}, /* , */ + {0x2d, 0}, /* - */ + {0x37, 0}, /* . */ + {0x38, 0}, /* / */ + {0x27, 0}, /* 0 */ + {0x1e, 0}, /* 1 */ + {0x1f, 0}, /* 2 */ + {0x20, 0}, /* 3 */ + {0x21, 0}, /* 4 */ + {0x22, 0}, /* 5 */ + {0x23, 0}, /* 6 */ + {0x24, 0}, /* 7 */ + {0x25, 0}, /* 8 */ + {0x26, 0}, /* 9 */ + {0x33, KEY_SHIFT}, /* : */ + {0x33, 0}, /* ; */ + {0x36, KEY_SHIFT}, /* < */ + {0x2e, 0}, /* = */ + {0x37, KEY_SHIFT}, /* > */ + {0x38, KEY_SHIFT}, /* ? */ + {0x34, KEY_SHIFT}, /* @ */ + {0x04, KEY_SHIFT}, /* A */ + {0x05, KEY_SHIFT}, /* B */ + {0x06, KEY_SHIFT}, /* C */ + {0x07, KEY_SHIFT}, /* D */ + {0x08, KEY_SHIFT}, /* E */ + {0x09, KEY_SHIFT}, /* F */ + {0x0a, KEY_SHIFT}, /* G */ + {0x0b, KEY_SHIFT}, /* H */ + {0x0c, KEY_SHIFT}, /* I */ + {0x0d, KEY_SHIFT}, /* J */ + {0x0e, KEY_SHIFT}, /* K */ + {0x0f, KEY_SHIFT}, /* L */ + {0x10, KEY_SHIFT}, /* M */ + {0x11, KEY_SHIFT}, /* N */ + {0x12, KEY_SHIFT}, /* O */ + {0x13, KEY_SHIFT}, /* P */ + {0x14, KEY_SHIFT}, /* Q */ + {0x15, KEY_SHIFT}, /* R */ + {0x16, KEY_SHIFT}, /* S */ + {0x17, KEY_SHIFT}, /* T */ + {0x18, KEY_SHIFT}, /* U */ + {0x19, KEY_SHIFT}, /* V */ + {0x1a, KEY_SHIFT}, /* W */ + {0x1b, KEY_SHIFT}, /* X */ + {0x1c, KEY_SHIFT}, /* Y */ + {0x1d, KEY_SHIFT}, /* Z */ + {0x2f, 0}, /* [ */ + {0x64, 0}, /* \ */ + {0x30, 0}, /* ] */ + {0x23, KEY_SHIFT}, /* ^ */ + {0x2d, KEY_SHIFT}, /* _ */ + {0x35, 0}, /* ` */ + {0x04, 0}, /* a */ + {0x05, 0}, /* b */ + {0x06, 0}, /* c */ + {0x07, 0}, /* d */ + {0x08, 0}, /* e */ + {0x09, 0}, /* f */ + {0x0a, 0}, /* g */ + {0x0b, 0}, /* h */ + {0x0c, 0}, /* i */ + {0x0d, 0}, /* j */ + {0x0e, 0}, /* k */ + {0x0f, 0}, /* l */ + {0x10, 0}, /* m */ + {0x11, 0}, /* n */ + {0x12, 0}, /* o */ + {0x13, 0}, /* p */ + {0x14, 0}, /* q */ + {0x15, 0}, /* r */ + {0x16, 0}, /* s */ + {0x17, 0}, /* t */ + {0x18, 0}, /* u */ + {0x19, 0}, /* v */ + {0x1a, 0}, /* w */ + {0x1b, 0}, /* x */ + {0x1c, 0}, /* y */ + {0x1d, 0}, /* z */ + {0x2f, KEY_SHIFT}, /* { */ + {0x64, KEY_SHIFT}, /* | */ + {0x30, KEY_SHIFT}, /* } */ + {0x32, KEY_SHIFT}, /* ~ */ + {0, 0}, /* DEL */ - { 0x3a, 0 }, /* F1 */ - { 0x3b, 0 }, /* F2 */ - { 0x3c, 0 }, /* F3 */ - { 0x3d, 0 }, /* F4 */ - { 0x3e, 0 }, /* F5 */ - { 0x3f, 0 }, /* F6 */ - { 0x40, 0 }, /* F7 */ - { 0x41, 0 }, /* F8 */ - { 0x42, 0 }, /* F9 */ - { 0x43, 0 }, /* F10 */ - { 0x44, 0 }, /* F11 */ - { 0x45, 0 }, /* F12 */ + {0x3a, 0}, /* F1 */ + {0x3b, 0}, /* F2 */ + {0x3c, 0}, /* F3 */ + {0x3d, 0}, /* F4 */ + {0x3e, 0}, /* F5 */ + {0x3f, 0}, /* F6 */ + {0x40, 0}, /* F7 */ + {0x41, 0}, /* F8 */ + {0x42, 0}, /* F9 */ + {0x43, 0}, /* F10 */ + {0x44, 0}, /* F11 */ + {0x45, 0}, /* F12 */ - { 0x46, 0 }, /* PRINT_SCREEN */ - { 0x47, 0 }, /* SCROLL_LOCK */ - { 0x39, 0 }, /* CAPS_LOCK */ - { 0x53, 0 }, /* NUM_LOCK */ - { 0x49, 0 }, /* INSERT */ - { 0x4a, 0 }, /* HOME */ - { 0x4b, 0 }, /* PAGE_UP */ - { 0x4e, 0 }, /* PAGE_DOWN */ + {0x46, 0}, /* PRINT_SCREEN */ + {0x47, 0}, /* SCROLL_LOCK */ + {0x39, 0}, /* CAPS_LOCK */ + {0x53, 0}, /* NUM_LOCK */ + {0x49, 0}, /* INSERT */ + {0x4a, 0}, /* HOME */ + {0x4b, 0}, /* PAGE_UP */ + {0x4e, 0}, /* PAGE_DOWN */ - { 0x4f, 0 }, /* RIGHT_ARROW */ - { 0x50, 0 }, /* LEFT_ARROW */ - { 0x51, 0 }, /* DOWN_ARROW */ - { 0x52, 0 }, /* UP_ARROW */ + {0x4f, 0}, /* RIGHT_ARROW */ + {0x50, 0}, /* LEFT_ARROW */ + {0x51, 0}, /* DOWN_ARROW */ + {0x52, 0}, /* UP_ARROW */ }; #endif diff --git a/libraries/BLE/src/HIDTypes.h b/libraries/BLE/src/HIDTypes.h index d57f9c28f..2dbdadc06 100644 --- a/libraries/BLE/src/HIDTypes.h +++ b/libraries/BLE/src/HIDTypes.h @@ -25,20 +25,20 @@ #define HID_VERSION_1_11 (0x0111) /* HID Class */ -#define BLE_HID_CLASS (3) +#define BLE_HID_CLASS (3) #define BLE_HID_SUBCLASS_NONE (0) #define BLE_HID_PROTOCOL_NONE (0) /* Descriptors */ -#define HID_DESCRIPTOR (33) +#define HID_DESCRIPTOR (33) #define HID_DESCRIPTOR_LENGTH (0x09) -#define REPORT_DESCRIPTOR (34) +#define REPORT_DESCRIPTOR (34) /* Class requests */ #define GET_REPORT (0x1) -#define GET_IDLE (0x2) +#define GET_IDLE (0x2) #define SET_REPORT (0x9) -#define SET_IDLE (0xa) +#define SET_IDLE (0xa) /* HID Class Report Descriptor */ /* Short items: size is 0, 1, 2 or 3 specifying 0, 1, 2 or 4 (four) bytes */ @@ -46,41 +46,41 @@ /* Main items */ #ifdef ARDUINO_ARCH_ESP32 -#define HIDINPUT(size) (0x80 | size) +#define HIDINPUT(size) (0x80 | size) #define HIDOUTPUT(size) (0x90 | size) #else -#define INPUT(size) (0x80 | size) +#define INPUT(size) (0x80 | size) #define OUTPUT(size) (0x90 | size) #endif -#define FEATURE(size) (0xb0 | size) -#define COLLECTION(size) (0xa0 | size) +#define FEATURE(size) (0xb0 | size) +#define COLLECTION(size) (0xa0 | size) #define END_COLLECTION(size) (0xc0 | size) /* Global items */ -#define USAGE_PAGE(size) (0x04 | size) -#define LOGICAL_MINIMUM(size) (0x14 | size) -#define LOGICAL_MAXIMUM(size) (0x24 | size) +#define USAGE_PAGE(size) (0x04 | size) +#define LOGICAL_MINIMUM(size) (0x14 | size) +#define LOGICAL_MAXIMUM(size) (0x24 | size) #define PHYSICAL_MINIMUM(size) (0x34 | size) #define PHYSICAL_MAXIMUM(size) (0x44 | size) -#define UNIT_EXPONENT(size) (0x54 | size) -#define UNIT(size) (0x64 | size) -#define REPORT_SIZE(size) (0x74 | size) //bits -#define REPORT_ID(size) (0x84 | size) -#define REPORT_COUNT(size) (0x94 | size) //bytes -#define PUSH(size) (0xa4 | size) -#define POP(size) (0xb4 | size) +#define UNIT_EXPONENT(size) (0x54 | size) +#define UNIT(size) (0x64 | size) +#define REPORT_SIZE(size) (0x74 | size) //bits +#define REPORT_ID(size) (0x84 | size) +#define REPORT_COUNT(size) (0x94 | size) //bytes +#define PUSH(size) (0xa4 | size) +#define POP(size) (0xb4 | size) /* Local items */ -#define USAGE(size) (0x08 | size) -#define USAGE_MINIMUM(size) (0x18 | size) -#define USAGE_MAXIMUM(size) (0x28 | size) -#define DESIGNATOR_INDEX(size) (0x38 | size) +#define USAGE(size) (0x08 | size) +#define USAGE_MINIMUM(size) (0x18 | size) +#define USAGE_MAXIMUM(size) (0x28 | size) +#define DESIGNATOR_INDEX(size) (0x38 | size) #define DESIGNATOR_MINIMUM(size) (0x48 | size) #define DESIGNATOR_MAXIMUM(size) (0x58 | size) -#define STRING_INDEX(size) (0x78 | size) -#define STRING_MINIMUM(size) (0x88 | size) -#define STRING_MAXIMUM(size) (0x98 | size) -#define DELIMITER(size) (0xa8 | size) +#define STRING_INDEX(size) (0x78 | size) +#define STRING_MINIMUM(size) (0x88 | size) +#define STRING_MAXIMUM(size) (0x98 | size) +#define DELIMITER(size) (0xa8 | size) /* HID Report */ /* Where report IDs are used the first byte of 'data' will be the */ diff --git a/libraries/BLE/src/RTOS.h b/libraries/BLE/src/RTOS.h index 74a81205b..0f798c5e9 100644 --- a/libraries/BLE/src/RTOS.h +++ b/libraries/BLE/src/RTOS.h @@ -17,14 +17,13 @@ #include // Include the semaphore definitions. #include // Include the ringbuffer definitions. - /** * @brief Interface to %FreeRTOS functions. */ class FreeRTOS { public: static void sleep(uint32_t ms); - static void startTask(void task(void*), String taskName, void* param = nullptr, uint32_t stackSize = 2048); + static void startTask(void task(void *), String taskName, void *param = nullptr, uint32_t stackSize = 2048); static void deleteTask(TaskHandle_t pTask = nullptr); static uint32_t getTimeSinceStart(); @@ -56,7 +55,6 @@ public: }; }; - /** * @brief Ringbuffer. */ @@ -69,9 +67,10 @@ public: #endif ~Ringbuffer(); - void* receive(size_t* size, TickType_t wait = portMAX_DELAY); - void returnItem(void* item); - bool send(void* data, size_t length, TickType_t wait = portMAX_DELAY); + void *receive(size_t *size, TickType_t wait = portMAX_DELAY); + void returnItem(void *item); + bool send(void *data, size_t length, TickType_t wait = portMAX_DELAY); + private: RingbufHandle_t m_handle; }; diff --git a/libraries/BluetoothSerial/examples/DiscoverConnect/DiscoverConnect.ino b/libraries/BluetoothSerial/examples/DiscoverConnect/DiscoverConnect.ino index e6d9850c3..e9ec101b9 100644 --- a/libraries/BluetoothSerial/examples/DiscoverConnect/DiscoverConnect.ino +++ b/libraries/BluetoothSerial/examples/DiscoverConnect/DiscoverConnect.ino @@ -43,10 +43,9 @@ void setup() { // SerialBT.setPin("1234"); // doesn't seem to change anything // SerialBT.enableSSP(); // doesn't seem to change anything - Serial.println("Starting discoverAsync..."); - BTScanResults* btDeviceList = SerialBT.getScanResults(); // maybe accessing from different threads! - if (SerialBT.discoverAsync([](BTAdvertisedDevice* pDevice) { + BTScanResults *btDeviceList = SerialBT.getScanResults(); // maybe accessing from different threads! + if (SerialBT.discoverAsync([](BTAdvertisedDevice *pDevice) { // BTAdvertisedDeviceSet*set = reinterpret_cast(pDevice); // btDeviceList[pDevice->getAddress()] = * set; Serial.printf(">>>>>>>>>>>Found a new device asynchronously: %s\n", pDevice->toString().c_str()); @@ -61,11 +60,11 @@ void setup() { int channel = 0; Serial.println("Found devices:"); for (int i = 0; i < btDeviceList->getCount(); i++) { - BTAdvertisedDevice* device = btDeviceList->getDevice(i); + BTAdvertisedDevice *device = btDeviceList->getDevice(i); Serial.printf(" ----- %s %s %d\n", device->getAddress().toString().c_str(), device->getName().c_str(), device->getRSSI()); std::map channels = SerialBT.getChannels(device->getAddress()); Serial.printf("scanned for services, found %d\n", channels.size()); - for (auto const& entry : channels) { + for (auto const &entry : channels) { Serial.printf(" channel %d (%s)\n", entry.first, entry.second.c_str()); } if (channels.size() > 0) { @@ -85,12 +84,11 @@ void setup() { } } - String sendData = "Hi from esp32!\n"; void loop() { if (!SerialBT.isClosed() && SerialBT.connected()) { - if (SerialBT.write((const uint8_t*)sendData.c_str(), sendData.length()) != sendData.length()) { + if (SerialBT.write((const uint8_t *)sendData.c_str(), sendData.length()) != sendData.length()) { Serial.println("tx: error"); } else { Serial.printf("tx: %s", sendData.c_str()); diff --git a/libraries/BluetoothSerial/examples/GetLocalMAC/GetLocalMAC.ino b/libraries/BluetoothSerial/examples/GetLocalMAC/GetLocalMAC.ino index cc55a4af5..32e782bef 100644 --- a/libraries/BluetoothSerial/examples/GetLocalMAC/GetLocalMAC.ino +++ b/libraries/BluetoothSerial/examples/GetLocalMAC/GetLocalMAC.ino @@ -46,5 +46,4 @@ void setup() { Serial.println(mac_str.c_str()); } -void loop() { -} +void loop() {} diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino b/libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino index fb3ce1ab3..64774d417 100644 --- a/libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino +++ b/libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino @@ -33,8 +33,8 @@ BluetoothSerial SerialBT; #ifdef USE_NAME String slaveName = "ESP32-BT-Slave"; // Change this to reflect the real name of your slave BT device #else -String MACadd = "AA:BB:CC:11:22:33"; // This only for printing -uint8_t address[6] = { 0xAA, 0xBB, 0xCC, 0x11, 0x22, 0x33 }; // Change this to reflect real MAC address of your slave BT device +String MACadd = "AA:BB:CC:11:22:33"; // This only for printing +uint8_t address[6] = {0xAA, 0xBB, 0xCC, 0x11, 0x22, 0x33}; // Change this to reflect real MAC address of your slave BT device #endif String myName = "ESP32-BT-Master"; diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBT_Legacy/SerialToSerialBT_Legacy.ino b/libraries/BluetoothSerial/examples/SerialToSerialBT_Legacy/SerialToSerialBT_Legacy.ino index 5f55ad85a..343bd79c7 100644 --- a/libraries/BluetoothSerial/examples/SerialToSerialBT_Legacy/SerialToSerialBT_Legacy.ino +++ b/libraries/BluetoothSerial/examples/SerialToSerialBT_Legacy/SerialToSerialBT_Legacy.ino @@ -23,7 +23,7 @@ void setup() {} void loop() {} #else -const char* deviceName = "ESP32_Legacy_example"; +const char *deviceName = "ESP32_Legacy_example"; BluetoothSerial SerialBT; bool confirmRequestDone = false; diff --git a/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP/SerialToSerialBT_SSP.ino b/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP/SerialToSerialBT_SSP.ino index 4855a6b01..eb0c05e00 100644 --- a/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP/SerialToSerialBT_SSP.ino +++ b/libraries/BluetoothSerial/examples/SerialToSerialBT_SSP/SerialToSerialBT_SSP.ino @@ -27,7 +27,7 @@ #error Simple Secure Pairing for Bluetooth is not available or not enabled. #endif -const char* deviceName = "ESP32_SSP_example"; +const char *deviceName = "ESP32_SSP_example"; // The following lines defines the method of pairing // When both Input and Output are false only the other device authenticates pairing without any pin. @@ -46,7 +46,9 @@ bool confirmRequestDone = false; void BTConfirmRequestCallback(uint32_t numVal) { confirmRequestDone = false; #ifndef AUTO_PAIR - Serial.printf("The PIN is: %06lu. If it matches number displayed on the other device write \'Y\' or \'y\':\n", numVal); // Note the formatting "%06lu" - PIN can start with zero(s) which would be ignored with simple "%lu" + Serial.printf( + "The PIN is: %06lu. If it matches number displayed on the other device write \'Y\' or \'y\':\n", numVal + ); // Note the formatting "%06lu" - PIN can start with zero(s) which would be ignored with simple "%lu" while (!Serial.available()) { delay(1); // Feed the watchdog // Wait until data is available on the Serial port. @@ -65,7 +67,7 @@ void BTConfirmRequestCallback(uint32_t numVal) { void BTKeyRequestCallback() { Serial.println("BTKeyRequestCallback"); // debug - char buffer[7] = { 0 }; // 6 bytes for number, one for termination '0' + char buffer[7] = {0}; // 6 bytes for number, one for termination '0' while (1) { Serial.print("Enter the passkey displayed on the other device: "); while (!Serial.available()) { @@ -82,7 +84,7 @@ void BTKeyRequestCallback() { } catch (...) { Serial.print("Wrong PIN! Try again."); } // try - } // while(1) + } // while(1) } void BTAuthCompleteCallback(boolean success) { @@ -120,7 +122,8 @@ void setup() { } else if (not INPUT_CAPABILITY and OUTPUT_CAPABILITY) { Serial.println("Authenticate pairing on the other device. No PIN is used"); } else if (INPUT_CAPABILITY and not OUTPUT_CAPABILITY) { - Serial.println("After pairing is initiated you will be required to enter the passkey to the ESP32 device to authenticate\n > The Passkey will displayed on the other device"); + Serial.println("After pairing is initiated you will be required to enter the passkey to the ESP32 device to authenticate\n > The Passkey will displayed on " + "the other device"); } } diff --git a/libraries/BluetoothSerial/examples/bt_classic_device_discovery/bt_classic_device_discovery.ino b/libraries/BluetoothSerial/examples/bt_classic_device_discovery/bt_classic_device_discovery.ino index 453fafb15..226cbd8da 100644 --- a/libraries/BluetoothSerial/examples/bt_classic_device_discovery/bt_classic_device_discovery.ino +++ b/libraries/BluetoothSerial/examples/bt_classic_device_discovery/bt_classic_device_discovery.ino @@ -10,15 +10,12 @@ BluetoothSerial SerialBT; - #define BT_DISCOVER_TIME 10000 - static bool btScanAsync = true; static bool btScanSync = true; - -void btAdvertisedDeviceFound(BTAdvertisedDevice* pDevice) { +void btAdvertisedDeviceFound(BTAdvertisedDevice *pDevice) { Serial.printf("Found a device asynchronously: %s\n", pDevice->toString().c_str()); } @@ -27,7 +24,6 @@ void setup() { SerialBT.begin("ESP32test"); //Bluetooth device name Serial.println("The device started, now you can pair it with bluetooth!"); - if (btScanAsync) { Serial.print("Starting asynchronous discovery... "); if (SerialBT.discoverAsync(btAdvertisedDeviceFound)) { @@ -43,11 +39,12 @@ void setup() { if (btScanSync) { Serial.println("Starting synchronous discovery... "); - BTScanResults* pResults = SerialBT.discover(BT_DISCOVER_TIME); - if (pResults) + BTScanResults *pResults = SerialBT.discover(BT_DISCOVER_TIME); + if (pResults) { pResults->dump(&Serial); - else + } else { Serial.println("Error on BT Scan, no result!"); + } } } diff --git a/libraries/BluetoothSerial/examples/bt_remove_paired_devices/bt_remove_paired_devices.ino b/libraries/BluetoothSerial/examples/bt_remove_paired_devices/bt_remove_paired_devices.ino index d8124fe1c..6f301bd28 100644 --- a/libraries/BluetoothSerial/examples/bt_remove_paired_devices/bt_remove_paired_devices.ino +++ b/libraries/BluetoothSerial/examples/bt_remove_paired_devices/bt_remove_paired_devices.ino @@ -19,15 +19,14 @@ #endif #define REMOVE_BONDED_DEVICES true // <- Set to `false` to view all bonded devices addresses, set to `true` to remove -#define PAIR_MAX_DEVICES 20 +#define PAIR_MAX_DEVICES 20 BluetoothSerial SerialBT; char *bda2str(const uint8_t *bda, char *str, size_t size) { if (bda == NULL || str == NULL || size < 18) { return NULL; } - sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x", - bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]); + sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x", bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]); return str; } @@ -65,10 +64,10 @@ void setup() { } else { Serial.printf("Failed to remove bonded device # %d", i); } // if(ESP_OK == tError) - } // if(REMOVE_BONDED_DEVICES) - } // for(int i = 0; i < count; i++) - } // if(ESP_OK == tError) - } // if(!count) + } // if(REMOVE_BONDED_DEVICES) + } // for(int i = 0; i < count; i++) + } // if(ESP_OK == tError) + } // if(!count) } void loop() {} diff --git a/libraries/BluetoothSerial/src/BTAddress.cpp b/libraries/BluetoothSerial/src/BTAddress.cpp index 8a469ea7d..6a6de6522 100644 --- a/libraries/BluetoothSerial/src/BTAddress.cpp +++ b/libraries/BluetoothSerial/src/BTAddress.cpp @@ -20,7 +20,6 @@ #include "esp32-hal-log.h" #endif - /** * @brief Create an address from the native ESP32 representation. * @param [in] address The native representation. @@ -45,7 +44,9 @@ BTAddress::BTAddress() { * @param [in] stringAddress The hex representation of the address. */ BTAddress::BTAddress(String stringAddress) { - if (stringAddress.length() != 17) return; + if (stringAddress.length() != 17) { + return; + } int data[6]; sscanf(stringAddress.c_str(), "%x:%x:%x:%x:%x:%x", &data[0], &data[1], &data[2], &data[3], &data[4], &data[5]); @@ -57,7 +58,6 @@ BTAddress::BTAddress(String stringAddress) { m_address[5] = (uint8_t)data[5]; } // BTAddress - /** * @brief Determine if this address equals another. * @param [in] otherAddress The other address to compare against. @@ -69,8 +69,9 @@ bool BTAddress::equals(BTAddress otherAddress) { BTAddress::operator bool() const { for (int i = 0; i < ESP_BD_ADDR_LEN; i++) { - if (this->m_address[i]) + if (this->m_address[i]) { return true; + } } return false; } // operator () @@ -83,7 +84,6 @@ esp_bd_addr_t *BTAddress::getNative() const { return const_cast(&m_address); } // getNative - /** * @brief Convert a BT address to a string. * @param [in] capital changes the letter size diff --git a/libraries/BluetoothSerial/src/BTAddress.h b/libraries/BluetoothSerial/src/BTAddress.h index 2b5fce8d6..a2af9247f 100644 --- a/libraries/BluetoothSerial/src/BTAddress.h +++ b/libraries/BluetoothSerial/src/BTAddress.h @@ -14,7 +14,6 @@ #include // ESP32 BT #include - /** * @brief A %BT device address. * @@ -28,7 +27,7 @@ public: bool equals(BTAddress otherAddress); operator bool() const; - esp_bd_addr_t* getNative() const; + esp_bd_addr_t *getNative() const; String toString(bool capital = false) const; private: diff --git a/libraries/BluetoothSerial/src/BTAdvertisedDevice.h b/libraries/BluetoothSerial/src/BTAdvertisedDevice.h index 5e223f655..63c19c908 100644 --- a/libraries/BluetoothSerial/src/BTAdvertisedDevice.h +++ b/libraries/BluetoothSerial/src/BTAdvertisedDevice.h @@ -20,7 +20,6 @@ public: virtual std::string getName() const = 0; virtual int8_t getRSSI() const = 0; - virtual bool haveCOD() const = 0; virtual bool haveName() const = 0; virtual bool haveRSSI() const = 0; @@ -33,13 +32,11 @@ public: BTAdvertisedDeviceSet(); //~BTAdvertisedDeviceSet() = default; - BTAddress getAddress(); uint32_t getCOD() const; std::string getName() const; int8_t getRSSI() const; - bool haveCOD() const; bool haveName() const; bool haveRSSI() const; @@ -55,8 +52,7 @@ public: bool m_haveName; bool m_haveRSSI; - - BTAddress m_address = BTAddress((uint8_t*)"\0\0\0\0\0\0"); + BTAddress m_address = BTAddress((uint8_t *)"\0\0\0\0\0\0"); uint32_t m_cod; std::string m_name; int8_t m_rssi; diff --git a/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp b/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp index f780727a9..ed6076a31 100644 --- a/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp +++ b/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp @@ -13,7 +13,6 @@ #include "BTAdvertisedDevice.h" //#include "BTScan.h" - BTAdvertisedDeviceSet::BTAdvertisedDeviceSet() { m_cod = 0; m_name = ""; @@ -37,7 +36,6 @@ int8_t BTAdvertisedDeviceSet::getRSSI() const { return m_rssi; } - bool BTAdvertisedDeviceSet::haveCOD() const { return m_haveCOD; } @@ -69,7 +67,6 @@ std::string BTAdvertisedDeviceSet::toString() { return res; } // toString - void BTAdvertisedDeviceSet::setAddress(BTAddress address) { m_address = address; } diff --git a/libraries/BluetoothSerial/src/BTScan.h b/libraries/BluetoothSerial/src/BTScan.h index f03e3d35c..a08f68cd7 100644 --- a/libraries/BluetoothSerial/src/BTScan.h +++ b/libraries/BluetoothSerial/src/BTScan.h @@ -17,21 +17,20 @@ class BTAdvertisedDevice; class BTAdvertisedDeviceSet; - class BTScanResults { public: virtual ~BTScanResults() = default; - virtual void dump(Print* print = nullptr) = 0; + virtual void dump(Print *print = nullptr) = 0; virtual int getCount() = 0; - virtual BTAdvertisedDevice* getDevice(int i) = 0; + virtual BTAdvertisedDevice *getDevice(int i) = 0; }; class BTScanResultsSet : public BTScanResults { public: - void dump(Print* print = nullptr); + void dump(Print *print = nullptr); int getCount(); - BTAdvertisedDevice* getDevice(int i); + BTAdvertisedDevice *getDevice(int i); bool add(BTAdvertisedDeviceSet advertisedDevice, bool unique = true); void clear(); diff --git a/libraries/BluetoothSerial/src/BTScanResultsSet.cpp b/libraries/BluetoothSerial/src/BTScanResultsSet.cpp index 65f07936c..3633c010e 100644 --- a/libraries/BluetoothSerial/src/BTScanResultsSet.cpp +++ b/libraries/BluetoothSerial/src/BTScanResultsSet.cpp @@ -8,7 +8,6 @@ #include "sdkconfig.h" #if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) - #include #include "BTAdvertisedDevice.h" @@ -16,38 +15,38 @@ //#include "GeneralUtils.h" #include "esp32-hal-log.h" - class BTAdvertisedDevice; /** * @brief Dump the scan results to the log. */ -void BTScanResultsSet::dump(Print* print) { +void BTScanResultsSet::dump(Print *print) { int cnt = getCount(); if (print == nullptr) { log_v(">> Dump scan results : %d", cnt); for (int i = 0; i < cnt; i++) { - BTAdvertisedDevice* dev = getDevice(i); - if (dev) + BTAdvertisedDevice *dev = getDevice(i); + if (dev) { log_d("- %d: %s\n", i + 1, dev->toString().c_str()); - else + } else { log_d("- %d is null\n", i + 1); + } } log_v("-- dump finished --"); } else { print->printf(">> Dump scan results: %d\n", cnt); for (int i = 0; i < cnt; i++) { - BTAdvertisedDevice* dev = getDevice(i); - if (dev) + BTAdvertisedDevice *dev = getDevice(i); + if (dev) { print->printf("- %d: %s\n", i + 1, dev->toString().c_str()); - else + } else { print->printf("- %d is null\n", i + 1); + } } print->println("-- Dump finished --"); } } // dump - /** * @brief Return the count of devices found in the last scan. * @return The number of devices found in the last scan. @@ -56,22 +55,24 @@ int BTScanResultsSet::getCount() { return m_vectorAdvertisedDevices.size(); } // getCount - /** * @brief Return the specified device at the given index. * The index should be between 0 and getCount()-1. * @param [in] i The index of the device. * @return The device at the specified index. */ -BTAdvertisedDevice* BTScanResultsSet::getDevice(int i) { - if (i < 0) +BTAdvertisedDevice *BTScanResultsSet::getDevice(int i) { + if (i < 0) { return nullptr; + } int x = 0; - BTAdvertisedDeviceSet* pDev = &m_vectorAdvertisedDevices.begin()->second; + BTAdvertisedDeviceSet *pDev = &m_vectorAdvertisedDevices.begin()->second; for (auto it = m_vectorAdvertisedDevices.begin(); it != m_vectorAdvertisedDevices.end(); it++) { pDev = &it->second; - if (x == i) break; + if (x == i) { + break; + } x++; } return x == i ? pDev : nullptr; @@ -88,8 +89,9 @@ bool BTScanResultsSet::add(BTAdvertisedDeviceSet advertisedDevice, bool unique) if (!unique || m_vectorAdvertisedDevices.count(key) == 0) { m_vectorAdvertisedDevices.insert(std::pair(key, advertisedDevice)); return true; - } else + } else { return false; + } } #endif diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.cpp b/libraries/BluetoothSerial/src/BluetoothSerial.cpp index dbe4d6c13..9eaf7bda8 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.cpp +++ b/libraries/BluetoothSerial/src/BluetoothSerial.cpp @@ -20,7 +20,6 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" - #if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #ifdef ARDUINO_ARCH_ESP32 @@ -41,10 +40,10 @@ const char *_spp_server_name = "ESP32SPP"; -#define RX_QUEUE_SIZE 512 -#define TX_QUEUE_SIZE 32 -#define SPP_TX_QUEUE_TIMEOUT 1000 -#define SPP_TX_DONE_TIMEOUT 1000 +#define RX_QUEUE_SIZE 512 +#define TX_QUEUE_SIZE 32 +#define SPP_TX_QUEUE_TIMEOUT 1000 +#define SPP_TX_DONE_TIMEOUT 1000 #define SPP_CONGESTED_TIMEOUT 1000 static uint32_t _spp_client = 0; @@ -62,12 +61,12 @@ static ConfirmRequestCb confirm_request_callback = NULL; static KeyRequestCb key_request_callback = NULL; static AuthCompleteCb auth_complete_callback = NULL; static bool _rmt_name_valid = false; -static uint8_t _rmt_name[ESP_BT_GAP_MAX_BDNAME_LEN + 1] = { 0 }; +static uint8_t _rmt_name[ESP_BT_GAP_MAX_BDNAME_LEN + 1] = {0}; -#define INQ_LEN 0x10 -#define INQ_NUM_RSPS 20 +#define INQ_LEN 0x10 +#define INQ_NUM_RSPS 20 #define READY_TIMEOUT (10 * 1000) -#define SCAN_TIMEOUT (INQ_LEN * 2 * 1000) +#define SCAN_TIMEOUT (INQ_LEN * 2 * 1000) static esp_bd_addr_t _peer_bd_addr; static char _remote_name[ESP_BT_GAP_MAX_BDNAME_LEN + 1]; static bool _isRemoteAddressSet; @@ -77,7 +76,7 @@ static bool _enableSSP; static bool _IO_CAP_INPUT; static bool _IO_CAP_OUTPUT; #endif -esp_bt_pin_code_t _pin_code = { 0 }; +esp_bt_pin_code_t _pin_code = {0}; uint8_t _pin_code_len = 0; // Number of valid Bytes in the esp_bt_pin_code_t array static esp_spp_sec_t _sec_mask; static esp_spp_role_t _role; @@ -89,7 +88,7 @@ static BTScanResultsSet scanResults; static BTAdvertisedDeviceCb advertisedDeviceCb = nullptr; // _spp_event_group -#define SPP_RUNNING 0x01 +#define SPP_RUNNING 0x01 #define SPP_CONNECTED 0x02 #define SPP_CONGESTED 0x04 // true until OPEN successful, changes to false on CLOSE @@ -98,10 +97,10 @@ static BTAdvertisedDeviceCb advertisedDeviceCb = nullptr; #define SPP_CLOSED 0x10 // _bt_event_group -#define BT_DISCOVERY_RUNNING 0x01 +#define BT_DISCOVERY_RUNNING 0x01 #define BT_DISCOVERY_COMPLETED 0x02 -#define BT_SDP_RUNNING 0x04 +#define BT_SDP_RUNNING 0x04 #define BT_SDP_COMPLETED 0x08 typedef struct { @@ -116,8 +115,7 @@ static char *bda2str(esp_bd_addr_t bda, char *str, size_t size) { } uint8_t *p = bda; - snprintf(str, size, "%02x:%02x:%02x:%02x:%02x:%02x", - p[0], p[1], p[2], p[3], p[4], p[5]); + snprintf(str, size, "%02x:%02x:%02x:%02x:%02x:%02x", p[0], p[1], p[2], p[3], p[4], p[5]); return str; } #endif @@ -272,9 +270,7 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) { if (param->disc_comp.scn_num > 0) { #if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) char bda_str[18]; - log_i("ESP_SPP_DISCOVERY_COMP_EVT: spp connect to remote %s channel %d", - bda2str(_peer_bd_addr, bda_str, sizeof(bda_str)), - param->disc_comp.scn[0]); + log_i("ESP_SPP_DISCOVERY_COMP_EVT: spp connect to remote %s channel %d", bda2str(_peer_bd_addr, bda_str, sizeof(bda_str)), param->disc_comp.scn[0]); #endif xEventGroupClearBits(_spp_event_group, SPP_CLOSED); if (esp_spp_connect(_sec_mask, _role, param->disc_comp.scn[0], _peer_bd_addr) != ESP_OK) { @@ -311,8 +307,10 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) { case ESP_SPP_CLOSE_EVT: // Enum 27 - When SPP connection closed if ((param->close.async == false && param->close.status == ESP_SPP_SUCCESS) || param->close.async) { - log_i("ESP_SPP_CLOSE_EVT status:%d handle:%d close_by_remote:%d attempt %u", param->close.status, - param->close.handle, param->close.async, secondConnectionAttempt); + log_i( + "ESP_SPP_CLOSE_EVT status:%d handle:%d close_by_remote:%d attempt %u", param->close.status, param->close.handle, param->close.async, + secondConnectionAttempt + ); if (secondConnectionAttempt) { secondConnectionAttempt = false; } else { @@ -406,99 +404,96 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) { log_i("ESP_SPP_VFS_UNREGISTER_EVT"); break; - default: - log_i("ESP_SPP_* event #%d unhandled", event); - break; + default: log_i("ESP_SPP_* event #%d unhandled", event); break; + } + if (custom_spp_callback) { + (*custom_spp_callback)(event, param); } - if (custom_spp_callback) (*custom_spp_callback)(event, param); } void BluetoothSerial::onData(BluetoothSerialDataCb cb) { custom_data_callback = cb; } - static void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param) { switch (event) { case ESP_BT_GAP_DISC_RES_EVT: - { // Enum 0 - Device discovery result event - log_i("ESP_BT_GAP_DISC_RES_EVT properties=%d", param->disc_res.num_prop); + { // Enum 0 - Device discovery result event + log_i("ESP_BT_GAP_DISC_RES_EVT properties=%d", param->disc_res.num_prop); #if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) - char bda_str[18]; - log_i("Scanned device: %s", bda2str(param->disc_res.bda, bda_str, 18)); + char bda_str[18]; + log_i("Scanned device: %s", bda2str(param->disc_res.bda, bda_str, 18)); #endif - BTAdvertisedDeviceSet advertisedDevice; - uint8_t peer_bdname_len = 0; - char peer_bdname[ESP_BT_GAP_MAX_BDNAME_LEN + 1]; - for (int i = 0; i < param->disc_res.num_prop; i++) { - switch (param->disc_res.prop[i].type) { - case ESP_BT_GAP_DEV_PROP_BDNAME: // Enum 1 - Bluetooth device name, value type is int8_t [] - peer_bdname_len = param->disc_res.prop[i].len; - memcpy(peer_bdname, param->disc_res.prop[i].val, peer_bdname_len); - peer_bdname_len--; // len includes 0 terminator - log_v("ESP_BT_GAP_DISC_RES_EVT : BDNAME : %s : %d", peer_bdname, peer_bdname_len); - if (strlen(_remote_name) == peer_bdname_len - && strncmp(peer_bdname, _remote_name, peer_bdname_len) == 0) { - log_i("ESP_BT_GAP_DISC_RES_EVT : SPP_START_DISCOVERY_BDNAME : %s", peer_bdname); + BTAdvertisedDeviceSet advertisedDevice; + uint8_t peer_bdname_len = 0; + char peer_bdname[ESP_BT_GAP_MAX_BDNAME_LEN + 1]; + for (int i = 0; i < param->disc_res.num_prop; i++) { + switch (param->disc_res.prop[i].type) { + case ESP_BT_GAP_DEV_PROP_BDNAME: // Enum 1 - Bluetooth device name, value type is int8_t [] + peer_bdname_len = param->disc_res.prop[i].len; + memcpy(peer_bdname, param->disc_res.prop[i].val, peer_bdname_len); + peer_bdname_len--; // len includes 0 terminator + log_v("ESP_BT_GAP_DISC_RES_EVT : BDNAME : %s : %d", peer_bdname, peer_bdname_len); + if (strlen(_remote_name) == peer_bdname_len && strncmp(peer_bdname, _remote_name, peer_bdname_len) == 0) { + log_i("ESP_BT_GAP_DISC_RES_EVT : SPP_START_DISCOVERY_BDNAME : %s", peer_bdname); + _isRemoteAddressSet = true; + memcpy(_peer_bd_addr, param->disc_res.bda, ESP_BD_ADDR_LEN); + esp_bt_gap_cancel_discovery(); + esp_spp_start_discovery(_peer_bd_addr); + } + break; + + case ESP_BT_GAP_DEV_PROP_COD: // Enum 2 - Class of Device, value type is uint32_t + if (param->disc_res.prop[i].len <= sizeof(int)) { + uint32_t cod = 0; + memcpy(&cod, param->disc_res.prop[i].val, param->disc_res.prop[i].len); + advertisedDevice.setCOD(cod); + log_d("ESP_BT_GAP_DEV_PROP_COD 0x%x", cod); + } else { + log_d("ESP_BT_GAP_DEV_PROP_COD invalid COD: Value size larger than integer"); + } + break; + + case ESP_BT_GAP_DEV_PROP_RSSI: // Enum 3 - Received Signal strength Indication, value type is int8_t, ranging from -128 to 127 + if (param->disc_res.prop[i].len <= sizeof(int)) { + uint8_t rssi = 0; + memcpy(&rssi, param->disc_res.prop[i].val, param->disc_res.prop[i].len); + log_d("ESP_BT_GAP_DEV_PROP_RSSI %d", rssi); + advertisedDevice.setRSSI(rssi); + } else { + log_d("ESP_BT_GAP_DEV_PROP_RSSI invalid RSSI: Value size larger than integer"); + } + break; + + case ESP_BT_GAP_DEV_PROP_EIR: // Enum 4 - Extended Inquiry Response, value type is uint8_t [] + if (get_name_from_eir((uint8_t *)param->disc_res.prop[i].val, peer_bdname, &peer_bdname_len)) { + log_i("ESP_BT_GAP_DISC_RES_EVT : EIR : %s : %d", peer_bdname, peer_bdname_len); + if (strlen(_remote_name) == peer_bdname_len && strncmp(peer_bdname, _remote_name, peer_bdname_len) == 0) { + log_v("ESP_BT_GAP_DISC_RES_EVT : SPP_START_DISCOVERY_EIR : %s", peer_bdname, peer_bdname_len); _isRemoteAddressSet = true; memcpy(_peer_bd_addr, param->disc_res.bda, ESP_BD_ADDR_LEN); esp_bt_gap_cancel_discovery(); esp_spp_start_discovery(_peer_bd_addr); } - break; - - case ESP_BT_GAP_DEV_PROP_COD: // Enum 2 - Class of Device, value type is uint32_t - if (param->disc_res.prop[i].len <= sizeof(int)) { - uint32_t cod = 0; - memcpy(&cod, param->disc_res.prop[i].val, param->disc_res.prop[i].len); - advertisedDevice.setCOD(cod); - log_d("ESP_BT_GAP_DEV_PROP_COD 0x%x", cod); - } else { - log_d("ESP_BT_GAP_DEV_PROP_COD invalid COD: Value size larger than integer"); - } - break; - - case ESP_BT_GAP_DEV_PROP_RSSI: // Enum 3 - Received Signal strength Indication, value type is int8_t, ranging from -128 to 127 - if (param->disc_res.prop[i].len <= sizeof(int)) { - uint8_t rssi = 0; - memcpy(&rssi, param->disc_res.prop[i].val, param->disc_res.prop[i].len); - log_d("ESP_BT_GAP_DEV_PROP_RSSI %d", rssi); - advertisedDevice.setRSSI(rssi); - } else { - log_d("ESP_BT_GAP_DEV_PROP_RSSI invalid RSSI: Value size larger than integer"); - } - break; - - case ESP_BT_GAP_DEV_PROP_EIR: // Enum 4 - Extended Inquiry Response, value type is uint8_t [] - if (get_name_from_eir((uint8_t *)param->disc_res.prop[i].val, peer_bdname, &peer_bdname_len)) { - log_i("ESP_BT_GAP_DISC_RES_EVT : EIR : %s : %d", peer_bdname, peer_bdname_len); - if (strlen(_remote_name) == peer_bdname_len - && strncmp(peer_bdname, _remote_name, peer_bdname_len) == 0) { - log_v("ESP_BT_GAP_DISC_RES_EVT : SPP_START_DISCOVERY_EIR : %s", peer_bdname, peer_bdname_len); - _isRemoteAddressSet = true; - memcpy(_peer_bd_addr, param->disc_res.bda, ESP_BD_ADDR_LEN); - esp_bt_gap_cancel_discovery(); - esp_spp_start_discovery(_peer_bd_addr); - } - } - break; - - default: - log_i("ESP_BT_GAP_DISC_RES_EVT unknown property [%d]:type:%d", i, param->disc_res.prop[i].type); - break; - } - if (_isRemoteAddressSet) + } break; + + default: log_i("ESP_BT_GAP_DISC_RES_EVT unknown property [%d]:type:%d", i, param->disc_res.prop[i].type); break; + } + if (_isRemoteAddressSet) { + break; } - if (peer_bdname_len) - advertisedDevice.setName(peer_bdname); - esp_bd_addr_t addr; - memcpy(addr, param->disc_res.bda, ESP_BD_ADDR_LEN); - advertisedDevice.setAddress(BTAddress(addr)); - if (scanResults.add(advertisedDevice) && advertisedDeviceCb) - advertisedDeviceCb(&advertisedDevice); } - break; + if (peer_bdname_len) { + advertisedDevice.setName(peer_bdname); + } + esp_bd_addr_t addr; + memcpy(addr, param->disc_res.bda, ESP_BD_ADDR_LEN); + advertisedDevice.setAddress(BTAddress(addr)); + if (scanResults.add(advertisedDevice) && advertisedDeviceCb) { + advertisedDeviceCb(&advertisedDevice); + } + } break; case ESP_BT_GAP_DISC_STATE_CHANGED_EVT: // Enum 1 - Discovery state changed event if (param->disc_st_chg.state == ESP_BT_GAP_DISCOVERY_STOPPED) { @@ -594,7 +589,6 @@ static void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa } break; - case ESP_BT_GAP_MODE_CHG_EVT: // Enum 13 log_i("ESP_BT_GAP_MODE_CHG_EVT: mode: %d", param->mode_chg.mode); break; @@ -612,12 +606,13 @@ static void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa break; case ESP_BT_GAP_ACL_DISCONN_CMPL_STAT_EVT: // Enum 17 - ACL disconnection complete status event - log_i("ESP_BT_GAP_ACL_DISCONN_CMPL_STAT_EVT ACL disconnection complete status event: reason %d, handle %d", param->acl_disconn_cmpl_stat.reason, param->acl_disconn_cmpl_stat.handle); + log_i( + "ESP_BT_GAP_ACL_DISCONN_CMPL_STAT_EVT ACL disconnection complete status event: reason %d, handle %d", param->acl_disconn_cmpl_stat.reason, + param->acl_disconn_cmpl_stat.handle + ); break; - default: - log_i("ESP-BT_GAP_* unknown message: %d", event); - break; + default: log_i("ESP-BT_GAP_* unknown message: %d", event); break; } } @@ -744,8 +739,9 @@ static bool _init_bt(const char *deviceName, bt_mode mode) { static bool _stop_bt() { if (btStarted()) { - if (_spp_client) + if (_spp_client) { esp_spp_disconnect(_spp_client); + } esp_spp_deinit(); esp_bluedroid_disable(); esp_bluedroid_deinit(); @@ -788,9 +784,9 @@ static bool waitForConnect(int timeout) { TickType_t xTicksToWait = timeout / portTICK_PERIOD_MS; // wait for connected or closed EventBits_t rc = xEventGroupWaitBits(_spp_event_group, SPP_CONNECTED | SPP_CLOSED, pdFALSE, pdFALSE, xTicksToWait); - if ((rc & SPP_CONNECTED) != 0) + if ((rc & SPP_CONNECTED) != 0) { return true; - else if ((rc & SPP_CLOSED) != 0) { + } else if ((rc & SPP_CLOSED) != 0) { log_d("connection closed!"); return false; } @@ -920,7 +916,6 @@ void BluetoothSerial::confirmReply(boolean confirm) { esp_bt_gap_ssp_confirm_reply(current_bd_addr, confirm); } - esp_err_t BluetoothSerial::register_callback(esp_spp_cb_t callback) { custom_spp_callback = callback; return ESP_OK; @@ -978,7 +973,9 @@ bool BluetoothSerial::setPin(const char *pin, uint8_t pin_code_len) { bool BluetoothSerial::connect(String remoteName) { bool retval = false; - if (!isReady(true, READY_TIMEOUT)) return false; + if (!isReady(true, READY_TIMEOUT)) { + return false; + } if (remoteName && remoteName.length() < 1) { log_e("No remote name is provided"); return false; @@ -1020,7 +1017,9 @@ bool BluetoothSerial::connect(String remoteName) { */ bool BluetoothSerial::connect(uint8_t remoteAddress[], int channel, esp_spp_sec_t sec_mask, esp_spp_role_t role) { bool retval = false; - if (!isReady(true, READY_TIMEOUT)) return false; + if (!isReady(true, READY_TIMEOUT)) { + return false; + } if (!remoteAddress) { log_e("No remote address is provided"); return false; @@ -1037,9 +1036,7 @@ bool BluetoothSerial::connect(uint8_t remoteAddress[], int channel, esp_spp_sec_ if (channel > 0) { #if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO) char bda_str[18]; - log_i("spp connect to remote %s channel %d", - bda2str(_peer_bd_addr, bda_str, sizeof(bda_str)), - channel); + log_i("spp connect to remote %s channel %d", bda2str(_peer_bd_addr, bda_str, sizeof(bda_str)), channel); #endif if (esp_spp_connect(sec_mask, role, channel, _peer_bd_addr) != ESP_OK) { log_e("spp connect failed"); @@ -1067,7 +1064,9 @@ bool BluetoothSerial::connect(uint8_t remoteAddress[], int channel, esp_spp_sec_ } bool BluetoothSerial::connect() { - if (!isReady(true, READY_TIMEOUT)) return false; + if (!isReady(true, READY_TIMEOUT)) { + return false; + } _doConnect = true; if (_isRemoteAddressSet) { disconnect(); @@ -1139,7 +1138,6 @@ bool BluetoothSerial::isReady(bool checkMaster, int timeout) { return (xEventGroupWaitBits(_spp_event_group, SPP_RUNNING, pdFALSE, pdTRUE, xTicksToWait) & SPP_RUNNING) != 0; } - /** * @brief RemoteName or address are not allowed to be set during discovery * (otherwise it might connect automatically and stop discovery) @@ -1176,17 +1174,20 @@ BTScanResults *BluetoothSerial::discover(int timeoutMs) { */ bool BluetoothSerial::discoverAsync(BTAdvertisedDeviceCb cb, int timeoutMs) { scanResults.clear(); - if (strlen(_remote_name) || _isRemoteAddressSet) + if (strlen(_remote_name) || _isRemoteAddressSet) { return false; + } int timeout = timeoutMs / INQ_TIME; disconnect(); advertisedDeviceCb = cb; log_i("discovering"); // will resolve name to address first - it may take a while esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE); - if (timeout > 0) + if (timeout > 0) { return esp_bt_gap_start_discovery(ESP_BT_INQ_MODE_GENERAL_INQUIRY, timeout, 0) == ESP_OK; - else return esp_bt_gap_start_discovery(ESP_BT_INQ_MODE_GENERAL_INQUIRY, ESP_BT_GAP_MAX_INQ_LEN, 0) == ESP_OK; + } else { + return esp_bt_gap_start_discovery(ESP_BT_INQ_MODE_GENERAL_INQUIRY, ESP_BT_GAP_MAX_INQ_LEN, 0) == ESP_OK; + } } /** @brief Stops the asynchronous discovery and clears the callback */ diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.h b/libraries/BluetoothSerial/src/BluetoothSerial.h index 8060766e5..6b7ba419e 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.h +++ b/libraries/BluetoothSerial/src/BluetoothSerial.h @@ -36,7 +36,6 @@ typedef std::function BTAdvertisedD class BluetoothSerial : public Stream { public: - BluetoothSerial(void); ~BluetoothSerial(void); @@ -73,8 +72,14 @@ public: bool setPin(const char *pin, uint8_t pin_code_len); #endif bool connect(String remoteName); - bool connect(uint8_t remoteAddress[], int channel = 0, esp_spp_sec_t sec_mask = (ESP_SPP_SEC_ENCRYPT | ESP_SPP_SEC_AUTHENTICATE), esp_spp_role_t role = ESP_SPP_ROLE_MASTER); - bool connect(const BTAddress &remoteAddress, int channel = 0, esp_spp_sec_t sec_mask = (ESP_SPP_SEC_ENCRYPT | ESP_SPP_SEC_AUTHENTICATE), esp_spp_role_t role = ESP_SPP_ROLE_MASTER) { + bool connect( + uint8_t remoteAddress[], int channel = 0, esp_spp_sec_t sec_mask = (ESP_SPP_SEC_ENCRYPT | ESP_SPP_SEC_AUTHENTICATE), + esp_spp_role_t role = ESP_SPP_ROLE_MASTER + ); + bool connect( + const BTAddress &remoteAddress, int channel = 0, esp_spp_sec_t sec_mask = (ESP_SPP_SEC_ENCRYPT | ESP_SPP_SEC_AUTHENTICATE), + esp_spp_role_t role = ESP_SPP_ROLE_MASTER + ) { return connect(*remoteAddress.getNative(), channel, sec_mask); }; bool connect(); @@ -108,6 +113,7 @@ public: int getBondedDevices(uint dev_num, esp_bd_addr_t *dev_list); bool deleteBondedDevice(uint8_t *remoteAddress); void deleteAllBondedDevices(); + private: String local_name; int timeoutTicks = 0; diff --git a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino index 9f4f95e5c..f5de8aa9b 100644 --- a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino +++ b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino @@ -11,7 +11,6 @@ This works for Android, Ubuntu, FireFox, Windows, maybe others... #include #include - DNSServer dnsServer; WebServer server(80); diff --git a/libraries/DNSServer/src/DNSServer.cpp b/libraries/DNSServer/src/DNSServer.cpp index e976981e2..69e41092d 100644 --- a/libraries/DNSServer/src/DNSServer.cpp +++ b/libraries/DNSServer/src/DNSServer.cpp @@ -3,7 +3,6 @@ #include #include - // #define DEBUG_ESP_DNS #ifdef DEBUG_ESP_PORT #define DEBUG_OUTPUT DEBUG_ESP_PORT @@ -13,13 +12,11 @@ #define DNS_MIN_REQ_LEN 17 // minimal size for DNS request asking ROOT = DNS_HEADER_SIZE + 1 null byte for Name + 4 bytes type/class -DNSServer::DNSServer() - : _port(DNS_DEFAULT_PORT), _ttl(htonl(DNS_DEFAULT_TTL)), _errorReplyCode(DNSReplyCode::NonExistentDomain) {} +DNSServer::DNSServer() : _port(DNS_DEFAULT_PORT), _ttl(htonl(DNS_DEFAULT_TTL)), _errorReplyCode(DNSReplyCode::NonExistentDomain) {} -DNSServer::DNSServer(const String& domainName) +DNSServer::DNSServer(const String &domainName) : _port(DNS_DEFAULT_PORT), _ttl(htonl(DNS_DEFAULT_TTL)), _errorReplyCode(DNSReplyCode::NonExistentDomain), _domainName(domainName){}; - bool DNSServer::start() { if (_resolvedIP.operator uint32_t() == 0) { // no address is set, try to obtain AP interface's IP #if SOC_WIFI_SUPPORTED @@ -32,33 +29,34 @@ bool DNSServer::start() { } _udp.close(); - _udp.onPacket([this](AsyncUDPPacket& pkt) { + _udp.onPacket([this](AsyncUDPPacket &pkt) { this->_handleUDP(pkt); }); return _udp.listen(_port); } -bool DNSServer::start(uint16_t port, const String& domainName, const IPAddress& resolvedIP) { +bool DNSServer::start(uint16_t port, const String &domainName, const IPAddress &resolvedIP) { _port = port; if (domainName != "*") { _domainName = domainName; downcaseAndRemoveWwwPrefix(_domainName); - } else + } else { _domainName.clear(); + } _resolvedIP = resolvedIP; _udp.close(); - _udp.onPacket([this](AsyncUDPPacket& pkt) { + _udp.onPacket([this](AsyncUDPPacket &pkt) { this->_handleUDP(pkt); }); return _udp.listen(_port); } -void DNSServer::setErrorReplyCode(const DNSReplyCode& replyCode) { +void DNSServer::setErrorReplyCode(const DNSReplyCode &replyCode) { _errorReplyCode = replyCode; } -void DNSServer::setTTL(const uint32_t& ttl) { +void DNSServer::setTTL(const uint32_t &ttl) { _ttl = htonl(ttl); } @@ -66,19 +64,23 @@ void DNSServer::stop() { _udp.close(); } -void DNSServer::downcaseAndRemoveWwwPrefix(String& domainName) { +void DNSServer::downcaseAndRemoveWwwPrefix(String &domainName) { domainName.toLowerCase(); domainName.replace("www.", ""); } -void DNSServer::_handleUDP(AsyncUDPPacket& pkt) { - if (pkt.length() < DNS_MIN_REQ_LEN) return; // truncated packet or not a DNS req +void DNSServer::_handleUDP(AsyncUDPPacket &pkt) { + if (pkt.length() < DNS_MIN_REQ_LEN) { + return; // truncated packet or not a DNS req + } // get DNS header (beginning of message) DNSHeader dnsHeader; DNSQuestion dnsQuestion; memcpy(&dnsHeader, pkt.data(), DNS_HEADER_SIZE); - if (dnsHeader.QR != DNS_QR_QUERY) return; // ignore non-query messages + if (dnsHeader.QR != DNS_QR_QUERY) { + return; // ignore non-query messages + } if (requestIncludesOnlyOneQuestion(dnsHeader)) { /* @@ -86,15 +88,17 @@ void DNSServer::_handleUDP(AsyncUDPPacket& pkt) { // Each label contains a byte to describe its length and the label itself. The list of // labels terminates with a zero-valued byte. In "github.com", we have two labels "github" & "com" */ - const char* enoflbls = strchr(reinterpret_cast(pkt.data()) + DNS_HEADER_SIZE, 0); // find end_of_label marker - ++enoflbls; // advance after null terminator - dnsQuestion.QName = pkt.data() + DNS_HEADER_SIZE; // we can reference labels from the request - dnsQuestion.QNameLength = enoflbls - (char*)pkt.data() - DNS_HEADER_SIZE; + const char *enoflbls = strchr(reinterpret_cast(pkt.data()) + DNS_HEADER_SIZE, 0); // find end_of_label marker + ++enoflbls; // advance after null terminator + dnsQuestion.QName = pkt.data() + DNS_HEADER_SIZE; // we can reference labels from the request + dnsQuestion.QNameLength = enoflbls - (char *)pkt.data() - DNS_HEADER_SIZE; /* check if we aint going out of pkt bounds proper dns req should have label terminator at least 4 bytes before end of packet */ - if (dnsQuestion.QNameLength > pkt.length() - DNS_HEADER_SIZE - sizeof(dnsQuestion.QType) - sizeof(dnsQuestion.QClass)) return; // malformed packet + if (dnsQuestion.QNameLength > pkt.length() - DNS_HEADER_SIZE - sizeof(dnsQuestion.QType) - sizeof(dnsQuestion.QClass)) { + return; // malformed packet + } // Copy the QType and QClass memcpy(&dnsQuestion.QType, enoflbls, sizeof(dnsQuestion.QType)); @@ -102,7 +106,8 @@ void DNSServer::_handleUDP(AsyncUDPPacket& pkt) { } // will reply with IP only to "*" or if domain matches without www. subdomain - if (dnsHeader.OPCode == DNS_OPCODE_QUERY && requestIncludesOnlyOneQuestion(dnsHeader) && (_domainName.isEmpty() || getDomainNameWithoutWwwPrefix(static_cast(dnsQuestion.QName), dnsQuestion.QNameLength) == _domainName)) { + if (dnsHeader.OPCode == DNS_OPCODE_QUERY && requestIncludesOnlyOneQuestion(dnsHeader) + && (_domainName.isEmpty() || getDomainNameWithoutWwwPrefix(static_cast(dnsQuestion.QName), dnsQuestion.QNameLength) == _domainName)) { replyWithIP(pkt, dnsHeader, dnsQuestion); return; } @@ -111,12 +116,11 @@ void DNSServer::_handleUDP(AsyncUDPPacket& pkt) { replyWithCustomCode(pkt, dnsHeader); } -bool DNSServer::requestIncludesOnlyOneQuestion(DNSHeader& dnsHeader) { +bool DNSServer::requestIncludesOnlyOneQuestion(DNSHeader &dnsHeader) { return ntohs(dnsHeader.QDCount) == 1 && dnsHeader.ANCount == 0 && dnsHeader.NSCount == 0 && dnsHeader.ARCount == 0; } - -String DNSServer::getDomainNameWithoutWwwPrefix(const unsigned char* start, size_t len) { +String DNSServer::getDomainNameWithoutWwwPrefix(const unsigned char *start, size_t len) { String parsedDomainName(start, --len); // exclude trailing null byte from labels length, String constructor will add it anyway int pos = 0; @@ -130,19 +134,19 @@ String DNSServer::getDomainNameWithoutWwwPrefix(const unsigned char* start, size return parsedDomainName; } -void DNSServer::replyWithIP(AsyncUDPPacket& req, DNSHeader& dnsHeader, DNSQuestion& dnsQuestion) { +void DNSServer::replyWithIP(AsyncUDPPacket &req, DNSHeader &dnsHeader, DNSQuestion &dnsQuestion) { AsyncUDPMessage rpl; // Change the type of message to a response and set the number of answers equal to // the number of questions in the header dnsHeader.QR = DNS_QR_RESPONSE; dnsHeader.ANCount = dnsHeader.QDCount; - rpl.write((unsigned char*)&dnsHeader, DNS_HEADER_SIZE); + rpl.write((unsigned char *)&dnsHeader, DNS_HEADER_SIZE); // Write the question rpl.write(dnsQuestion.QName, dnsQuestion.QNameLength); - rpl.write((uint8_t*)&dnsQuestion.QType, 2); - rpl.write((uint8_t*)&dnsQuestion.QClass, 2); + rpl.write((uint8_t *)&dnsQuestion.QType, 2); + rpl.write((uint8_t *)&dnsQuestion.QClass, 2); // Write the answer // Use DNS name compression : instead of repeating the name in this RNAME occurrence, @@ -154,27 +158,29 @@ void DNSServer::replyWithIP(AsyncUDPPacket& req, DNSHeader& dnsHeader, DNSQuesti // DNS type A : host address, DNS class IN for INternet, returning an IPv4 address uint16_t answerType = htons(DNS_TYPE_A), answerClass = htons(DNS_CLASS_IN), answerIPv4 = htons(DNS_RDLENGTH_IPV4); - rpl.write((unsigned char*)&answerType, 2); - rpl.write((unsigned char*)&answerClass, 2); - rpl.write((unsigned char*)&_ttl, 4); // DNS Time To Live - rpl.write((unsigned char*)&answerIPv4, 2); + rpl.write((unsigned char *)&answerType, 2); + rpl.write((unsigned char *)&answerClass, 2); + rpl.write((unsigned char *)&_ttl, 4); // DNS Time To Live + rpl.write((unsigned char *)&answerIPv4, 2); uint32_t ip = _resolvedIP; - rpl.write(reinterpret_cast(&ip), sizeof(uint32_t)); // The IPv4 address to return + rpl.write(reinterpret_cast(&ip), sizeof(uint32_t)); // The IPv4 address to return _udp.sendTo(rpl, req.remoteIP(), req.remotePort()); #ifdef DEBUG_ESP_DNS - DEBUG_OUTPUT.printf("DNS responds: %s for %s\n", - _resolvedIP.toString().c_str(), getDomainNameWithoutWwwPrefix(static_cast(dnsQuestion.QName), dnsQuestion.QNameLength).c_str()); + DEBUG_OUTPUT.printf( + "DNS responds: %s for %s\n", _resolvedIP.toString().c_str(), + getDomainNameWithoutWwwPrefix(static_cast(dnsQuestion.QName), dnsQuestion.QNameLength).c_str() + ); #endif } -void DNSServer::replyWithCustomCode(AsyncUDPPacket& req, DNSHeader& dnsHeader) { +void DNSServer::replyWithCustomCode(AsyncUDPPacket &req, DNSHeader &dnsHeader) { dnsHeader.QR = DNS_QR_RESPONSE; dnsHeader.RCode = static_cast(_errorReplyCode); dnsHeader.QDCount = 0; AsyncUDPMessage rpl(sizeof(DNSHeader)); - rpl.write(reinterpret_cast(&dnsHeader), sizeof(DNSHeader)); + rpl.write(reinterpret_cast(&dnsHeader), sizeof(DNSHeader)); _udp.sendTo(rpl, req.remoteIP(), req.remotePort()); } diff --git a/libraries/DNSServer/src/DNSServer.h b/libraries/DNSServer/src/DNSServer.h index 622a95608..dfd9a4560 100644 --- a/libraries/DNSServer/src/DNSServer.h +++ b/libraries/DNSServer/src/DNSServer.h @@ -1,13 +1,13 @@ #pragma once #include -#define DNS_QR_QUERY 0 -#define DNS_QR_RESPONSE 1 -#define DNS_OPCODE_QUERY 0 -#define DNS_DEFAULT_TTL 60 // Default Time To Live : time interval in seconds that the resource record should be cached before being discarded -#define DNS_HEADER_SIZE 12 +#define DNS_QR_QUERY 0 +#define DNS_QR_RESPONSE 1 +#define DNS_OPCODE_QUERY 0 +#define DNS_DEFAULT_TTL 60 // Default Time To Live : time interval in seconds that the resource record should be cached before being discarded +#define DNS_HEADER_SIZE 12 #define DNS_OFFSET_DOMAIN_NAME DNS_HEADER_SIZE // Offset in bytes to reach the domain name labels in the DNS message -#define DNS_DEFAULT_PORT 53 +#define DNS_DEFAULT_PORT 53 enum class DNSReplyCode : uint16_t { NoError = 0, @@ -42,14 +42,14 @@ struct DNSHeader { uint16_t ID; // identification number union { struct { - uint16_t RD : 1; // recursion desired - uint16_t TC : 1; // truncated message - uint16_t AA : 1; // authoritative answer + uint16_t RD : 1; // recursion desired + uint16_t TC : 1; // truncated message + uint16_t AA : 1; // authoritative answer uint16_t OPCode : 4; // message_type - uint16_t QR : 1; // query/response flag - uint16_t RCode : 4; // response code - uint16_t Z : 3; // its z! reserved - uint16_t RA : 1; // recursion available + uint16_t QR : 1; // query/response flag + uint16_t RCode : 4; // response code + uint16_t Z : 3; // its z! reserved + uint16_t RA : 1; // recursion available }; uint16_t Flags; }; @@ -60,7 +60,7 @@ struct DNSHeader { }; struct DNSQuestion { - const uint8_t* QName; + const uint8_t *QName; uint16_t QNameLength; uint16_t QType; uint16_t QClass; @@ -81,34 +81,33 @@ public: * builds DNS server with default parameters * @param domainName - domain name to serve */ - DNSServer(const String& domainName); + DNSServer(const String &domainName); ~DNSServer(){}; // default d-tor // Copy semantics not implemented (won't run on same UDP port anyway) - DNSServer(const DNSServer&) = delete; - DNSServer& operator=(const DNSServer&) = delete; - + DNSServer(const DNSServer &) = delete; + DNSServer &operator=(const DNSServer &) = delete; /** * @brief stub, left for compatibility with an old version * does nothing actually * */ - void processNextRequest(){}; + void processNextRequest() {}; /** * @brief Set the Error Reply Code for all req's not matching predefined domain * * @param replyCode */ - void setErrorReplyCode(const DNSReplyCode& replyCode); + void setErrorReplyCode(const DNSReplyCode &replyCode); /** * @brief set TTL for successful replies * * @param ttl in seconds */ - void setTTL(const uint32_t& ttl); + void setTTL(const uint32_t &ttl); /** * @brief (re)Starts a server with current configuration or with default parameters @@ -129,9 +128,7 @@ public: * @return true on success * @return false if IP or socket error */ - bool start(uint16_t port, - const String& domainName, - const IPAddress& resolvedIP); + bool start(uint16_t port, const String &domainName, const IPAddress &resolvedIP); /** * @brief stops the server and close UDP socket @@ -168,8 +165,7 @@ private: String _domainName; IPAddress _resolvedIP; - - void downcaseAndRemoveWwwPrefix(String& domainName); + void downcaseAndRemoveWwwPrefix(String &domainName); /** * @brief Get the Domain Name Without Www Prefix object @@ -179,9 +175,9 @@ private: * @param len labels length * @return String */ - String getDomainNameWithoutWwwPrefix(const unsigned char* start, size_t len); - inline bool requestIncludesOnlyOneQuestion(DNSHeader& dnsHeader); - void replyWithIP(AsyncUDPPacket& req, DNSHeader& dnsHeader, DNSQuestion& dnsQuestion); - inline void replyWithCustomCode(AsyncUDPPacket& req, DNSHeader& dnsHeader); - void _handleUDP(AsyncUDPPacket& pkt); + String getDomainNameWithoutWwwPrefix(const unsigned char *start, size_t len); + inline bool requestIncludesOnlyOneQuestion(DNSHeader &dnsHeader); + void replyWithIP(AsyncUDPPacket &req, DNSHeader &dnsHeader, DNSQuestion &dnsQuestion); + inline void replyWithCustomCode(AsyncUDPPacket &req, DNSHeader &dnsHeader); + void _handleUDP(AsyncUDPPacket &pkt); }; diff --git a/libraries/EEPROM/examples/eeprom_class/eeprom_class.ino b/libraries/EEPROM/examples/eeprom_class/eeprom_class.ino index 6afe39efa..386360ac6 100644 --- a/libraries/EEPROM/examples/eeprom_class/eeprom_class.ino +++ b/libraries/EEPROM/examples/eeprom_class/eeprom_class.ino @@ -38,7 +38,7 @@ void setup() { ESP.restart(); } - const char* name = "Teo Swee Ann"; + const char *name = "Teo Swee Ann"; char rname[32]; double height = 5.8; uint32_t age = 47; diff --git a/libraries/EEPROM/src/EEPROM.cpp b/libraries/EEPROM/src/EEPROM.cpp index 0fe0c9feb..7a6b6722f 100644 --- a/libraries/EEPROM/src/EEPROM.cpp +++ b/libraries/EEPROM/src/EEPROM.cpp @@ -28,18 +28,13 @@ #include #include -EEPROMClass::EEPROMClass(void) - : _handle(0), _data(0), _size(0), _dirty(false), _name("eeprom") { -} +EEPROMClass::EEPROMClass(void) : _handle(0), _data(0), _size(0), _dirty(false), _name("eeprom") {} EEPROMClass::EEPROMClass(uint32_t sector) // Only for compatiility, no sectors in nvs! - : _handle(0), _data(0), _size(0), _dirty(false), _name("eeprom") { -} + : _handle(0), _data(0), _size(0), _dirty(false), _name("eeprom") {} -EEPROMClass::EEPROMClass(const char* name) - : _handle(0), _data(0), _size(0), _dirty(false), _name(name) { -} +EEPROMClass::EEPROMClass(const char *name) : _handle(0), _data(0), _size(0), _dirty(false), _name(name) {} EEPROMClass::~EEPROMClass() { end(); @@ -64,7 +59,7 @@ bool EEPROMClass::begin(size_t size) { } if (size < key_size) { // truncate log_w("truncating EEPROM from %d to %d", key_size, size); - uint8_t* key_data = (uint8_t*)malloc(key_size); + uint8_t *key_data = (uint8_t *)malloc(key_size); if (!key_data) { log_e("Not enough memory to truncate EEPROM!"); return false; @@ -75,7 +70,7 @@ bool EEPROMClass::begin(size_t size) { free(key_data); } else if (size > key_size) { // expand or new size_t expand_size = size - key_size; - uint8_t* expand_key = (uint8_t*)malloc(expand_size); + uint8_t *expand_key = (uint8_t *)malloc(expand_size); if (!expand_key) { log_e("Not enough memory to expand EEPROM!"); return false; @@ -88,7 +83,7 @@ bool EEPROMClass::begin(size_t size) { } free(expand_key); nvs_erase_key(_handle, "expand"); - uint8_t* key_data = (uint8_t*)malloc(size); + uint8_t *key_data = (uint8_t *)malloc(size); if (!key_data) { log_e("Not enough memory to expand EEPROM!"); return false; @@ -112,7 +107,7 @@ bool EEPROMClass::begin(size_t size) { delete[] _data; } - _data = (uint8_t*)malloc(size); + _data = (uint8_t *)malloc(size); if (!_data) { log_e("Not enough memory for %d bytes in EEPROM", size); return false; @@ -150,13 +145,15 @@ uint8_t EEPROMClass::read(int address) { } void EEPROMClass::write(int address, uint8_t value) { - if (address < 0 || (size_t)address >= _size) + if (address < 0 || (size_t)address >= _size) { return; - if (!_data) + } + if (!_data) { return; + } // Optimize _dirty. Only flagged if data written is different. - uint8_t* pData = &_data[address]; + uint8_t *pData = &_data[address]; if (*pData != value) { *pData = value; _dirty = true; @@ -186,7 +183,7 @@ bool EEPROMClass::commit() { return ret; } -uint8_t* EEPROMClass::getDataPtr() { +uint8_t *EEPROMClass::getDataPtr() { _dirty = true; return &_data[0]; } @@ -202,22 +199,22 @@ uint16_t EEPROMClass::length() { Convert EEPROM partition into nvs blob Call convert before you call begin */ -uint16_t EEPROMClass::convert(bool clear, const char* EEPROMname, const char* nvsname) { +uint16_t EEPROMClass::convert(bool clear, const char *EEPROMname, const char *nvsname) { uint16_t result = 0; - const esp_partition_t* mypart = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, EEPROMname); + const esp_partition_t *mypart = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, EEPROMname); if (mypart == NULL) { log_i("EEPROM partition not found for conversion"); return result; } size_t size = mypart->size; - uint8_t* data = (uint8_t*)malloc(size); + uint8_t *data = (uint8_t *)malloc(size); if (!data) { log_e("Not enough memory to convert EEPROM!"); goto exit; } - if (esp_partition_read(mypart, 0, (void*)data, size) != ESP_OK) { + if (esp_partition_read(mypart, 0, (void *)data, size) != ESP_OK) { log_e("Unable to read EEPROM partition"); goto exit; } @@ -331,63 +328,76 @@ bool EEPROMClass::readBool(int address) { return EEPROMClass::readAll(address, value) ? 1 : 0; } -size_t EEPROMClass::readString(int address, char* value, size_t maxLen) { - if (!value) +size_t EEPROMClass::readString(int address, char *value, size_t maxLen) { + if (!value) { return 0; + } - if (address < 0 || address + maxLen > _size) + if (address < 0 || address + maxLen > _size) { return 0; + } uint16_t len; - for (len = 0; len <= _size; len++) - if (_data[address + len] == 0) + for (len = 0; len <= _size; len++) { + if (_data[address + len] == 0) { break; + } + } - if (address + len > _size) + if (address + len > _size) { return 0; + } - if (len > maxLen) + if (len > maxLen) { return 0; //Maybe return part of the string instead? + } - memcpy((uint8_t*)value, _data + address, len); + memcpy((uint8_t *)value, _data + address, len); value[len] = 0; return len; } String EEPROMClass::readString(int address) { - if (address < 0 || address > _size) + if (address < 0 || address > _size) { return String(); + } uint16_t len; - for (len = 0; len <= _size; len++) - if (_data[address + len] == 0) + for (len = 0; len <= _size; len++) { + if (_data[address + len] == 0) { break; + } + } - if (address + len > _size) + if (address + len > _size) { return String(); + } char value[len + 1]; - memcpy((uint8_t*)value, _data + address, len); + memcpy((uint8_t *)value, _data + address, len); value[len] = 0; return String(value); } -size_t EEPROMClass::readBytes(int address, void* value, size_t maxLen) { - if (!value || !maxLen) +size_t EEPROMClass::readBytes(int address, void *value, size_t maxLen) { + if (!value || !maxLen) { return 0; + } - if (address < 0 || address + maxLen > _size) + if (address < 0 || address + maxLen > _size) { return 0; + } - memcpy((void*)value, _data + address, maxLen); + memcpy((void *)value, _data + address, maxLen); return maxLen; } -template T EEPROMClass::readAll(int address, T& value) { - if (address < 0 || address + sizeof(T) > _size) +template T EEPROMClass::readAll(int address, T &value) { + if (address < 0 || address + sizeof(T) > _size) { return value; + } - memcpy((uint8_t*)&value, _data + address, sizeof(T)); + memcpy((uint8_t *)&value, _data + address, sizeof(T)); return value; } @@ -452,22 +462,27 @@ size_t EEPROMClass::writeBool(int address, bool value) { return EEPROMClass::writeAll(address, Bool); } -size_t EEPROMClass::writeString(int address, const char* value) { - if (!value) +size_t EEPROMClass::writeString(int address, const char *value) { + if (!value) { return 0; + } - if (address < 0 || address > _size) + if (address < 0 || address > _size) { return 0; + } uint16_t len; - for (len = 0; len <= _size; len++) - if (value[len] == 0) + for (len = 0; len <= _size; len++) { + if (value[len] == 0) { break; + } + } - if (address + len > _size) + if (address + len > _size) { return 0; + } - memcpy(_data + address, (const uint8_t*)value, len + 1); + memcpy(_data + address, (const uint8_t *)value, len + 1); _dirty = true; return strlen(value); } @@ -476,23 +491,26 @@ size_t EEPROMClass::writeString(int address, String value) { return EEPROMClass::writeString(address, value.c_str()); } -size_t EEPROMClass::writeBytes(int address, const void* value, size_t len) { - if (!value || !len) +size_t EEPROMClass::writeBytes(int address, const void *value, size_t len) { + if (!value || !len) { return 0; + } - if (address < 0 || address + len > _size) + if (address < 0 || address + len > _size) { return 0; + } - memcpy(_data + address, (const void*)value, len); + memcpy(_data + address, (const void *)value, len); _dirty = true; return len; } -template T EEPROMClass::writeAll(int address, const T& value) { - if (address < 0 || address + sizeof(T) > _size) +template T EEPROMClass::writeAll(int address, const T &value) { + if (address < 0 || address + sizeof(T) > _size) { return value; + } - memcpy(_data + address, (const uint8_t*)&value, sizeof(T)); + memcpy(_data + address, (const uint8_t *)&value, sizeof(T)); _dirty = true; return sizeof(value); diff --git a/libraries/EEPROM/src/EEPROM.h b/libraries/EEPROM/src/EEPROM.h index b2599fd81..fd0613b8f 100644 --- a/libraries/EEPROM/src/EEPROM.h +++ b/libraries/EEPROM/src/EEPROM.h @@ -35,7 +35,7 @@ typedef uint32_t nvs_handle; class EEPROMClass { public: EEPROMClass(uint32_t sector); - EEPROMClass(const char* name); + EEPROMClass(const char *name); EEPROMClass(void); ~EEPROMClass(void); @@ -46,24 +46,24 @@ public: bool commit(); void end(); - uint8_t* getDataPtr(); - uint16_t convert(bool clear, const char* EEPROMname = "eeprom", const char* nvsname = "eeprom"); + uint8_t *getDataPtr(); + uint16_t convert(bool clear, const char *EEPROMname = "eeprom", const char *nvsname = "eeprom"); - template - T& get(int address, T& t) { - if (address < 0 || address + sizeof(T) > _size) + template T &get(int address, T &t) { + if (address < 0 || address + sizeof(T) > _size) { return t; + } - memcpy((uint8_t*)&t, _data + address, sizeof(T)); + memcpy((uint8_t *)&t, _data + address, sizeof(T)); return t; } - template - const T& put(int address, const T& t) { - if (address < 0 || address + sizeof(T) > _size) + template const T &put(int address, const T &t) { + if (address < 0 || address + sizeof(T) > _size) { return t; + } - memcpy(_data + address, (const uint8_t*)&t, sizeof(T)); + memcpy(_data + address, (const uint8_t *)&t, sizeof(T)); _dirty = true; return t; } @@ -82,10 +82,10 @@ public: float_t readFloat(int address); double_t readDouble(int address); bool readBool(int address); - size_t readString(int address, char* value, size_t maxLen); + size_t readString(int address, char *value, size_t maxLen); String readString(int address); - size_t readBytes(int address, void* value, size_t maxLen); - template T readAll(int address, T&); + size_t readBytes(int address, void *value, size_t maxLen); + template T readAll(int address, T &); size_t writeByte(int address, uint8_t value); size_t writeChar(int address, int8_t value); @@ -101,17 +101,17 @@ public: size_t writeFloat(int address, float_t value); size_t writeDouble(int address, double_t value); size_t writeBool(int address, bool value); - size_t writeString(int address, const char* value); + size_t writeString(int address, const char *value); size_t writeString(int address, String value); - size_t writeBytes(int address, const void* value, size_t len); - template T writeAll(int address, const T&); + size_t writeBytes(int address, const void *value, size_t len); + template T writeAll(int address, const T &); protected: nvs_handle _handle; - uint8_t* _data; + uint8_t *_data; size_t _size; bool _dirty; - const char* _name; + const char *_name; }; #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM) diff --git a/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino b/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino index 223352629..dc152a63e 100644 --- a/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino +++ b/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino @@ -16,9 +16,9 @@ #define LED_PIN 4 // define starting duty, target duty and maximum fade time -#define LEDC_START_DUTY (0) +#define LEDC_START_DUTY (0) #define LEDC_TARGET_DUTY (4095) -#define LEDC_FADE_TIME (3000) +#define LEDC_FADE_TIME (3000) bool fade_ended = false; // status of LED fade bool fade_on = true; @@ -30,7 +30,9 @@ void ARDUINO_ISR_ATTR LED_FADE_ISR() { void setup() { // Initialize serial communication at 115200 bits per second: Serial.begin(115200); - while (!Serial) delay(10); + while (!Serial) { + delay(10); + } // Setup timer with given frequency, resolution and attach it to a led pin with auto-selected channel ledcAttach(LED_PIN, LEDC_BASE_FREQ, LEDC_TIMER_12_BIT); diff --git a/libraries/ESP32/examples/AnalogOut/ledcFrequency/ledcFrequency.ino b/libraries/ESP32/examples/AnalogOut/ledcFrequency/ledcFrequency.ino index f81def389..8e86c6662 100644 --- a/libraries/ESP32/examples/AnalogOut/ledcFrequency/ledcFrequency.ino +++ b/libraries/ESP32/examples/AnalogOut/ledcFrequency/ledcFrequency.ino @@ -62,12 +62,11 @@ void setup() { printf("Bit resolution | Min Frequency [Hz] | Max Frequency [Hz]\n"); for (uint8_t r = 1; r <= SOC_LEDC_TIMER_BIT_WIDTH; ++r) { size_t max_len = std::to_string(UINT32_MAX).length(); - printf(" %s%d | %s%lu | %s%lu\n", - std::string(2 - std::to_string(r).length(), ' ').c_str(), r, - std::string(max_len - std::to_string(min_freq_array[r - 1]).length(), ' ').c_str(), - min_freq_array[r - 1], - std::string(max_len - std::to_string(max_freq_array[r - 1]).length(), ' ').c_str(), - max_freq_array[r - 1]); + printf( + " %s%d | %s%lu | %s%lu\n", std::string(2 - std::to_string(r).length(), ' ').c_str(), r, + std::string(max_len - std::to_string(min_freq_array[r - 1]).length(), ' ').c_str(), min_freq_array[r - 1], + std::string(max_len - std::to_string(max_freq_array[r - 1]).length(), ' ').c_str(), max_freq_array[r - 1] + ); } ledcDetach(PIN); diff --git a/libraries/ESP32/examples/AnalogOut/ledcWrite_RGB/ledcWrite_RGB.ino b/libraries/ESP32/examples/AnalogOut/ledcWrite_RGB/ledcWrite_RGB.ino index a81a92926..b7ea89434 100644 --- a/libraries/ESP32/examples/AnalogOut/ledcWrite_RGB/ledcWrite_RGB.ino +++ b/libraries/ESP32/examples/AnalogOut/ledcWrite_RGB/ledcWrite_RGB.ino @@ -66,10 +66,9 @@ void loop() { void hueToRGB(uint8_t hue, uint8_t brightness) { uint16_t scaledHue = (hue * 6); - uint8_t segment = scaledHue / 256; // segment 0 to 5 around the - // color wheel - uint16_t segmentOffset = - scaledHue - (segment * 256); // position within the segment + uint8_t segment = scaledHue / 256; // segment 0 to 5 around the + // color wheel + uint16_t segmentOffset = scaledHue - (segment * 256); // position within the segment uint8_t complement = 0; uint16_t prev = (brightness * (255 - segmentOffset)) / 256; diff --git a/libraries/ESP32/examples/AnalogReadContinuous/AnalogReadContinuous.ino b/libraries/ESP32/examples/AnalogReadContinuous/AnalogReadContinuous.ino index 2c03a53fc..5011bebe7 100644 --- a/libraries/ESP32/examples/AnalogReadContinuous/AnalogReadContinuous.ino +++ b/libraries/ESP32/examples/AnalogReadContinuous/AnalogReadContinuous.ino @@ -4,9 +4,9 @@ // Declare array of ADC pins that will be used for ADC Continuous mode - ONLY ADC1 pins are supported // Number of selected pins can be from 1 to ALL ADC1 pins. #ifdef CONFIG_IDF_TARGET_ESP32 -uint8_t adc_pins[] = { 36, 39, 34, 35 }; //some of ADC1 pins for ESP32 +uint8_t adc_pins[] = {36, 39, 34, 35}; //some of ADC1 pins for ESP32 #else -uint8_t adc_pins[] = { 1, 2, 3, 4 }; //ADC1 common pins for ESP32S2/S3 + ESP32C3/C6 + ESP32H2 +uint8_t adc_pins[] = {1, 2, 3, 4}; //ADC1 common pins for ESP32S2/S3 + ESP32C3/C6 + ESP32H2 #endif // Calculate how many pins are declared in the array - needed as input for the setup function of ADC Continuous @@ -16,7 +16,7 @@ uint8_t adc_pins_count = sizeof(adc_pins) / sizeof(uint8_t); volatile bool adc_coversion_done = false; // Result structure for ADC Continuous reading -adc_continuous_data_t* result = NULL; +adc_continuous_data_t *result = NULL; // ISR Function that will be triggered when ADC conversion is done void ARDUINO_ISR_ATTR adcComplete() { diff --git a/libraries/ESP32/examples/ArduinoStackSize/ArduinoStackSize.ino b/libraries/ESP32/examples/ArduinoStackSize/ArduinoStackSize.ino index e26d3d866..c326f0a22 100644 --- a/libraries/ESP32/examples/ArduinoStackSize/ArduinoStackSize.ino +++ b/libraries/ESP32/examples/ArduinoStackSize/ArduinoStackSize.ino @@ -15,7 +15,6 @@ In this example, you can verify it by changing or just commenting out SET_LOOP_TASK_STACK_SIZE(); */ - // This sets Arduino Stack Size - comment this line to use default 8K stack size SET_LOOP_TASK_STACK_SIZE(16 * 1024); // 16KB diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino b/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino index 8040eabb7..54e2df8f3 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino +++ b/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino @@ -35,8 +35,8 @@ // =========================== // Enter your WiFi credentials // =========================== -const char* ssid = "**********"; -const char* password = "**********"; +const char *ssid = "**********"; +const char *password = "**********"; void startCameraServer(); void setupLedFlash(int pin); @@ -106,7 +106,7 @@ void setup() { return; } - sensor_t* s = esp_camera_sensor_get(); + sensor_t *s = esp_camera_sensor_get(); // initial sensors are flipped vertically and colors are a bit saturated if (s->id.PID == OV3660_PID) { s->set_vflip(s, 1); // flip it back diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp b/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp index 17ad3bc2b..9f78de594 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp +++ b/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp @@ -30,13 +30,13 @@ // Makes no sense to have it enabled for them #if CONFIG_IDF_TARGET_ESP32S3 #define CONFIG_ESP_FACE_RECOGNITION_ENABLED 1 -#define CONFIG_ESP_FACE_DETECT_ENABLED 1 +#define CONFIG_ESP_FACE_DETECT_ENABLED 1 #else #define CONFIG_ESP_FACE_RECOGNITION_ENABLED 0 -#define CONFIG_ESP_FACE_DETECT_ENABLED 0 +#define CONFIG_ESP_FACE_DETECT_ENABLED 0 #endif #else -#define CONFIG_ESP_FACE_DETECT_ENABLED 0 +#define CONFIG_ESP_FACE_DETECT_ENABLED 0 #define CONFIG_ESP_FACE_RECOGNITION_ENABLED 0 #endif @@ -63,13 +63,13 @@ #define FACE_ID_SAVE_NUMBER 7 #endif -#define FACE_COLOR_WHITE 0x00FFFFFF -#define FACE_COLOR_BLACK 0x00000000 -#define FACE_COLOR_RED 0x000000FF -#define FACE_COLOR_GREEN 0x0000FF00 -#define FACE_COLOR_BLUE 0x00FF0000 +#define FACE_COLOR_WHITE 0x00FFFFFF +#define FACE_COLOR_BLACK 0x00000000 +#define FACE_COLOR_RED 0x000000FF +#define FACE_COLOR_GREEN 0x0000FF00 +#define FACE_COLOR_BLUE 0x00FF0000 #define FACE_COLOR_YELLOW (FACE_COLOR_RED | FACE_COLOR_GREEN) -#define FACE_COLOR_CYAN (FACE_COLOR_BLUE | FACE_COLOR_GREEN) +#define FACE_COLOR_CYAN (FACE_COLOR_BLUE | FACE_COLOR_GREEN) #define FACE_COLOR_PURPLE (FACE_COLOR_BLUE | FACE_COLOR_RED) #endif @@ -79,7 +79,7 @@ // LED FLASH setup #if CONFIG_LED_ILLUMINATOR_ENABLED -#define LED_LEDC_GPIO 22 //configure LED pin +#define LED_LEDC_GPIO 22 //configure LED pin #define CONFIG_LED_MAX_INTENSITY 255 int led_duty = 0; @@ -87,8 +87,7 @@ bool isStreaming = false; #endif -typedef struct -{ +typedef struct { httpd_req_t *req; size_t len; } jpg_chunking_t; @@ -127,8 +126,7 @@ FaceRecognition112V1S8 recognizer; #endif -typedef struct -{ +typedef struct { size_t size; //number of values used for filtering size_t index; //current value index size_t count; //value count @@ -246,7 +244,7 @@ static int run_face_recognition(fb_data_t *fb, std::list * int id = -1; Tensor tensor; - tensor.set_element((uint8_t *)fb->data).set_shape({ fb->height, fb->width, 3 }).set_auto_free(false); + tensor.set_element((uint8_t *)fb->data).set_shape({fb->height, fb->width, 3}).set_auto_free(false); int enrolled_count = recognizer.get_enrolled_id_num(); @@ -301,7 +299,6 @@ static esp_err_t bmp_handler(httpd_req_t *req) { snprintf(ts, 32, "%lld.%06ld", fb->timestamp.tv_sec, fb->timestamp.tv_usec); httpd_resp_set_hdr(req, "X-Timestamp", (const char *)ts); - uint8_t *buf = NULL; size_t buf_len = 0; bool converted = frame2bmp(fb, &buf, &buf_len); @@ -381,7 +378,7 @@ static esp_err_t capture_handler(httpd_req_t *req) { #endif res = httpd_resp_send(req, (const char *)fb->buf, fb->len); } else { - jpg_chunking_t jchunk = { req, 0 }; + jpg_chunking_t jchunk = {req, 0}; res = frame2jpg_cb(fb, 80, jpg_encode_stream, &jchunk) ? ESP_OK : ESP_FAIL; httpd_resp_send_chunk(req, NULL, 0); #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO @@ -397,7 +394,7 @@ static esp_err_t capture_handler(httpd_req_t *req) { #if CONFIG_ESP_FACE_DETECT_ENABLED } - jpg_chunking_t jchunk = { req, 0 }; + jpg_chunking_t jchunk = {req, 0}; if (fb->format == PIXFORMAT_RGB565 #if CONFIG_ESP_FACE_RECOGNITION_ENABLED @@ -407,11 +404,11 @@ static esp_err_t capture_handler(httpd_req_t *req) { #if TWO_STAGE HumanFaceDetectMSR01 s1(0.1F, 0.5F, 10, 0.2F); HumanFaceDetectMNP01 s2(0.5F, 0.3F, 5); - std::list &candidates = s1.infer((uint16_t *)fb->buf, { (int)fb->height, (int)fb->width, 3 }); - std::list &results = s2.infer((uint16_t *)fb->buf, { (int)fb->height, (int)fb->width, 3 }, candidates); + std::list &candidates = s1.infer((uint16_t *)fb->buf, {(int)fb->height, (int)fb->width, 3}); + std::list &results = s2.infer((uint16_t *)fb->buf, {(int)fb->height, (int)fb->width, 3}, candidates); #else HumanFaceDetectMSR01 s1(0.3F, 0.5F, 10, 0.2F); - std::list &results = s1.infer((uint16_t *)fb->buf, { (int)fb->height, (int)fb->width, 3 }); + std::list &results = s1.infer((uint16_t *)fb->buf, {(int)fb->height, (int)fb->width, 3}); #endif if (results.size() > 0) { fb_data_t rfb; @@ -456,11 +453,11 @@ static esp_err_t capture_handler(httpd_req_t *req) { #if TWO_STAGE HumanFaceDetectMSR01 s1(0.1F, 0.5F, 10, 0.2F); HumanFaceDetectMNP01 s2(0.5F, 0.3F, 5); - std::list &candidates = s1.infer((uint8_t *)out_buf, { (int)out_height, (int)out_width, 3 }); - std::list &results = s2.infer((uint8_t *)out_buf, { (int)out_height, (int)out_width, 3 }, candidates); + std::list &candidates = s1.infer((uint8_t *)out_buf, {(int)out_height, (int)out_width, 3}); + std::list &results = s2.infer((uint8_t *)out_buf, {(int)out_height, (int)out_width, 3}, candidates); #else HumanFaceDetectMSR01 s1(0.3F, 0.5F, 10, 0.2F); - std::list &results = s1.infer((uint8_t *)out_buf, { (int)out_height, (int)out_width, 3 }); + std::list &results = s1.infer((uint8_t *)out_buf, {(int)out_height, (int)out_width, 3}); #endif if (results.size() > 0) { @@ -586,10 +583,10 @@ static esp_err_t stream_handler(httpd_req_t *req) { fr_ready = esp_timer_get_time(); #endif #if TWO_STAGE - std::list &candidates = s1.infer((uint16_t *)fb->buf, { (int)fb->height, (int)fb->width, 3 }); - std::list &results = s2.infer((uint16_t *)fb->buf, { (int)fb->height, (int)fb->width, 3 }, candidates); + std::list &candidates = s1.infer((uint16_t *)fb->buf, {(int)fb->height, (int)fb->width, 3}); + std::list &results = s2.infer((uint16_t *)fb->buf, {(int)fb->height, (int)fb->width, 3}, candidates); #else - std::list &results = s1.infer((uint16_t *)fb->buf, { (int)fb->height, (int)fb->width, 3 }); + std::list &results = s1.infer((uint16_t *)fb->buf, {(int)fb->height, (int)fb->width, 3}); #endif #if CONFIG_ESP_FACE_DETECT_ENABLED && ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO fr_face = esp_timer_get_time(); @@ -646,10 +643,10 @@ static esp_err_t stream_handler(httpd_req_t *req) { rfb.format = FB_BGR888; #if TWO_STAGE - std::list &candidates = s1.infer((uint8_t *)out_buf, { (int)out_height, (int)out_width, 3 }); - std::list &results = s2.infer((uint8_t *)out_buf, { (int)out_height, (int)out_width, 3 }, candidates); + std::list &candidates = s1.infer((uint8_t *)out_buf, {(int)out_height, (int)out_width, 3}); + std::list &results = s2.infer((uint8_t *)out_buf, {(int)out_height, (int)out_width, 3}, candidates); #else - std::list &results = s1.infer((uint8_t *)out_buf, { (int)out_height, (int)out_width, 3 }); + std::list &results = s1.infer((uint8_t *)out_buf, {(int)out_height, (int)out_width, 3}); #endif #if CONFIG_ESP_FACE_DETECT_ENABLED && ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO @@ -723,18 +720,16 @@ static esp_err_t stream_handler(httpd_req_t *req) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO uint32_t avg_frame_time = ra_filter_run(&ra_filter, frame_time); #endif - log_i("MJPG: %uB %ums (%.1ffps), AVG: %ums (%.1ffps)" + log_i( + "MJPG: %uB %ums (%.1ffps), AVG: %ums (%.1ffps)" #if CONFIG_ESP_FACE_DETECT_ENABLED - ", %u+%u+%u+%u=%u %s%d" + ", %u+%u+%u+%u=%u %s%d" #endif - , - (uint32_t)(_jpg_buf_len), - (uint32_t)frame_time, 1000.0 / (uint32_t)frame_time, - avg_frame_time, 1000.0 / avg_frame_time + , + (uint32_t)(_jpg_buf_len), (uint32_t)frame_time, 1000.0 / (uint32_t)frame_time, avg_frame_time, 1000.0 / avg_frame_time #if CONFIG_ESP_FACE_DETECT_ENABLED - , - (uint32_t)ready_time, (uint32_t)face_time, (uint32_t)recognize_time, (uint32_t)encode_time, (uint32_t)process_time, - (detected) ? "DETECTED " : "", face_id + , + (uint32_t)ready_time, (uint32_t)face_time, (uint32_t)recognize_time, (uint32_t)encode_time, (uint32_t)process_time, (detected) ? "DETECTED " : "", face_id #endif ); } @@ -792,57 +787,59 @@ static esp_err_t cmd_handler(httpd_req_t *req) { if (s->pixformat == PIXFORMAT_JPEG) { res = s->set_framesize(s, (framesize_t)val); } - } else if (!strcmp(variable, "quality")) + } else if (!strcmp(variable, "quality")) { res = s->set_quality(s, val); - else if (!strcmp(variable, "contrast")) + } else if (!strcmp(variable, "contrast")) { res = s->set_contrast(s, val); - else if (!strcmp(variable, "brightness")) + } else if (!strcmp(variable, "brightness")) { res = s->set_brightness(s, val); - else if (!strcmp(variable, "saturation")) + } else if (!strcmp(variable, "saturation")) { res = s->set_saturation(s, val); - else if (!strcmp(variable, "gainceiling")) + } else if (!strcmp(variable, "gainceiling")) { res = s->set_gainceiling(s, (gainceiling_t)val); - else if (!strcmp(variable, "colorbar")) + } else if (!strcmp(variable, "colorbar")) { res = s->set_colorbar(s, val); - else if (!strcmp(variable, "awb")) + } else if (!strcmp(variable, "awb")) { res = s->set_whitebal(s, val); - else if (!strcmp(variable, "agc")) + } else if (!strcmp(variable, "agc")) { res = s->set_gain_ctrl(s, val); - else if (!strcmp(variable, "aec")) + } else if (!strcmp(variable, "aec")) { res = s->set_exposure_ctrl(s, val); - else if (!strcmp(variable, "hmirror")) + } else if (!strcmp(variable, "hmirror")) { res = s->set_hmirror(s, val); - else if (!strcmp(variable, "vflip")) + } else if (!strcmp(variable, "vflip")) { res = s->set_vflip(s, val); - else if (!strcmp(variable, "awb_gain")) + } else if (!strcmp(variable, "awb_gain")) { res = s->set_awb_gain(s, val); - else if (!strcmp(variable, "agc_gain")) + } else if (!strcmp(variable, "agc_gain")) { res = s->set_agc_gain(s, val); - else if (!strcmp(variable, "aec_value")) + } else if (!strcmp(variable, "aec_value")) { res = s->set_aec_value(s, val); - else if (!strcmp(variable, "aec2")) + } else if (!strcmp(variable, "aec2")) { res = s->set_aec2(s, val); - else if (!strcmp(variable, "dcw")) + } else if (!strcmp(variable, "dcw")) { res = s->set_dcw(s, val); - else if (!strcmp(variable, "bpc")) + } else if (!strcmp(variable, "bpc")) { res = s->set_bpc(s, val); - else if (!strcmp(variable, "wpc")) + } else if (!strcmp(variable, "wpc")) { res = s->set_wpc(s, val); - else if (!strcmp(variable, "raw_gma")) + } else if (!strcmp(variable, "raw_gma")) { res = s->set_raw_gma(s, val); - else if (!strcmp(variable, "lenc")) + } else if (!strcmp(variable, "lenc")) { res = s->set_lenc(s, val); - else if (!strcmp(variable, "special_effect")) + } else if (!strcmp(variable, "special_effect")) { res = s->set_special_effect(s, val); - else if (!strcmp(variable, "wb_mode")) + } else if (!strcmp(variable, "wb_mode")) { res = s->set_wb_mode(s, val); - else if (!strcmp(variable, "ae_level")) + } else if (!strcmp(variable, "ae_level")) { res = s->set_ae_level(s, val); + } #if CONFIG_LED_ILLUMINATOR_ENABLED else if (!strcmp(variable, "led_intensity")) { led_duty = val; - if (isStreaming) + if (isStreaming) { enable_led(true); + } } #endif @@ -1001,7 +998,8 @@ static esp_err_t reg_handler(httpd_req_t *req) { if (parse_get(req, &buf) != ESP_OK) { return ESP_FAIL; } - if (httpd_query_key_value(buf, "reg", _reg, sizeof(_reg)) != ESP_OK || httpd_query_key_value(buf, "mask", _mask, sizeof(_mask)) != ESP_OK || httpd_query_key_value(buf, "val", _val, sizeof(_val)) != ESP_OK) { + if (httpd_query_key_value(buf, "reg", _reg, sizeof(_reg)) != ESP_OK || httpd_query_key_value(buf, "mask", _mask, sizeof(_mask)) != ESP_OK + || httpd_query_key_value(buf, "val", _val, sizeof(_val)) != ESP_OK) { free(buf); httpd_resp_send_404(req); return ESP_FAIL; @@ -1110,7 +1108,10 @@ static esp_err_t win_handler(httpd_req_t *req) { bool binning = parse_get_var(buf, "binning", 0) == 1; free(buf); - log_i("Set Window: Start: %d %d, End: %d %d, Offset: %d %d, Total: %d %d, Output: %d %d, Scale: %u, Binning: %u", startX, startY, endX, endY, offsetX, offsetY, totalX, totalY, outputX, outputY, scale, binning); + log_i( + "Set Window: Start: %d %d, End: %d %d, Offset: %d %d, Total: %d %d, Output: %d %d, Scale: %u, Binning: %u", startX, startY, endX, endY, offsetX, offsetY, + totalX, totalY, outputX, outputY, scale, binning + ); sensor_t *s = esp_camera_sensor_get(); int res = s->set_res_raw(s, startX, startY, endX, endY, offsetX, offsetY, totalX, totalY, outputX, outputY, scale, binning); if (res) { diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h b/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h index e2b9ba381..040f1ec52 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h +++ b/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h @@ -3,1568 +3,969 @@ //File: index_ov2640.html.gz, Size: 6787 #define index_ov2640_html_gz_len 6787 const uint8_t index_ov2640_html_gz[] = { - 0x1F, 0x8B, 0x08, 0x08, 0x23, 0xFC, 0x69, 0x5E, 0x00, 0x03, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x5F, - 0x6F, 0x76, 0x32, 0x36, 0x34, 0x30, 0x2E, 0x68, 0x74, 0x6D, 0x6C, 0x00, 0xED, 0x3D, 0x6B, 0x73, - 0xDB, 0x46, 0x92, 0xDF, 0xFD, 0x2B, 0x60, 0x24, 0x6B, 0x92, 0x25, 0x92, 0x22, 0x29, 0x4A, 0x96, - 0x15, 0x89, 0x3E, 0x5B, 0x96, 0x1F, 0xB5, 0x76, 0xE2, 0xB5, 0x12, 0x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 0x8F, 0x9B, 0x68, 0x43, 0x02, 0x31, + 0x95, 0xB0, 0x59, 0x2D, 0x8C, 0x41, 0xE1, 0xC4, 0x0E, 0x60, 0x10, 0x8E, 0x9F, 0xB3, 0x24, 0x0F, 0xF5, 0x28, 0x21, 0x96, 0xB2, 0x97, 0x9D, 0xED, 0x4F, 0x88, + 0x93, 0xC1, 0xC4, 0xB2, 0x7C, 0xC8, 0x79, 0xCC, 0x04, 0xA2, 0xA2, 0x79, 0xB4, 0x35, 0x44, 0x18, 0xDD, 0xFE, 0x6A, 0xA5, 0xA8, 0x66, 0xA0, 0x54, 0x90, 0x11, + 0x58, 0x2C, 0xCB, 0x98, 0xD7, 0x8C, 0x34, 0x55, 0x93, 0x95, 0x05, 0x1A, 0xC5, 0x39, 0x7B, 0x65, 0x94, 0xCF, 0xD7, 0x0A, 0x93, 0x38, 0x4B, 0xAC, 0xEC, 0x77, + 0x7E, 0x28, 0x76, 0x16, 0xB0, 0x33, 0x2C, 0x18, 0x07, 0x0F, 0xCE, 0x0F, 0x27, 0xE1, 0xD4, 0x19, 0x3C, 0xF8, 0x5F, 0x94, 0x18, 0xA6, 0xBF, 0xBA, 0xAB, 0x00, + 0x00 }; - //File: index_ov3660.html.gz, Size: 8887 #define index_ov3660_html_gz_len 8887 const uint8_t index_ov3660_html_gz[] = { - 0x1F, 0x8B, 0x08, 0x08, 0xA3, 0xFA, 0x69, 0x5E, 0x00, 0x03, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x5F, - 0x6F, 0x76, 0x33, 0x36, 0x36, 0x30, 0x2E, 0x68, 0x74, 0x6D, 0x6C, 0x00, 0xED, 0x3D, 0x69, 0x73, - 0xDB, 0x46, 0xB2, 0xDF, 0xFD, 0x2B, 0x60, 0x24, 0x6B, 0x51, 0x65, 0x91, 0xE2, 0xAD, 0x23, 0x12, - 0xFD, 0x6C, 0x59, 0xB1, 0x53, 0x1B, 0x67, 0xBD, 0x71, 0xE2, 0x24, 0xB5, 0xB5, 0x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, 0x4D, 0xE8, 0x20, 0x0C, 0x3E, 0x8B, 0xCC, 0x42, 0x52, 0xD8, 0x42, 0xA2, 0xFE, 0xDE, 0x26, 0x58, 0x9E, 0xE0, 0x2F, 0x65, + 0xBC, 0xF8, 0xE6, 0x6B, 0xCD, 0xF5, 0x34, 0xDB, 0xBD, 0x26, 0xB8, 0x28, 0x28, 0x36, 0x90, 0x69, 0x53, 0x02, 0x01, 0x8E, 0xB0, 0x22, 0x13, 0xEE, 0x8F, 0x09, + 0x96, 0x96, 0x0F, 0x73, 0x62, 0x7C, 0x75, 0x28, 0x79, 0xAA, 0x87, 0xA3, 0x53, 0x21, 0x7B, 0xDB, 0x25, 0xF4, 0x84, 0x38, 0x19, 0x4C, 0x24, 0xCB, 0xA7, 0x9C, + 0xC7, 0xAD, 0xC0, 0x92, 0x57, 0xD6, 0x2A, 0x21, 0xC2, 0xF0, 0xF6, 0xA3, 0x95, 0xA2, 0x9C, 0x81, 0x42, 0x41, 0x86, 0x60, 0x91, 0x2C, 0x23, 0x5E, 0xB7, 0xA4, + 0x29, 0xAB, 0x1D, 0xE6, 0x68, 0x14, 0x4B, 0xE1, 0xD2, 0x68, 0x9E, 0xAD, 0x15, 0x26, 0x71, 0x36, 0xCA, 0xB1, 0xDF, 0xD9, 0xA1, 0x78, 0x14, 0x8A, 0x9D, 0x61, + 0xF6, 0x36, 0x79, 0x72, 0x76, 0xB8, 0x0C, 0x56, 0xF6, 0xE4, 0xC9, 0xFF, 0x02, 0x49, 0x60, 0xC8, 0xA8, 0x55, 0x0C, 0x01, 0x00 }; - //File: index_ov5640.html.gz, Size: 9124 #define index_ov5640_html_gz_len 9124 const uint8_t index_ov5640_html_gz[] = { - 0x1F, 0x8B, 0x08, 0x08, 0xD9, 0x6C, 0x6A, 0x5E, 0x00, 0x03, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x5F, - 0x6F, 0x76, 0x35, 0x36, 0x34, 0x30, 0x2E, 0x68, 0x74, 0x6D, 0x6C, 0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3, 0x6A, 0x96, 0xB3, 0x22, 0xB8, 0x59, 0x34, 0x58, 0x0A, 0xD6, 0x86, 0x04, 0x12, 0x4B, 0xC2, 0x26, 0xD3, + 0x18, 0x87, 0xFC, 0x99, 0xE9, 0x41, 0xEA, 0x8E, 0xEF, 0x93, 0x25, 0x8F, 0x6B, 0x61, 0x31, 0x34, 0x97, 0xBD, 0xF5, 0xAD, 0x55, 0x31, 0x71, 0x32, 0x98, 0x48, + 0x96, 0x8F, 0x39, 0x8F, 0x6B, 0xC1, 0x28, 0x6B, 0xFA, 0x5E, 0x40, 0x84, 0xE1, 0xED, 0x07, 0x2B, 0x45, 0x39, 0x03, 0xB9, 0x82, 0x0C, 0xC1, 0x22, 0x59, 0x46, + 0xBC, 0xAE, 0x49, 0x53, 0x56, 0x23, 0xC9, 0xD0, 0x28, 0x96, 0x0B, 0xA5, 0x71, 0x3E, 0x5D, 0x2B, 0x4C, 0xE2, 0x2C, 0x55, 0x67, 0xBF, 0xB3, 0xC3, 0xE0, 0xB1, + 0x39, 0x76, 0x86, 0x8B, 0x05, 0x83, 0x47, 0x67, 0x87, 0x33, 0x7F, 0x6E, 0x0D, 0x1E, 0xFD, 0x2F, 0x5E, 0x72, 0x0B, 0x89, 0x42, 0x10, 0x01, 0x00 }; diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h b/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h index 113abc506..450ef6a93 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h +++ b/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h @@ -1,209 +1,209 @@ #if defined(CAMERA_MODEL_WROVER_KIT) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 21 -#define SIOD_GPIO_NUM 26 -#define SIOC_GPIO_NUM 27 +#define XCLK_GPIO_NUM 21 +#define SIOD_GPIO_NUM 26 +#define SIOC_GPIO_NUM 27 -#define Y9_GPIO_NUM 35 -#define Y8_GPIO_NUM 34 -#define Y7_GPIO_NUM 39 -#define Y6_GPIO_NUM 36 -#define Y5_GPIO_NUM 19 -#define Y4_GPIO_NUM 18 -#define Y3_GPIO_NUM 5 -#define Y2_GPIO_NUM 4 +#define Y9_GPIO_NUM 35 +#define Y8_GPIO_NUM 34 +#define Y7_GPIO_NUM 39 +#define Y6_GPIO_NUM 36 +#define Y5_GPIO_NUM 19 +#define Y4_GPIO_NUM 18 +#define Y3_GPIO_NUM 5 +#define Y2_GPIO_NUM 4 #define VSYNC_GPIO_NUM 25 -#define HREF_GPIO_NUM 23 -#define PCLK_GPIO_NUM 22 +#define HREF_GPIO_NUM 23 +#define PCLK_GPIO_NUM 22 #elif defined(CAMERA_MODEL_ESP_EYE) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 4 -#define SIOD_GPIO_NUM 18 -#define SIOC_GPIO_NUM 23 +#define XCLK_GPIO_NUM 4 +#define SIOD_GPIO_NUM 18 +#define SIOC_GPIO_NUM 23 -#define Y9_GPIO_NUM 36 -#define Y8_GPIO_NUM 37 -#define Y7_GPIO_NUM 38 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 35 -#define Y4_GPIO_NUM 14 -#define Y3_GPIO_NUM 13 -#define Y2_GPIO_NUM 34 +#define Y9_GPIO_NUM 36 +#define Y8_GPIO_NUM 37 +#define Y7_GPIO_NUM 38 +#define Y6_GPIO_NUM 39 +#define Y5_GPIO_NUM 35 +#define Y4_GPIO_NUM 14 +#define Y3_GPIO_NUM 13 +#define Y2_GPIO_NUM 34 #define VSYNC_GPIO_NUM 5 -#define HREF_GPIO_NUM 27 -#define PCLK_GPIO_NUM 25 +#define HREF_GPIO_NUM 27 +#define PCLK_GPIO_NUM 25 #define LED_GPIO_NUM 22 #elif defined(CAMERA_MODEL_M5STACK_PSRAM) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM 15 -#define XCLK_GPIO_NUM 27 -#define SIOD_GPIO_NUM 25 -#define SIOC_GPIO_NUM 23 +#define XCLK_GPIO_NUM 27 +#define SIOD_GPIO_NUM 25 +#define SIOC_GPIO_NUM 23 -#define Y9_GPIO_NUM 19 -#define Y8_GPIO_NUM 36 -#define Y7_GPIO_NUM 18 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 5 -#define Y4_GPIO_NUM 34 -#define Y3_GPIO_NUM 35 -#define Y2_GPIO_NUM 32 +#define Y9_GPIO_NUM 19 +#define Y8_GPIO_NUM 36 +#define Y7_GPIO_NUM 18 +#define Y6_GPIO_NUM 39 +#define Y5_GPIO_NUM 5 +#define Y4_GPIO_NUM 34 +#define Y3_GPIO_NUM 35 +#define Y2_GPIO_NUM 32 #define VSYNC_GPIO_NUM 22 -#define HREF_GPIO_NUM 26 -#define PCLK_GPIO_NUM 21 +#define HREF_GPIO_NUM 26 +#define PCLK_GPIO_NUM 21 #elif defined(CAMERA_MODEL_M5STACK_V2_PSRAM) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM 15 -#define XCLK_GPIO_NUM 27 -#define SIOD_GPIO_NUM 22 -#define SIOC_GPIO_NUM 23 +#define XCLK_GPIO_NUM 27 +#define SIOD_GPIO_NUM 22 +#define SIOC_GPIO_NUM 23 -#define Y9_GPIO_NUM 19 -#define Y8_GPIO_NUM 36 -#define Y7_GPIO_NUM 18 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 5 -#define Y4_GPIO_NUM 34 -#define Y3_GPIO_NUM 35 -#define Y2_GPIO_NUM 32 +#define Y9_GPIO_NUM 19 +#define Y8_GPIO_NUM 36 +#define Y7_GPIO_NUM 18 +#define Y6_GPIO_NUM 39 +#define Y5_GPIO_NUM 5 +#define Y4_GPIO_NUM 34 +#define Y3_GPIO_NUM 35 +#define Y2_GPIO_NUM 32 #define VSYNC_GPIO_NUM 25 -#define HREF_GPIO_NUM 26 -#define PCLK_GPIO_NUM 21 +#define HREF_GPIO_NUM 26 +#define PCLK_GPIO_NUM 21 #elif defined(CAMERA_MODEL_M5STACK_WIDE) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM 15 -#define XCLK_GPIO_NUM 27 -#define SIOD_GPIO_NUM 22 -#define SIOC_GPIO_NUM 23 +#define XCLK_GPIO_NUM 27 +#define SIOD_GPIO_NUM 22 +#define SIOC_GPIO_NUM 23 -#define Y9_GPIO_NUM 19 -#define Y8_GPIO_NUM 36 -#define Y7_GPIO_NUM 18 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 5 -#define Y4_GPIO_NUM 34 -#define Y3_GPIO_NUM 35 -#define Y2_GPIO_NUM 32 +#define Y9_GPIO_NUM 19 +#define Y8_GPIO_NUM 36 +#define Y7_GPIO_NUM 18 +#define Y6_GPIO_NUM 39 +#define Y5_GPIO_NUM 5 +#define Y4_GPIO_NUM 34 +#define Y3_GPIO_NUM 35 +#define Y2_GPIO_NUM 32 #define VSYNC_GPIO_NUM 25 -#define HREF_GPIO_NUM 26 -#define PCLK_GPIO_NUM 21 +#define HREF_GPIO_NUM 26 +#define PCLK_GPIO_NUM 21 #define LED_GPIO_NUM 2 #elif defined(CAMERA_MODEL_M5STACK_ESP32CAM) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM 15 -#define XCLK_GPIO_NUM 27 -#define SIOD_GPIO_NUM 25 -#define SIOC_GPIO_NUM 23 +#define XCLK_GPIO_NUM 27 +#define SIOD_GPIO_NUM 25 +#define SIOC_GPIO_NUM 23 -#define Y9_GPIO_NUM 19 -#define Y8_GPIO_NUM 36 -#define Y7_GPIO_NUM 18 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 5 -#define Y4_GPIO_NUM 34 -#define Y3_GPIO_NUM 35 -#define Y2_GPIO_NUM 17 +#define Y9_GPIO_NUM 19 +#define Y8_GPIO_NUM 36 +#define Y7_GPIO_NUM 18 +#define Y6_GPIO_NUM 39 +#define Y5_GPIO_NUM 5 +#define Y4_GPIO_NUM 34 +#define Y3_GPIO_NUM 35 +#define Y2_GPIO_NUM 17 #define VSYNC_GPIO_NUM 22 -#define HREF_GPIO_NUM 26 -#define PCLK_GPIO_NUM 21 +#define HREF_GPIO_NUM 26 +#define PCLK_GPIO_NUM 21 #elif defined(CAMERA_MODEL_M5STACK_UNITCAM) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM 15 -#define XCLK_GPIO_NUM 27 -#define SIOD_GPIO_NUM 25 -#define SIOC_GPIO_NUM 23 +#define XCLK_GPIO_NUM 27 +#define SIOD_GPIO_NUM 25 +#define SIOC_GPIO_NUM 23 -#define Y9_GPIO_NUM 19 -#define Y8_GPIO_NUM 36 -#define Y7_GPIO_NUM 18 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 5 -#define Y4_GPIO_NUM 34 -#define Y3_GPIO_NUM 35 -#define Y2_GPIO_NUM 32 +#define Y9_GPIO_NUM 19 +#define Y8_GPIO_NUM 36 +#define Y7_GPIO_NUM 18 +#define Y6_GPIO_NUM 39 +#define Y5_GPIO_NUM 5 +#define Y4_GPIO_NUM 34 +#define Y3_GPIO_NUM 35 +#define Y2_GPIO_NUM 32 #define VSYNC_GPIO_NUM 22 -#define HREF_GPIO_NUM 26 -#define PCLK_GPIO_NUM 21 +#define HREF_GPIO_NUM 26 +#define PCLK_GPIO_NUM 21 #elif defined(CAMERA_MODEL_AI_THINKER) -#define PWDN_GPIO_NUM 32 +#define PWDN_GPIO_NUM 32 #define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 0 -#define SIOD_GPIO_NUM 26 -#define SIOC_GPIO_NUM 27 +#define XCLK_GPIO_NUM 0 +#define SIOD_GPIO_NUM 26 +#define SIOC_GPIO_NUM 27 -#define Y9_GPIO_NUM 35 -#define Y8_GPIO_NUM 34 -#define Y7_GPIO_NUM 39 -#define Y6_GPIO_NUM 36 -#define Y5_GPIO_NUM 21 -#define Y4_GPIO_NUM 19 -#define Y3_GPIO_NUM 18 -#define Y2_GPIO_NUM 5 +#define Y9_GPIO_NUM 35 +#define Y8_GPIO_NUM 34 +#define Y7_GPIO_NUM 39 +#define Y6_GPIO_NUM 36 +#define Y5_GPIO_NUM 21 +#define Y4_GPIO_NUM 19 +#define Y3_GPIO_NUM 18 +#define Y2_GPIO_NUM 5 #define VSYNC_GPIO_NUM 25 -#define HREF_GPIO_NUM 23 -#define PCLK_GPIO_NUM 22 +#define HREF_GPIO_NUM 23 +#define PCLK_GPIO_NUM 22 // 4 for flash led or 33 for normal led -#define LED_GPIO_NUM 4 +#define LED_GPIO_NUM 4 #elif defined(CAMERA_MODEL_TTGO_T_JOURNAL) -#define PWDN_GPIO_NUM 0 +#define PWDN_GPIO_NUM 0 #define RESET_GPIO_NUM 15 -#define XCLK_GPIO_NUM 27 -#define SIOD_GPIO_NUM 25 -#define SIOC_GPIO_NUM 23 +#define XCLK_GPIO_NUM 27 +#define SIOD_GPIO_NUM 25 +#define SIOC_GPIO_NUM 23 -#define Y9_GPIO_NUM 19 -#define Y8_GPIO_NUM 36 -#define Y7_GPIO_NUM 18 -#define Y6_GPIO_NUM 39 -#define Y5_GPIO_NUM 5 -#define Y4_GPIO_NUM 34 -#define Y3_GPIO_NUM 35 -#define Y2_GPIO_NUM 17 +#define Y9_GPIO_NUM 19 +#define Y8_GPIO_NUM 36 +#define Y7_GPIO_NUM 18 +#define Y6_GPIO_NUM 39 +#define Y5_GPIO_NUM 5 +#define Y4_GPIO_NUM 34 +#define Y3_GPIO_NUM 35 +#define Y2_GPIO_NUM 17 #define VSYNC_GPIO_NUM 22 -#define HREF_GPIO_NUM 26 -#define PCLK_GPIO_NUM 21 +#define HREF_GPIO_NUM 26 +#define PCLK_GPIO_NUM 21 #elif defined(CAMERA_MODEL_XIAO_ESP32S3) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 10 -#define SIOD_GPIO_NUM 40 -#define SIOC_GPIO_NUM 39 +#define XCLK_GPIO_NUM 10 +#define SIOD_GPIO_NUM 40 +#define SIOC_GPIO_NUM 39 -#define Y9_GPIO_NUM 48 -#define Y8_GPIO_NUM 11 -#define Y7_GPIO_NUM 12 -#define Y6_GPIO_NUM 14 -#define Y5_GPIO_NUM 16 -#define Y4_GPIO_NUM 18 -#define Y3_GPIO_NUM 17 -#define Y2_GPIO_NUM 15 +#define Y9_GPIO_NUM 48 +#define Y8_GPIO_NUM 11 +#define Y7_GPIO_NUM 12 +#define Y6_GPIO_NUM 14 +#define Y5_GPIO_NUM 16 +#define Y4_GPIO_NUM 18 +#define Y3_GPIO_NUM 17 +#define Y2_GPIO_NUM 15 #define VSYNC_GPIO_NUM 38 -#define HREF_GPIO_NUM 47 -#define PCLK_GPIO_NUM 13 +#define HREF_GPIO_NUM 47 +#define PCLK_GPIO_NUM 13 #elif defined(CAMERA_MODEL_ESP32_CAM_BOARD) // The 18 pin header on the board has Y5 and Y3 swapped #define USE_BOARD_HEADER 0 -#define PWDN_GPIO_NUM 32 -#define RESET_GPIO_NUM 33 -#define XCLK_GPIO_NUM 4 -#define SIOD_GPIO_NUM 18 -#define SIOC_GPIO_NUM 23 +#define PWDN_GPIO_NUM 32 +#define RESET_GPIO_NUM 33 +#define XCLK_GPIO_NUM 4 +#define SIOD_GPIO_NUM 18 +#define SIOC_GPIO_NUM 23 #define Y9_GPIO_NUM 36 #define Y8_GPIO_NUM 19 @@ -220,38 +220,38 @@ #else #define Y3_GPIO_NUM 13 #endif -#define Y2_GPIO_NUM 34 +#define Y2_GPIO_NUM 34 #define VSYNC_GPIO_NUM 5 -#define HREF_GPIO_NUM 27 -#define PCLK_GPIO_NUM 25 +#define HREF_GPIO_NUM 27 +#define PCLK_GPIO_NUM 25 #elif defined(CAMERA_MODEL_ESP32S3_CAM_LCD) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 40 -#define SIOD_GPIO_NUM 17 -#define SIOC_GPIO_NUM 18 +#define XCLK_GPIO_NUM 40 +#define SIOD_GPIO_NUM 17 +#define SIOC_GPIO_NUM 18 -#define Y9_GPIO_NUM 39 -#define Y8_GPIO_NUM 41 -#define Y7_GPIO_NUM 42 -#define Y6_GPIO_NUM 12 -#define Y5_GPIO_NUM 3 -#define Y4_GPIO_NUM 14 -#define Y3_GPIO_NUM 47 -#define Y2_GPIO_NUM 13 +#define Y9_GPIO_NUM 39 +#define Y8_GPIO_NUM 41 +#define Y7_GPIO_NUM 42 +#define Y6_GPIO_NUM 12 +#define Y5_GPIO_NUM 3 +#define Y4_GPIO_NUM 14 +#define Y3_GPIO_NUM 47 +#define Y2_GPIO_NUM 13 #define VSYNC_GPIO_NUM 21 -#define HREF_GPIO_NUM 38 -#define PCLK_GPIO_NUM 11 +#define HREF_GPIO_NUM 38 +#define PCLK_GPIO_NUM 11 #elif defined(CAMERA_MODEL_ESP32S2_CAM_BOARD) // The 18 pin header on the board has Y5 and Y3 swapped #define USE_BOARD_HEADER 0 -#define PWDN_GPIO_NUM 1 -#define RESET_GPIO_NUM 2 -#define XCLK_GPIO_NUM 42 -#define SIOD_GPIO_NUM 41 -#define SIOC_GPIO_NUM 18 +#define PWDN_GPIO_NUM 1 +#define RESET_GPIO_NUM 2 +#define XCLK_GPIO_NUM 42 +#define SIOD_GPIO_NUM 41 +#define SIOC_GPIO_NUM 18 #define Y9_GPIO_NUM 16 #define Y8_GPIO_NUM 39 @@ -268,17 +268,17 @@ #else #define Y3_GPIO_NUM 12 #endif -#define Y2_GPIO_NUM 14 +#define Y2_GPIO_NUM 14 #define VSYNC_GPIO_NUM 38 -#define HREF_GPIO_NUM 4 -#define PCLK_GPIO_NUM 3 +#define HREF_GPIO_NUM 4 +#define PCLK_GPIO_NUM 3 #elif defined(CAMERA_MODEL_ESP32S3_EYE) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 15 -#define SIOD_GPIO_NUM 4 -#define SIOC_GPIO_NUM 5 +#define XCLK_GPIO_NUM 15 +#define SIOD_GPIO_NUM 4 +#define SIOC_GPIO_NUM 5 #define Y2_GPIO_NUM 11 #define Y3_GPIO_NUM 9 @@ -290,27 +290,27 @@ #define Y9_GPIO_NUM 16 #define VSYNC_GPIO_NUM 6 -#define HREF_GPIO_NUM 7 -#define PCLK_GPIO_NUM 13 +#define HREF_GPIO_NUM 7 +#define PCLK_GPIO_NUM 13 #elif defined(CAMERA_MODEL_DFRobot_FireBeetle2_ESP32S3) || defined(CAMERA_MODEL_DFRobot_Romeo_ESP32S3) -#define PWDN_GPIO_NUM -1 +#define PWDN_GPIO_NUM -1 #define RESET_GPIO_NUM -1 -#define XCLK_GPIO_NUM 45 -#define SIOD_GPIO_NUM 1 -#define SIOC_GPIO_NUM 2 +#define XCLK_GPIO_NUM 45 +#define SIOD_GPIO_NUM 1 +#define SIOC_GPIO_NUM 2 -#define Y9_GPIO_NUM 48 -#define Y8_GPIO_NUM 46 -#define Y7_GPIO_NUM 8 -#define Y6_GPIO_NUM 7 -#define Y5_GPIO_NUM 4 -#define Y4_GPIO_NUM 41 -#define Y3_GPIO_NUM 40 -#define Y2_GPIO_NUM 39 +#define Y9_GPIO_NUM 48 +#define Y8_GPIO_NUM 46 +#define Y7_GPIO_NUM 8 +#define Y6_GPIO_NUM 7 +#define Y5_GPIO_NUM 4 +#define Y4_GPIO_NUM 41 +#define Y3_GPIO_NUM 40 +#define Y2_GPIO_NUM 39 #define VSYNC_GPIO_NUM 6 -#define HREF_GPIO_NUM 42 -#define PCLK_GPIO_NUM 5 +#define HREF_GPIO_NUM 42 +#define PCLK_GPIO_NUM 5 #else #error "Camera model not selected" diff --git a/libraries/ESP32/examples/DeepSleep/ExternalWakeUp/ExternalWakeUp.ino b/libraries/ESP32/examples/DeepSleep/ExternalWakeUp/ExternalWakeUp.ino index 3ac9c727d..fb4228031 100644 --- a/libraries/ESP32/examples/DeepSleep/ExternalWakeUp/ExternalWakeUp.ino +++ b/libraries/ESP32/examples/DeepSleep/ExternalWakeUp/ExternalWakeUp.ino @@ -35,12 +35,12 @@ void print_wakeup_reason() { wakeup_reason = esp_sleep_get_wakeup_cause(); switch (wakeup_reason) { - case ESP_SLEEP_WAKEUP_EXT0: Serial.println("Wakeup caused by external signal using RTC_IO"); break; - case ESP_SLEEP_WAKEUP_EXT1: Serial.println("Wakeup caused by external signal using RTC_CNTL"); break; - case ESP_SLEEP_WAKEUP_TIMER: Serial.println("Wakeup caused by timer"); break; + case ESP_SLEEP_WAKEUP_EXT0: Serial.println("Wakeup caused by external signal using RTC_IO"); break; + case ESP_SLEEP_WAKEUP_EXT1: Serial.println("Wakeup caused by external signal using RTC_CNTL"); break; + case ESP_SLEEP_WAKEUP_TIMER: Serial.println("Wakeup caused by timer"); break; case ESP_SLEEP_WAKEUP_TOUCHPAD: Serial.println("Wakeup caused by touchpad"); break; - case ESP_SLEEP_WAKEUP_ULP: Serial.println("Wakeup caused by ULP program"); break; - default: Serial.printf("Wakeup was not caused by deep sleep: %d\n", wakeup_reason); break; + case ESP_SLEEP_WAKEUP_ULP: Serial.println("Wakeup caused by ULP program"); break; + default: Serial.printf("Wakeup was not caused by deep sleep: %d\n", wakeup_reason); break; } } diff --git a/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/SmoothBlink_ULP_Code.ino b/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/SmoothBlink_ULP_Code.ino index 654456a39..5b21a2115 100644 --- a/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/SmoothBlink_ULP_Code.ino +++ b/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/SmoothBlink_ULP_Code.ino @@ -12,7 +12,7 @@ // RTC Memory used for ULP internal variable and Sketch interfacing #define RTC_dutyMeter 0 -#define RTC_dir 4 +#define RTC_dir 4 #define RTC_fadeDelay 12 // *fadeCycleDelay is used to pass values to ULP and change its behavior uint32_t *fadeCycleDelay = &RTC_SLOW_MEM[RTC_fadeDelay]; @@ -23,8 +23,7 @@ RTC_DATA_ATTR uint32_t ULP_Started = 0; // 0 or 1 //Time-to-Sleep #define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */ -#define TIME_TO_SLEEP 5 /* Time ESP32 will go to sleep (in microseconds); multiplied by above conversion to achieve seconds*/ - +#define TIME_TO_SLEEP 5 /* Time ESP32 will go to sleep (in microseconds); multiplied by above conversion to achieve seconds*/ void ulp_setup() { if (ULP_Started) { @@ -138,7 +137,6 @@ void ulp_setup() { ulp_run(ULP_START_OFFSET); } - void setup() { Serial.begin(115200); while (!Serial) {} // wait for Serial to start @@ -159,7 +157,6 @@ void setup() { // From this point on, no code is executed in DEEP SLEEP mode } - void loop() { // It never reaches this code because it enters in Deep Sleep mode at the end of setup() } diff --git a/libraries/ESP32/examples/DeepSleep/TimerWakeUp/TimerWakeUp.ino b/libraries/ESP32/examples/DeepSleep/TimerWakeUp/TimerWakeUp.ino index 47af6b2ef..a6e88557b 100644 --- a/libraries/ESP32/examples/DeepSleep/TimerWakeUp/TimerWakeUp.ino +++ b/libraries/ESP32/examples/DeepSleep/TimerWakeUp/TimerWakeUp.ino @@ -20,7 +20,7 @@ Pranav Cherukupalli */ #define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */ -#define TIME_TO_SLEEP 5 /* Time ESP32 will go to sleep (in seconds) */ +#define TIME_TO_SLEEP 5 /* Time ESP32 will go to sleep (in seconds) */ RTC_DATA_ATTR int bootCount = 0; @@ -34,12 +34,12 @@ void print_wakeup_reason() { wakeup_reason = esp_sleep_get_wakeup_cause(); switch (wakeup_reason) { - case ESP_SLEEP_WAKEUP_EXT0: Serial.println("Wakeup caused by external signal using RTC_IO"); break; - case ESP_SLEEP_WAKEUP_EXT1: Serial.println("Wakeup caused by external signal using RTC_CNTL"); break; - case ESP_SLEEP_WAKEUP_TIMER: Serial.println("Wakeup caused by timer"); break; + case ESP_SLEEP_WAKEUP_EXT0: Serial.println("Wakeup caused by external signal using RTC_IO"); break; + case ESP_SLEEP_WAKEUP_EXT1: Serial.println("Wakeup caused by external signal using RTC_CNTL"); break; + case ESP_SLEEP_WAKEUP_TIMER: Serial.println("Wakeup caused by timer"); break; case ESP_SLEEP_WAKEUP_TOUCHPAD: Serial.println("Wakeup caused by touchpad"); break; - case ESP_SLEEP_WAKEUP_ULP: Serial.println("Wakeup caused by ULP program"); break; - default: Serial.printf("Wakeup was not caused by deep sleep: %d\n", wakeup_reason); break; + case ESP_SLEEP_WAKEUP_ULP: Serial.println("Wakeup caused by ULP program"); break; + default: Serial.printf("Wakeup was not caused by deep sleep: %d\n", wakeup_reason); break; } } diff --git a/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino b/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino index 6b7419d5f..5aacf1baa 100644 --- a/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino +++ b/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino @@ -32,12 +32,12 @@ void print_wakeup_reason() { wakeup_reason = esp_sleep_get_wakeup_cause(); switch (wakeup_reason) { - case ESP_SLEEP_WAKEUP_EXT0: Serial.println("Wakeup caused by external signal using RTC_IO"); break; - case ESP_SLEEP_WAKEUP_EXT1: Serial.println("Wakeup caused by external signal using RTC_CNTL"); break; - case ESP_SLEEP_WAKEUP_TIMER: Serial.println("Wakeup caused by timer"); break; + case ESP_SLEEP_WAKEUP_EXT0: Serial.println("Wakeup caused by external signal using RTC_IO"); break; + case ESP_SLEEP_WAKEUP_EXT1: Serial.println("Wakeup caused by external signal using RTC_CNTL"); break; + case ESP_SLEEP_WAKEUP_TIMER: Serial.println("Wakeup caused by timer"); break; case ESP_SLEEP_WAKEUP_TOUCHPAD: Serial.println("Wakeup caused by touchpad"); break; - case ESP_SLEEP_WAKEUP_ULP: Serial.println("Wakeup caused by ULP program"); break; - default: Serial.printf("Wakeup was not caused by deep sleep: %d\n", wakeup_reason); break; + case ESP_SLEEP_WAKEUP_ULP: Serial.println("Wakeup caused by ULP program"); break; + default: Serial.printf("Wakeup was not caused by deep sleep: %d\n", wakeup_reason); break; } } @@ -50,16 +50,16 @@ void print_wakeup_touchpad() { #if CONFIG_IDF_TARGET_ESP32 switch (touchPin) { - case 0: Serial.println("Touch detected on GPIO 4"); break; - case 1: Serial.println("Touch detected on GPIO 0"); break; - case 2: Serial.println("Touch detected on GPIO 2"); break; - case 3: Serial.println("Touch detected on GPIO 15"); break; - case 4: Serial.println("Touch detected on GPIO 13"); break; - case 5: Serial.println("Touch detected on GPIO 12"); break; - case 6: Serial.println("Touch detected on GPIO 14"); break; - case 7: Serial.println("Touch detected on GPIO 27"); break; - case 8: Serial.println("Touch detected on GPIO 33"); break; - case 9: Serial.println("Touch detected on GPIO 32"); break; + case 0: Serial.println("Touch detected on GPIO 4"); break; + case 1: Serial.println("Touch detected on GPIO 0"); break; + case 2: Serial.println("Touch detected on GPIO 2"); break; + case 3: Serial.println("Touch detected on GPIO 15"); break; + case 4: Serial.println("Touch detected on GPIO 13"); break; + case 5: Serial.println("Touch detected on GPIO 12"); break; + case 6: Serial.println("Touch detected on GPIO 14"); break; + case 7: Serial.println("Touch detected on GPIO 27"); break; + case 8: Serial.println("Touch detected on GPIO 33"); break; + case 9: Serial.println("Touch detected on GPIO 32"); break; default: Serial.println("Wakeup not by touchpad"); break; } #else diff --git a/libraries/ESP32/examples/FreeRTOS/Mutex/Mutex.ino b/libraries/ESP32/examples/FreeRTOS/Mutex/Mutex.ino index ab55194da..9ace13a19 100644 --- a/libraries/ESP32/examples/FreeRTOS/Mutex/Mutex.ino +++ b/libraries/ESP32/examples/FreeRTOS/Mutex/Mutex.ino @@ -17,7 +17,9 @@ void Task(void *pvParameters); void setup() { // Initialize serial communication at 115200 bits per second: Serial.begin(115200); - while (!Serial) delay(100); + while (!Serial) { + delay(100); + } Serial.printf(" Task 0 | Task 1\n"); #ifdef USE_MUTEX @@ -53,8 +55,7 @@ void setup() { // Now the task scheduler, which takes over control of scheduling individual tasks, is automatically started. } -void loop() { -} +void loop() {} /*--------------------------------------------------*/ /*---------------------- Tasks ---------------------*/ @@ -96,8 +97,8 @@ void Task(void *pvParameters) { // This is a task. } else { // We could not obtain the semaphore and can therefore not access the shared resource safely. } // mutex take - } // sanity check + } // sanity check #endif delay(10); // Allow other task to be scheduled - } // Infinite loop + } // Infinite loop } diff --git a/libraries/ESP32/examples/FreeRTOS/Queue/Queue.ino b/libraries/ESP32/examples/FreeRTOS/Queue/Queue.ino index 3e3ab0f42..b617bdd74 100644 --- a/libraries/ESP32/examples/FreeRTOS/Queue/Queue.ino +++ b/libraries/ESP32/examples/FreeRTOS/Queue/Queue.ino @@ -24,7 +24,9 @@ typedef struct { void setup() { // Initialize serial communication at 115200 bits per second: Serial.begin(115200); - while (!Serial) { delay(10); } + while (!Serial) { + delay(10); + } // Create the queue which will have number of elements, each of size `message_t` and pass the address to . QueueHandle = xQueueCreate(QueueElementSize, sizeof(message_t)); @@ -32,7 +34,9 @@ void setup() { // Check if the queue was successfully created if (QueueHandle == NULL) { Serial.println("Queue could not be created. Halt."); - while (1) delay(1000); // Halt at this point as is not possible to continue + while (1) { + delay(1000); // Halt at this point as is not possible to continue + } } // Set up two tasks to run independently. @@ -59,7 +63,11 @@ void setup() { ); // Now the task scheduler, which takes over control of scheduling individual tasks, is automatically started. - Serial.printf("\nAnything you write will return as echo.\nMaximum line length is %d characters (+ terminating '0').\nAnything longer will be sent as a separate line.\n\n", MAX_LINE_LENGTH - 1); + Serial.printf( + "\nAnything you write will return as echo.\nMaximum line length is %d characters (+ terminating '0').\nAnything longer will be sent as a separate " + "line.\n\n", + MAX_LINE_LENGTH - 1 + ); } void loop() { @@ -87,7 +95,7 @@ void TaskWriteToSerial(void *pvParameters) { // This is a task. Serial.println("The `TaskWriteToSerial` was unable to receive data from the Queue"); } } // Sanity check - } // Infinite loop + } // Infinite loop } void TaskReadFromSerial(void *pvParameters) { // This is a task. @@ -116,9 +124,9 @@ void TaskReadFromSerial(void *pvParameters) { // This is a task. // write into the same queue it can fill-up between the test and actual send attempt Serial.println("The `TaskReadFromSerial` was unable to send data into the Queue"); } // Queue send check - } // Queue sanity check + } // Queue sanity check } else { delay(100); // Allow other tasks to run when there is nothing to read - } // Serial buffer check - } // Infinite loop + } // Serial buffer check + } // Infinite loop } diff --git a/libraries/ESP32/examples/FreeRTOS/Semaphore/Semaphore.ino b/libraries/ESP32/examples/FreeRTOS/Semaphore/Semaphore.ino index a6a5d58ae..66f43f942 100644 --- a/libraries/ESP32/examples/FreeRTOS/Semaphore/Semaphore.ino +++ b/libraries/ESP32/examples/FreeRTOS/Semaphore/Semaphore.ino @@ -36,7 +36,9 @@ void warehouse_worker_task(void *pvParameters) { void setup() { Serial.begin(115200); - while (!Serial) { delay(100); } + while (!Serial) { + delay(100); + } // Create the semaphore package_delivered_semaphore = xSemaphoreCreateCounting(10, 0); diff --git a/libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino b/libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino index 2d6c428a6..2ea0ed2a4 100644 --- a/libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino +++ b/libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino @@ -12,7 +12,6 @@ * This is completely normal and is not to be considered a fault. */ - #include #include @@ -21,8 +20,7 @@ class Button { public: - Button(uint8_t reqPin) - : PIN(reqPin) { + Button(uint8_t reqPin) : PIN(reqPin) { pinMode(PIN, INPUT_PULLUP); }; @@ -58,7 +56,9 @@ Button button2(BUTTON2); void setup() { Serial.begin(115200); - while (!Serial) delay(10); + while (!Serial) { + delay(10); + } Serial.println("Starting Functional Interrupt example."); button1.begin(); button2.begin(); diff --git a/libraries/ESP32/examples/GPIO/FunctionalInterruptStruct/FunctionalInterruptStruct.ino b/libraries/ESP32/examples/GPIO/FunctionalInterruptStruct/FunctionalInterruptStruct.ino index 6131ab267..1b4d549c5 100644 --- a/libraries/ESP32/examples/GPIO/FunctionalInterruptStruct/FunctionalInterruptStruct.ino +++ b/libraries/ESP32/examples/GPIO/FunctionalInterruptStruct/FunctionalInterruptStruct.ino @@ -9,28 +9,28 @@ struct Button { volatile int pressed; }; -void isr(void* param) { - struct Button* button = (struct Button*)param; +void isr(void *param) { + struct Button *button = (struct Button *)param; button->numberKeyPresses = button->numberKeyPresses + 1; button->pressed = 1; } -void checkPressed(struct Button* button) { +void checkPressed(struct Button *button) { if (button->pressed) { Serial.printf("Button on pin %u has been pressed %lu times\n", button->PIN, button->numberKeyPresses); button->pressed = 0; } } -struct Button button1 = { BUTTON1, 0, 0 }; -struct Button button2 = { BUTTON2, 0, 0 }; +struct Button button1 = {BUTTON1, 0, 0}; +struct Button button2 = {BUTTON2, 0, 0}; void setup() { Serial.begin(115200); pinMode(button1.PIN, INPUT_PULLUP); pinMode(button2.PIN, INPUT_PULLUP); - attachInterruptArg(button1.PIN, isr, (void*)&button1, FALLING); - attachInterruptArg(button2.PIN, isr, (void*)&button2, FALLING); + attachInterruptArg(button1.PIN, isr, (void *)&button1, FALLING); + attachInterruptArg(button2.PIN, isr, (void *)&button2, FALLING); } void loop() { diff --git a/libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino b/libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino index 942eae68d..2e9417622 100644 --- a/libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino +++ b/libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino @@ -6,11 +6,11 @@ struct Button { bool pressed; }; -Button button1 = { 23, 0, false }; -Button button2 = { 18, 0, false }; +Button button1 = {23, 0, false}; +Button button2 = {18, 0, false}; -void ARDUINO_ISR_ATTR isr(void* arg) { - Button* s = static_cast(arg); +void ARDUINO_ISR_ATTR isr(void *arg) { + Button *s = static_cast