forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Darwin backwards-compat shims for the TestCluster rename. (projec…
…t-chip#23611) project-chip#23495 renamed "TestCluster" to "UnitTesting", which changed a bunch of Darwin APIs. This PR puts in place backwards-compat shims to avoid API changes. Specifically, compared to revision 9a41c9c (right before project-chip#23495 landed), the changes to Darwin code end up looking like this: 1. MTRAttributeTLVValueDecoder.mm: internal-only changes to cluster ids. 2. MTRBaseClusters.h: * MTRBaseClusterTestCluster renamed to MTRBaseClusterUnitTesting, which is marked MTR_NEWLY_AVAILABLE. * Various modifications to methods on MTRBaseClusterUnitTesting that are marked MTR_NEWLY_AVAILABLE, so these changes are OK. * MTRBaseClusterTestCluster is added as a subclass of MTRBaseClusterUnitTesting. * The MTRBaseClusterTestCluster (Deprecated) bits are not changed at all. * The MTRUnitTesting enums/bitmaps are added as MTR_NEWLY_AVAILABLE. * The MTRTestCluster enums/bitmaps are marked as MTR_NEWLY_DEPRECATED. 3. MTRBaseClusters.mm: The various (Deprecated) bits get shims on the completion handlers to handle the fact that for MTRBaseClusterTestCluster (Deprecated) the types in the completions are TestCluster but we want to call things that expect UnitTesting types, so we have to cast between them. We could restrict these shims to just TestCluster with enough work, but it does not seem worth it. 4. MTRBaseClusters_internal.h: just follows the renaming from MTRBaseClusters.h 5. MTRCallbackBridge.mm: just follows the renamings of the various struct types, commands, etc.. 6. MTRCallbackBridge_internal.h: just follows the renaming of the various struct types. 7. MTRClusterConstants.h: marks the old constants as MTR_NEWLY_DEPRECATED and adds the new constants as MTR_NEWLY_AVAILABLE. 8. MTRClusters.h: * MTRClusterTestCluster renamed to MTRClusterUnitTesting, which is marked MTR_NEWLY_AVAILABLE. * Various modifications to methods on MTRClusterUnitTesting that are marked MTR_NEWLY_AVAILABLE, so these changes are OK. * MTRClusterTestCluster is added as a subclass of MTRClusterUnitTesting. * The MTRClusterTestCluster (Deprecated) bits are not changed at all. 9. MTRClusters.mm: The various (Deprecated) bits get shims on the completion handlers, like for MTRBaseClusters.mm above. 10. MTRClusters_internal.h: Just follows the renaming from MTRClusters.h 11. MTRCommandPayloadsObjc.h: * Renames payload structs to UnitTesting, marks them MTR_NEWLY_AVAILABLE * Adds subclasses of the payload structs with the old name that are marked as MTR_NEWLY_DEPRECATED and have no extra selectors. * Changes types of struct members of payloads to have the UnitTesting types. 12. MTRCommandPayloadsObjc.mm: just follows the header changes. 13. MTREventTLVValueDecoder.mm: Internal changes to ID names. 14. MTRStructsObjc.h: * Renames structs defined in the unit testing cluster to UnitTesting names, marks them MTR_NEWLY_AVAILABLE. * Adds subclasses of the structs with the old name that are marked as MTR_NEWLY_DEPRECATED and have no extra selectors. 15. MTRStructsObjc.mm: just follows the header changes.
- Loading branch information
1 parent
3302741
commit 7d0f91f
Showing
19 changed files
with
15,630 additions
and
3,953 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.