project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.32k stars 1.96k forks source link

Content Launcher feature map shows up as indexes instead of bitmask #33444

Open andy31415 opened 3 months ago

andy31415 commented 3 months ago

Definition of

<bitmap name="Feature" type="bitmap32">
     <cluster code="0x050a"/>
     <field name="ContentSearch" mask="0x1"/>
     <field name="URLPlayback" mask="0x2"/>
     <field name="AdvancedSeek" mask="0x3"/>
     <field name="TextTracks" mask="0x4"/>
     <field name="AudioTracks" mask="0x5"/>
   </bitmap>

is wrong because masks should be 0x01, 0x02, 0x04, 0x08, 0x10, ... instead of using indexes. This prevented us from migrating to feature bits for these features.

If we use these, there may be sideffects. Need to update the data type and validate if there are any sideffects in code (that thinks these are indexes instead of bitmasks).

bzbarsky-apple commented 3 months ago

Looks like the buggy XML was added in https://github.com/project-chip/connectedhomeip/pull/30691 @lazarkov @hawk248 @Brian-Resideo

chrisdecenzo commented 3 months ago

These are not actually used in the code today, but this should be fixed to prevent future issues in case developers reference the output from these.

bzbarsky-apple commented 3 months ago

These are not actually used in the code today

They're shipped in the Android and Python APIs, no? (And Darwin, but we made sure to not expose this to API consumers so far....)

brdandu commented 3 months ago

We should also look into ZAP have an upgrade mechanism where things like this can be fixed. The latest ZAP can have upgrade rules to fix old .zap files opened with latest GSDK.