Various fixes and improvements (#435)

- Fix for `sdkconfig` generation: the keys that contained the MCU type in its name weren't properly upper-cased.
- Moved WiFi configuration property files to the user data path of the app instead of a fixed location.
- Moved more properties from `device.py` to `sdkconfig/default.properties`
- Fix for `device.cmake` device id parsing: separate basic property parsing from device id validation
- Created internal `tt::service::wifi::findServiceContext()`
- Changed Wi-Fi service id to lowercase (will change it for other services later)
This commit is contained in:
Ken Van Hoeylandt
2025-12-25 15:41:39 +01:00
committed by GitHub
parent 261796068e
commit f48654d3dc
10 changed files with 91 additions and 34 deletions
+6 -1
View File
@@ -14,7 +14,7 @@ function(INIT_TACTILITY_GLOBALS SDKCONFIG_FILE)
message(FATAL_ERROR "sdkconfig file not found:\nMake sure you select a device by running \"python device.py [device-id]\"\n")
endif ()
file(READ ${SDKCONFIG_FILE_ABS} sdkconfig_text)
string(REGEX MATCH "(CONFIG_TT_DEVICE_ID\=\"[a-z0-9_\-]*\")" sdkconfig_device_id "${sdkconfig_text}")
string(REGEX MATCH "(CONFIG_TT_DEVICE_ID\=\"[^\"]*\")" sdkconfig_device_id "${sdkconfig_text}")
if (sdkconfig_device_id STREQUAL "CONFIG_TT_DEVICE_ID=\"\"" OR sdkconfig_device_id STREQUAL "")
message(FATAL_ERROR "CONFIG_TT_DEVICE_ID not found in sdkconfig:\nMake sure you select a device with 'python device.py device-id'")
endif ()
@@ -24,6 +24,11 @@ function(INIT_TACTILITY_GLOBALS SDKCONFIG_FILE)
math(EXPR id_length "${sdkconfig_device_id_length} - 22")
# Skip 'CONFIG_TT_DEVICE_ID="' then read the relevant (remaining) chars
string(SUBSTRING ${sdkconfig_device_id} 21 ${id_length} device_id)
# Validate device id
if (NOT device_id MATCHES "^[a-z0-9\-]*$")
message(FATAL_ERROR "Device identifier ${device_id} contains invalid characters. Valid characters: a-z 0-9 \"-\"")
endif ()
# Output results
message("Device identifier: ${Cyan}${device_id}${ColorReset}")
set(TACTILITY_DEVICE_PROJECT ${device_id})
message("Device project path: ${Cyan}Devices/${TACTILITY_DEVICE_PROJECT}${ColorReset}\n")