Skip to content

Commit

Permalink
Changes restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
ATmobica committed Feb 8, 2022
1 parent c181f6a commit 6ba31ca
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
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 6ba31ca

Please sign in to comment.