Compare commits

...

33 Commits

Author SHA1 Message Date
b0e896e9ae IDF release/v3.3 cd59d107b (#4708)
Co-authored-by: me-no-dev <me-no-dev@github.com>
2021-01-12 15:24:34 +02:00
08f4665775 Change fetch depth for release so that history can be fetched 2021-01-12 15:09:28 +02:00
2452c1fb53 IDF release/v3.3 71df1f742
esp-face: master 420fc7e
esp32-camera: master 0107093
2021-01-11 14:20:02 +02:00
5f98370707 Add IP101 support (#4620) 2021-01-11 12:00:35 +02:00
81b9130d8d BluetoothSerial SSP Authentication with callbacks (#4634)
Added authentication callbacks and example, resolves #4622.
2021-01-11 11:58:15 +02:00
434d02c49f BLERemoteCharacteristic::registerForNotify: Permit event registration without updating descriptor. (#4659) 2021-01-11 11:44:38 +02:00
15db297130 availableForWrite (#4664)
added availableForWrite to Print.h to make compatible with Arduino Print.h
2021-01-11 11:43:10 +02:00
fe093a5e35 Sanitize compiler warning in BLERemoteService.cpp (issue #4660) (#4669)
Compiler complains on unused parameter pCharacteristicMap:

framework-arduinoespressif32\libraries\BLE\src\BLERemoteService.cpp: In member function 'void BLERemoteService::getCharacteristics(std::map<short unsigned int, BLERemoteCharacteristic*>*)':
\framework-arduinoespressif32\libraries\BLE\src\BLERemoteService.cpp:246:89: warning: parameter 'pCharacteristicMap' set but not used [-Wunused-but-set-parameter]
 void BLERemoteService::getCharacteristics(std::map<uint16_t, BLERemoteCharacteristic*>* pCharacteristicMap) {
2021-01-11 11:42:32 +02:00
a0ef17a9dd Use non-deprecated DPORT values in SPI HAL (#4682) 2021-01-11 11:40:18 +02:00
be77bd4e27 Resolve crash with timer interrupt functions called from ISR (#4684) 2021-01-11 11:39:39 +02:00
ef99cd7fe7 Add WiFiClientSecure::setInsecure() to equalize API with ESP8266 (#4648) 2020-12-21 01:09:37 +02:00
b05bdf6904 Update esptool for Big Sur 2020-12-07 10:19:55 +02:00
442c63a4c6 IDF release/v3.3 b4c075169 (#4604)
esp-face: master 420fc7e
esp32-camera: master 0107093
2020-12-07 10:03:16 +02:00
d1a4b3b822 Add loop task stack size config to Kconfig
Follow up for https://github.com/espressif/arduino-esp32/pull/4564
2020-12-02 11:56:45 +02:00
7d5bf9e385 [1.0.5] Make looptask stack size configurable (#4564)
Added guarded define to set the stacksize on the main looptask.
Advantage of this is that build_flags can be used to provide a different value for the stack size should it be neccessary
default behaviour is unaffected
2020-12-02 11:52:04 +02:00
aac26a4d1e [1.0.5] Update Heltec ESP32 series boards definition (#4577) 2020-12-02 11:50:12 +02:00
804c221499 Update .gitignore 2020-12-01 22:20:06 +02:00
3236358ded Update WiFiClient.cpp (#4573)
Replace (depricated) bzero, bcopy with memset and memcpy.
2020-12-01 16:35:12 +02:00
82e71f9b50 Update ssl_client.cpp (#4574)
Replace (depricated) bzero with memset.
2020-12-01 16:34:36 +02:00
2e12392721 IDF release/v3.3 c33fc7821
esp-face: master 420fc7e
esp32-camera: master 0107093
2020-12-01 16:22:18 +02:00
6b0114366b Fix logic in SPIClass::setHwCs. (#4559)
Fixes #4558
2020-11-23 14:22:43 +02:00
18832bb418 M5TimerCam: add LED_BUILTIN & SS/MOSI/MISO/SCK (#4560) 2020-11-23 14:21:58 +02:00
97dcea2b99 Update library.properties (#4563)
Set the category to silence this warning in the Arduino IDE:
```
WARNING: Category '' in library WiFiProv is not valid. Setting to 'Uncategorized'
```
2020-11-23 14:21:34 +02:00
dcff2e9774 Separate Provisioning library from WiFi library (#4547) 2020-11-19 00:12:16 +02:00
6d256b6454 IDF release/v3.3 68b237fe5 with Disable IRAM optimisation for WiFi 2020-11-16 13:06:50 +02:00
f6bf0f7aa2 IDF release/v3.3 68b237fe5 2020-11-16 12:44:07 +02:00
a59eb5d51e Merge branch 'master' into idf-release/v3.3 2020-11-16 12:09:23 +02:00
cee7b4237c Merge branch 'master' into idf-release/v3.3 2020-11-15 12:02:51 +02:00
954df2fc3e Disable IRAM optimization for WiFi 2020-11-15 11:56:01 +02:00
cecef8e930 IDF release/v3.3 68b237fe5 2020-11-14 00:33:27 +00:00
a8e99baeab Merge branch 'master' into idf-release/v3.3 2020-11-12 21:29:57 +02:00
7494c4e76d IDF release/v3.3 44ec7972b 2020-11-08 00:36:32 +00:00
c1951670d1 IDF release/v3.3 66d3783c8 2020-11-06 18:15:23 +00:00
159 changed files with 1478 additions and 666 deletions

View File

@ -11,6 +11,8 @@ jobs:
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
with:
fetch-depth: 0
- uses: actions/setup-python@v1 - uses: actions/setup-python@v1
with: with:
python-version: '3.x' python-version: '3.x'

5
.gitignore vendored
View File

@ -1,9 +1,10 @@
tools/xtensa-esp32-elf tools/xtensa-esp32-elf
tools/xtensa-esp32s2-elf
tools/dist tools/dist
tools/esptool tools/esptool
tools/esptool.exe tools/esptool.exe
tools/mkspiffs/mkspiffs tools/mkspiffs
tools/mkspiffs/mkspiffs.exe tools/mklittlefs
.DS_Store .DS_Store
#Ignore files built by Visual Studio/Visual Micro #Ignore files built by Visual Studio/Visual Micro

View File

@ -72,11 +72,11 @@ set(LIBRARY_SRCS
libraries/WiFi/src/WiFi.cpp libraries/WiFi/src/WiFi.cpp
libraries/WiFi/src/WiFiGeneric.cpp libraries/WiFi/src/WiFiGeneric.cpp
libraries/WiFi/src/WiFiMulti.cpp libraries/WiFi/src/WiFiMulti.cpp
libraries/WiFi/src/WiFiProv.cpp
libraries/WiFi/src/WiFiScan.cpp libraries/WiFi/src/WiFiScan.cpp
libraries/WiFi/src/WiFiServer.cpp libraries/WiFi/src/WiFiServer.cpp
libraries/WiFi/src/WiFiSTA.cpp libraries/WiFi/src/WiFiSTA.cpp
libraries/WiFi/src/WiFiUdp.cpp libraries/WiFi/src/WiFiUdp.cpp
libraries/WiFiProv/src/WiFiProv.cpp
libraries/Wire/src/Wire.cpp libraries/Wire/src/Wire.cpp
) )
@ -202,6 +202,7 @@ set(COMPONENT_ADD_INCLUDEDIRS
libraries/WebServer/src libraries/WebServer/src
libraries/WiFiClientSecure/src libraries/WiFiClientSecure/src
libraries/WiFi/src libraries/WiFi/src
libraries/WiFiProv/src
libraries/Wire/src libraries/Wire/src
) )

View File

@ -40,6 +40,12 @@ config ARDUINO_RUNNING_CORE
default 1 if ARDUINO_RUN_CORE1 default 1 if ARDUINO_RUN_CORE1
default -1 if ARDUINO_RUN_NO_AFFINITY default -1 if ARDUINO_RUN_NO_AFFINITY
config ARDUINO_LOOP_STACK_SIZE
int "Loop thread stack size"
default 8192
help
Amount of stack available for the Arduino task.
choice ARDUINO_EVENT_RUNNING_CORE choice ARDUINO_EVENT_RUNNING_CORE
bool "Core on which Arduino's event handler is running" bool "Core on which Arduino's event handler is running"
default ARDUINO_EVENT_RUN_CORE1 default ARDUINO_EVENT_RUN_CORE1

View File

@ -7,6 +7,8 @@ menu.PartitionScheme=Partition Scheme
menu.DebugLevel=Core Debug Level menu.DebugLevel=Core Debug Level
menu.PSRAM=PSRAM menu.PSRAM=PSRAM
menu.Revision=Board Revision menu.Revision=Board Revision
menu.LORAWAN_REGION=LoRaWan Region
menu.LoRaWanDebugLevel=LoRaWan Debug Level
############################################################## ##############################################################
### DO NOT PUT BOARDS ABOVE THE OFFICIAL ESPRESSIF BOARDS! ### ### DO NOT PUT BOARDS ABOVE THE OFFICIAL ESPRESSIF BOARDS! ###
@ -3073,74 +3075,29 @@ heltec_wifi_kit_32.serial.disableRTS=true
heltec_wifi_kit_32.build.mcu=esp32 heltec_wifi_kit_32.build.mcu=esp32
heltec_wifi_kit_32.build.core=esp32 heltec_wifi_kit_32.build.core=esp32
heltec_wifi_kit_32.build.variant=heltec_wifi_kit_32 heltec_wifi_kit_32.build.variant=heltec_wifi_kit_32
heltec_wifi_kit_32.build.board=HELTEC_WIFI_KIT_32 heltec_wifi_kit_32.build.board=heltec_wifi_kit_32
heltec_wifi_kit_32.build.f_cpu=240000000L heltec_wifi_kit_32.build.f_cpu=240000000L
heltec_wifi_kit_32.build.flash_size=4MB heltec_wifi_kit_32.build.flash_size=4MB
heltec_wifi_kit_32.build.flash_freq=40m heltec_wifi_kit_32.build.flash_freq=80m
heltec_wifi_kit_32.build.flash_mode=dio heltec_wifi_kit_32.build.flash_mode=dio
heltec_wifi_kit_32.build.boot=dio heltec_wifi_kit_32.build.boot=dio
heltec_wifi_kit_32.build.partitions=default heltec_wifi_kit_32.build.partitions=default
heltec_wifi_kit_32.build.defines= heltec_wifi_kit_32.build.defines=
heltec_wifi_kit_32.build.band=LoRaWAN_NONE
heltec_wifi_kit_32.build.LoRaWanDebugLevel=0
heltec_wifi_kit_32.menu.PSRAM.disabled=Disabled heltec_wifi_kit_32.menu.PSRAM.disabled=Disabled
heltec_wifi_kit_32.menu.PSRAM.disabled.build.defines= heltec_wifi_kit_32.menu.PSRAM.disabled.build.defines=
heltec_wifi_kit_32.menu.PSRAM.enabled=Enabled heltec_wifi_kit_32.menu.PSRAM.enabled=Enabled
heltec_wifi_kit_32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue heltec_wifi_kit_32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
heltec_wifi_kit_32.menu.PartitionScheme.default=Default
heltec_wifi_kit_32.menu.PartitionScheme.default.build.partitions=default
heltec_wifi_kit_32.menu.PartitionScheme.minimal=Minimal (2MB FLASH)
heltec_wifi_kit_32.menu.PartitionScheme.minimal.build.partitions=minimal
heltec_wifi_kit_32.menu.PartitionScheme.no_ota=No OTA (Large APP)
heltec_wifi_kit_32.menu.PartitionScheme.no_ota.build.partitions=no_ota
heltec_wifi_kit_32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
heltec_wifi_kit_32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA)
heltec_wifi_kit_32.menu.PartitionScheme.huge_app.build.partitions=huge_app
heltec_wifi_kit_32.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
heltec_wifi_kit_32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
heltec_wifi_kit_32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
heltec_wifi_kit_32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
heltec_wifi_kit_32.menu.PartitionScheme.fatflash=16M Fat
heltec_wifi_kit_32.menu.PartitionScheme.fatflash.build.partitions=ffat
heltec_wifi_kit_32.menu.CPUFreq.240=240MHz (WiFi/BT) heltec_wifi_kit_32.menu.CPUFreq.240=240MHz (WiFi/BT)
heltec_wifi_kit_32.menu.CPUFreq.240.build.f_cpu=240000000L heltec_wifi_kit_32.menu.CPUFreq.240.build.f_cpu=240000000L
heltec_wifi_kit_32.menu.CPUFreq.160=160MHz (WiFi/BT) heltec_wifi_kit_32.menu.CPUFreq.160=160MHz (WiFi/BT)
heltec_wifi_kit_32.menu.CPUFreq.160.build.f_cpu=160000000L heltec_wifi_kit_32.menu.CPUFreq.160.build.f_cpu=160000000L
heltec_wifi_kit_32.menu.CPUFreq.80=80MHz (WiFi/BT) heltec_wifi_kit_32.menu.CPUFreq.80=80MHz (WiFi/BT)
heltec_wifi_kit_32.menu.CPUFreq.80.build.f_cpu=80000000L heltec_wifi_kit_32.menu.CPUFreq.80.build.f_cpu=80000000L
heltec_wifi_kit_32.menu.CPUFreq.26=26MHz (26MHz XTAL)
heltec_wifi_kit_32.menu.CPUFreq.26.build.f_cpu=26000000L
heltec_wifi_kit_32.menu.CPUFreq.13=13MHz (26MHz XTAL)
heltec_wifi_kit_32.menu.CPUFreq.13.build.f_cpu=13000000L
heltec_wifi_kit_32.menu.FlashMode.qio=QIO
heltec_wifi_kit_32.menu.FlashMode.qio.build.flash_mode=dio
heltec_wifi_kit_32.menu.FlashMode.qio.build.boot=qio
heltec_wifi_kit_32.menu.FlashMode.dio=DIO
heltec_wifi_kit_32.menu.FlashMode.dio.build.flash_mode=dio
heltec_wifi_kit_32.menu.FlashMode.dio.build.boot=dio
heltec_wifi_kit_32.menu.FlashMode.qout=QOUT
heltec_wifi_kit_32.menu.FlashMode.qout.build.flash_mode=dout
heltec_wifi_kit_32.menu.FlashMode.qout.build.boot=qout
heltec_wifi_kit_32.menu.FlashMode.dout=DOUT
heltec_wifi_kit_32.menu.FlashMode.dout.build.flash_mode=dout
heltec_wifi_kit_32.menu.FlashMode.dout.build.boot=dout
heltec_wifi_kit_32.menu.FlashFreq.40=40MHz
heltec_wifi_kit_32.menu.FlashFreq.40.build.flash_freq=40m
heltec_wifi_kit_32.menu.FlashFreq.80=80MHz
heltec_wifi_kit_32.menu.FlashFreq.80.build.flash_freq=80m
heltec_wifi_kit_32.menu.FlashSize.4M=4MB (32Mb)
heltec_wifi_kit_32.menu.FlashSize.4M.build.flash_size=4MB
heltec_wifi_kit_32.menu.FlashSize.2M=2MB (16Mb)
heltec_wifi_kit_32.menu.FlashSize.2M.build.flash_size=2MB
heltec_wifi_kit_32.menu.FlashSize.2M.build.partitions=minimal
heltec_wifi_kit_32.menu.FlashSize.16M=16MB (128Mb)
heltec_wifi_kit_32.menu.FlashSize.16M.build.flash_size=16MB
heltec_wifi_kit_32.menu.FlashSize.16M.build.partitions=ffat
heltec_wifi_kit_32.menu.UploadSpeed.921600=921600 heltec_wifi_kit_32.menu.UploadSpeed.921600=921600
heltec_wifi_kit_32.menu.UploadSpeed.921600.upload.speed=921600 heltec_wifi_kit_32.menu.UploadSpeed.921600.upload.speed=921600
@ -3185,74 +3142,27 @@ heltec_wifi_lora_32.serial.disableRTS=true
heltec_wifi_lora_32.build.mcu=esp32 heltec_wifi_lora_32.build.mcu=esp32
heltec_wifi_lora_32.build.core=esp32 heltec_wifi_lora_32.build.core=esp32
heltec_wifi_lora_32.build.variant=heltec_wifi_lora_32 heltec_wifi_lora_32.build.variant=heltec_wifi_lora_32
heltec_wifi_lora_32.build.board=HELTEC_WIFI_LORA_32 heltec_wifi_lora_32.build.board=heltec_wifi_lora_32
heltec_wifi_lora_32.build.f_cpu=240000000L heltec_wifi_lora_32.build.f_cpu=240000000L
heltec_wifi_lora_32.build.flash_size=4MB heltec_wifi_lora_32.build.flash_size=4MB
heltec_wifi_lora_32.build.flash_freq=40m heltec_wifi_lora_32.build.flash_freq=80m
heltec_wifi_lora_32.build.flash_mode=dio heltec_wifi_lora_32.build.flash_mode=dio
heltec_wifi_lora_32.build.boot=dio heltec_wifi_lora_32.build.boot=dio
heltec_wifi_lora_32.build.partitions=default heltec_wifi_lora_32.build.partitions=default
heltec_wifi_lora_32.build.defines= heltec_wifi_lora_32.build.defines=-D{build.band} -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} {build.psram}
heltec_wifi_lora_32.menu.PSRAM.disabled=Disabled heltec_wifi_lora_32.menu.PSRAM.disabled=Disabled
heltec_wifi_lora_32.menu.PSRAM.disabled.build.defines= heltec_wifi_lora_32.menu.PSRAM.disabled.build.psram=
heltec_wifi_lora_32.menu.PSRAM.enabled=Enabled heltec_wifi_lora_32.menu.PSRAM.enabled=Enabled
heltec_wifi_lora_32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue heltec_wifi_lora_32.menu.PSRAM.enabled.build.psram=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
heltec_wifi_lora_32.menu.PartitionScheme.default=Default
heltec_wifi_lora_32.menu.PartitionScheme.default.build.partitions=default
heltec_wifi_lora_32.menu.PartitionScheme.minimal=Minimal (2MB FLASH)
heltec_wifi_lora_32.menu.PartitionScheme.minimal.build.partitions=minimal
heltec_wifi_lora_32.menu.PartitionScheme.no_ota=No OTA (Large APP)
heltec_wifi_lora_32.menu.PartitionScheme.no_ota.build.partitions=no_ota
heltec_wifi_lora_32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
heltec_wifi_lora_32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA)
heltec_wifi_lora_32.menu.PartitionScheme.huge_app.build.partitions=huge_app
heltec_wifi_lora_32.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
heltec_wifi_lora_32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
heltec_wifi_lora_32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
heltec_wifi_lora_32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
heltec_wifi_lora_32.menu.PartitionScheme.fatflash=16M Fat
heltec_wifi_lora_32.menu.PartitionScheme.fatflash.build.partitions=ffat
heltec_wifi_lora_32.menu.CPUFreq.240=240MHz (WiFi/BT) heltec_wifi_lora_32.menu.CPUFreq.240=240MHz (WiFi/BT)
heltec_wifi_lora_32.menu.CPUFreq.240.build.f_cpu=240000000L heltec_wifi_lora_32.menu.CPUFreq.240.build.f_cpu=240000000L
heltec_wifi_lora_32.menu.CPUFreq.160=160MHz (WiFi/BT) heltec_wifi_lora_32.menu.CPUFreq.160=160MHz (WiFi/BT)
heltec_wifi_lora_32.menu.CPUFreq.160.build.f_cpu=160000000L heltec_wifi_lora_32.menu.CPUFreq.160.build.f_cpu=160000000L
heltec_wifi_lora_32.menu.CPUFreq.80=80MHz (WiFi/BT) heltec_wifi_lora_32.menu.CPUFreq.80=80MHz (WiFi/BT)
heltec_wifi_lora_32.menu.CPUFreq.80.build.f_cpu=80000000L heltec_wifi_lora_32.menu.CPUFreq.160.build.f_cpu=80000000L
heltec_wifi_lora_32.menu.CPUFreq.26=26MHz (26MHz XTAL)
heltec_wifi_lora_32.menu.CPUFreq.26.build.f_cpu=26000000L
heltec_wifi_lora_32.menu.CPUFreq.13=13MHz (26MHz XTAL)
heltec_wifi_lora_32.menu.CPUFreq.13.build.f_cpu=13000000L
heltec_wifi_lora_32.menu.FlashMode.qio=QIO
heltec_wifi_lora_32.menu.FlashMode.qio.build.flash_mode=dio
heltec_wifi_lora_32.menu.FlashMode.qio.build.boot=qio
heltec_wifi_lora_32.menu.FlashMode.dio=DIO
heltec_wifi_lora_32.menu.FlashMode.dio.build.flash_mode=dio
heltec_wifi_lora_32.menu.FlashMode.dio.build.boot=dio
heltec_wifi_lora_32.menu.FlashMode.qout=QOUT
heltec_wifi_lora_32.menu.FlashMode.qout.build.flash_mode=dout
heltec_wifi_lora_32.menu.FlashMode.qout.build.boot=qout
heltec_wifi_lora_32.menu.FlashMode.dout=DOUT
heltec_wifi_lora_32.menu.FlashMode.dout.build.flash_mode=dout
heltec_wifi_lora_32.menu.FlashMode.dout.build.boot=dout
heltec_wifi_lora_32.menu.FlashFreq.40=40MHz
heltec_wifi_lora_32.menu.FlashFreq.40.build.flash_freq=40m
heltec_wifi_lora_32.menu.FlashFreq.80=80MHz
heltec_wifi_lora_32.menu.FlashFreq.80.build.flash_freq=80m
heltec_wifi_lora_32.menu.FlashSize.4M=4MB (32Mb)
heltec_wifi_lora_32.menu.FlashSize.4M.build.flash_size=4MB
heltec_wifi_lora_32.menu.FlashSize.2M=2MB (16Mb)
heltec_wifi_lora_32.menu.FlashSize.2M.build.flash_size=2MB
heltec_wifi_lora_32.menu.FlashSize.2M.build.partitions=minimal
heltec_wifi_lora_32.menu.FlashSize.16M=16MB (128Mb)
heltec_wifi_lora_32.menu.FlashSize.16M.build.flash_size=16MB
heltec_wifi_lora_32.menu.FlashSize.16M.build.partitions=ffat
heltec_wifi_lora_32.menu.UploadSpeed.921600=921600 heltec_wifi_lora_32.menu.UploadSpeed.921600=921600
heltec_wifi_lora_32.menu.UploadSpeed.921600.upload.speed=921600 heltec_wifi_lora_32.menu.UploadSpeed.921600.upload.speed=921600
@ -3282,12 +3192,42 @@ heltec_wifi_lora_32.menu.DebugLevel.debug.build.code_debug=4
heltec_wifi_lora_32.menu.DebugLevel.verbose=Verbose heltec_wifi_lora_32.menu.DebugLevel.verbose=Verbose
heltec_wifi_lora_32.menu.DebugLevel.verbose.build.code_debug=5 heltec_wifi_lora_32.menu.DebugLevel.verbose.build.code_debug=5
heltec_wifi_lora_32.menu.LORAWAN_REGION.0=REGION_EU868
heltec_wifi_lora_32.menu.LORAWAN_REGION.0.build.band=REGION_EU868
heltec_wifi_lora_32.menu.LORAWAN_REGION.1=REGION_EU433
heltec_wifi_lora_32.menu.LORAWAN_REGION.1.build.band=REGION_EU433
heltec_wifi_lora_32.menu.LORAWAN_REGION.2=REGION_CN470
heltec_wifi_lora_32.menu.LORAWAN_REGION.2.build.band=REGION_CN470
heltec_wifi_lora_32.menu.LORAWAN_REGION.3=REGION_US915
heltec_wifi_lora_32.menu.LORAWAN_REGION.3.build.band=REGION_US915
heltec_wifi_lora_32.menu.LORAWAN_REGION.4=REGION_AU915
heltec_wifi_lora_32.menu.LORAWAN_REGION.4.build.band=REGION_AU915
heltec_wifi_lora_32.menu.LORAWAN_REGION.5=REGION_CN779
heltec_wifi_lora_32.menu.LORAWAN_REGION.5.build.band=REGION_CN779
heltec_wifi_lora_32.menu.LORAWAN_REGION.6=REGION_AS923
heltec_wifi_lora_32.menu.LORAWAN_REGION.6.build.band=REGION_AS923
heltec_wifi_lora_32.menu.LORAWAN_REGION.7=REGION_KR920
heltec_wifi_lora_32.menu.LORAWAN_REGION.7.build.band=REGION_KR920
heltec_wifi_lora_32.menu.LORAWAN_REGION.8=REGION_IN865
heltec_wifi_lora_32.menu.LORAWAN_REGION.8.build.band=REGION_IN865
heltec_wifi_lora_32.menu.LORAWAN_REGION.9=REGION_US915_HYBRID
heltec_wifi_lora_32.menu.LORAWAN_REGION.9.build.band=REGION_US915_HYBRID
heltec_wifi_lora_32.menu.LoRaWanDebugLevel.0=None
heltec_wifi_lora_32.menu.LoRaWanDebugLevel.0.build.LoRaWanDebugLevel=0
heltec_wifi_lora_32.menu.LoRaWanDebugLevel.1=Freq
heltec_wifi_lora_32.menu.LoRaWanDebugLevel.1.build.LoRaWanDebugLevel=1
heltec_wifi_lora_32.menu.LoRaWanDebugLevel.2=Freq && DIO
heltec_wifi_lora_32.menu.LoRaWanDebugLevel.2.build.LoRaWanDebugLevel=2
heltec_wifi_lora_32.menu.LoRaWanDebugLevel.3=Freq && DIO && PW
heltec_wifi_lora_32.menu.LoRaWanDebugLevel.3.build.LoRaWanDebugLevel=3
############################################################## ##############################################################
heltec_wifi_lora_32_V2.name=Heltec WiFi LoRa 32(V2) heltec_wifi_lora_32_V2.name=Heltec WiFi LoRa 32(V2)
heltec_wifi_lora_32_V2.upload.tool=esptool_py heltec_wifi_lora_32_V2.upload.tool=esptool_py
heltec_wifi_lora_32_V2.upload.maximum_size=1310720 heltec_wifi_lora_32_V2.upload.maximum_size=3342336
heltec_wifi_lora_32_V2.upload.maximum_data_size=327680 heltec_wifi_lora_32_V2.upload.maximum_data_size=327680
heltec_wifi_lora_32_V2.upload.wait_for_upload_port=true heltec_wifi_lora_32_V2.upload.wait_for_upload_port=true
@ -3297,37 +3237,20 @@ heltec_wifi_lora_32_V2.serial.disableRTS=true
heltec_wifi_lora_32_V2.build.mcu=esp32 heltec_wifi_lora_32_V2.build.mcu=esp32
heltec_wifi_lora_32_V2.build.core=esp32 heltec_wifi_lora_32_V2.build.core=esp32
heltec_wifi_lora_32_V2.build.variant=heltec_wifi_lora_32_V2 heltec_wifi_lora_32_V2.build.variant=heltec_wifi_lora_32_V2
heltec_wifi_lora_32_V2.build.board=HELTEC_WIFI_LORA_32_V2 heltec_wifi_lora_32_V2.build.board=heltec_wifi_lora_32_V2
heltec_wifi_lora_32_V2.build.f_cpu=240000000L heltec_wifi_lora_32_V2.build.f_cpu=240000000L
heltec_wifi_lora_32_V2.build.flash_size=8MB heltec_wifi_lora_32_V2.build.flash_size=8MB
heltec_wifi_lora_32_V2.build.flash_freq=40m heltec_wifi_lora_32_V2.build.flash_freq=80m
heltec_wifi_lora_32_V2.build.flash_mode=dio heltec_wifi_lora_32_V2.build.flash_mode=dio
heltec_wifi_lora_32_V2.build.boot=dio heltec_wifi_lora_32_V2.build.boot=qio
heltec_wifi_lora_32_V2.build.partitions=default_8MB heltec_wifi_lora_32_V2.build.partitions=default_8MB
heltec_wifi_lora_32_V2.build.defines= heltec_wifi_lora_32_V2.build.defines=-D{build.band} -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} {build.psram}
heltec_wifi_lora_32_V2.menu.PSRAM.disabled=Disabled heltec_wifi_lora_32_V2.menu.PSRAM.disabled=Disabled
heltec_wifi_lora_32_V2.menu.PSRAM.disabled.build.defines= heltec_wifi_lora_32_V2.menu.PSRAM.disabled.build.psram=
heltec_wifi_lora_32_V2.menu.PSRAM.enabled=Enabled heltec_wifi_lora_32_V2.menu.PSRAM.enabled=Enabled
heltec_wifi_lora_32_V2.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue heltec_wifi_lora_32_V2.menu.PSRAM.enabled.build.psram=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
heltec_wifi_lora_32_V2.menu.PartitionScheme.default=default_8MB
heltec_wifi_lora_32_V2.menu.PartitionScheme.default.build.partitions=default_8MB
heltec_wifi_lora_32_V2.menu.PartitionScheme.default.upload.maximum_size=3342336
heltec_wifi_lora_32_V2.menu.PartitionScheme.minimal=Minimal (2MB FLASH)
heltec_wifi_lora_32_V2.menu.PartitionScheme.minimal.build.partitions=minimal
heltec_wifi_lora_32_V2.menu.PartitionScheme.no_ota=No OTA (Large APP)
heltec_wifi_lora_32_V2.menu.PartitionScheme.no_ota.build.partitions=no_ota
heltec_wifi_lora_32_V2.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
heltec_wifi_lora_32_V2.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA)
heltec_wifi_lora_32_V2.menu.PartitionScheme.huge_app.build.partitions=huge_app
heltec_wifi_lora_32_V2.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
heltec_wifi_lora_32_V2.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
heltec_wifi_lora_32_V2.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
heltec_wifi_lora_32_V2.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
heltec_wifi_lora_32_V2.menu.PartitionScheme.fatflash=16M Fat
heltec_wifi_lora_32_V2.menu.PartitionScheme.fatflash.build.partitions=ffat
heltec_wifi_lora_32_V2.menu.CPUFreq.240=240MHz (WiFi/BT) heltec_wifi_lora_32_V2.menu.CPUFreq.240=240MHz (WiFi/BT)
heltec_wifi_lora_32_V2.menu.CPUFreq.240.build.f_cpu=240000000L heltec_wifi_lora_32_V2.menu.CPUFreq.240.build.f_cpu=240000000L
@ -3335,42 +3258,6 @@ heltec_wifi_lora_32_V2.menu.CPUFreq.160=160MHz (WiFi/BT)
heltec_wifi_lora_32_V2.menu.CPUFreq.160.build.f_cpu=160000000L heltec_wifi_lora_32_V2.menu.CPUFreq.160.build.f_cpu=160000000L
heltec_wifi_lora_32_V2.menu.CPUFreq.80=80MHz (WiFi/BT) heltec_wifi_lora_32_V2.menu.CPUFreq.80=80MHz (WiFi/BT)
heltec_wifi_lora_32_V2.menu.CPUFreq.80.build.f_cpu=80000000L heltec_wifi_lora_32_V2.menu.CPUFreq.80.build.f_cpu=80000000L
heltec_wifi_lora_32_V2.menu.CPUFreq.40=40MHz (40MHz XTAL)
heltec_wifi_lora_32_V2.menu.CPUFreq.40.build.f_cpu=40000000L
heltec_wifi_lora_32_V2.menu.CPUFreq.20=20MHz (40MHz XTAL)
heltec_wifi_lora_32_V2.menu.CPUFreq.20.build.f_cpu=20000000L
heltec_wifi_lora_32_V2.menu.CPUFreq.10=10MHz (40MHz XTAL)
heltec_wifi_lora_32_V2.menu.CPUFreq.10.build.f_cpu=10000000L
heltec_wifi_lora_32_V2.menu.FlashMode.qio=QIO
heltec_wifi_lora_32_V2.menu.FlashMode.qio.build.flash_mode=dio
heltec_wifi_lora_32_V2.menu.FlashMode.qio.build.boot=qio
heltec_wifi_lora_32_V2.menu.FlashMode.dio=DIO
heltec_wifi_lora_32_V2.menu.FlashMode.dio.build.flash_mode=dio
heltec_wifi_lora_32_V2.menu.FlashMode.dio.build.boot=dio
heltec_wifi_lora_32_V2.menu.FlashMode.qout=QOUT
heltec_wifi_lora_32_V2.menu.FlashMode.qout.build.flash_mode=dout
heltec_wifi_lora_32_V2.menu.FlashMode.qout.build.boot=qout
heltec_wifi_lora_32_V2.menu.FlashMode.dout=DOUT
heltec_wifi_lora_32_V2.menu.FlashMode.dout.build.flash_mode=dout
heltec_wifi_lora_32_V2.menu.FlashMode.dout.build.boot=dout
heltec_wifi_lora_32_V2.menu.FlashFreq.80=80MHz
heltec_wifi_lora_32_V2.menu.FlashFreq.80.build.flash_freq=80m
heltec_wifi_lora_32_V2.menu.FlashFreq.40=40MHz
heltec_wifi_lora_32_V2.menu.FlashFreq.40.build.flash_freq=40m
heltec_wifi_lora_32_V2.menu.FlashSize.8M=8MB (64Mb)
heltec_wifi_lora_32_V2.menu.FlashSize.8M.build.flash_size=8MB
heltec_wifi_lora_32_V2.menu.FlashSize.8M.build.partitions=default_8MB
heltec_wifi_lora_32_V2.menu.FlashSize.4M=4MB (32Mb)
heltec_wifi_lora_32_V2.menu.FlashSize.4M.build.flash_size=4MB
heltec_wifi_lora_32_V2.menu.FlashSize.2M=2MB (16Mb)
heltec_wifi_lora_32_V2.menu.FlashSize.2M.build.flash_size=2MB
heltec_wifi_lora_32_V2.menu.FlashSize.2M.build.partitions=minimal
heltec_wifi_lora_32_V2.menu.FlashSize.16M=16MB (128Mb)
heltec_wifi_lora_32_V2.menu.FlashSize.16M.build.flash_size=16MB
heltec_wifi_lora_32_V2.menu.FlashSize.16M.build.partitions=ffat
heltec_wifi_lora_32_V2.menu.UploadSpeed.921600=921600 heltec_wifi_lora_32_V2.menu.UploadSpeed.921600=921600
heltec_wifi_lora_32_V2.menu.UploadSpeed.921600.upload.speed=921600 heltec_wifi_lora_32_V2.menu.UploadSpeed.921600.upload.speed=921600
@ -3400,12 +3287,42 @@ heltec_wifi_lora_32_V2.menu.DebugLevel.debug.build.code_debug=4
heltec_wifi_lora_32_V2.menu.DebugLevel.verbose=Verbose heltec_wifi_lora_32_V2.menu.DebugLevel.verbose=Verbose
heltec_wifi_lora_32_V2.menu.DebugLevel.verbose.build.code_debug=5 heltec_wifi_lora_32_V2.menu.DebugLevel.verbose.build.code_debug=5
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.0=REGION_EU868
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.0.build.band=REGION_EU868
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.1=REGION_EU433
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.1.build.band=REGION_EU433
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.2=REGION_CN470
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.2.build.band=REGION_CN470
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.3=REGION_US915
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.3.build.band=REGION_US915
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.4=REGION_AU915
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.4.build.band=REGION_AU915
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.5=REGION_CN779
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.5.build.band=REGION_CN779
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.6=REGION_AS923
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.6.build.band=REGION_AS923
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.7=REGION_KR920
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.7.build.band=REGION_KR920
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.8=REGION_IN865
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.8.build.band=REGION_IN865
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.9=REGION_US915_HYBRID
heltec_wifi_lora_32_V2.menu.LORAWAN_REGION.9.build.band=REGION_US915_HYBRID
heltec_wifi_lora_32_V2.menu.LoRaWanDebugLevel.0=None
heltec_wifi_lora_32_V2.menu.LoRaWanDebugLevel.0.build.LoRaWanDebugLevel=0
heltec_wifi_lora_32_V2.menu.LoRaWanDebugLevel.1=Freq
heltec_wifi_lora_32_V2.menu.LoRaWanDebugLevel.1.build.LoRaWanDebugLevel=1
heltec_wifi_lora_32_V2.menu.LoRaWanDebugLevel.2=Freq && DIO
heltec_wifi_lora_32_V2.menu.LoRaWanDebugLevel.2.build.LoRaWanDebugLevel=2
heltec_wifi_lora_32_V2.menu.LoRaWanDebugLevel.3=Freq && DIO && PW
heltec_wifi_lora_32_V2.menu.LoRaWanDebugLevel.3.build.LoRaWanDebugLevel=3
############################################################## ##############################################################
heltec_wireless_stick.name=Heltec Wireless Stick heltec_wireless_stick.name=Heltec Wireless Stick
heltec_wireless_stick.upload.tool=esptool_py heltec_wireless_stick.upload.tool=esptool_py
heltec_wireless_stick.upload.maximum_size=1310720 heltec_wireless_stick.upload.maximum_size=3342336
heltec_wireless_stick.upload.maximum_data_size=327680 heltec_wireless_stick.upload.maximum_data_size=327680
heltec_wireless_stick.upload.wait_for_upload_port=true heltec_wireless_stick.upload.wait_for_upload_port=true
@ -3415,37 +3332,20 @@ heltec_wireless_stick.serial.disableRTS=true
heltec_wireless_stick.build.mcu=esp32 heltec_wireless_stick.build.mcu=esp32
heltec_wireless_stick.build.core=esp32 heltec_wireless_stick.build.core=esp32
heltec_wireless_stick.build.variant=heltec_wireless_stick heltec_wireless_stick.build.variant=heltec_wireless_stick
heltec_wireless_stick.build.board=HELTEC_WIRELESS_STICK heltec_wireless_stick.build.board=heltec_wireless_stick
heltec_wireless_stick.build.f_cpu=240000000L heltec_wireless_stick.build.f_cpu=240000000L
heltec_wireless_stick.build.flash_size=8MB heltec_wireless_stick.build.flash_size=8MB
heltec_wireless_stick.build.flash_freq=40m heltec_wireless_stick.build.flash_freq=80m
heltec_wireless_stick.build.flash_mode=dio heltec_wireless_stick.build.flash_mode=dio
heltec_wireless_stick.build.boot=dio heltec_wireless_stick.build.boot=dio
heltec_wireless_stick.build.partitions=default_8MB heltec_wireless_stick.build.partitions=default_8MB
heltec_wireless_stick.build.defines= heltec_wireless_stick.build.defines=-D{build.band} -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} {build.psram}
heltec_wireless_stick.menu.PSRAM.disabled=Disabled heltec_wireless_stick.menu.PSRAM.disabled=Disabled
heltec_wireless_stick.menu.PSRAM.disabled.build.defines= heltec_wireless_stick.menu.PSRAM.disabled.build.psram=
heltec_wireless_stick.menu.PSRAM.enabled=Enabled heltec_wireless_stick.menu.PSRAM.enabled=Enabled
heltec_wireless_stick.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue heltec_wireless_stick.menu.PSRAM.enabled.build.psram=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
heltec_wireless_stick.menu.PartitionScheme.default=default_8MB
heltec_wireless_stick.menu.PartitionScheme.default.build.partitions=default_8MB
heltec_wireless_stick.menu.PartitionScheme.default.upload.maximum_size=3342336
heltec_wireless_stick.menu.PartitionScheme.minimal=Minimal (2MB FLASH)
heltec_wireless_stick.menu.PartitionScheme.minimal.build.partitions=minimal
heltec_wireless_stick.menu.PartitionScheme.no_ota=No OTA (Large APP)
heltec_wireless_stick.menu.PartitionScheme.no_ota.build.partitions=no_ota
heltec_wireless_stick.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
heltec_wireless_stick.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA)
heltec_wireless_stick.menu.PartitionScheme.huge_app.build.partitions=huge_app
heltec_wireless_stick.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
heltec_wireless_stick.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
heltec_wireless_stick.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
heltec_wireless_stick.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
heltec_wireless_stick.menu.PartitionScheme.fatflash=16M Fat
heltec_wireless_stick.menu.PartitionScheme.fatflash.build.partitions=ffat
heltec_wireless_stick.menu.CPUFreq.240=240MHz (WiFi/BT) heltec_wireless_stick.menu.CPUFreq.240=240MHz (WiFi/BT)
heltec_wireless_stick.menu.CPUFreq.240.build.f_cpu=240000000L heltec_wireless_stick.menu.CPUFreq.240.build.f_cpu=240000000L
@ -3453,42 +3353,6 @@ heltec_wireless_stick.menu.CPUFreq.160=160MHz (WiFi/BT)
heltec_wireless_stick.menu.CPUFreq.160.build.f_cpu=160000000L heltec_wireless_stick.menu.CPUFreq.160.build.f_cpu=160000000L
heltec_wireless_stick.menu.CPUFreq.80=80MHz (WiFi/BT) heltec_wireless_stick.menu.CPUFreq.80=80MHz (WiFi/BT)
heltec_wireless_stick.menu.CPUFreq.80.build.f_cpu=80000000L heltec_wireless_stick.menu.CPUFreq.80.build.f_cpu=80000000L
heltec_wireless_stick.menu.CPUFreq.40=40MHz (40MHz XTAL)
heltec_wireless_stick.menu.CPUFreq.40.build.f_cpu=40000000L
heltec_wireless_stick.menu.CPUFreq.20=20MHz (40MHz XTAL)
heltec_wireless_stick.menu.CPUFreq.20.build.f_cpu=20000000L
heltec_wireless_stick.menu.CPUFreq.10=10MHz (40MHz XTAL)
heltec_wireless_stick.menu.CPUFreq.10.build.f_cpu=10000000L
heltec_wireless_stick.menu.FlashMode.qio=QIO
heltec_wireless_stick.menu.FlashMode.qio.build.flash_mode=dio
heltec_wireless_stick.menu.FlashMode.qio.build.boot=qio
heltec_wireless_stick.menu.FlashMode.dio=DIO
heltec_wireless_stick.menu.FlashMode.dio.build.flash_mode=dio
heltec_wireless_stick.menu.FlashMode.dio.build.boot=dio
heltec_wireless_stick.menu.FlashMode.qout=QOUT
heltec_wireless_stick.menu.FlashMode.qout.build.flash_mode=dout
heltec_wireless_stick.menu.FlashMode.qout.build.boot=qout
heltec_wireless_stick.menu.FlashMode.dout=DOUT
heltec_wireless_stick.menu.FlashMode.dout.build.flash_mode=dout
heltec_wireless_stick.menu.FlashMode.dout.build.boot=dout
heltec_wireless_stick.menu.FlashFreq.80=80MHz
heltec_wireless_stick.menu.FlashFreq.80.build.flash_freq=80m
heltec_wireless_stick.menu.FlashFreq.40=40MHz
heltec_wireless_stick.menu.FlashFreq.40.build.flash_freq=40m
heltec_wireless_stick.menu.FlashSize.8M=8MB (64Mb)
heltec_wireless_stick.menu.FlashSize.8M.build.flash_size=8MB
heltec_wireless_stick.menu.FlashSize.2M.build.partitions=default_8MB
heltec_wireless_stick.menu.FlashSize.4M=4MB (32Mb)
heltec_wireless_stick.menu.FlashSize.4M.build.flash_size=4MB
heltec_wireless_stick.menu.FlashSize.2M=2MB (16Mb)
heltec_wireless_stick.menu.FlashSize.2M.build.flash_size=2MB
heltec_wireless_stick.menu.FlashSize.2M.build.partitions=minimal
heltec_wireless_stick.menu.FlashSize.16M=16MB (128Mb)
heltec_wireless_stick.menu.FlashSize.16M.build.flash_size=16MB
heltec_wireless_stick.menu.FlashSize.16M.build.partitions=ffat
heltec_wireless_stick.menu.UploadSpeed.921600=921600 heltec_wireless_stick.menu.UploadSpeed.921600=921600
heltec_wireless_stick.menu.UploadSpeed.921600.upload.speed=921600 heltec_wireless_stick.menu.UploadSpeed.921600.upload.speed=921600
@ -3518,6 +3382,131 @@ heltec_wireless_stick.menu.DebugLevel.debug.build.code_debug=4
heltec_wireless_stick.menu.DebugLevel.verbose=Verbose heltec_wireless_stick.menu.DebugLevel.verbose=Verbose
heltec_wireless_stick.menu.DebugLevel.verbose.build.code_debug=5 heltec_wireless_stick.menu.DebugLevel.verbose.build.code_debug=5
heltec_wireless_stick.menu.LORAWAN_REGION.0=REGION_EU868
heltec_wireless_stick.menu.LORAWAN_REGION.0.build.band=REGION_EU868
heltec_wireless_stick.menu.LORAWAN_REGION.1=REGION_EU433
heltec_wireless_stick.menu.LORAWAN_REGION.1.build.band=REGION_EU433
heltec_wireless_stick.menu.LORAWAN_REGION.2=REGION_CN470
heltec_wireless_stick.menu.LORAWAN_REGION.2.build.band=REGION_CN470
heltec_wireless_stick.menu.LORAWAN_REGION.3=REGION_US915
heltec_wireless_stick.menu.LORAWAN_REGION.3.build.band=REGION_US915
heltec_wireless_stick.menu.LORAWAN_REGION.4=REGION_AU915
heltec_wireless_stick.menu.LORAWAN_REGION.4.build.band=REGION_AU915
heltec_wireless_stick.menu.LORAWAN_REGION.5=REGION_CN779
heltec_wireless_stick.menu.LORAWAN_REGION.5.build.band=REGION_CN779
heltec_wireless_stick.menu.LORAWAN_REGION.6=REGION_AS923
heltec_wireless_stick.menu.LORAWAN_REGION.6.build.band=REGION_AS923
heltec_wireless_stick.menu.LORAWAN_REGION.7=REGION_KR920
heltec_wireless_stick.menu.LORAWAN_REGION.7.build.band=REGION_KR920
heltec_wireless_stick.menu.LORAWAN_REGION.8=REGION_IN865
heltec_wireless_stick.menu.LORAWAN_REGION.8.build.band=REGION_IN865
heltec_wireless_stick.menu.LORAWAN_REGION.9=REGION_US915_HYBRID
heltec_wireless_stick.menu.LORAWAN_REGION.9.build.band=REGION_US915_HYBRID
heltec_wireless_stick.menu.LoRaWanDebugLevel.0=None
heltec_wireless_stick.menu.LoRaWanDebugLevel.0.build.LoRaWanDebugLevel=0
heltec_wireless_stick.menu.LoRaWanDebugLevel.1=Freq
heltec_wireless_stick.menu.LoRaWanDebugLevel.1.build.LoRaWanDebugLevel=1
heltec_wireless_stick.menu.LoRaWanDebugLevel.2=Freq && DIO
heltec_wireless_stick.menu.LoRaWanDebugLevel.2.build.LoRaWanDebugLevel=2
heltec_wireless_stick.menu.LoRaWanDebugLevel.3=Freq && DIO && PW
heltec_wireless_stick.menu.LoRaWanDebugLevel.3.build.LoRaWanDebugLevel=3
##############################################################
heltec_wireless_stick_lite.name=Heltec Wireless Stick Lite
heltec_wireless_stick_lite.upload.tool=esptool_py
heltec_wireless_stick_lite.upload.maximum_size=1310720
heltec_wireless_stick_lite.upload.maximum_data_size=327680
heltec_wireless_stick_lite.upload.wait_for_upload_port=true
heltec_wireless_stick_lite.serial.disableDTR=true
heltec_wireless_stick_lite.serial.disableRTS=true
heltec_wireless_stick_lite.build.mcu=esp32
heltec_wireless_stick_lite.build.core=esp32
heltec_wireless_stick_lite.build.variant=heltec_wireless_stick_lite
heltec_wireless_stick_lite.build.board=heltec_wireless_stick_LITE
heltec_wireless_stick_lite.build.f_cpu=240000000L
heltec_wireless_stick_lite.build.flash_size=4MB
heltec_wireless_stick_lite.build.flash_freq=80m
heltec_wireless_stick_lite.build.flash_mode=dio
heltec_wireless_stick_lite.build.boot=dio
heltec_wireless_stick_lite.build.partitions=default
heltec_wireless_stick_lite.build.defines=-D{build.band} -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} {build.psram}
heltec_wireless_stick_lite.menu.PSRAM.disabled=Disabled
heltec_wireless_stick_lite.menu.PSRAM.disabled.build.psram=
heltec_wireless_stick_lite.menu.PSRAM.enabled=Enabled
heltec_wireless_stick_lite.menu.PSRAM.enabled.build.psram=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
heltec_wireless_stick_lite.menu.CPUFreq.240=240MHz (WiFi/BT)
heltec_wireless_stick_lite.menu.CPUFreq.240.build.f_cpu=240000000L
heltec_wireless_stick_lite.menu.CPUFreq.160=160MHz (WiFi/BT)
heltec_wireless_stick_lite.menu.CPUFreq.160.build.f_cpu=160000000L
heltec_wireless_stick_lite.menu.CPUFreq.80=80MHz (WiFi/BT)
heltec_wireless_stick_lite.menu.CPUFreq.80.build.f_cpu=80000000L
heltec_wireless_stick_lite.menu.UploadSpeed.921600=921600
heltec_wireless_stick_lite.menu.UploadSpeed.921600.upload.speed=921600
heltec_wireless_stick_lite.menu.UploadSpeed.115200=115200
heltec_wireless_stick_lite.menu.UploadSpeed.115200.upload.speed=115200
heltec_wireless_stick_lite.menu.UploadSpeed.256000.windows=256000
heltec_wireless_stick_lite.menu.UploadSpeed.256000.upload.speed=256000
heltec_wireless_stick_lite.menu.UploadSpeed.230400.windows.upload.speed=256000
heltec_wireless_stick_lite.menu.UploadSpeed.230400=230400
heltec_wireless_stick_lite.menu.UploadSpeed.230400.upload.speed=230400
heltec_wireless_stick_lite.menu.UploadSpeed.460800.linux=460800
heltec_wireless_stick_lite.menu.UploadSpeed.460800.macosx=460800
heltec_wireless_stick_lite.menu.UploadSpeed.460800.upload.speed=460800
heltec_wireless_stick_lite.menu.UploadSpeed.512000.windows=512000
heltec_wireless_stick_lite.menu.UploadSpeed.512000.upload.speed=512000
heltec_wireless_stick_lite.menu.DebugLevel.none=None
heltec_wireless_stick_lite.menu.DebugLevel.none.build.code_debug=0
heltec_wireless_stick_lite.menu.DebugLevel.error=Error
heltec_wireless_stick_lite.menu.DebugLevel.error.build.code_debug=1
heltec_wireless_stick_lite.menu.DebugLevel.warn=Warn
heltec_wireless_stick_lite.menu.DebugLevel.warn.build.code_debug=2
heltec_wireless_stick_lite.menu.DebugLevel.info=Info
heltec_wireless_stick_lite.menu.DebugLevel.info.build.code_debug=3
heltec_wireless_stick_lite.menu.DebugLevel.debug=Debug
heltec_wireless_stick_lite.menu.DebugLevel.debug.build.code_debug=4
heltec_wireless_stick_lite.menu.DebugLevel.verbose=Verbose
heltec_wireless_stick_lite.menu.DebugLevel.verbose.build.code_debug=5
heltec_wireless_stick_lite.menu.LORAWAN_REGION.0=REGION_EU868
heltec_wireless_stick_lite.menu.LORAWAN_REGION.0.build.band=REGION_EU868
heltec_wireless_stick_lite.menu.LORAWAN_REGION.1=REGION_EU433
heltec_wireless_stick_lite.menu.LORAWAN_REGION.1.build.band=REGION_EU433
heltec_wireless_stick_lite.menu.LORAWAN_REGION.2=REGION_CN470
heltec_wireless_stick_lite.menu.LORAWAN_REGION.2.build.band=REGION_CN470
heltec_wireless_stick_lite.menu.LORAWAN_REGION.3=REGION_US915
heltec_wireless_stick_lite.menu.LORAWAN_REGION.3.build.band=REGION_US915
heltec_wireless_stick_lite.menu.LORAWAN_REGION.4=REGION_AU915
heltec_wireless_stick_lite.menu.LORAWAN_REGION.4.build.band=REGION_AU915
heltec_wireless_stick_lite.menu.LORAWAN_REGION.5=REGION_CN779
heltec_wireless_stick_lite.menu.LORAWAN_REGION.5.build.band=REGION_CN779
heltec_wireless_stick_lite.menu.LORAWAN_REGION.6=REGION_AS923
heltec_wireless_stick_lite.menu.LORAWAN_REGION.6.build.band=REGION_AS923
heltec_wireless_stick_lite.menu.LORAWAN_REGION.7=REGION_KR920
heltec_wireless_stick_lite.menu.LORAWAN_REGION.7.build.band=REGION_KR920
heltec_wireless_stick_lite.menu.LORAWAN_REGION.8=REGION_IN865
heltec_wireless_stick_lite.menu.LORAWAN_REGION.8.build.band=REGION_IN865
heltec_wireless_stick_lite.menu.LORAWAN_REGION.9=REGION_US915_HYBRID
heltec_wireless_stick_lite.menu.LORAWAN_REGION.9.build.band=REGION_US915_HYBRID
heltec_wireless_stick_lite.menu.LoRaWanDebugLevel.0=None
heltec_wireless_stick_lite.menu.LoRaWanDebugLevel.0.build.LoRaWanDebugLevel=0
heltec_wireless_stick_lite.menu.LoRaWanDebugLevel.1=Freq
heltec_wireless_stick_lite.menu.LoRaWanDebugLevel.1.build.LoRaWanDebugLevel=1
heltec_wireless_stick_lite.menu.LoRaWanDebugLevel.2=Freq && DIO
heltec_wireless_stick_lite.menu.LoRaWanDebugLevel.2.build.LoRaWanDebugLevel=2
heltec_wireless_stick_lite.menu.LoRaWanDebugLevel.3=Freq && DIO && PW
heltec_wireless_stick_lite.menu.LoRaWanDebugLevel.3.build.LoRaWanDebugLevel=3
############################################################## ##############################################################
espectro32.name=ESPectro32 espectro32.name=ESPectro32

View File

@ -73,6 +73,11 @@ public:
} }
size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3))); size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3)));
// add availableForWrite to make compatible with Arduino Print.h
// default to zero, meaning "a single write may block"
// should be overriden by subclasses with buffering
virtual int availableForWrite() { return 0; }
size_t print(const __FlashStringHelper *); size_t print(const __FlashStringHelper *);
size_t print(const String &); size_t print(const String &);
size_t print(const char[]); size_t print(const char[]);

View File

@ -402,9 +402,9 @@ void spiStopBus(spi_t * spi)
if(!spi) { if(!spi) {
return; return;
} }
removeApbChangeCallback(spi, _on_apb_change); removeApbChangeCallback(spi, _on_apb_change);
SPI_MUTEX_LOCK(); SPI_MUTEX_LOCK();
spiInitBus(spi); spiInitBus(spi);
SPI_MUTEX_UNLOCK(); SPI_MUTEX_UNLOCK();
@ -428,14 +428,14 @@ spi_t * spiStartBus(uint8_t spi_num, uint32_t clockDiv, uint8_t dataMode, uint8_
#endif #endif
if(spi_num == HSPI) { if(spi_num == HSPI) {
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN); DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI2_CLK_EN);
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST); DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI2_RST);
} else if(spi_num == VSPI) { } else if(spi_num == VSPI) {
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_2); DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI3_CLK_EN);
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_2); DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI3_RST);
} else { } else {
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_1); DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI01_CLK_EN);
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_1); DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI01_RST);
} }
SPI_MUTEX_LOCK(); SPI_MUTEX_LOCK();

View File

@ -90,56 +90,56 @@ void IRAM_ATTR __timerISR(void * arg){
} }
} }
uint64_t timerRead(hw_timer_t *timer){ uint64_t IRAM_ATTR timerRead(hw_timer_t *timer){
timer->dev->update = 1; timer->dev->update = 1;
uint64_t h = timer->dev->cnt_high; uint64_t h = timer->dev->cnt_high;
uint64_t l = timer->dev->cnt_low; uint64_t l = timer->dev->cnt_low;
return (h << 32) | l; return (h << 32) | l;
} }
uint64_t timerAlarmRead(hw_timer_t *timer){ uint64_t IRAM_ATTR timerAlarmRead(hw_timer_t *timer){
uint64_t h = timer->dev->alarm_high; uint64_t h = timer->dev->alarm_high;
uint64_t l = timer->dev->alarm_low; uint64_t l = timer->dev->alarm_low;
return (h << 32) | l; return (h << 32) | l;
} }
void timerWrite(hw_timer_t *timer, uint64_t val){ void IRAM_ATTR timerWrite(hw_timer_t *timer, uint64_t val){
timer->dev->load_high = (uint32_t) (val >> 32); timer->dev->load_high = (uint32_t) (val >> 32);
timer->dev->load_low = (uint32_t) (val); timer->dev->load_low = (uint32_t) (val);
timer->dev->reload = 1; timer->dev->reload = 1;
} }
void timerAlarmWrite(hw_timer_t *timer, uint64_t alarm_value, bool autoreload){ void IRAM_ATTR timerAlarmWrite(hw_timer_t *timer, uint64_t alarm_value, bool autoreload){
timer->dev->alarm_high = (uint32_t) (alarm_value >> 32); timer->dev->alarm_high = (uint32_t) (alarm_value >> 32);
timer->dev->alarm_low = (uint32_t) alarm_value; timer->dev->alarm_low = (uint32_t) alarm_value;
timer->dev->config.autoreload = autoreload; timer->dev->config.autoreload = autoreload;
} }
void timerSetConfig(hw_timer_t *timer, uint32_t config){ void IRAM_ATTR timerSetConfig(hw_timer_t *timer, uint32_t config){
timer->dev->config.val = config; timer->dev->config.val = config;
} }
uint32_t timerGetConfig(hw_timer_t *timer){ uint32_t IRAM_ATTR timerGetConfig(hw_timer_t *timer){
return timer->dev->config.val; return timer->dev->config.val;
} }
void timerSetCountUp(hw_timer_t *timer, bool countUp){ void IRAM_ATTR timerSetCountUp(hw_timer_t *timer, bool countUp){
timer->dev->config.increase = countUp; timer->dev->config.increase = countUp;
} }
bool timerGetCountUp(hw_timer_t *timer){ bool IRAM_ATTR timerGetCountUp(hw_timer_t *timer){
return timer->dev->config.increase; return timer->dev->config.increase;
} }
void timerSetAutoReload(hw_timer_t *timer, bool autoreload){ void IRAM_ATTR timerSetAutoReload(hw_timer_t *timer, bool autoreload){
timer->dev->config.autoreload = autoreload; timer->dev->config.autoreload = autoreload;
} }
bool timerGetAutoReload(hw_timer_t *timer){ bool IRAM_ATTR timerGetAutoReload(hw_timer_t *timer){
return timer->dev->config.autoreload; return timer->dev->config.autoreload;
} }
void timerSetDivider(hw_timer_t *timer, uint16_t divider){//2 to 65536 void IRAM_ATTR timerSetDivider(hw_timer_t *timer, uint16_t divider){//2 to 65536
if(!divider){ if(!divider){
divider = 0xFFFF; divider = 0xFFFF;
} else if(divider == 1){ } else if(divider == 1){
@ -151,41 +151,41 @@ void timerSetDivider(hw_timer_t *timer, uint16_t divider){//2 to 65536
timer->dev->config.enable = timer_en; timer->dev->config.enable = timer_en;
} }
uint16_t timerGetDivider(hw_timer_t *timer){ uint16_t IRAM_ATTR timerGetDivider(hw_timer_t *timer){
return timer->dev->config.divider; return timer->dev->config.divider;
} }
void timerStart(hw_timer_t *timer){ void IRAM_ATTR timerStart(hw_timer_t *timer){
timer->dev->config.enable = 1; timer->dev->config.enable = 1;
} }
void timerStop(hw_timer_t *timer){ void IRAM_ATTR timerStop(hw_timer_t *timer){
timer->dev->config.enable = 0; timer->dev->config.enable = 0;
} }
void timerRestart(hw_timer_t *timer){ void IRAM_ATTR timerRestart(hw_timer_t *timer){
timer->dev->config.enable = 0; timer->dev->config.enable = 0;
timer->dev->reload = 1; timer->dev->reload = 1;
timer->dev->config.enable = 1; timer->dev->config.enable = 1;
} }
bool timerStarted(hw_timer_t *timer){ bool IRAM_ATTR timerStarted(hw_timer_t *timer){
return timer->dev->config.enable; return timer->dev->config.enable;
} }
void timerAlarmEnable(hw_timer_t *timer){ void IRAM_ATTR timerAlarmEnable(hw_timer_t *timer){
timer->dev->config.alarm_en = 1; timer->dev->config.alarm_en = 1;
} }
void timerAlarmDisable(hw_timer_t *timer){ void IRAM_ATTR timerAlarmDisable(hw_timer_t *timer){
timer->dev->config.alarm_en = 0; timer->dev->config.alarm_en = 0;
} }
bool timerAlarmEnabled(hw_timer_t *timer){ bool IRAM_ATTR timerAlarmEnabled(hw_timer_t *timer){
return timer->dev->config.alarm_en; return timer->dev->config.alarm_en;
} }
static void _on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb){ static void IRAM_ATTR _on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb){
hw_timer_t * timer = (hw_timer_t *)arg; hw_timer_t * timer = (hw_timer_t *)arg;
if(ev_type == APB_BEFORE_CHANGE){ if(ev_type == APB_BEFORE_CHANGE){
timer->dev->config.enable = 0; timer->dev->config.enable = 0;
@ -197,7 +197,7 @@ static void _on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb
} }
} }
hw_timer_t * timerBegin(uint8_t num, uint16_t divider, bool countUp){ hw_timer_t * IRAM_ATTR timerBegin(uint8_t num, uint16_t divider, bool countUp){
if(num > 3){ if(num > 3){
return NULL; return NULL;
} }
@ -222,13 +222,13 @@ hw_timer_t * timerBegin(uint8_t num, uint16_t divider, bool countUp){
return timer; return timer;
} }
void timerEnd(hw_timer_t *timer){ void IRAM_ATTR timerEnd(hw_timer_t *timer){
timer->dev->config.enable = 0; timer->dev->config.enable = 0;
timerAttachInterrupt(timer, NULL, false); timerAttachInterrupt(timer, NULL, false);
removeApbChangeCallback(timer, _on_apb_change); removeApbChangeCallback(timer, _on_apb_change);
} }
void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge){ void IRAM_ATTR timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge){
static bool initialized = false; static bool initialized = false;
static intr_handle_t intr_handle = NULL; static intr_handle_t intr_handle = NULL;
if(intr_handle){ if(intr_handle){
@ -279,29 +279,29 @@ void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge){
} }
} }
void timerDetachInterrupt(hw_timer_t *timer){ void IRAM_ATTR timerDetachInterrupt(hw_timer_t *timer){
timerAttachInterrupt(timer, NULL, false); timerAttachInterrupt(timer, NULL, false);
} }
uint64_t timerReadMicros(hw_timer_t *timer){ uint64_t IRAM_ATTR timerReadMicros(hw_timer_t *timer){
uint64_t timer_val = timerRead(timer); uint64_t timer_val = timerRead(timer);
uint16_t div = timerGetDivider(timer); uint16_t div = timerGetDivider(timer);
return timer_val * div / (getApbFrequency() / 1000000); return timer_val * div / (getApbFrequency() / 1000000);
} }
double timerReadSeconds(hw_timer_t *timer){ double IRAM_ATTR timerReadSeconds(hw_timer_t *timer){
uint64_t timer_val = timerRead(timer); uint64_t timer_val = timerRead(timer);
uint16_t div = timerGetDivider(timer); uint16_t div = timerGetDivider(timer);
return (double)timer_val * div / getApbFrequency(); return (double)timer_val * div / getApbFrequency();
} }
uint64_t timerAlarmReadMicros(hw_timer_t *timer){ uint64_t IRAM_ATTR timerAlarmReadMicros(hw_timer_t *timer){
uint64_t timer_val = timerAlarmRead(timer); uint64_t timer_val = timerAlarmRead(timer);
uint16_t div = timerGetDivider(timer); uint16_t div = timerGetDivider(timer);
return timer_val * div / (getApbFrequency() / 1000000); return timer_val * div / (getApbFrequency() / 1000000);
} }
double timerAlarmReadSeconds(hw_timer_t *timer){ double IRAM_ATTR timerAlarmReadSeconds(hw_timer_t *timer){
uint64_t timer_val = timerAlarmRead(timer); uint64_t timer_val = timerAlarmRead(timer);
uint16_t div = timerGetDivider(timer); uint16_t div = timerGetDivider(timer);
return (double)timer_val * div / getApbFrequency(); return (double)timer_val * div / getApbFrequency();

View File

@ -3,6 +3,10 @@
#include "esp_task_wdt.h" #include "esp_task_wdt.h"
#include "Arduino.h" #include "Arduino.h"
#ifndef CONFIG_ARDUINO_LOOP_STACK_SIZE
#define CONFIG_ARDUINO_LOOP_STACK_SIZE 8192
#endif
TaskHandle_t loopTaskHandle = NULL; TaskHandle_t loopTaskHandle = NULL;
#if CONFIG_AUTOSTART_ARDUINO #if CONFIG_AUTOSTART_ARDUINO
@ -25,7 +29,7 @@ extern "C" void app_main()
{ {
loopTaskWDTEnabled = false; loopTaskWDTEnabled = false;
initArduino(); initArduino();
xTaskCreateUniversal(loopTask, "loopTask", 8192, NULL, 1, &loopTaskHandle, CONFIG_ARDUINO_RUNNING_CORE); xTaskCreateUniversal(loopTask, "loopTask", CONFIG_ARDUINO_LOOP_STACK_SIZE, NULL, 1, &loopTaskHandle, CONFIG_ARDUINO_RUNNING_CORE);
} }
#endif #endif

View File

@ -453,7 +453,7 @@ std::string BLERemoteCharacteristic::readValue() {
* unregistering a notification. * unregistering a notification.
* @return N/A. * @return N/A.
*/ */
void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback, bool notifications) { void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback, bool notifications, bool descriptorRequiresRegistration) {
log_v(">> registerForNotify(): %s", toString().c_str()); log_v(">> registerForNotify(): %s", toString().c_str());
m_notifyCallback = notifyCallback; // Save the notification callback. m_notifyCallback = notifyCallback; // Save the notification callback.
@ -474,7 +474,7 @@ void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback,
uint8_t val[] = {0x01, 0x00}; uint8_t val[] = {0x01, 0x00};
if(!notifications) val[0] = 0x02; if(!notifications) val[0] = 0x02;
BLERemoteDescriptor* desc = getDescriptor(BLEUUID((uint16_t)0x2902)); BLERemoteDescriptor* desc = getDescriptor(BLEUUID((uint16_t)0x2902));
if (desc != nullptr) if (desc != nullptr && descriptorRequiresRegistration)
desc->writeValue(val, 2, true); desc->writeValue(val, 2, true);
} // End Register } // End Register
else { // If we weren't passed a callback function, then this is an unregistration. else { // If we weren't passed a callback function, then this is an unregistration.
@ -490,7 +490,7 @@ void BLERemoteCharacteristic::registerForNotify(notify_callback notifyCallback,
uint8_t val[] = {0x00, 0x00}; uint8_t val[] = {0x00, 0x00};
BLERemoteDescriptor* desc = getDescriptor((uint16_t)0x2902); BLERemoteDescriptor* desc = getDescriptor((uint16_t)0x2902);
if (desc != nullptr) if (desc != nullptr && descriptorRequiresRegistration)
desc->writeValue(val, 2, true); desc->writeValue(val, 2, true);
} // End Unregister } // End Unregister

View File

@ -46,7 +46,7 @@ public:
uint16_t readUInt16(); uint16_t readUInt16();
uint32_t readUInt32(); uint32_t readUInt32();
float readFloat(); float readFloat();
void registerForNotify(notify_callback _callback, bool notifications = true); 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(std::string newValue, bool response = false); void writeValue(std::string newValue, bool response = false);
void writeValue(uint8_t newValue, bool response = false); void writeValue(uint8_t newValue, bool response = false);

View File

@ -245,6 +245,7 @@ std::map<uint16_t, BLERemoteCharacteristic*>* BLERemoteService::getCharacteristi
*/ */
void BLERemoteService::getCharacteristics(std::map<uint16_t, BLERemoteCharacteristic*>* pCharacteristicMap) { void BLERemoteService::getCharacteristics(std::map<uint16_t, BLERemoteCharacteristic*>* pCharacteristicMap) {
log_v(">> getCharacteristics() for service: %s", getUUID().toString().c_str()); 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 // 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 // now. The request to retrieve the characteristics by calling "retrieveCharacteristics" is a blocking
// call and does not return until all the characteristics are available. // call and does not return until all the characteristics are available.

View File

@ -0,0 +1,75 @@
//This example code is in the Public Domain (or CC0 licensed, at your option.)
//By Richard Li - 2020
//
//This example creates a bridge between Serial and Classical Bluetooth (SPP with authentication)
//and also demonstrate that SerialBT have the same functionalities of a normal Serial
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
BluetoothSerial SerialBT;
boolean confirmRequestPending = true;
void BTConfirmRequestCallback(uint32_t numVal)
{
confirmRequestPending = true;
Serial.println(numVal);
}
void BTAuthCompleteCallback(boolean success)
{
confirmRequestPending = false;
if (success)
{
Serial.println("Pairing success!!");
}
else
{
Serial.println("Pairing failed, rejected by user!!");
}
}
void setup()
{
Serial.begin(115200);
SerialBT.enableSSP();
SerialBT.onConfirmRequest(BTConfirmRequestCallback);
SerialBT.onAuthComplete(BTAuthCompleteCallback);
SerialBT.begin("ESP32test"); //Bluetooth device name
Serial.println("The device started, now you can pair it with bluetooth!");
}
void loop()
{
if (confirmRequestPending)
{
if (Serial.available())
{
int dat = Serial.read();
if (dat == 'Y' || dat == 'y')
{
SerialBT.confirmReply(true);
}
else
{
SerialBT.confirmReply(false);
}
}
}
else
{
if (Serial.available())
{
SerialBT.write(Serial.read());
}
if (SerialBT.available())
{
Serial.write(SerialBT.read());
}
delay(20);
}
}

View File

@ -51,6 +51,9 @@ static EventGroupHandle_t _spp_event_group = NULL;
static boolean secondConnectionAttempt; static boolean secondConnectionAttempt;
static esp_spp_cb_t * custom_spp_callback = NULL; static esp_spp_cb_t * custom_spp_callback = NULL;
static BluetoothSerialDataCb custom_data_callback = NULL; static BluetoothSerialDataCb custom_data_callback = NULL;
static esp_bd_addr_t current_bd_addr;
static ConfirmRequestCb confirm_request_callback = NULL;
static AuthCompleteCb auth_complete_callback = NULL;
#define INQ_LEN 0x10 #define INQ_LEN 0x10
#define INQ_NUM_RSPS 20 #define INQ_NUM_RSPS 20
@ -398,8 +401,14 @@ static void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa
case ESP_BT_GAP_AUTH_CMPL_EVT: case ESP_BT_GAP_AUTH_CMPL_EVT:
if (param->auth_cmpl.stat == ESP_BT_STATUS_SUCCESS) { if (param->auth_cmpl.stat == ESP_BT_STATUS_SUCCESS) {
log_v("authentication success: %s", param->auth_cmpl.device_name); log_v("authentication success: %s", param->auth_cmpl.device_name);
if (auth_complete_callback) {
auth_complete_callback(true);
}
} else { } else {
log_e("authentication failed, status:%d", param->auth_cmpl.stat); log_e("authentication failed, status:%d", param->auth_cmpl.stat);
if (auth_complete_callback) {
auth_complete_callback(false);
}
} }
break; break;
@ -421,7 +430,13 @@ static void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa
case ESP_BT_GAP_CFM_REQ_EVT: case ESP_BT_GAP_CFM_REQ_EVT:
log_i("ESP_BT_GAP_CFM_REQ_EVT Please compare the numeric value: %d", param->cfm_req.num_val); log_i("ESP_BT_GAP_CFM_REQ_EVT Please compare the numeric value: %d", param->cfm_req.num_val);
esp_bt_gap_ssp_confirm_reply(param->cfm_req.bda, true); if (confirm_request_callback) {
memcpy(current_bd_addr, param->cfm_req.bda, sizeof(esp_bd_addr_t));
confirm_request_callback(param->cfm_req.num_val);
}
else {
esp_bt_gap_ssp_confirm_reply(param->cfm_req.bda, true);
}
break; break;
case ESP_BT_GAP_KEY_NOTIF_EVT: case ESP_BT_GAP_KEY_NOTIF_EVT:
@ -500,7 +515,9 @@ static bool _init_bt(const char *deviceName)
} }
} }
if (_isMaster && esp_bt_gap_register_callback(esp_bt_gap_cb) != ESP_OK) { // Why only master need this? Slave need this during pairing as well
// if (_isMaster && esp_bt_gap_register_callback(esp_bt_gap_cb) != ESP_OK) {
if (esp_bt_gap_register_callback(esp_bt_gap_cb) != ESP_OK) {
log_e("gap register failed"); log_e("gap register failed");
return false; return false;
} }
@ -672,6 +689,22 @@ void BluetoothSerial::end()
_stop_bt(); _stop_bt();
} }
void BluetoothSerial::onConfirmRequest(ConfirmRequestCb cb)
{
confirm_request_callback = cb;
}
void BluetoothSerial::onAuthComplete(AuthCompleteCb cb)
{
auth_complete_callback = cb;
}
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) esp_err_t BluetoothSerial::register_callback(esp_spp_cb_t * callback)
{ {
custom_spp_callback = callback; custom_spp_callback = callback;

View File

@ -25,6 +25,8 @@
#include <functional> #include <functional>
typedef std::function<void(const uint8_t *buffer, size_t size)> BluetoothSerialDataCb; typedef std::function<void(const uint8_t *buffer, size_t size)> BluetoothSerialDataCb;
typedef std::function<void(uint32_t num_val)> ConfirmRequestCb;
typedef std::function<void(boolean success)> AuthCompleteCb;
class BluetoothSerial: public Stream class BluetoothSerial: public Stream
{ {
@ -44,6 +46,10 @@ class BluetoothSerial: public Stream
void end(void); void end(void);
void onData(BluetoothSerialDataCb cb); void onData(BluetoothSerialDataCb cb);
esp_err_t register_callback(esp_spp_cb_t * callback); esp_err_t register_callback(esp_spp_cb_t * callback);
void onConfirmRequest(ConfirmRequestCb cb);
void onAuthComplete(AuthCompleteCb cb);
void confirmReply(boolean confirm);
void enableSSP(); void enableSSP();
bool setPin(const char *pin); bool setPin(const char *pin);

View File

@ -73,11 +73,15 @@ public:
bool verify(WiFiClient& client, const char* host) override bool verify(WiFiClient& client, const char* host) override
{ {
WiFiClientSecure& wcs = static_cast<WiFiClientSecure&>(client); WiFiClientSecure& wcs = static_cast<WiFiClientSecure&>(client);
wcs.setCACert(_cacert); if (_cacert == nullptr) {
wcs.setCertificate(_clicert); wcs.setInsecure();
wcs.setPrivateKey(_clikey); } else {
return true; wcs.setCACert(_cacert);
wcs.setCertificate(_clicert);
wcs.setPrivateKey(_clikey);
}
return true;
} }
protected: protected:

View File

@ -85,7 +85,7 @@ void SPIClass::setHwCs(bool use)
if(use && !_use_hw_ss) { if(use && !_use_hw_ss) {
spiAttachSS(_spi, 0, _ss); spiAttachSS(_spi, 0, _ss);
spiSSEnable(_spi); spiSSEnable(_spi);
} else if(_use_hw_ss) { } else if(!use && _use_hw_ss) {
spiSSDisable(_spi); spiSSDisable(_spi);
spiDetachSS(_spi, _ss); spiDetachSS(_spi, _ss);
} }

View File

@ -22,6 +22,7 @@
#include "eth_phy/phy.h" #include "eth_phy/phy.h"
#include "eth_phy/phy_tlk110.h" #include "eth_phy/phy_tlk110.h"
#include "eth_phy/phy_lan8720.h" #include "eth_phy/phy_lan8720.h"
#include "eth_phy/phy_ip101.h"
#include "lwip/err.h" #include "lwip/err.h"
#include "lwip/dns.h" #include "lwip/dns.h"
@ -78,6 +79,9 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
} else if(type == ETH_PHY_TLK110){ } else if(type == ETH_PHY_TLK110){
eth_config_t config = phy_tlk110_default_ethernet_config; eth_config_t config = phy_tlk110_default_ethernet_config;
memcpy(&eth_config, &config, sizeof(eth_config_t)); memcpy(&eth_config, &config, sizeof(eth_config_t));
} else if(type == ETH_PHY_IP101) {
eth_config_t config = phy_ip101_default_ethernet_config;
memcpy(&eth_config, &config, sizeof(eth_config_t));
} else { } else {
log_e("Bad ETH_PHY type: %u", (uint8_t)type); log_e("Bad ETH_PHY type: %u", (uint8_t)type);
return false; return false;

View File

@ -48,7 +48,7 @@
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN #define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN
#endif #endif
typedef enum { ETH_PHY_LAN8720, ETH_PHY_TLK110, ETH_PHY_MAX } eth_phy_type_t; typedef enum { ETH_PHY_LAN8720, ETH_PHY_TLK110, ETH_PHY_IP101, ETH_PHY_MAX } eth_phy_type_t;
class ETHClass { class ETHClass {
private: private:

View File

@ -88,4 +88,14 @@ void WiFiClass::printDiag(Print& p)
p.println(conf.sta.bssid_set); p.println(conf.sta.bssid_set);
} }
void WiFiClass::enableProv(bool status)
{
prov_enable = status;
}
bool WiFiClass::isProvEnabled()
{
return prov_enable;
}
WiFiClass WiFi; WiFiClass WiFi;

View File

@ -37,11 +37,17 @@
#include "WiFiClient.h" #include "WiFiClient.h"
#include "WiFiServer.h" #include "WiFiServer.h"
#include "WiFiUdp.h" #include "WiFiUdp.h"
#include "WiFiProv.h"
class WiFiClass : public WiFiGenericClass, public WiFiSTAClass, public WiFiScanClass, public WiFiAPClass, public WiFiProvClass class WiFiClass : public WiFiGenericClass, public WiFiSTAClass, public WiFiScanClass, public WiFiAPClass
{ {
private:
bool prov_enable;
public: public:
WiFiClass()
{
prov_enable = false;
}
using WiFiGenericClass::channel; using WiFiGenericClass::channel;
using WiFiSTAClass::SSID; using WiFiSTAClass::SSID;
@ -60,6 +66,8 @@ public:
friend class WiFiClient; friend class WiFiClient;
friend class WiFiServer; friend class WiFiServer;
friend class WiFiUDP; friend class WiFiUDP;
void enableProv(bool status);
bool isProvEnabled();
}; };
extern WiFiClass WiFi; extern WiFiClass WiFi;

View File

@ -216,9 +216,9 @@ int WiFiClient::connect(IPAddress ip, uint16_t port, int32_t timeout)
uint32_t ip_addr = ip; uint32_t ip_addr = ip;
struct sockaddr_in serveraddr; struct sockaddr_in serveraddr;
bzero((char *) &serveraddr, sizeof(serveraddr)); memset((char *) &serveraddr, 0, sizeof(serveraddr));
serveraddr.sin_family = AF_INET; serveraddr.sin_family = AF_INET;
bcopy((const void *)(&ip_addr), (void *)&serveraddr.sin_addr.s_addr, 4); memcpy((void *)&serveraddr.sin_addr.s_addr, (const void *)(&ip_addr), 4);
serveraddr.sin_port = htons(port); serveraddr.sin_port = htons(port);
fd_set fdset; fd_set fdset;
struct timeval tv; struct timeval tv;

View File

@ -0,0 +1,61 @@
#include <WiFiClientSecure.h>
const char* ssid = "your-ssid"; // your network SSID (name of wifi network)
const char* password = "your-password"; // your network password
const char* server = "www.howsmyssl.com"; // Server URL
WiFiClientSecure client;
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(115200);
delay(100);
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
WiFi.begin(ssid, password);
// attempt to connect to Wifi network:
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
// wait 1 second for re-trying
delay(1000);
}
Serial.print("Connected to ");
Serial.println(ssid);
Serial.println("\nStarting connection to server...");
client.setInsecure();//skip verification
if (!client.connect(server, 443))
Serial.println("Connection failed!");
else {
Serial.println("Connected to server!");
// Make a HTTP request:
client.println("GET https://www.howsmyssl.com/a/check HTTP/1.0");
client.println("Host: www.howsmyssl.com");
client.println("Connection: close");
client.println();
while (client.connected()) {
String line = client.readStringUntil('\n');
if (line == "\r") {
Serial.println("headers received");
break;
}
}
// if there are incoming bytes available
// from the server, read them and print them:
while (client.available()) {
char c = client.read();
Serial.write(c);
}
client.stop();
}
}
void loop() {
// do nothing
}

View File

@ -36,6 +36,7 @@ WiFiClientSecure::WiFiClientSecure()
ssl_init(sslclient); ssl_init(sslclient);
sslclient->socket = -1; sslclient->socket = -1;
sslclient->handshake_timeout = 120000; sslclient->handshake_timeout = 120000;
_use_insecure = false;
_CA_cert = NULL; _CA_cert = NULL;
_cert = NULL; _cert = NULL;
_private_key = NULL; _private_key = NULL;
@ -116,17 +117,17 @@ int WiFiClientSecure::connect(const char *host, uint16_t port, int32_t timeout){
return connect(host, port); return connect(host, port);
} }
int WiFiClientSecure::connect(IPAddress ip, uint16_t port, const char *_CA_cert, const char *_cert, const char *_private_key) int WiFiClientSecure::connect(IPAddress ip, uint16_t port, const char *CA_cert, const char *cert, const char *private_key)
{ {
return connect(ip.toString().c_str(), port, _CA_cert, _cert, _private_key); return connect(ip.toString().c_str(), port, CA_cert, cert, private_key);
} }
int WiFiClientSecure::connect(const char *host, uint16_t port, const char *_CA_cert, const char *_cert, const char *_private_key) int WiFiClientSecure::connect(const char *host, uint16_t port, const char *CA_cert, const char *cert, const char *private_key)
{ {
if(_timeout > 0){ if(_timeout > 0){
sslclient->handshake_timeout = _timeout; sslclient->handshake_timeout = _timeout;
} }
int ret = start_ssl_client(sslclient, host, port, _timeout, _CA_cert, _cert, _private_key, NULL, NULL); int ret = start_ssl_client(sslclient, host, port, _timeout, CA_cert, cert, private_key, NULL, NULL, _use_insecure);
_lastError = ret; _lastError = ret;
if (ret < 0) { if (ret < 0) {
log_e("start_ssl_client: %d", ret); log_e("start_ssl_client: %d", ret);
@ -138,7 +139,7 @@ int WiFiClientSecure::connect(const char *host, uint16_t port, const char *_CA_c
} }
int WiFiClientSecure::connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psKey) { int WiFiClientSecure::connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psKey) {
return connect(ip.toString().c_str(), port,_pskIdent, _psKey); return connect(ip.toString().c_str(), port, pskIdent, psKey);
} }
int WiFiClientSecure::connect(const char *host, uint16_t port, const char *pskIdent, const char *psKey) { int WiFiClientSecure::connect(const char *host, uint16_t port, const char *pskIdent, const char *psKey) {
@ -146,7 +147,7 @@ int WiFiClientSecure::connect(const char *host, uint16_t port, const char *pskId
if(_timeout > 0){ if(_timeout > 0){
sslclient->handshake_timeout = _timeout; sslclient->handshake_timeout = _timeout;
} }
int ret = start_ssl_client(sslclient, host, port, _timeout, NULL, NULL, NULL, _pskIdent, _psKey); int ret = start_ssl_client(sslclient, host, port, _timeout, NULL, NULL, NULL, pskIdent, psKey, _use_insecure);
_lastError = ret; _lastError = ret;
if (ret < 0) { if (ret < 0) {
log_e("start_ssl_client: %d", ret); log_e("start_ssl_client: %d", ret);
@ -245,6 +246,16 @@ uint8_t WiFiClientSecure::connected()
return _connected; return _connected;
} }
void WiFiClientSecure::setInsecure()
{
_CA_cert = NULL;
_cert = NULL;
_private_key = NULL;
_pskIdent = NULL;
_psKey = NULL;
_use_insecure = true;
}
void WiFiClientSecure::setCACert (const char *rootCA) void WiFiClientSecure::setCACert (const char *rootCA)
{ {
_CA_cert = rootCA; _CA_cert = rootCA;

View File

@ -33,6 +33,7 @@ protected:
int _lastError = 0; int _lastError = 0;
int _peek = -1; int _peek = -1;
int _timeout = 0; int _timeout = 0;
bool _use_insecure;
const char *_CA_cert; const char *_CA_cert;
const char *_cert; const char *_cert;
const char *_private_key; const char *_private_key;
@ -62,6 +63,7 @@ public:
void stop(); void stop();
uint8_t connected(); uint8_t connected();
int lastError(char *buf, const size_t size); int lastError(char *buf, const size_t size);
void setInsecure(); // Don't validate the chain, just accept whatever is given. VERY INSECURE!
void setPreSharedKey(const char *pskIdent, const char *psKey); // psKey in Hex void setPreSharedKey(const char *pskIdent, const char *psKey); // psKey in Hex
void setCACert(const char *rootCA); void setCACert(const char *rootCA);
void setCertificate(const char *client_ca); void setCertificate(const char *client_ca);

View File

@ -51,13 +51,17 @@ void ssl_init(sslclient_context *ssl_client)
} }
int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t port, int timeout, const char *rootCABuff, const char *cli_cert, const char *cli_key, const char *pskIdent, const char *psKey) int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t port, int timeout, const char *rootCABuff, const char *cli_cert, const char *cli_key, const char *pskIdent, const char *psKey, bool insecure)
{ {
char buf[512]; char buf[512];
int ret, flags; int ret, flags;
int enable = 1; int enable = 1;
log_v("Free internal heap before TLS %u", ESP.getFreeHeap()); log_v("Free internal heap before TLS %u", ESP.getFreeHeap());
if (rootCABuff == NULL && pskIdent == NULL && psKey == NULL && !insecure) {
return -1;
}
log_v("Starting socket"); log_v("Starting socket");
ssl_client->socket = -1; ssl_client->socket = -1;
@ -118,7 +122,10 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p
// MBEDTLS_SSL_VERIFY_REQUIRED if a CA certificate is defined on Arduino IDE and // MBEDTLS_SSL_VERIFY_REQUIRED if a CA certificate is defined on Arduino IDE and
// MBEDTLS_SSL_VERIFY_NONE if not. // MBEDTLS_SSL_VERIFY_NONE if not.
if (rootCABuff != NULL) { if (insecure) {
mbedtls_ssl_conf_authmode(&ssl_client->ssl_conf, MBEDTLS_SSL_VERIFY_NONE);
log_i("WARNING: Skipping SSL Verification. INSECURE!");
} else if (rootCABuff != NULL) {
log_v("Loading CA cert"); log_v("Loading CA cert");
mbedtls_x509_crt_init(&ssl_client->ca_cert); mbedtls_x509_crt_init(&ssl_client->ca_cert);
mbedtls_ssl_conf_authmode(&ssl_client->ssl_conf, MBEDTLS_SSL_VERIFY_REQUIRED); mbedtls_ssl_conf_authmode(&ssl_client->ssl_conf, MBEDTLS_SSL_VERIFY_REQUIRED);
@ -126,8 +133,8 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p
mbedtls_ssl_conf_ca_chain(&ssl_client->ssl_conf, &ssl_client->ca_cert, NULL); mbedtls_ssl_conf_ca_chain(&ssl_client->ssl_conf, &ssl_client->ca_cert, NULL);
//mbedtls_ssl_conf_verify(&ssl_client->ssl_ctx, my_verify, NULL ); //mbedtls_ssl_conf_verify(&ssl_client->ssl_ctx, my_verify, NULL );
if (ret < 0) { if (ret < 0) {
// free the ca_cert in the case parse failed, otherwise, the old ca_cert still in the heap memory, that lead to "out of memory" crash. // free the ca_cert in the case parse failed, otherwise, the old ca_cert still in the heap memory, that lead to "out of memory" crash.
mbedtls_x509_crt_free(&ssl_client->ca_cert); mbedtls_x509_crt_free(&ssl_client->ca_cert);
return handle_error(ret); return handle_error(ret);
} }
} else if (pskIdent != NULL && psKey != NULL) { } else if (pskIdent != NULL && psKey != NULL) {
@ -161,11 +168,10 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p
return handle_error(ret); return handle_error(ret);
} }
} else { } else {
mbedtls_ssl_conf_authmode(&ssl_client->ssl_conf, MBEDTLS_SSL_VERIFY_NONE); return -1;
log_i("WARNING: Use certificates for a more secure communication!");
} }
if (cli_cert != NULL && cli_key != NULL) { if (!insecure && cli_cert != NULL && cli_key != NULL) {
mbedtls_x509_crt_init(&ssl_client->client_cert); mbedtls_x509_crt_init(&ssl_client->client_cert);
mbedtls_pk_init(&ssl_client->client_key); mbedtls_pk_init(&ssl_client->client_key);
@ -173,8 +179,8 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p
ret = mbedtls_x509_crt_parse(&ssl_client->client_cert, (const unsigned char *)cli_cert, strlen(cli_cert) + 1); ret = mbedtls_x509_crt_parse(&ssl_client->client_cert, (const unsigned char *)cli_cert, strlen(cli_cert) + 1);
if (ret < 0) { if (ret < 0) {
// free the client_cert in the case parse failed, otherwise, the old client_cert still in the heap memory, that lead to "out of memory" crash. // free the client_cert in the case parse failed, otherwise, the old client_cert still in the heap memory, that lead to "out of memory" crash.
mbedtls_x509_crt_free(&ssl_client->client_cert); mbedtls_x509_crt_free(&ssl_client->client_cert);
return handle_error(ret); return handle_error(ret);
} }
@ -211,7 +217,7 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p
} }
if((millis()-handshake_start_time)>ssl_client->handshake_timeout) if((millis()-handshake_start_time)>ssl_client->handshake_timeout)
return -1; return -1;
vTaskDelay(10 / portTICK_PERIOD_MS); vTaskDelay(2);//2 ticks
} }
@ -227,7 +233,7 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p
log_v("Verifying peer X.509 certificate..."); log_v("Verifying peer X.509 certificate...");
if ((flags = mbedtls_ssl_get_verify_result(&ssl_client->ssl_ctx)) != 0) { if ((flags = mbedtls_ssl_get_verify_result(&ssl_client->ssl_ctx)) != 0) {
bzero(buf, sizeof(buf)); memset(buf, 0, sizeof(buf));
mbedtls_x509_crt_verify_info(buf, sizeof(buf), " ! ", flags); mbedtls_x509_crt_verify_info(buf, sizeof(buf), " ! ", flags);
log_e("Failed to verify peer certificate! verification info: %s", buf); log_e("Failed to verify peer certificate! verification info: %s", buf);
stop_ssl_socket(ssl_client, rootCABuff, cli_cert, cli_key); //It's not safe continue. stop_ssl_socket(ssl_client, rootCABuff, cli_cert, cli_key); //It's not safe continue.

View File

@ -29,7 +29,7 @@ typedef struct sslclient_context {
void ssl_init(sslclient_context *ssl_client); void ssl_init(sslclient_context *ssl_client);
int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t port, int timeout, const char *rootCABuff, const char *cli_cert, const char *cli_key, const char *pskIdent, const char *psKey); int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t port, int timeout, const char *rootCABuff, const char *cli_cert, const char *cli_key, const char *pskIdent, const char *psKey, bool insecure);
void stop_ssl_socket(sslclient_context *ssl_client, const char *rootCABuff, const char *cli_cert, const char *cli_key); void stop_ssl_socket(sslclient_context *ssl_client, const char *rootCABuff, const char *cli_cert, const char *cli_key);
int data_to_read(sslclient_context *ssl_client); int data_to_read(sslclient_context *ssl_client);
int send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, uint16_t len); int send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, uint16_t len);

View File

@ -1,4 +1,4 @@
#include "WiFi.h" #include "WiFiProv.h"
void SysProvEvent(system_event_t *sys_event,wifi_prov_event_t *prov_event) void SysProvEvent(system_event_t *sys_event,wifi_prov_event_t *prov_event)
{ {
if(sys_event) { if(sys_event) {
@ -56,8 +56,8 @@ void setup() {
/* uint8_t uuid[16] = {0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf, /* uint8_t uuid[16] = {0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf,
0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02 };*/ 0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02 };*/
WiFi.onEvent(SysProvEvent); WiFi.onEvent(SysProvEvent);
//WiFi.beginProvision(provSchemeBLE, WIFI_PROV_SCHEME_BLE_EVENT_HANDLER_FREE_BTDM, WIFI_PROV_SECURITY_1, "abcd1234", "PROV_XXX", NULL, NULL); //WiFiProv.beginProvision(provSchemeBLE, WIFI_PROV_SCHEME_BLE_EVENT_HANDLER_FREE_BTDM, WIFI_PROV_SECURITY_1, "abcd1234", "PROV_XXX", NULL, NULL);
WiFi.beginProvision(provSchemeSoftAP, WIFI_PROV_EVENT_HANDLER_NONE, WIFI_PROV_SECURITY_1, "abcd1234", NULL, NULL, NULL); WiFiProv.beginProvision(provSchemeSoftAP, WIFI_PROV_EVENT_HANDLER_NONE, WIFI_PROV_SECURITY_1, "abcd1234", NULL, NULL, NULL);
} }
void loop() { void loop() {

View File

@ -0,0 +1,9 @@
name=WiFiProv
version=1.0
author=Switi Mhaiske <sweetymhaiske@gmail.com>
maintainer=Hristo Gochkov <hristo@espressif.com>
sentence=Enables provisioning.
paragraph=With this library you can perform provisioning on esp32 via SoftAP or BLE.
category=Communication
url=
architectures=esp32

View File

@ -31,7 +31,8 @@
#include <wifi_provisioning/scheme_softap.h> #include <wifi_provisioning/scheme_softap.h>
#include <wifi_provisioning/manager.h> #include <wifi_provisioning/manager.h>
#undef IPADDR_NONE #undef IPADDR_NONE
#include "WiFi.h" #include "WiFiProv.h"
#include "SimpleBLE.h"
extern esp_err_t postToSysQueue(system_prov_event_t *); extern esp_err_t postToSysQueue(system_prov_event_t *);
@ -42,13 +43,6 @@ static const uint8_t custom_service_uuid[16] = { 0xb4, 0xdf, 0x5a, 0x1c, 0x3f,
#define SERV_NAME_PREFIX_PROV "PROV_" #define SERV_NAME_PREFIX_PROV "PROV_"
bool WiFiProvClass::prov_enable = true;
bool WiFiProvClass::isProvEnabled()
{
return prov_enable;
}
void provSchemeBLE() void provSchemeBLE()
{ {
prov_scheme = WIFI_PROV_SCHEME_BLE; prov_scheme = WIFI_PROV_SCHEME_BLE;
@ -109,7 +103,7 @@ static void get_device_service_name(char *service_name, size_t max)
void WiFiProvClass :: beginProvision(void (*scheme_cb)(), wifi_prov_event_handler_t scheme_event_handler, wifi_prov_security_t security, const char * pop, const char *service_name, const char *service_key, uint8_t * uuid) void WiFiProvClass :: beginProvision(void (*scheme_cb)(), wifi_prov_event_handler_t scheme_event_handler, wifi_prov_security_t security, const char * pop, const char *service_name, const char *service_key, uint8_t * uuid)
{ {
prov_enable = true; WiFi.enableProv(true);
bool provisioned = false; bool provisioned = false;
scheme_cb(); scheme_cb();
config.scheme_event_handler = scheme_event_handler; config.scheme_event_handler = scheme_event_handler;
@ -152,7 +146,7 @@ void WiFiProvClass :: beginProvision(void (*scheme_cb)(), wifi_prov_event_handle
} else { } else {
wifi_prov_mgr_deinit(); wifi_prov_mgr_deinit();
WiFi.mode(WIFI_MODE_STA); WiFi.mode(WIFI_MODE_STA);
log_i("Aleardy Provisioned, starting Wi-Fi STA"); log_i("Already Provisioned, starting Wi-Fi STA");
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
wifi_config_t conf; wifi_config_t conf;
esp_wifi_get_config(WIFI_IF_STA,&conf); esp_wifi_get_config(WIFI_IF_STA,&conf);
@ -162,4 +156,4 @@ void WiFiProvClass :: beginProvision(void (*scheme_cb)(), wifi_prov_event_handle
WiFi.begin(); WiFi.begin();
} }
} }
WiFiProvClass WiFiProv;

View File

@ -17,10 +17,9 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "WiFi.h"
#include "wifi_provisioning/manager.h" #include "wifi_provisioning/manager.h"
#include "wifi_provisioning/scheme_ble.h" #include "wifi_provisioning/scheme_ble.h"
#include "nvs_flash.h"
#include "SimpleBLE.h"
//Select the scheme using which you want to provision //Select the scheme using which you want to provision
typedef enum typedef enum
{ {
@ -34,19 +33,11 @@ extern void provSchemeBLE();
//Provisioning class //Provisioning class
class WiFiProvClass class WiFiProvClass
{ {
protected:
static bool prov_enable;
public: public:
WiFiProvClass() {
prov_enable = false;
}
bool isProvEnabled(); void beginProvision(void (*scheme_cb)() = provSchemeSoftAP, wifi_prov_event_handler_t scheme_event_handler = WIFI_PROV_EVENT_HANDLER_NONE, wifi_prov_security_t security = WIFI_PROV_SECURITY_1, const char * pop = "abcd1234", const char * service_name = NULL, const char * service_key = NULL, uint8_t *uuid = NULL);
void beginProvision(void (*scheme_cb)() = provSchemeSoftAP, wifi_prov_event_handler_t scheme_event_handler = WIFI_PROV_EVENT_HANDLER_NONE, wifi_prov_security_t security = WIFI_PROV_SECURITY_1, const char * pop = "abcd1234", const char * service_name = NULL, const char * service_key = NULL, uint8_t *uuid = NULL);
}; };
extern WiFiProvClass WiFiProv;
/* /*
Event Handler for BLE Event Handler for BLE
- WIFI_PROV_SCHEME_BLE_EVENT_HANDLER_FREE_BTDM - WIFI_PROV_SCHEME_BLE_EVENT_HANDLER_FREE_BTDM

View File

@ -115,8 +115,8 @@
"host": "x86_64-apple-darwin", "host": "x86_64-apple-darwin",
"url": "https://dl.espressif.com/dl/esptool-3.0.0.2-macos.tar.gz", "url": "https://dl.espressif.com/dl/esptool-3.0.0.2-macos.tar.gz",
"archiveFileName": "esptool-3.0.0.2-macos.tar.gz", "archiveFileName": "esptool-3.0.0.2-macos.tar.gz",
"checksum": "SHA-256:9213f46d5aa865558da4a2ef4218e87eef4782779128083c15ce2b3e4d07a1ea", "checksum": "SHA-256:2cafab7f1ebce89475b84c115548eaace40b6366d7b3f9862cdb2fc64f806643",
"size": "3849615" "size": "3859642"
}, },
{ {
"host": "x86_64-pc-linux-gnu", "host": "x86_64-pc-linux-gnu",

View File

@ -35,7 +35,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
compiler.c.elf.cmd=xtensa-esp32-elf-gcc compiler.c.elf.cmd=xtensa-esp32-elf-gcc
compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception
compiler.c.elf.libs=-lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lesp_http_client -lprotobuf-c -lhal -lnewlib -ldriver -lbootloader_support -lpp -lfreemodbus -lmesh -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lapp_trace -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lesp32-camera -lcxx -lxtensa-debug-module -ltcp_transport -lod -lmdns -ldetection -lvfs -lpe -lesp_websocket_client -lespcoredump -lesp_ringbuf -lsoc -lcore -lfb_gfx -lsdmmc -llibsodium -lcoap -ltcpip_adapter -lprotocomm -lesp_event -limage_util -lc_nano -lesp-tls -lasio -lrtc -lspi_flash -lwpa2 -lwifi_provisioning -lesp32 -lface_recognition -lapp_update -lnghttp -ldl -lspiffs -lface_detection -lefuse -lunity -lesp_https_server -lespnow -lnvs_flash -lesp_adc_cal -llog -ldetection_cat_face -lsmartconfig_ack -lexpat -lm -lfr -lmqtt -lc -lheap -lmbedtls -llwip -lnet80211 -lesp_http_server -lpthread -ljson -lesp_https_ota -lfd -lstdc++ compiler.c.elf.libs=-lgcc -lesp_http_client -lcxx -lwps -lsoc -lesp_event -lc -lprotobuf-c -lunity -lesp_ringbuf -lasio -lnewlib -lfreemodbus -lbtdm_app -ltcpip_adapter -llog -lxtensa-debug-module -lsmartconfig -lspi_flash -lmesh -lwpa -lheap -lbootloader_support -lapp_update -llwip -ldetection_cat_face -lopenssl -ldriver -lesp_https_ota -lfr -lconsole -llibsodium -lmqtt -ljson -lwear_levelling -lface_recognition -lfatfs -lspiffs -ldl -lrtc -ljsmn -lesp_http_server -lfreertos -lespcoredump -lesp_websocket_client -lod -lprotocomm -lwpa2 -lesp_adc_cal -lnghttp -lc_nano -lpp -lpe -lethernet -lbt -ldetection -lulp -lcoap -lfd -lespnow -lmdns -lmicro-ecc -lcore -lmbedtls -lcoexist -lface_detection -lesp32 -ltcp_transport -lphy -lsmartconfig_ack -lhal -lnvs_flash -lfb_gfx -lvfs -lesp32-camera -lm -lsdmmc -lapp_trace -lefuse -lnet80211 -lesp-tls -lwifi_provisioning -lwpa_supplicant -lesp_https_server -limage_util -lpthread -lexpat -lstdc++
compiler.as.cmd=xtensa-esp32-elf-as compiler.as.cmd=xtensa-esp32-elf-as

File diff suppressed because it is too large Load Diff

View File

@ -171,7 +171,7 @@ env.Append(
], ],
LIBS=[ LIBS=[
"-lgcc", "-lopenssl", "-lbtdm_app", "-lfatfs", "-lwps", "-lcoexist", "-lwear_levelling", "-lesp_http_client", "-lprotobuf-c", "-lhal", "-lnewlib", "-ldriver", "-lbootloader_support", "-lpp", "-lfreemodbus", "-lmesh", "-lsmartconfig", "-ljsmn", "-lwpa", "-lethernet", "-lphy", "-lapp_trace", "-lconsole", "-lulp", "-lwpa_supplicant", "-lfreertos", "-lbt", "-lmicro-ecc", "-lesp32-camera", "-lcxx", "-lxtensa-debug-module", "-ltcp_transport", "-lod", "-lmdns", "-ldetection", "-lvfs", "-lpe", "-lesp_websocket_client", "-lespcoredump", "-lesp_ringbuf", "-lsoc", "-lcore", "-lfb_gfx", "-lsdmmc", "-llibsodium", "-lcoap", "-ltcpip_adapter", "-lprotocomm", "-lesp_event", "-limage_util", "-lc_nano", "-lesp-tls", "-lasio", "-lrtc", "-lspi_flash", "-lwpa2", "-lwifi_provisioning", "-lesp32", "-lface_recognition", "-lapp_update", "-lnghttp", "-ldl", "-lspiffs", "-lface_detection", "-lefuse", "-lunity", "-lesp_https_server", "-lespnow", "-lnvs_flash", "-lesp_adc_cal", "-llog", "-ldetection_cat_face", "-lsmartconfig_ack", "-lexpat", "-lm", "-lfr", "-lmqtt", "-lc", "-lheap", "-lmbedtls", "-llwip", "-lnet80211", "-lesp_http_server", "-lpthread", "-ljson", "-lesp_https_ota", "-lfd", "-lstdc++" "-lgcc", "-lesp_http_client", "-lcxx", "-lwps", "-lsoc", "-lesp_event", "-lc", "-lprotobuf-c", "-lunity", "-lesp_ringbuf", "-lasio", "-lnewlib", "-lfreemodbus", "-lbtdm_app", "-ltcpip_adapter", "-llog", "-lxtensa-debug-module", "-lsmartconfig", "-lspi_flash", "-lmesh", "-lwpa", "-lheap", "-lbootloader_support", "-lapp_update", "-llwip", "-ldetection_cat_face", "-lopenssl", "-ldriver", "-lesp_https_ota", "-lfr", "-lconsole", "-llibsodium", "-lmqtt", "-ljson", "-lwear_levelling", "-lface_recognition", "-lfatfs", "-lspiffs", "-ldl", "-lrtc", "-ljsmn", "-lesp_http_server", "-lfreertos", "-lespcoredump", "-lesp_websocket_client", "-lod", "-lprotocomm", "-lwpa2", "-lesp_adc_cal", "-lnghttp", "-lc_nano", "-lpp", "-lpe", "-lethernet", "-lbt", "-ldetection", "-lulp", "-lcoap", "-lfd", "-lespnow", "-lmdns", "-lmicro-ecc", "-lcore", "-lmbedtls", "-lcoexist", "-lface_detection", "-lesp32", "-ltcp_transport", "-lphy", "-lsmartconfig_ack", "-lhal", "-lnvs_flash", "-lfb_gfx", "-lvfs", "-lesp32-camera", "-lm", "-lsdmmc", "-lapp_trace", "-lefuse", "-lnet80211", "-lesp-tls", "-lwifi_provisioning", "-lwpa_supplicant", "-lesp_https_server", "-limage_util", "-lpthread", "-lexpat", "-lstdc++"
], ],
LIBSOURCE_DIRS=[ LIBSOURCE_DIRS=[

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -110,7 +110,11 @@ esp_err_t esp_flash_encrypt_region(uint32_t src_addr, size_t data_length);
* is enabled but secure boot is not used. This should protect against * is enabled but secure boot is not used. This should protect against
* serial re-flashing of an unauthorised code in absence of secure boot. * serial re-flashing of an unauthorised code in absence of secure boot.
* *
* @return * @note To support disabling UART Download Mode on ESP32 V3 only, this function
* doesn't write protect FLASH_CRYPT_CNT but instead sets it to the max value
* (effectively the same result but allows burning the UART_DL_DIS efuse later on,
* as this is otherwise also disabled if FLASH_CRYPT_CNT is write protected.)
*
*/ */
void esp_flash_write_protect_crypt_cnt(); void esp_flash_write_protect_crypt_cnt();

View File

@ -454,28 +454,6 @@ esp_err_t esp_bt_sleep_enable(void);
*/ */
esp_err_t esp_bt_sleep_disable(void); esp_err_t esp_bt_sleep_disable(void);
/**
* @brief to check whether bluetooth controller is sleeping at the instant, if modem sleep is enabled
*
* Note that this function shall not be invoked before esp_bt_controller_enable()
* This function is supposed to be used ORIG mode of modem sleep
*
* @return true if in modem sleep state, false otherwise
*/
bool esp_bt_controller_is_sleeping(void);
/**
* @brief request controller to wakeup from sleeping state during sleep mode
*
* Note that this function shall not be invoked before esp_bt_controller_enable()
* Note that this function is supposed to be used ORIG mode of modem sleep
* Note that after this request, bluetooth controller may again enter sleep as long as the modem sleep is enabled
*
* Profiling shows that it takes several milliseconds to wakeup from modem sleep after this request.
* Generally it takes longer if 32kHz XTAL is used than the main XTAL, due to the lower frequency of the former as the bluetooth low power clock source.
*/
void esp_bt_controller_wakeup_request(void);
/** /**
* @brief Manually clear scan duplicate list * @brief Manually clear scan duplicate list
* *

View File

@ -287,6 +287,8 @@ typedef enum {
ESP_BLE_SM_ONLY_ACCEPT_SPECIFIED_SEC_AUTH, ESP_BLE_SM_ONLY_ACCEPT_SPECIFIED_SEC_AUTH,
/* Enable/Disable OOB support */ /* Enable/Disable OOB support */
ESP_BLE_SM_OOB_SUPPORT, ESP_BLE_SM_OOB_SUPPORT,
/* Appl encryption key size */
ESP_BLE_APP_ENC_KEY_SIZE,
ESP_BLE_SM_MAX_PARAM, ESP_BLE_SM_MAX_PARAM,
} esp_ble_sm_param_t; } esp_ble_sm_param_t;
@ -895,7 +897,7 @@ esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params);
esp_err_t esp_ble_gap_set_pkt_data_len(esp_bd_addr_t remote_device, uint16_t tx_data_length); esp_err_t esp_ble_gap_set_pkt_data_len(esp_bd_addr_t remote_device, uint16_t tx_data_length);
/** /**
* @brief This function sets the random address for the application * @brief This function sets the static Random Address and Non-Resolvable Private Address for the application
* *
* @param[in] rand_addr: the random address which should be setting * @param[in] rand_addr: the random address which should be setting
* *
@ -1243,6 +1245,18 @@ esp_err_t esp_ble_oob_req_reply(esp_bd_addr_t bd_addr, uint8_t *TK, uint8_t len)
*/ */
esp_err_t esp_ble_gap_disconnect(esp_bd_addr_t remote_device); esp_err_t esp_ble_gap_disconnect(esp_bd_addr_t remote_device);
/**
* @brief This function is called to authorized a link after Authentication(MITM protection)
*
* @param[in] bd_addr: BD address of the peer device.
* @param[out] authorize: Authorized the link or not.
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_gap_ble_set_authorization(esp_bd_addr_t bd_addr, bool authorize);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -278,6 +278,8 @@ typedef enum {
#define ESP_GATT_PERM_WRITE_ENC_MITM (1 << 6) /* bit 6 - 0x0040 */ /* relate to BTA_GATT_PERM_WRITE_ENC_MITM in bta/bta_gatt_api.h */ #define ESP_GATT_PERM_WRITE_ENC_MITM (1 << 6) /* bit 6 - 0x0040 */ /* relate to BTA_GATT_PERM_WRITE_ENC_MITM in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_WRITE_SIGNED (1 << 7) /* bit 7 - 0x0080 */ /* relate to BTA_GATT_PERM_WRITE_SIGNED in bta/bta_gatt_api.h */ #define ESP_GATT_PERM_WRITE_SIGNED (1 << 7) /* bit 7 - 0x0080 */ /* relate to BTA_GATT_PERM_WRITE_SIGNED in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_WRITE_SIGNED_MITM (1 << 8) /* bit 8 - 0x0100 */ /* relate to BTA_GATT_PERM_WRITE_SIGNED_MITM in bta/bta_gatt_api.h */ #define ESP_GATT_PERM_WRITE_SIGNED_MITM (1 << 8) /* bit 8 - 0x0100 */ /* relate to BTA_GATT_PERM_WRITE_SIGNED_MITM in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_READ_AUTHORIZATION (1 << 9) /* bit 9 - 0x0200 */
#define ESP_GATT_PERM_WRITE_AUTHORIZATION (1 << 10) /* bit 10 - 0x0400 */
typedef uint16_t esp_gatt_perm_t; typedef uint16_t esp_gatt_perm_t;
/* relate to BTA_GATT_CHAR_PROP_BIT_xxx in bta/bta_gatt_api.h */ /* relate to BTA_GATT_CHAR_PROP_BIT_xxx in bta/bta_gatt_api.h */

View File

@ -603,6 +603,29 @@ esp_err_t esp_ble_gattc_read_char (esp_gatt_if_t gattc_if,
uint16_t conn_id, uint16_t conn_id,
uint16_t handle, uint16_t handle,
esp_gatt_auth_req_t auth_req); esp_gatt_auth_req_t auth_req);
/**
* @brief This function is called to read a service's characteristics of
* the given characteristic UUID
*
* @param[in] gattc_if: Gatt client access interface.
* @param[in] conn_id : connection ID.
* @param[in] start_handle : the attribute start handle.
* @param[in] end_handle : the attribute end handle
* @param[in] uuid : The UUID of attribute which will be read.
* @param[in] auth_req : authenticate request type
*
* @return
* - ESP_OK: success
* - other: failed
*
*/
esp_err_t esp_ble_gattc_read_by_type (esp_gatt_if_t gattc_if,
uint16_t conn_id,
uint16_t start_handle,
uint16_t end_handle,
esp_bt_uuid_t *uuid,
esp_gatt_auth_req_t auth_req);
/** /**
* @brief This function is called to read multiple characteristic or * @brief This function is called to read multiple characteristic or

View File

@ -27,7 +27,10 @@ typedef enum {
ESP_SPP_FAILURE, /*!< Generic failure. */ ESP_SPP_FAILURE, /*!< Generic failure. */
ESP_SPP_BUSY, /*!< Temporarily can not handle this request. */ ESP_SPP_BUSY, /*!< Temporarily can not handle this request. */
ESP_SPP_NO_DATA, /*!< no data. */ ESP_SPP_NO_DATA, /*!< no data. */
ESP_SPP_NO_RESOURCE /*!< No more set pm control block */ ESP_SPP_NO_RESOURCE, /*!< No more resource */
ESP_SPP_NEED_INIT, /*!< SPP module shall init first */
ESP_SPP_NEED_DEINIT, /*!< SPP module shall deinit first */
ESP_SPP_NO_CONNECTION, /*!< connection may have been closed */
} esp_spp_status_t; } esp_spp_status_t;
/* Security Setting Mask, Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only.*/ /* Security Setting Mask, Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only.*/

View File

@ -87,6 +87,7 @@
#define CONFIG_MFN56_1X 1 #define CONFIG_MFN56_1X 1
#define CONFIG_LWIP_MAX_SOCKETS 10 #define CONFIG_LWIP_MAX_SOCKETS 10
#define CONFIG_LWIP_NETIF_LOOPBACK 1 #define CONFIG_LWIP_NETIF_LOOPBACK 1
#define CONFIG_LWIP_TCP_ISN_HOOK 1
#define CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT "pthread" #define CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT "pthread"
#define CONFIG_EMAC_TASK_PRIORITY 20 #define CONFIG_EMAC_TASK_PRIORITY 20
#define CONFIG_TIMER_TASK_STACK_DEPTH 2048 #define CONFIG_TIMER_TASK_STACK_DEPTH 2048
@ -143,6 +144,7 @@
#define CONFIG_MBEDTLS_PSK_MODES 1 #define CONFIG_MBEDTLS_PSK_MODES 1
#define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1 #define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1
#define CONFIG_LWIP_DHCPS_LEASE_UNIT 60 #define CONFIG_LWIP_DHCPS_LEASE_UNIT 60
#define CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION 1
#define CONFIG_EFUSE_MAX_BLK_LEN 192 #define CONFIG_EFUSE_MAX_BLK_LEN 192
#define CONFIG_SPIFFS_USE_MAGIC 1 #define CONFIG_SPIFFS_USE_MAGIC 1
#define CONFIG_OV7725_SUPPORT 1 #define CONFIG_OV7725_SUPPORT 1
@ -170,6 +172,7 @@
#define CONFIG_ESP32_REV_MIN_0 1 #define CONFIG_ESP32_REV_MIN_0 1
#define CONFIG_LOG_DEFAULT_LEVEL 1 #define CONFIG_LOG_DEFAULT_LEVEL 1
#define CONFIG_TIMER_QUEUE_LENGTH 10 #define CONFIG_TIMER_QUEUE_LENGTH 10
#define CONFIG_ARDUINO_LOOP_STACK_SIZE 8192
#define CONFIG_ESP32_REV_MIN 0 #define CONFIG_ESP32_REV_MIN 0
#define CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT 1 #define CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT 1
#define CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE 0 #define CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE 0
@ -244,7 +247,6 @@
#define CONFIG_SPIFFS_GC_MAX_RUNS 10 #define CONFIG_SPIFFS_GC_MAX_RUNS 10
#define CONFIG_ARDUINO_RUN_CORE1 1 #define CONFIG_ARDUINO_RUN_CORE1 1
#define CONFIG_ESP32_APPTRACE_DEST_NONE 1 #define CONFIG_ESP32_APPTRACE_DEST_NONE 1
#define CONFIG_ESP32_WIFI_RX_IRAM_OPT 1
#define CONFIG_HP_NANO1 1 #define CONFIG_HP_NANO1 1
#define CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC 1 #define CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC 1
#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 1 #define CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 1
@ -371,6 +373,7 @@
#define CONFIG_SPIFFS_PAGE_SIZE 256 #define CONFIG_SPIFFS_PAGE_SIZE 256
#define CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED 1 #define CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED 1
#define CONFIG_ESP32_DPORT_WORKAROUND 1 #define CONFIG_ESP32_DPORT_WORKAROUND 1
#define CONFIG_GATTS_BLUFI_ENABLE 1
#define CONFIG_PPP_MSCHAP_SUPPORT 1 #define CONFIG_PPP_MSCHAP_SUPPORT 1
#define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 1 #define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 1
#define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT 2048 #define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT 2048
@ -392,7 +395,6 @@
#define CONFIG_HD_NANO1 1 #define CONFIG_HD_NANO1 1
#define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1 #define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1
#define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1 #define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1
#define CONFIG_ESP32_WIFI_IRAM_OPT 1
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1 #define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_ARDUINO_IDF_COMMIT "66d3783c8" #define CONFIG_ARDUINO_IDF_COMMIT "cd59d107b"
#define CONFIG_ARDUINO_IDF_BRANCH "release/v3.3" #define CONFIG_ARDUINO_IDF_BRANCH "release/v3.3"

View File

@ -228,14 +228,32 @@ int adc1_get_voltage(adc1_channel_t channel) __attribute__((deprecated));
/** /**
* @brief Enable ADC power * @brief Enable ADC power
* @deprecated Use adc_power_acquire and adc_power_release instead.
*/ */
void adc_power_on(); void adc_power_on(void) __attribute__((deprecated));
/** /**
* @brief Power off SAR ADC * @brief Power off SAR ADC
* This function will force power down for ADC * @deprecated Use adc_power_acquire and adc_power_release instead.
* This function will force power down for ADC.
* This function is deprecated because forcing power ADC power off may
* disrupt operation of other components which may be using the ADC.
*/ */
void adc_power_off(); void adc_power_off(void) __attribute__((deprecated));
/**
* @brief Increment the usage counter for ADC module.
* ADC will stay powered on while the counter is greater than 0.
* Call adc_power_release when done using the ADC.
*/
void adc_power_acquire(void);
/**
* @brief Decrement the usage counter for ADC module.
* ADC will stay powered on while the counter is greater than 0.
* Call this function when done using the ADC.
*/
void adc_power_release(void);
/** /**
* @brief Initialize ADC pad * @brief Initialize ADC pad

View File

@ -37,7 +37,8 @@ extern "C" {
#define CAN_GENERAL_CONFIG_DEFAULT(tx_io_num, rx_io_num, op_mode) {.mode = op_mode, .tx_io = tx_io_num, .rx_io = rx_io_num, \ #define CAN_GENERAL_CONFIG_DEFAULT(tx_io_num, rx_io_num, op_mode) {.mode = op_mode, .tx_io = tx_io_num, .rx_io = rx_io_num, \
.clkout_io = CAN_IO_UNUSED, .bus_off_io = CAN_IO_UNUSED, \ .clkout_io = CAN_IO_UNUSED, .bus_off_io = CAN_IO_UNUSED, \
.tx_queue_len = 5, .rx_queue_len = 5, \ .tx_queue_len = 5, .rx_queue_len = 5, \
.alerts_enabled = CAN_ALERT_NONE, .clkout_divider = 0, } .alerts_enabled = CAN_ALERT_NONE, .clkout_divider = 0, \
.intr_flags = ESP_INTR_FLAG_LEVEL1}
/** /**
* @brief Initializer macros for timing configuration structure * @brief Initializer macros for timing configuration structure
@ -91,7 +92,7 @@ extern "C" {
#define CAN_ALERT_BUS_OFF 0x1000 /**< Alert(4096): Bus-off condition occurred. CAN controller can no longer influence bus */ #define CAN_ALERT_BUS_OFF 0x1000 /**< Alert(4096): Bus-off condition occurred. CAN controller can no longer influence bus */
#define CAN_ALERT_ALL 0x1FFF /**< Bit mask to enable all alerts during configuration */ #define CAN_ALERT_ALL 0x1FFF /**< Bit mask to enable all alerts during configuration */
#define CAN_ALERT_NONE 0x0000 /**< Bit mask to disable all alerts during configuration */ #define CAN_ALERT_NONE 0x0000 /**< Bit mask to disable all alerts during configuration */
#define CAN_ALERT_AND_LOG 0x2000 /**< Bit mask to enable alerts to also be logged when they occur */ #define CAN_ALERT_AND_LOG 0x2000 /**< Bit mask to enable alerts to also be logged when they occur. Note that logging from the ISR is disabled if CONFIG_TWAI_ISR_IN_IRAM is enabled. */
/** /**
* @brief Message flags * @brief Message flags
@ -151,6 +152,7 @@ typedef struct {
uint32_t rx_queue_len; /**< Number of messages RX queue can hold */ uint32_t rx_queue_len; /**< Number of messages RX queue can hold */
uint32_t alerts_enabled; /**< Bit field of alerts to enable (see documentation) */ uint32_t alerts_enabled; /**< Bit field of alerts to enable (see documentation) */
uint32_t clkout_divider; /**< CLKOUT divider. Can be 1 or any even number from 2 to 14 (optional, set to 0 if unused) */ uint32_t clkout_divider; /**< CLKOUT divider. Can be 1 or any even number from 2 to 14 (optional, set to 0 if unused) */
int intr_flags; /**< Interrupt flags to set the priority of the driver's ISR. Note that to use the ESP_INTR_FLAG_IRAM, the CONFIG_CAN_ISR_IN_IRAM option should be enabled first. */
} can_general_config_t; } can_general_config_t;
/** /**

View File

@ -276,9 +276,11 @@ esp_err_t gpio_set_intr_type(gpio_num_t gpio_num, gpio_int_type_t intr_type);
/** /**
* @brief Enable GPIO module interrupt signal * @brief Enable GPIO module interrupt signal
* *
* @note Please do not use the interrupt of GPIO36 and GPIO39 when using ADC. * @note Please do not use the interrupt of GPIO36 and GPIO39 when using ADC or Wi-Fi with sleep mode enabled.
* Please refer to the comments of `adc1_get_raw`. * Please refer to the comments of `adc1_get_raw`.
* Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue. * Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue.
* As a workaround, call adc_power_acquire() in the app. This will result in higher power consumption (by ~1mA),
* but will remove the glitches on GPIO36 and GPIO39.
* *
* @param gpio_num GPIO number. If you want to enable an interrupt on e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16); * @param gpio_num GPIO number. If you want to enable an interrupt on e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16);
* *

View File

@ -301,6 +301,23 @@ void esp_efuse_disable_basic_rom_console(void);
*/ */
esp_err_t esp_efuse_apply_34_encoding(const uint8_t *in_bytes, uint32_t *out_words, size_t in_bytes_len); esp_err_t esp_efuse_apply_34_encoding(const uint8_t *in_bytes, uint32_t *out_words, size_t in_bytes_len);
/* @brief Disable ROM Download Mode via eFuse
*
* Permanently disables the ROM Download Mode feature. Once disabled, if the SoC is booted with
* strapping pins set for ROM Download Mode then an error is printed instead.
*
* @note Not all SoCs support this option. An error will be returned if called on an ESP32
* with a silicon revision lower than 3, as these revisions do not support this option.
*
* @note If ROM Download Mode is already disabled, this function does nothing and returns success.
*
* @return
* - ESP_OK If the eFuse was successfully burned, or had already been burned.
* - ESP_ERR_NOT_SUPPORTED (ESP32 only) This SoC is not capable of disabling UART download mode
* - ESP_ERR_INVALID_STATE (ESP32 only) This eFuse is write protected and cannot be written
*/
esp_err_t esp_efuse_disable_rom_download_mode(void);
/* @brief Write random data to efuse key block write registers /* @brief Write random data to efuse key block write registers
* *
* @note Caller is responsible for ensuring efuse * @note Caller is responsible for ensuring efuse

View File

@ -17,7 +17,7 @@ extern "C" {
#endif #endif
// md5_digest_table 2e23344575b3d07f01ecb695294e9770 // md5_digest_table 11b691b6fa8546a3862a7a876be5f758
// This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY. // This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY.
// If you want to change some fields, you need to change esp_efuse_table.csv file // If you want to change some fields, you need to change esp_efuse_table.csv file
// then run `efuse_common_table` or `efuse_custom_table` command it will generate this file. // then run `efuse_common_table` or `efuse_custom_table` command it will generate this file.
@ -36,9 +36,10 @@ extern const esp_efuse_desc_t* ESP_EFUSE_ENCRYPT_CONFIG[];
extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_DL_ENCRYPT[]; extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_DL_ENCRYPT[];
extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_DL_DECRYPT[]; extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_DL_DECRYPT[];
extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_DL_CACHE[]; extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_DL_CACHE[];
extern const esp_efuse_desc_t* ESP_EFUSE_FLASH_CRYPT_CNT[];
extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_JTAG[]; extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_JTAG[];
extern const esp_efuse_desc_t* ESP_EFUSE_CONSOLE_DEBUG_DISABLE[]; extern const esp_efuse_desc_t* ESP_EFUSE_CONSOLE_DEBUG_DISABLE[];
extern const esp_efuse_desc_t* ESP_EFUSE_FLASH_CRYPT_CNT[]; extern const esp_efuse_desc_t* ESP_EFUSE_UART_DOWNLOAD_DIS[];
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_CRYPT_CNT[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_CRYPT_CNT[];
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK1[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK1[];
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK2[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK2[];

View File

@ -135,6 +135,8 @@ typedef struct esp_tls {
fd_set rset; /*!< read file descriptors */ fd_set rset; /*!< read file descriptors */
fd_set wset; /*!< write file descriptors */ fd_set wset; /*!< write file descriptors */
bool is_tls; /*!< indicates connection type (TLS or NON-TLS) */
} esp_tls_t; } esp_tls_t;
/** /**

View File

@ -84,21 +84,6 @@ esp_err_t esp_coex_status_bit_set(esp_coex_status_type_t type, uint32_t status);
*/ */
esp_err_t esp_coex_status_bit_clear(esp_coex_status_type_t type, uint32_t status); esp_err_t esp_coex_status_bit_clear(esp_coex_status_type_t type, uint32_t status);
/**
* @brief Enable BLE connection dynamic priority
* @attention If the parameter is true, BLE connection performance will be better but WiFi performance
* will be poorer. And vice versa.
* @param low_interval : true - Increase BLE connection priority to be higher than WiFi's when BLE
* connection interval is less or equal than 50 ms. The default value
* is false.
* false - not increace
* @param high_interval : true - Increase BLE connection priority to be higher than WiFi's when BLE
* connection interval is more than 50 ms. The default value is true.
* false - not increace
* @return : ESP_OK - success, other - failed
*/
esp_err_t esp_coex_ble_conn_dynamic_prio_enable(bool low_interval, bool high_interval);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -112,44 +112,73 @@ int coex_wifi_request(uint32_t event, uint32_t latency, uint32_t duration);
int coex_wifi_release(uint32_t event); int coex_wifi_release(uint32_t event);
/** /**
* @brief Blue tooth requests coexistence. * @brief Set WiFi channel to coexistence module.
* *
* @param event : blue tooth event * @param primary : WiFi primary channel
* @param latency : blue tooth will request coexistence after latency * @param secondary : WiFi secondary channel
* @param duration : duration for blue tooth to request coexistence
* @return : 0 - success, other - failed * @return : 0 - success, other - failed
*/ */
int coex_bt_request(uint32_t event, uint32_t latency, uint32_t duration); int coex_wifi_channel_set(uint8_t primary, uint8_t secondary);
/** /**
* @brief Blue tooth release coexistence. * @brief Clear coexistence status.
* *
* @param event : blue tooth event * @param type : Coexistence status type
* @param status: Coexistence status
*/
void coex_schm_status_bit_clear(uint32_t type, uint32_t status);
/**
* @brief Set coexistence status.
*
* @param type : Coexistence status type
* @param status: Coexistence status
*/
void coex_schm_status_bit_set(uint32_t type, uint32_t status);
/**
* @brief Set coexistence scheme interval.
*
* @param interval : Coexistence scheme interval
* @return : 0 - success, other - failed * @return : 0 - success, other - failed
*/ */
int coex_bt_release(uint32_t event); int coex_schm_interval_set(uint32_t interval);
/** /**
* @brief Register callback function for blue tooth. * @brief Get coexistence scheme interval.
* *
* @param cb : callback function * @return : Coexistence scheme interval
*/
uint32_t coex_schm_interval_get(void);
/**
* @brief Get current coexistence scheme period.
*
* @return : Coexistence scheme period
*/
uint8_t coex_schm_curr_period_get(void);
/**
* @brief Get current coexistence scheme phase.
*
* @return : Coexistence scheme phase
*/
void * coex_schm_curr_phase_get(void);
/**
* @brief Set current coexistence scheme phase index.
*
* @param interval : Coexistence scheme phase index
* @return : 0 - success, other - failed * @return : 0 - success, other - failed
*/ */
int coex_register_bt_cb(coex_func_cb_t cb); int coex_schm_curr_phase_idx_set(int idx);
/** /**
* @brief Lock before reset base band. * @brief Get current coexistence scheme phase index.
* *
* @return : lock value * @return : Coexistence scheme phase index
*/ */
uint32_t coex_bb_reset_lock(void); int coex_schm_curr_phase_idx_get(void);
/**
* @brief Unlock after reset base band.
*
* @param restore : lock value
*/
void coex_bb_reset_unlock(uint32_t restore);
/** /**
* @brief Register coexistence adapter functions. * @brief Register coexistence adapter functions.

View File

@ -263,6 +263,16 @@ esp_err_t esp_mesh_set_announce_interval(int short_ms, int long_ms);
*/ */
esp_err_t esp_mesh_get_announce_interval(int *short_ms, int *long_ms); esp_err_t esp_mesh_get_announce_interval(int *short_ms, int *long_ms);
/**
* @brief Enable mesh print scan result
*
* @param[in] enable enable or not
*
* @return
* - ESP_OK
*/
esp_err_t esp_mesh_print_scan_result(bool enable);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -252,7 +252,7 @@ esp_err_t esp_now_mod_peer(const esp_now_peer_info_t *peer);
esp_err_t esp_now_get_peer(const uint8_t *peer_addr, esp_now_peer_info_t *peer); esp_err_t esp_now_get_peer(const uint8_t *peer_addr, esp_now_peer_info_t *peer);
/** /**
* @brief Fetch a peer from peer list * @brief Fetch a peer from peer list. Only return the peer which address is unicast, for the multicast/broadcast address, the function will ignore and try to find the next in the peer list.
* *
* @param from_head fetch from head of list or not * @param from_head fetch from head of list or not
* @param peer peer information * @param peer peer information

View File

@ -20,6 +20,7 @@ extern "C"
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
#include "esp_err.h" #include "esp_err.h"
#include "soc/soc.h"
/** /**
@ -61,12 +62,36 @@ esp_err_t esp_set_watchpoint(int no, void *adr, int size, int flags);
*/ */
void esp_clear_watchpoint(int no); void esp_clear_watchpoint(int no);
/**
* @brief Checks stack pointer in dram
*/
inline static bool esp_stack_ptr_in_dram(uint32_t sp)
{
//Check if stack ptr is in between SOC_DRAM_LOW and SOC_DRAM_HIGH, and 16 byte aligned.
return !(sp < SOC_DRAM_LOW + 0x10 || sp > SOC_DRAM_HIGH - 0x10 || ((sp & 0xF) != 0));
}
#if CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
/**
* @brief Checks stack pointer in external ram
*/
inline static bool esp_stack_ptr_in_extram(uint32_t sp)
{
//Check if stack ptr is in between SOC_EXTRAM_DATA_LOW and SOC_EXTRAM_DATA_HIGH, and 16 byte aligned.
return !(sp < SOC_EXTRAM_DATA_LOW + 0x10 || sp > SOC_EXTRAM_DATA_HIGH - 0x10 || ((sp & 0xF) != 0));
}
#endif
/** /**
* @brief Checks stack pointer * @brief Checks stack pointer
*/ */
static inline bool esp_stack_ptr_is_sane(uint32_t sp) static inline bool esp_stack_ptr_is_sane(uint32_t sp)
{ {
return !(sp < 0x3ffae010UL || sp > 0x3ffffff0UL || ((sp & 0xf) != 0)); #if CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
return (esp_stack_ptr_in_dram(sp) || esp_stack_ptr_in_extram(sp));
#else
return esp_stack_ptr_in_dram(sp);
#endif
} }
#endif #endif

View File

@ -89,10 +89,8 @@ esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t source);
/** /**
* @brief Enable wakeup by ULP coprocessor * @brief Enable wakeup by ULP coprocessor
* @note In revisions 0 and 1 of the ESP32, ULP wakeup source * @note ULP wakeup source cannot be used when RTC_PERIPH power domain is forced
* can not be used when RTC_PERIPH power domain is forced * to be powered on (ESP_PD_OPTION_ON) or when ext0 wakeup source is used.
* to be powered on (ESP_PD_OPTION_ON) or when ext0 wakeup
* source is used.
* @return * @return
* - ESP_OK on success * - ESP_OK on success
* - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT) is enabled. * - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT) is enabled.
@ -112,8 +110,7 @@ esp_err_t esp_sleep_enable_timer_wakeup(uint64_t time_in_us);
/** /**
* @brief Enable wakeup by touch sensor * @brief Enable wakeup by touch sensor
* *
* @note In revisions 0 and 1 of the ESP32, touch wakeup source * @note Touch wakeup source cannot be used when RTC_PERIPH power domain is forced
* can not be used when RTC_PERIPH power domain is forced
* to be powered on (ESP_PD_OPTION_ON) or when ext0 wakeup * to be powered on (ESP_PD_OPTION_ON) or when ext0 wakeup
* source is used. * source is used.
* *
@ -148,8 +145,7 @@ touch_pad_t esp_sleep_get_touchpad_wakeup_status();
* @note This function does not modify pin configuration. The pin is * @note This function does not modify pin configuration. The pin is
* configured in esp_sleep_start, immediately before entering sleep mode. * configured in esp_sleep_start, immediately before entering sleep mode.
* *
* @note In revisions 0 and 1 of the ESP32, ext0 wakeup source * @note ext0 wakeup source cannot be used together with touch or ULP wakeup sources.
* can not be used together with touch or ULP wakeup sources.
* *
* @param gpio_num GPIO number used as wakeup source. Only GPIOs which are have RTC * @param gpio_num GPIO number used as wakeup source. Only GPIOs which are have RTC
* functionality can be used: 0,2,4,12-15,25-27,32-39. * functionality can be used: 0,2,4,12-15,25-27,32-39.
@ -206,8 +202,7 @@ esp_err_t esp_sleep_enable_ext1_wakeup(uint64_t mask, esp_sleep_ext1_wakeup_mode
* wakeup level, for each GPIO which is used for wakeup. * wakeup level, for each GPIO which is used for wakeup.
* Then call this function to enable wakeup feature. * Then call this function to enable wakeup feature.
* *
* @note In revisions 0 and 1 of the ESP32, GPIO wakeup source * @note GPIO wakeup source cannot be used together with touch or ULP wakeup sources.
* can not be used together with touch or ULP wakeup sources.
* *
* @return * @return
* - ESP_OK on success * - ESP_OK on success

View File

@ -85,7 +85,7 @@ extern "C" {
#define ESP_ERR_WIFI_NOT_CONNECT (ESP_ERR_WIFI_BASE + 15) /*!< Station still in disconnect status */ #define ESP_ERR_WIFI_NOT_CONNECT (ESP_ERR_WIFI_BASE + 15) /*!< Station still in disconnect status */
#define ESP_ERR_WIFI_POST (ESP_ERR_WIFI_BASE + 18) /*!< Failed to post the event to WiFi task */ #define ESP_ERR_WIFI_POST (ESP_ERR_WIFI_BASE + 18) /*!< Failed to post the event to WiFi task */
#define ESP_ERR_WIFI_INIT_STATE (ESP_ERR_WIFI_BASE + 19) /*!< Invalod WiFi state when init/deinit is called */ #define ESP_ERR_WIFI_INIT_STATE (ESP_ERR_WIFI_BASE + 19) /*!< Invalid WiFi state when init/deinit is called */
#define ESP_ERR_WIFI_STOP_STATE (ESP_ERR_WIFI_BASE + 20) /*!< Returned when WiFi is stopping */ #define ESP_ERR_WIFI_STOP_STATE (ESP_ERR_WIFI_BASE + 20) /*!< Returned when WiFi is stopping */
/** /**
@ -110,6 +110,7 @@ typedef struct {
int wifi_task_core_id; /**< WiFi Task Core ID */ int wifi_task_core_id; /**< WiFi Task Core ID */
int beacon_max_len; /**< WiFi softAP maximum length of the beacon */ int beacon_max_len; /**< WiFi softAP maximum length of the beacon */
int mgmt_sbuf_num; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */ int mgmt_sbuf_num; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */
uint64_t feature_caps; /**< Enables additional WiFi features and capabilities */
int magic; /**< WiFi init magic number, it should be the last field */ int magic; /**< WiFi init magic number, it should be the last field */
} wifi_init_config_t; } wifi_init_config_t;
@ -156,6 +157,7 @@ typedef struct {
#endif #endif
extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
extern uint64_t g_wifi_feature_caps;
#define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F #define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F
@ -208,6 +210,7 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
.wifi_task_core_id = WIFI_TASK_CORE_ID,\ .wifi_task_core_id = WIFI_TASK_CORE_ID,\
.beacon_max_len = WIFI_SOFTAP_BEACON_MAX_LEN, \ .beacon_max_len = WIFI_SOFTAP_BEACON_MAX_LEN, \
.mgmt_sbuf_num = WIFI_MGMT_SBUF_NUM, \ .mgmt_sbuf_num = WIFI_MGMT_SBUF_NUM, \
.feature_caps = g_wifi_feature_caps, \
.magic = WIFI_INIT_CONFIG_MAGIC\ .magic = WIFI_INIT_CONFIG_MAGIC\
}; };
@ -304,7 +307,7 @@ esp_err_t esp_wifi_stop(void);
* @brief Restore WiFi stack persistent settings to default values * @brief Restore WiFi stack persistent settings to default values
* *
* This function will reset settings made using the following APIs: * This function will reset settings made using the following APIs:
* - esp_wifi_get_auto_connect, * - esp_wifi_set_bandwidth,
* - esp_wifi_set_protocol, * - esp_wifi_set_protocol,
* - esp_wifi_set_config related * - esp_wifi_set_config related
* - esp_wifi_set_mode * - esp_wifi_set_mode
@ -904,32 +907,8 @@ esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx);
* @attention 3. Mapping Table {Power, max_tx_power} = {{8, 2}, {20, 5}, {28, 7}, {34, 8}, {44, 11}, * @attention 3. Mapping Table {Power, max_tx_power} = {{8, 2}, {20, 5}, {28, 7}, {34, 8}, {44, 11},
* {52, 13}, {56, 14}, {60, 15}, {66, 16}, {72, 18}, {78, 20}}. * {52, 13}, {56, 14}, {60, 15}, {66, 16}, {72, 18}, {78, 20}}.
* @attention 4. Param power unit is 0.25dBm, range is [8, 78] corresponding to 2dBm - 20dBm. * @attention 4. Param power unit is 0.25dBm, range is [8, 78] corresponding to 2dBm - 20dBm.
* @attention 5. Relationship between set value and actual value. As follows: * @attention 5. Relationship between set value and actual value. As follows: {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 77],72}, {78,78}}
* +------------+--------------+ *
* | set value | actual value |
* +============+==============+
* | [8, 19] | 8 |
* +------------+--------------+
* | [20, 27] | 20 |
* +------------+--------------+
* | [28, 33] | 28 |
* +------------+--------------+
* | [34, 43] | 34 |
* +------------+--------------+
* | [44, 51] | 44 |
* +------------+--------------+
* | [52, 55] | 52 |
* +------------+--------------+
* | [56, 59] | 56 |
* +------------+--------------+
* | [60, 65] | 60 |
* +------------+--------------+
* | [66, 71] | 66 |
* +------------+--------------+
* | [72, 77] | 72 |
* +------------+--------------+
* | 78 | 78 |
* +------------+--------------+
* @param power Maximum WiFi transmitting power. * @param power Maximum WiFi transmitting power.
* *
* @return * @return
@ -1144,6 +1123,17 @@ esp_err_t esp_wifi_set_inactive_time(wifi_interface_t ifx, uint16_t sec);
*/ */
esp_err_t esp_wifi_get_inactive_time(wifi_interface_t ifx, uint16_t *sec); esp_err_t esp_wifi_get_inactive_time(wifi_interface_t ifx, uint16_t *sec);
/**
* @brief Dump WiFi statistics
*
* @param modules statistic modules to be dumped
*
* @return
* - ESP_OK: succeed
* - others: failed
*/
esp_err_t esp_wifi_statis_dump(uint32_t modules);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -51,7 +51,8 @@ typedef struct {
* *
*/ */
typedef enum { typedef enum {
WIFI_LOG_ERROR = 0, /*enabled by default*/ WIFI_LOG_NONE = 0,
WIFI_LOG_ERROR, /*enabled by default*/
WIFI_LOG_WARNING, /*enabled by default*/ WIFI_LOG_WARNING, /*enabled by default*/
WIFI_LOG_INFO, /*enabled by default*/ WIFI_LOG_INFO, /*enabled by default*/
WIFI_LOG_DEBUG, /*can be set in menuconfig*/ WIFI_LOG_DEBUG, /*can be set in menuconfig*/

View File

@ -21,7 +21,7 @@
extern "C" { extern "C" {
#endif #endif
#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000004 #define ESP_WIFI_OS_ADAPTER_VERSION 0x00000005
#define ESP_WIFI_OS_ADAPTER_MAGIC 0xDEADBEAF #define ESP_WIFI_OS_ADAPTER_MAGIC 0xDEADBEAF
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff #define OSI_FUNCS_TIME_BLOCKING 0xffffffff
@ -127,6 +127,15 @@ typedef struct {
void (* _coex_condition_set)(uint32_t type, bool dissatisfy); void (* _coex_condition_set)(uint32_t type, bool dissatisfy);
int32_t (* _coex_wifi_request)(uint32_t event, uint32_t latency, uint32_t duration); int32_t (* _coex_wifi_request)(uint32_t event, uint32_t latency, uint32_t duration);
int32_t (* _coex_wifi_release)(uint32_t event); int32_t (* _coex_wifi_release)(uint32_t event);
int (* _coex_wifi_channel_set)(uint8_t primary, uint8_t secondary);
void (* _coex_schm_status_bit_clear)(uint32_t type, uint32_t status);
void (* _coex_schm_status_bit_set)(uint32_t type, uint32_t status);
int (* _coex_schm_interval_set)(uint32_t interval);
uint32_t (* _coex_schm_interval_get)(void);
uint8_t (* _coex_schm_curr_period_get)(void);
void * (* _coex_schm_curr_phase_get)(void);
int (* _coex_schm_curr_phase_idx_set)(int idx);
int (* _coex_schm_curr_phase_idx_get)(void);
int32_t _magic; int32_t _magic;
} wifi_osi_funcs_t; } wifi_osi_funcs_t;

View File

@ -216,7 +216,7 @@ typedef struct {
wifi_auth_mode_t authmode; /**< Auth mode of ESP32 soft-AP. Do not support AUTH_WEP in soft-AP mode */ wifi_auth_mode_t authmode; /**< Auth mode of ESP32 soft-AP. Do not support AUTH_WEP in soft-AP mode */
uint8_t ssid_hidden; /**< Broadcast SSID or not, default 0, broadcast the SSID */ uint8_t ssid_hidden; /**< Broadcast SSID or not, default 0, broadcast the SSID */
uint8_t max_connection; /**< Max number of stations allowed to connect in, default 4, max 10 */ uint8_t max_connection; /**< Max number of stations allowed to connect in, default 4, max 10 */
uint16_t beacon_interval; /**< Beacon interval, 100 ~ 60000 ms, default 100 ms */ uint16_t beacon_interval; /**< Beacon interval which should be multiples of 100. Unit: TU(time unit, 1 TU = 1024 us). Range: 100 ~ 60000. Default value: 100 */
} wifi_ap_config_t; } wifi_ap_config_t;
/** @brief STA configuration settings for the ESP32 */ /** @brief STA configuration settings for the ESP32 */
@ -520,6 +520,12 @@ typedef struct {
} data; /**< Configuration of ioctl command */ } data; /**< Configuration of ioctl command */
} wifi_ioctl_config_t; } wifi_ioctl_config_t;
#define WIFI_STATIS_BUFFER (1<<0)
#define WIFI_STATIS_RXTX (1<<1)
#define WIFI_STATIS_HW (1<<2)
#define WIFI_STATIS_DIAG (1<<3)
#define WIFI_STATIS_ALL (-1)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -538,6 +538,13 @@ esp_rom_spiflash_result_t esp_rom_spiflash_wait_idle(esp_rom_spiflash_chip_t *sp
*/ */
void esp_rom_spiflash_select_qio_pins(uint8_t wp_gpio_num, uint32_t spiconfig); void esp_rom_spiflash_select_qio_pins(uint8_t wp_gpio_num, uint32_t spiconfig);
/**
* @brief Clear WEL bit unconditionally.
*
* @return always ESP_ROM_SPIFLASH_RESULT_OK
*/
esp_rom_spiflash_result_t esp_rom_spiflash_write_disable(void);
/** @brief Global esp_rom_spiflash_chip_t structure used by ROM functions /** @brief Global esp_rom_spiflash_chip_t structure used by ROM functions
* *
*/ */

View File

@ -108,6 +108,7 @@ typedef struct {
const char *cert_pem; /*!< SSL server certification, PEM format as string, if the client requires to verify server */ const char *cert_pem; /*!< SSL server certification, PEM format as string, if the client requires to verify server */
const char *client_cert_pem; /*!< SSL client certification, PEM format as string, if the server requires to verify client */ const char *client_cert_pem; /*!< SSL client certification, PEM format as string, if the server requires to verify client */
const char *client_key_pem; /*!< SSL client key, PEM format as string, if the server requires to verify client */ const char *client_key_pem; /*!< SSL client key, PEM format as string, if the server requires to verify client */
const char *user_agent; /*!< The User Agent string to send with HTTP requests */
esp_http_client_method_t method; /*!< HTTP Method */ esp_http_client_method_t method; /*!< HTTP Method */
int timeout_ms; /*!< Network timeout in milliseconds */ int timeout_ms; /*!< Network timeout in milliseconds */
bool disable_auto_redirect; /*!< Disable HTTP automatic redirects */ bool disable_auto_redirect; /*!< Disable HTTP automatic redirects */
@ -125,7 +126,11 @@ typedef struct {
* Enum for the HTTP status codes. * Enum for the HTTP status codes.
*/ */
typedef enum { typedef enum {
/* 2xx - Success */
HttpStatus_Ok = 200,
/* 3xx - Redirection */ /* 3xx - Redirection */
HttpStatus_MultipleChoices = 300,
HttpStatus_MovedPermanently = 301, HttpStatus_MovedPermanently = 301,
HttpStatus_Found = 302, HttpStatus_Found = 302,

View File

@ -396,6 +396,17 @@
*/ */
#define LWIP_TCP_RTO_TIME CONFIG_LWIP_TCP_RTO_TIME #define LWIP_TCP_RTO_TIME CONFIG_LWIP_TCP_RTO_TIME
/**
* Set TCP hook for Initial Sequence Number (ISN)
*/
#ifdef CONFIG_LWIP_TCP_ISN_HOOK
#include <lwip/arch.h>
struct ip_addr;
u32_t lwip_hook_tcp_isn(const struct ip_addr *local_ip, u16_t local_port,
const struct ip_addr *remote_ip, u16_t remote_port);
#define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn
#endif
/* /*
---------------------------------- ----------------------------------
---------- Pbuf options ---------- ---------- Pbuf options ----------
@ -767,6 +778,11 @@
*/ */
#define TCPIP_DEBUG LWIP_DBG_OFF #define TCPIP_DEBUG LWIP_DBG_OFF
/**
* TCP_OOSEQ_DEBUG: Enable debugging in tcpin.c for OOSEQ.
*/
#define TCP_OOSEQ_DEBUG LWIP_DBG_OFF
/** /**
* ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be
* updated with the source MAC and IP addresses supplied in the packet. * updated with the source MAC and IP addresses supplied in the packet.

View File

@ -32,9 +32,17 @@
#include "lwip/netdb.h" #include "lwip/netdb.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef ESP_PLATFORM #ifdef ESP_PLATFORM
int getnameinfo(const struct sockaddr *addr, socklen_t addrlen, int getnameinfo(const struct sockaddr *addr, socklen_t addrlen,
char *host, socklen_t hostlen, char *host, socklen_t hostlen,
char *serv, socklen_t servlen, int flags); char *serv, socklen_t servlen, int flags);
#endif #endif
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2016 The MINIX 3 Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* Author: David van Moolenbroek <david@minix3.org>
*/
#ifndef LWIP_TCP_ISN_H
#define LWIP_TCP_ISN_H
#include "lwip/opt.h"
#include "lwip/ip_addr.h"
#ifdef __cplusplus
extern "C" {
#endif
void lwip_init_tcp_isn(u32_t boot_time, const u8_t *secret_16_bytes);
u32_t lwip_hook_tcp_isn(const ip_addr_t *local_ip, u16_t local_port,
const ip_addr_t *remote_ip, u16_t remote_port);
#ifdef __cplusplus
}
#endif
#endif /* LWIP_TCP_ISN_H */

View File

@ -80,10 +80,17 @@ typedef enum {
*/ */
typedef enum { typedef enum {
MQTT_ERROR_TYPE_NONE = 0, MQTT_ERROR_TYPE_NONE = 0,
MQTT_ERROR_TYPE_ESP_TLS, MQTT_ERROR_TYPE_TCP_TRANSPORT,
MQTT_ERROR_TYPE_CONNECTION_REFUSED, MQTT_ERROR_TYPE_CONNECTION_REFUSED,
} esp_mqtt_error_type_t; } esp_mqtt_error_type_t;
/**
* MQTT_ERROR_TYPE_TCP_TRANSPORT error type hold all sorts of transport layer errors,
* including ESP-TLS error, but in the past only the errors from MQTT_ERROR_TYPE_ESP_TLS layer
* were reported, so the ESP-TLS error type is re-defined here for backward compatibility
*/
#define MQTT_ERROR_TYPE_ESP_TLS MQTT_ERROR_TYPE_TCP_TRANSPORT
typedef enum { typedef enum {
MQTT_TRANSPORT_UNKNOWN = 0x0, MQTT_TRANSPORT_UNKNOWN = 0x0,
MQTT_TRANSPORT_OVER_TCP, /*!< MQTT over TCP, using scheme: ``mqtt`` */ MQTT_TRANSPORT_OVER_TCP, /*!< MQTT over TCP, using scheme: ``mqtt`` */
@ -110,7 +117,7 @@ typedef enum {
* Use this structure directly checking error_type first and then appropriate error code depending on the source of the error: * Use this structure directly checking error_type first and then appropriate error code depending on the source of the error:
* *
* | error_type | related member variables | note | * | error_type | related member variables | note |
* | MQTT_ERROR_TYPE_ESP_TLS | esp_tls_last_esp_err, esp_tls_stack_err, esp_tls_cert_verify_flags | Error reported from esp-tls | * | MQTT_ERROR_TYPE_TCP_TRANSPORT | esp_tls_last_esp_err, esp_tls_stack_err, esp_tls_cert_verify_flags, sock_errno | Error reported from tcp_transport/esp-tls |
* | MQTT_ERROR_TYPE_CONNECTION_REFUSED | connect_return_code | Internal error reported from MQTT broker on connection | * | MQTT_ERROR_TYPE_CONNECTION_REFUSED | connect_return_code | Internal error reported from MQTT broker on connection |
*/ */
typedef struct esp_mqtt_error_codes { typedef struct esp_mqtt_error_codes {
@ -121,6 +128,9 @@ typedef struct esp_mqtt_error_codes {
/* esp-mqtt specific structure extension */ /* esp-mqtt specific structure extension */
esp_mqtt_error_type_t error_type; /*!< error type referring to the source of the error */ esp_mqtt_error_type_t error_type; /*!< error type referring to the source of the error */
esp_mqtt_connect_return_code_t connect_return_code; /*!< connection refused error code reported from MQTT broker on connection */ esp_mqtt_connect_return_code_t connect_return_code; /*!< connection refused error code reported from MQTT broker on connection */
/* tcp_transport extension */
int esp_transport_sock_errno; /*!< errno from the underlying socket */
} esp_mqtt_error_codes_t; } esp_mqtt_error_codes_t;
/** /**
@ -179,7 +189,7 @@ typedef struct {
int refresh_connection_after_ms; /*!< Refresh connection after this value (in milliseconds) */ int refresh_connection_after_ms; /*!< Refresh connection after this value (in milliseconds) */
const struct psk_key_hint* psk_hint_key; /*!< Pointer to PSK struct defined in esp_tls.h to enable PSK authentication (as alternative to certificate verification). If not NULL and server/client certificates are NULL, PSK is enabled */ const struct psk_key_hint* psk_hint_key; /*!< Pointer to PSK struct defined in esp_tls.h to enable PSK authentication (as alternative to certificate verification). If not NULL and server/client certificates are NULL, PSK is enabled */
bool use_global_ca_store; /*!< Use a global ca_store for all the connections in which this bool is set. */ bool use_global_ca_store; /*!< Use a global ca_store for all the connections in which this bool is set. */
int reconnect_timeout_ms; /*!< Reconnect to the broker after this value in miliseconds if auto reconnect is not disabled */ int reconnect_timeout_ms; /*!< Reconnect to the broker after this value in miliseconds if auto reconnect is not disabled (defaults to 10s) */
const char **alpn_protos; /*!< NULL-terminated list of supported application protocols to be used for ALPN */ const char **alpn_protos; /*!< NULL-terminated list of supported application protocols to be used for ALPN */
const char *clientkey_password; /*!< Client key decryption password string */ const char *clientkey_password; /*!< Client key decryption password string */
int clientkey_password_len; /*!< String length of the password pointed to by clientkey_password */ int clientkey_password_len; /*!< String length of the password pointed to by clientkey_password */
@ -188,6 +198,8 @@ typedef struct {
bool skip_cert_common_name_check; /*!< Skip any validation of server certificate CN field, this reduces the security of TLS and makes the mqtt client susceptible to MITM attacks */ bool skip_cert_common_name_check; /*!< Skip any validation of server certificate CN field, this reduces the security of TLS and makes the mqtt client susceptible to MITM attacks */
bool use_secure_element; /*!< enable secure element for enabling SSL connection */ bool use_secure_element; /*!< enable secure element for enabling SSL connection */
void *ds_data; /*!< carrier of handle for digital signature parameters */ void *ds_data; /*!< carrier of handle for digital signature parameters */
int network_timeout_ms; /*!< Abort network operation if it is not completed after this value, in milliseconds (defaults to 10s) */
bool disable_keepalive; /*!< Set disable_keepalive=true to turn off keep-alive mechanism, false by default (keepalive is active by default). Note: setting the config value `keepalive` to `0` doesn't disable keepalive feature, but uses a default keepalive period */
} esp_mqtt_client_config_t; } esp_mqtt_client_config_t;
/** /**
@ -347,6 +359,14 @@ esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_mqtt_cl
*/ */
esp_err_t esp_mqtt_client_register_event(esp_mqtt_client_handle_t client, esp_mqtt_event_id_t event, esp_event_handler_t event_handler, void* event_handler_arg); esp_err_t esp_mqtt_client_register_event(esp_mqtt_client_handle_t client, esp_mqtt_event_id_t event, esp_event_handler_t event_handler, void* event_handler_arg);
/**
* @brief Get outbox size
*
* @param client mqtt client handle
* @return outbox size
*/
int esp_mqtt_client_get_outbox_size(esp_mqtt_client_handle_t client);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif //__cplusplus #endif //__cplusplus

View File

@ -84,8 +84,8 @@
#endif #endif
#endif #endif
#ifdef CONFIG_OUTBOX_EXPIRED_TIMEOUT_MS #ifdef CONFIG_MQTT_OUTBOX_EXPIRED_TIMEOUT_MS
#define OUTBOX_EXPIRED_TIMEOUT_MS CONFIG_OUTBOX_EXPIRED_TIMEOUT_MS #define OUTBOX_EXPIRED_TIMEOUT_MS CONFIG_MQTT_OUTBOX_EXPIRED_TIMEOUT_MS
#else #else
#define OUTBOX_EXPIRED_TIMEOUT_MS (30*1000) #define OUTBOX_EXPIRED_TIMEOUT_MS (30*1000)
#endif #endif

View File

@ -56,6 +56,7 @@
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0) #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
// Features supported in 4.3 // Features supported in 4.3
#define MQTT_SUPPORTED_FEATURE_DIGITAL_SIGNATURE #define MQTT_SUPPORTED_FEATURE_DIGITAL_SIGNATURE
#define MQTT_SUPPORTED_FEATURE_TRANSPORT_SOCK_ERRNO_REPORTING
#endif #endif
#endif /* ESP_IDF_VERSION */ #endif /* ESP_IDF_VERSION */

View File

@ -88,30 +88,37 @@ esp_err_t nvs_flash_deinit_partition(const char* partition_label);
/** /**
* @brief Erase the default NVS partition * @brief Erase the default NVS partition
* *
* This function erases all contents of the default NVS partition (one with label "nvs") * Erases all contents of the default NVS partition (one with label "nvs").
*
* @note If the partition is initialized, this function first de-initializes it. Afterwards, the partition has to
* be initialized again to be used.
* *
* @return * @return
* - ESP_OK on success * - ESP_OK on success
* - ESP_ERR_NOT_FOUND if there is no NVS partition labeled "nvs" in the * - ESP_ERR_NOT_FOUND if there is no NVS partition labeled "nvs" in the
* partition table * partition table
* - different error in case de-initialization fails (shouldn't happen)
*/ */
esp_err_t nvs_flash_erase(void); esp_err_t nvs_flash_erase(void);
/** /**
* @brief Erase specified NVS partition * @brief Erase specified NVS partition
* *
* This function erases all contents of specified NVS partition * Erase all content of a specified NVS partition
* *
* @param[in] part_name Name (label) of the partition to be erased * @note If the partition is initialized, this function first de-initializes it. Afterwards, the partition has to
* be initialized again to be used.
*
* @param[in] part_name Name (label) of the partition which should be erased
* *
* @return * @return
* - ESP_OK on success * - ESP_OK on success
* - ESP_ERR_NOT_FOUND if there is no NVS partition with the specified name * - ESP_ERR_NOT_FOUND if there is no NVS partition with the specified name
* in the partition table * in the partition table
* - different error in case de-initialization fails (shouldn't happen)
*/ */
esp_err_t nvs_flash_erase_partition(const char *part_name); esp_err_t nvs_flash_erase_partition(const char *part_name);
/** /**
* @brief Initialize the default NVS partition. * @brief Initialize the default NVS partition.
* *

View File

@ -147,8 +147,8 @@ typedef struct {
typedef union { typedef union {
struct { struct {
uint32_t rx_message_counter: 5; /* RMC[4:0] RX Message Counter */ uint32_t rx_message_counter: 7; /* RMC[6:0] RX Message Counter */
uint32_t reserved27: 27; /* Internal Reserved */ uint32_t reserved25: 25; /* Internal Reserved */
}; };
uint32_t val; uint32_t val;
} can_rx_msg_cnt_reg_t; } can_rx_msg_cnt_reg_t;

View File

@ -47,6 +47,11 @@ void wpa_debug_close_file(void);
*/ */
void wpa_debug_print_timestamp(void); void wpa_debug_print_timestamp(void);
#if CONFIG_WPA_DEBUG_PRINT
#define DEBUG_PRINT
#endif
#ifdef DEBUG_PRINT
/** /**
* wpa_printf - conditional printf * wpa_printf - conditional printf
* @level: priority level (MSG_*) of the message * @level: priority level (MSG_*) of the message
@ -58,8 +63,17 @@ void wpa_debug_print_timestamp(void);
* *
* Note: New line '\n' is added to the end of the text when printing to stdout. * Note: New line '\n' is added to the end of the text when printing to stdout.
*/ */
#define DEBUG_PRINT
#define MSG_PRINT #define wpa_printf(level,fmt, args...) ESP_LOG_LEVEL_LOCAL(level, TAG, fmt, ##args)
static inline void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
{
}
static inline void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, size_t len)
{
}
/** /**
* wpa_hexdump - conditional hex dump * wpa_hexdump - conditional hex dump
@ -72,19 +86,6 @@ void wpa_debug_print_timestamp(void);
* output may be directed to stdout, stderr, and/or syslog based on * output may be directed to stdout, stderr, and/or syslog based on
* configuration. The contents of buf is printed out has hex dump. * configuration. The contents of buf is printed out has hex dump.
*/ */
#ifdef DEBUG_PRINT
#define wpa_printf(level,fmt, args...) ESP_LOG_LEVEL_LOCAL(level, TAG, fmt, ##args)
static inline void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
{
}
static inline void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, size_t len)
{
}
void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len); void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
static inline void wpa_hexdump_buf(int level, const char *title, static inline void wpa_hexdump_buf(int level, const char *title,
@ -148,13 +149,14 @@ void wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
size_t len); size_t len);
#else #else
#define wpa_printf(level,fmt, args...) #define wpa_printf(level,fmt, args...) do {} while(0)
#define wpa_hexdump(...) #define wpa_hexdump(...) do {} while(0)
#define wpa_hexdump_buf(...) #define wpa_dump_mem(...) do {} while(0)
#define wpa_hexdump_key(...) #define wpa_hexdump_buf(...) do {} while(0)
#define wpa_hexdump_buf_key(...) #define wpa_hexdump_key(...) do {} while(0)
#define wpa_hexdump_ascii(...) #define wpa_hexdump_buf_key(...) do {} while(0)
#define wpa_hexdump_ascii_key(...) #define wpa_hexdump_ascii(...) do {} while(0)
#define wpa_hexdump_ascii_key(...) do {} while(0)
#endif #endif
#define wpa_auth_logger #define wpa_auth_logger

File diff suppressed because one or more lines are too long

View File

@ -724,6 +724,7 @@ PROVIDE ( r_ld_acl_sniff = 0x4003617c );
PROVIDE ( r_ld_acl_sniff_trans = 0x400360a8 ); PROVIDE ( r_ld_acl_sniff_trans = 0x400360a8 );
PROVIDE ( r_ld_acl_ssr_set = 0x40036274 ); PROVIDE ( r_ld_acl_ssr_set = 0x40036274 );
PROVIDE ( r_ld_acl_start = 0x40034ddc ); PROVIDE ( r_ld_acl_start = 0x40034ddc );
PROVIDE ( ld_acl_sco_rsvd_check = 0x4002fa94 );
PROVIDE ( r_ld_acl_stop = 0x4003532c ); PROVIDE ( r_ld_acl_stop = 0x4003532c );
PROVIDE ( r_ld_acl_test_mode_set = 0x40036f24 ); PROVIDE ( r_ld_acl_test_mode_set = 0x40036f24 );
PROVIDE ( r_ld_acl_timing_accuracy_set = 0x4003673c ); PROVIDE ( r_ld_acl_timing_accuracy_set = 0x4003673c );

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More