Skip to content

Commit

Permalink
Changes restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
ATmobica committed Feb 11, 2022
1 parent 4903ab5 commit 838d669
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 15 deletions.
3 changes: 1 addition & 2 deletions examples/lighting-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if(APP_TYPE STREQUAL "boot" OR APP_TYPE STREQUAL "upgrade")
endif()

include(${MBED_PATH}/tools/cmake/app.cmake)
if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W" AND BOOT_ENABLED)
if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W" AND BOOT_ENABLED)
list(REMOVE_ITEM MBED_TARGET_LABELS CM0P_SLEEP)
list(REMOVE_ITEM MBED_TARGET_DEFINITIONS COMPONENT_CM0P_SLEEP=1)
endif()
Expand Down Expand Up @@ -58,7 +58,6 @@ target_sources(${APP_TARGET} PRIVATE
main/main.cpp
main/ZclCallbacks.cpp
${GEN_DIR}/lighting-app/zap-generated/callback-stub.cpp
${GEN_DIR}/lighting-app/zap-generated/CHIPClusters.cpp
${GEN_DIR}/lighting-app/zap-generated/IMClusterCommandHandler.cpp
${MBED_COMMON}/util/LEDWidget.cpp
${MBED_COMMON}/util/DFUManager.cpp
Expand Down
5 changes: 2 additions & 3 deletions examples/lock-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if(APP_TYPE STREQUAL "boot" OR APP_TYPE STREQUAL "upgrade")
endif()

include(${MBED_PATH}/tools/cmake/app.cmake)
if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W" AND BOOT_ENABLED)
if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W" AND BOOT_ENABLED)
list(REMOVE_ITEM MBED_TARGET_LABELS CM0P_SLEEP)
list(REMOVE_ITEM MBED_TARGET_DEFINITIONS COMPONENT_CM0P_SLEEP=1)
endif()
Expand All @@ -49,7 +49,7 @@ target_include_directories(${APP_TARGET} PRIVATE
${MBED_COMMON}/util/include
${GEN_DIR}/app-common
${GEN_DIR}/lock-app
${NLIO_ROOT}
${NLIO_ROOT}
)

target_sources(${APP_TARGET} PRIVATE
Expand All @@ -58,7 +58,6 @@ target_sources(${APP_TARGET} PRIVATE
main/main.cpp
main/ZclCallbacks.cpp
${GEN_DIR}/lock-app/zap-generated/callback-stub.cpp
${GEN_DIR}/lock-app/zap-generated/CHIPClusters.cpp
${GEN_DIR}/lock-app/zap-generated/IMClusterCommandHandler.cpp
${MBED_COMMON}/util/LEDWidget.cpp
${MBED_COMMON}/util/DFUManager.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/ota-requestor-app/mbed/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,4 +513,4 @@ bool AppTask::OnUpdateApplyHandler(void * context)
}
ChipLogProgress(NotSpecified, "\tApply new update %s", response == kUser_Response_confirm ? "CONFIRM" : "REJECT");
return response == kUser_Response_confirm;
}
}
2 changes: 1 addition & 1 deletion examples/pigweed-app/mbed/main/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@

#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION MBED_CONF_APP_VERSION_NUMBER
#endif
#endif
17 changes: 12 additions & 5 deletions examples/platform/mbed/ota/generate_ota_list_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,30 @@
}
"""


def CreateOtaListFile(config, imagePath):
data = json.loads(FILE_DATA_TEMPLATE)

data["deviceSoftwareVersionModel"][0]["vendorId"] = int(config["config"]["vendor-id"]["value"])
data["deviceSoftwareVersionModel"][0]["productId"] = int(config["config"]["product-id"]["value"])
data["deviceSoftwareVersionModel"][0]["softwareVersion"] = int(config["config"]["version-number"]["value"])
data["deviceSoftwareVersionModel"][0]["softwareVersionString"] = config["config"]["version-number-str"]["value"].strip('"\\')
data["deviceSoftwareVersionModel"][0]["vendorId"] = int(
config["config"]["vendor-id"]["value"])
data["deviceSoftwareVersionModel"][0]["productId"] = int(
config["config"]["product-id"]["value"])
data["deviceSoftwareVersionModel"][0]["softwareVersion"] = int(
config["config"]["version-number"]["value"])
data["deviceSoftwareVersionModel"][0]["softwareVersionString"] = config[
"config"]["version-number-str"]["value"].strip('"\\')
data["deviceSoftwareVersionModel"][0]["otaURL"] = str(imagePath)

output_path = os.path.join(os.path.dirname(imagePath), FILE_NAME)

with open(output_path, 'w') as jsonFile:
json.dump(data, jsonFile)


def main():
if len(sys.argv) != 3:
print('Usage: ' + sys.argv[0] + ' <mbed_config_json_file_path> <image_path>')
print('Usage: ' + sys.argv[0] +
' <mbed_config_json_file_path> <image_path>')
exit(1)

config_json_path = sys.argv[1]
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/mbed/util/DFUManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ bool DFUManager::OnOtaUpdateApplyHandler(void * context)

return true;
}
#endif
#endif
2 changes: 1 addition & 1 deletion examples/platform/mbed/util/include/DFUManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ class DFUManager
inline DFUManager & GetDFUManager(void)
{
return DFUManager::sDFUMgr;
}
}
2 changes: 1 addition & 1 deletion src/platform/mbed/OTARequestorDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ void OTARequestorDriverImpl::UpdateDownloaded()
}

} // namespace DeviceLayer
} // namespace chip
} // namespace chip

0 comments on commit 838d669

Please sign in to comment.