golioth / golioth-firmware-sdk

Firmware SDK enabling any IoT device to connect to Golioth - the Universal Connector for IoT
https://golioth.io
Apache License 2.0
60 stars 11 forks source link

[CP SDK] Manifest with multiple artifacts not being decoded correctly #405

Closed szczys closed 7 months ago

szczys commented 7 months ago

Manifest with multiple artifacts are not decoded correctly:

[00:00:07.136,505] <inf> hello_zephyr: Manifest received
[00:00:07.136,657] <wrn> golioth_ota: Did not end CBOR list correctly
[00:00:07.136,688] <wrn> golioth_ota: Failed to decode desired map: -77

Reproduce

  1. Register to be notified of manifest updates:
    golioth_ota_observe_manifest_async(client, on_manifest, NULL);
  1. Roll out a release that has multiple artifacts
  2. Decode the payload:
    struct golioth_ota_manifest manifest;

    status = golioth_ota_payload_as_manifest(payload, payload_size, &manifest);
szczys commented 7 months ago

Lol, you need to enable multiple artifacts by increasing this Kconfig symbol from the default of 1:

CONFIG_GOLIOTH_OTA_MAX_NUM_COMPONENTS=1