Skip to content

Commit

Permalink
[ESP32] Fix ota file path and update ota provider readme with ACL (#1…
Browse files Browse the repository at this point in the history
…7092)

requirements
  • Loading branch information
shubhamdp authored and pull[bot] committed Dec 8, 2023
1 parent 314887c commit 7795877
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions examples/ota-provider-app/esp32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,34 @@ idf.py -p <OTAProviderSerialPort> flash
./out/debug/chip-tool pairing ble-wifi 12345 <ssid> <passphrase> 20202021 3841
```

## Access control list requirements

Commissioner or Administrator should install necessary ACL entries at
commissioning time or later to enable processing of QueryImage commands from OTA
Requestors on their fabric, otherwise that OTA Provider will not be usable by
OTA Requestors.

Since the ACL attribute contains a list of entries, we cannot append a single
entry to it. So, read the ACL entries and append an entry which grants operate
privileges to all nodes for the OTA Provider cluster (0x0029) on every endpoint.

- Read the ACL attribute

```
./out/debug/chip-tool accesscontrol read acl 12345 0
```

- Write the ACL attribute

```
out/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": [{"cluster": 41, "endpoint": null, "deviceType": null}]}]' 12345 0
```

First entry created as part of commissioning which grants administer privilege
to the node ID 112233 (default controller node ID) for all clusters on every
endpoint. Seconds entry is the new entry being added which grants operate
privileges to all nodes for the OTA Provider cluster (0x0029) on every endpoint

## Set delayed action time (Optional)

- Set delayed action time in the Query Image Response and Apply Update
Expand Down
2 changes: 1 addition & 1 deletion examples/ota-provider-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void InitServer(intptr_t context)
if (otaImageLen > 0)
{
otaProvider.SetQueryImageStatus(OTAQueryStatus::kUpdateAvailable);
otaProvider.SetOTAFilePath(otaFilename);
otaProvider.SetOTAFilePath(otaImagePath);
}

chip::app::Clusters::OTAProvider::SetDelegate(kOtaProviderEndpoint, &otaProvider);
Expand Down

0 comments on commit 7795877

Please sign in to comment.