Skip to content

Commit

Permalink
Message counter storage issue temporary fix (#7288)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-apple authored Jun 3, 2021
1 parent 5f8176a commit 8dc374e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/controller/CHIPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@ CHIP_ERROR Device::Deserialize(const SerializedDevice & input)
mLocalMessageCounter = Encoding::LittleEndian::HostSwap32(serializable.mLocalMessageCounter);
mPeerMessageCounter = Encoding::LittleEndian::HostSwap32(serializable.mPeerMessageCounter);

// TODO - Remove the hack that's incrementing message counter while deserializing device
// This hack was added as a quick workaround for TE3 testing. The commissioning code
// is closing the exchange after the device has already been serialized and persisted to the storage.
// While closing the exchange, the outstanding ack gets sent to the device, thus incrementing
// the local message counter. As the device information was stored prior to sending the ack, it now has
// the old counter value (which is 1 less than the updated counter).
mLocalMessageCounter++;

mCASESessionKeyId = Encoding::LittleEndian::HostSwap16(serializable.mCASESessionKeyId);
mDeviceProvisioningComplete = (serializable.mDeviceProvisioningComplete != 0);

Expand Down

0 comments on commit 8dc374e

Please sign in to comment.