Skip to content

Commit

Permalink
Restart operational advertisements when we get a new opcert. (#7885)
Browse files Browse the repository at this point in the history
Per the spec, the commissioning flow goes like this:

1. Various steps.
2. Install a new opcert.
3. Optionally configure and enable a network.
4. Discover each other on the operational network.

This means when the commissionnee gets a new opcert it needs to start
operational advertisement (if it's able to), because it doesn't know
whether the next step on the part of the commissioner will be network
config or operational discovery.

In particular, adding a new opcert adds a new fabric and node id, so
we need to redo our operational advertisements in the case when we are
already on the operational network to advertise the new operational
identity.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Sep 13, 2021
1 parent c61d9b5 commit e8b32b8
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <app/common/gen/attribute-type.h>
#include <app/common/gen/cluster-id.h>
#include <app/common/gen/command-id.h>
#include <app/server/Mdns.h>
#include <app/server/Server.h>
#include <app/util/af.h>
#include <app/util/attribute-storage.h>
Expand Down Expand Up @@ -343,6 +344,12 @@ bool emberAfOperationalCredentialsClusterAddOpCertCallback(chip::app::Command *
VerifyOrExit(admin->SetOperationalCert(OperationalCert) == CHIP_NO_ERROR, status = EMBER_ZCL_STATUS_FAILURE);
VerifyOrExit(GetGlobalAdminPairingTable().Store(admin->GetAdminId()) == CHIP_NO_ERROR, status = EMBER_ZCL_STATUS_FAILURE);

// We have a new operational identity and should start advertising it. We
// can't just wait until we get network configuration commands, because we
// might be on the operational network already, in which case we are
// expected to be live with our new identity at this point.
chip::app::Mdns::StartServer();

exit:
emberAfSendImmediateDefaultResponse(status);
if (status == EMBER_ZCL_STATUS_FAILURE)
Expand Down

0 comments on commit e8b32b8

Please sign in to comment.