Skip to content

Commit

Permalink
esp32: Make SoftwareVersion configurable from application (#14693)
Browse files Browse the repository at this point in the history
* esp32: Make SoftwareVersion configurable from application

* esp32: Comment explaining why the MTU won't overflow

* Bumping ota-requestor-app/esp32 version to 2
  • Loading branch information
shubhamdp authored and pull[bot] committed Feb 15, 2022
1 parent ec856ae commit 3264453
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,17 @@ menu "CHIP Device Layer"
persistent storage (e.g. by a factory provisioning process).

config DEVICE_SOFTWARE_VERSION
string "Device Software Version"
string "Device Software Version String"
default ""
help
A string identifying the software version running on the device.

config DEVICE_SOFTWARE_VERSION_NUMBER
int "Device Software Version Number"
default 1
help
Software version number running on the device.

config DEVICE_TYPE
int "Default Device type"
default 0
Expand Down
1 change: 1 addition & 0 deletions examples/ota-requestor-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Enable OTA Requestor
CONFIG_ENABLE_OTA_REQUESTOR=y
CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER=2
1 change: 1 addition & 0 deletions src/platform/ESP32/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_DEVICE_TYPE
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER

#define CHIP_DEVICE_CONFIG_ENABLE_THREAD CONFIG_OPENTHREAD_ENABLED
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT CONFIG_OPENTHREAD_SRP_CLIENT
Expand Down
6 changes: 2 additions & 4 deletions src/platform/ESP32/bluedroid/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,12 +964,10 @@ void BLEManagerImpl::HandleGATTCommEvent(esp_gatts_cb_event_t event, esp_gatt_if
// possibly not fitting. There's no way to suppress that warning
// via explicit cast; we have to disable the warning around the
// assignment.
//
// TODO: https://github.com/project-chip/connectedhomeip/issues/2569
// tracks making this safe with a check or explaining why no check
// is needed.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
// As per the BLE specification, the maximum MTU value can be 517 bytes.
// This can be accomodated in 10 bits
conState->MTU = param->mtu.mtu;
#pragma GCC diagnostic pop
}
Expand Down

0 comments on commit 3264453

Please sign in to comment.