connectedhomeip icon indicating copy to clipboard operation
connectedhomeip copied to clipboard

PayloadHeader does not have a single source of truth for "is this an ack?" state

Open bzbarsky-apple opened this issue 4 years ago • 3 comments

Problem

PayloadHeader has two different ways to represent whether it's an ack: the kExchangeFlag_AckMsg flag in mExchangeFlags and mAckId.HasValue(). This is confusing some people who think they need to change both places to be sure they have an ack id.

PayloadHeader::Decode ensures the two are in sync, and the SetAckId setters ensure they stay in sync, but it might be better if there were only one source of truth.

Proposed Solution

Have a single source of truth, probably mAckId.HasValue(). Encode could then reconstitute the flag byte based on that, and we wouldn't need the synchronization code in the SetAckId setters.

I'm a little torn on whether to leave the IsAckMsg API, since that might still confuse people, but probably best to leave it for now.

@andy31415 @pan-apple

bzbarsky-apple avatar Dec 03 '20 23:12 bzbarsky-apple

SW Dev Bug Review: Closing this, as doesn't appear needed anymore and/or is complete, please reopen if needed.

woody-apple avatar Oct 27 '21 20:10 woody-apple

This is still an issue, though mAckId is now named mAckMessageCounter.

bzbarsky-apple avatar Oct 28 '21 04:10 bzbarsky-apple

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Sep 16 '22 13:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Mar 22 '23 22:03 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Oct 15 '23 07:10 stale[bot]