Skip to content

Commit

Permalink
Remove last remaining non-enum-class bitmaps that we codegen.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Sep 12, 2023
1 parent 4442906 commit fadc94b
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <app/ConcreteCommandPath.h>
#include <app/util/af.h>
#include <app/util/config.h>
#include <lib/support/TypeTraits.h>

#include <assert.h>

Expand Down Expand Up @@ -99,7 +100,7 @@ bool emAfPluginBarrierControlServerIsPartialBarrierSupported(EndpointId endpoint
uint8_t bitmap;
EmberAfStatus status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap);
assert(status == EMBER_ZCL_STATUS_SUCCESS);
return READBITS(bitmap, EMBER_AF_BARRIER_CONTROL_CAPABILITIES_PARTIAL_BARRIER);
return (bitmap & to_underlying(BarrierControlCapabilities::kPartialBarrier)) != 0;
}

static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open)
Expand Down Expand Up @@ -139,7 +140,7 @@ uint16_t emAfPluginBarrierControlServerGetSafetyStatus(EndpointId endpoint)
static bool isRemoteLockoutOn(EndpointId endpoint)
{
uint16_t safetyStatus = emAfPluginBarrierControlServerGetSafetyStatus(endpoint);
return READBITS(safetyStatus, EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_REMOTE_LOCKOUT);
return (safetyStatus & to_underlying(BarrierControlSafetyStatus::kRemoteLockout)) != 0;
}

void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool open, bool command)
Expand Down
6 changes: 0 additions & 6 deletions src/app/common/templates/config-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ WeakEnums:
- RadioFaultEnum
- StepMode

DefineBitmaps:
# Allow-list of bitmaps that we generates as #define as well as enum classes.
# The goal is to drive this down to 0.
- BarrierControlCapabilities
- BarrierControlSafetyStatus

CommandHandlerInterfaceOnlyClusters:
# List of clusters that are implemented entirely with
# CommandHandlerInterface and hence do not need generated command dispatch.
Expand Down
9 changes: 0 additions & 9 deletions src/app/zap-templates/templates/app/enums.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,3 @@ enum EmberAf{{asType label}} : {{asUnderlyingZclType name}} {
};
{{/if}}
{{/zcl_enums}}

{{#zcl_bitmaps}}
{{#if (isInConfigList label "DefineBitmaps")}}
{{#zcl_bitmap_items}}
#define EMBER_AF_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}} ({{mask}})
#define EMBER_AF_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}}_OFFSET ({{asOffset mask}})
{{/zcl_bitmap_items}}
{{/if}}
{{/zcl_bitmaps}}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ limitations under the License.
<domain name="Closures"/>

<bitmap name="BarrierControlCapabilities" type="BITMAP8">
<cluster code="0x0103"/>
<field name="partialBarrier" mask="0x01"/>
</bitmap>

<bitmap name="BarrierControlSafetyStatus" type="BITMAP16">
<cluster code="0x0103"/>
<field name="remoteLockout" mask="0x01"/>
<field name="temperDetected" mask="0x02"/>
<field name="failedCommunication" mask="0x04"/>
Expand Down
5 changes: 5 additions & 0 deletions src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7686,3 +7686,8 @@

- release: "Future"
versions: "future"
provisional:
bitmaps:
BarrierControl:
- BarrierControlCapabilities
- BarrierControlSafetyStatus
11 changes: 11 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions zzz_generated/app-common/app-common/zap-generated/enums.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fadc94b

Please sign in to comment.