Skip to content

Commit 8c93ec6

Browse files
[nrfconnect] Fix compilation warnings and turn on -Werror for examples (#4528)
Rename BIT/BYTE_x macros from the ember code to fix the BIT macro redeclaration (the same macro is provided by Zephyr).
1 parent 1f3e4ed commit 8c93ec6

File tree

22 files changed

+83
-74
lines changed

22 files changed

+83
-74
lines changed

examples/lighting-app/nrfconnect/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)
2525

2626
project(chip-nrf52840-lighting-example)
2727

28+
zephyr_compile_options(-Werror)
29+
2830
target_include_directories(app PRIVATE
2931
main/include
3032
${LIGHTING_COMMON}

examples/lock-app/nrfconnect/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)
2525

2626
project(chip-nrf52840-lock-example)
2727

28+
zephyr_compile_options(-Werror)
29+
2830
target_include_directories(app PRIVATE
2931
main/include
3032
${LOCK_COMMON}

examples/pigweed-app/nrfconnect/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)
2727

2828
project(chip-nrf52840-pigweed-example)
2929

30+
zephyr_compile_options(-Werror)
31+
3032
target_include_directories(app PRIVATE main/include
3133
${NRFCONNECT_COMMON}/util/include
3234
${PIGWEED_ROOT}/pw_sys_io/public

examples/shell/nrfconnect/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)
2424

2525
project(chip-nrf52840-shell-example)
2626

27+
zephyr_compile_options(-Werror)
28+
2729
target_include_directories(app PRIVATE
2830
${CMAKE_CURRENT_SOURCE_DIR}
2931
${APP_ROOT}/shell_common/include)

src/app/clusters/door-lock-server/door-lock-server-schedule.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ bool emberAfDoorLockClusterSetWeekdayScheduleCallback(uint8_t scheduleId, uint16
158158
emberAfReadServerAttribute(DOOR_LOCK_SERVER_ENDPOINT, ZCL_DOOR_LOCK_CLUSTER_ID, ZCL_RF_PROGRAMMING_EVENT_MASK_ATTRIBUTE_ID,
159159
(uint8_t *) &rfProgrammingEventMask, sizeof(rfProgrammingEventMask));
160160

161-
if (rfProgrammingEventMask & BIT(0))
161+
if (rfProgrammingEventMask & EMBER_BIT(0))
162162
{
163163
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
164164
ZCL_PROGRAMMING_EVENT_NOTIFICATION_COMMAND_ID, "uuvsuuws", 0x01, 0x00, userId, &userPin, 0x00,

src/app/clusters/door-lock-server/door-lock-server-user.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ bool emberAfDoorLockClusterSetPinCallback(uint16_t userId, uint8_t userStatus, u
281281
uint16_t rfProgrammingEventMask = 0xffff; // send event by default
282282
emberAfReadServerAttribute(DOOR_LOCK_SERVER_ENDPOINT, ZCL_DOOR_LOCK_CLUSTER_ID, ZCL_RF_PROGRAMMING_EVENT_MASK_ATTRIBUTE_ID,
283283
(uint8_t *) &rfProgrammingEventMask, sizeof(rfProgrammingEventMask));
284-
if ((rfProgrammingEventMask & BIT(2)) && !status && (pin != NULL))
284+
if ((rfProgrammingEventMask & EMBER_BIT(2)) && !status && (pin != NULL))
285285
{
286286
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
287287
ZCL_PROGRAMMING_EVENT_NOTIFICATION_COMMAND_ID, "uuvsuuws", EMBER_ZCL_DOOR_LOCK_EVENT_SOURCE_RF,
@@ -350,14 +350,14 @@ bool emberAfDoorLockClusterClearPinCallback(uint16_t userId)
350350
uint8_t userPin = 0x00; // Zero length Zigbee string
351351
emberAfReadServerAttribute(DOOR_LOCK_SERVER_ENDPOINT, ZCL_DOOR_LOCK_CLUSTER_ID, ZCL_RF_PROGRAMMING_EVENT_MASK_ATTRIBUTE_ID,
352352
(uint8_t *) &rfProgrammingEventMask, sizeof(rfProgrammingEventMask));
353-
if ((rfProgrammingEventMask & BIT(2)) && !status)
353+
if ((rfProgrammingEventMask & EMBER_BIT(2)) && !status)
354354
{
355355
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
356356
ZCL_PROGRAMMING_EVENT_NOTIFICATION_COMMAND_ID, "uuvsuuws", 0x01, 0x03, userId, &userPin, 0x00,
357357
0x00, 0x00, &userPin);
358358
SEND_COMMAND_UNICAST_TO_BINDINGS();
359359
}
360-
else if ((rfProgrammingEventMask & BIT(0)) && status)
360+
else if ((rfProgrammingEventMask & EMBER_BIT(0)) && status)
361361
{
362362
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
363363
ZCL_PROGRAMMING_EVENT_NOTIFICATION_COMMAND_ID, "uuvsuuws", 0x01, 0x00, userId, &userPin, 0x00,
@@ -550,15 +550,15 @@ bool emberAfDoorLockClusterLockDoorCallback(uint8_t * PIN)
550550
// Possibly send operation event
551551
if (doorLocked)
552552
{
553-
if (rfOperationEventMask & BIT(1) && (PIN != NULL))
553+
if (rfOperationEventMask & EMBER_BIT(1) && (PIN != NULL))
554554
{
555555
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
556556
ZCL_OPERATION_EVENT_NOTIFICATION_COMMAND_ID, "uuvsws", 0x01, 0x03, userId, PIN, 0X00, PIN);
557557
}
558558
}
559559
else
560560
{
561-
if (rfOperationEventMask & BIT(3) && (PIN != NULL))
561+
if (rfOperationEventMask & EMBER_BIT(3) && (PIN != NULL))
562562
{
563563
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
564564
ZCL_OPERATION_EVENT_NOTIFICATION_COMMAND_ID, "uuvsws", 0x01, 0x03, userId, PIN, 0x00, PIN);
@@ -599,7 +599,7 @@ bool emberAfDoorLockClusterUnlockDoorCallback(uint8_t * pin)
599599
(uint8_t *) &rfOperationEventMask, sizeof(rfOperationEventMask));
600600

601601
// send operation event
602-
if (doorUnlocked && (rfOperationEventMask & BIT(2)) && (pin != NULL))
602+
if (doorUnlocked && (rfOperationEventMask & EMBER_BIT(2)) && (pin != NULL))
603603
{
604604
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
605605
ZCL_OPERATION_EVENT_NOTIFICATION_COMMAND_ID, "uuvsws", EMBER_ZCL_DOOR_LOCK_EVENT_SOURCE_RF,

src/app/clusters/groups-server/groups-server.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ bool emberAfGroupsClusterGetGroupMembershipCallback(uint8_t groupCount, uint8_t
234234
status = emberGetBinding(i, &entry);
235235
if ((status == EMBER_SUCCESS) && (entry.type == EMBER_MULTICAST_BINDING) && (entry.local == emberAfCurrentEndpoint()))
236236
{
237-
list[listLen] = LOW_BYTE(entry.groupId);
238-
list[listLen + 1] = HIGH_BYTE(entry.groupId);
237+
list[listLen] = EMBER_LOW_BYTE(entry.groupId);
238+
list[listLen + 1] = EMBER_HIGH_BYTE(entry.groupId);
239239
listLen = static_cast<uint8_t>(listLen + 2);
240240
count++;
241241
}
@@ -254,8 +254,8 @@ bool emberAfGroupsClusterGetGroupMembershipCallback(uint8_t groupCount, uint8_t
254254
{
255255
if (entry.local == emberAfCurrentEndpoint() && entry.groupId == groupId)
256256
{
257-
list[listLen] = LOW_BYTE(groupId);
258-
list[listLen + 1] = HIGH_BYTE(groupId);
257+
list[listLen] = EMBER_LOW_BYTE(groupId);
258+
list[listLen + 1] = EMBER_HIGH_BYTE(groupId);
259259
listLen = static_cast<uint8_t>(listLen + 2);
260260
count++;
261261
}

src/app/clusters/ias-zone-client/ias-zone-client.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ static EmberStatus sendCommand(EmberNodeId destAddress)
402402
static void setCieAddress(EmberNodeId destAddress)
403403
{
404404
uint8_t writeAttributes[] = {
405-
LOW_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
406-
HIGH_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
405+
EMBER_LOW_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
406+
EMBER_HIGH_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
407407
ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE,
408408
0,
409409
0,
@@ -488,11 +488,11 @@ void emberAfPluginIasZoneClientZdoMessageReceivedCallback(EmberNodeId emberNodeI
488488
void readIasZoneServerAttributes(EmberNodeId nodeId)
489489
{
490490
uint8_t iasZoneAttributeIds[] = {
491-
LOW_BYTE(ZCL_ZONE_STATE_ATTRIBUTE_ID), HIGH_BYTE(ZCL_ZONE_STATE_ATTRIBUTE_ID),
491+
EMBER_LOW_BYTE(ZCL_ZONE_STATE_ATTRIBUTE_ID), EMBER_HIGH_BYTE(ZCL_ZONE_STATE_ATTRIBUTE_ID),
492492

493-
LOW_BYTE(ZCL_ZONE_TYPE_ATTRIBUTE_ID), HIGH_BYTE(ZCL_ZONE_TYPE_ATTRIBUTE_ID),
493+
EMBER_LOW_BYTE(ZCL_ZONE_TYPE_ATTRIBUTE_ID), EMBER_HIGH_BYTE(ZCL_ZONE_TYPE_ATTRIBUTE_ID),
494494

495-
LOW_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID), HIGH_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID),
495+
EMBER_LOW_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID), EMBER_HIGH_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID),
496496
};
497497
emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), ZCL_IAS_ZONE_CLUSTER_ID,
498498
ZCL_READ_ATTRIBUTES_COMMAND_ID, "b", iasZoneAttributeIds, sizeof(iasZoneAttributeIds));
@@ -505,8 +505,8 @@ void readIasZoneServerAttributes(EmberNodeId nodeId)
505505
void readIasZoneServerCieAddress(EmberNodeId nodeId)
506506
{
507507
uint8_t iasZoneAttributeIds[] = {
508-
LOW_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
509-
HIGH_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
508+
EMBER_LOW_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
509+
EMBER_HIGH_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
510510
};
511511
emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), ZCL_IAS_ZONE_CLUSTER_ID,
512512
ZCL_READ_ATTRIBUTES_COMMAND_ID, "b", iasZoneAttributeIds, sizeof(iasZoneAttributeIds));

src/app/clusters/messaging-client/messaging-client.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static void esiDeletionCallback(uint8_t esiIndex)
5858
uint8_t i;
5959
for (i = 0; i < EMBER_AF_MESSAGING_CLUSTER_CLIENT_ENDPOINT_COUNT; i++)
6060
{
61-
messageTable[i].esiBitmask &= ~BIT(esiIndex);
61+
messageTable[i].esiBitmask &= ~EMBER_BIT(esiIndex);
6262
}
6363
}
6464

@@ -159,9 +159,10 @@ bool emberAfMessagingClusterDisplayMessageCallback(uint32_t messageId, uint8_t m
159159
if (messageId == messageTable[ep].messageId)
160160
{
161161
// Duplicate message from a different ESI, add the ESI to the bitmask
162-
if (esiIndex < EMBER_AF_PLUGIN_ESI_MANAGEMENT_ESI_TABLE_SIZE && (messageTable[ep].esiBitmask & BIT(esiIndex)) == 0)
162+
if (esiIndex < EMBER_AF_PLUGIN_ESI_MANAGEMENT_ESI_TABLE_SIZE &&
163+
(messageTable[ep].esiBitmask & EMBER_BIT(esiIndex)) == 0)
163164
{
164-
messageTable[ep].esiBitmask |= BIT(esiIndex);
165+
messageTable[ep].esiBitmask |= EMBER_BIT(esiIndex);
165166
}
166167
// Either way, we send back a default response.
167168
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS);
@@ -179,7 +180,7 @@ bool emberAfMessagingClusterDisplayMessageCallback(uint32_t messageId, uint8_t m
179180

180181
if (esiIndex < EMBER_AF_PLUGIN_ESI_MANAGEMENT_ESI_TABLE_SIZE)
181182
{
182-
messageTable[ep].esiBitmask = BIT(esiIndex);
183+
messageTable[ep].esiBitmask = EMBER_BIT(esiIndex);
183184
}
184185

185186
messageTable[ep].clientEndpoint = emberAfCurrentCommand()->apsFrame->destinationEndpoint;
@@ -314,7 +315,7 @@ EmberAfStatus emberAfPluginMessagingClientConfirmMessage(EndpointId endpoint)
314315
{
315316
EmberAfPluginEsiManagementEsiEntry * esiEntry = emberAfPluginEsiManagementEsiLookUpByIndex(i);
316317
EmberNodeId nodeId;
317-
if ((messageTable[ep].esiBitmask & BIT(i)) == 0 || esiEntry == NULL)
318+
if ((messageTable[ep].esiBitmask & EMBER_BIT(i)) == 0 || esiEntry == NULL)
318319
{
319320
continue;
320321
}

src/app/clusters/messaging-client/messaging-client.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
// Message Control byte
4545
// ----------------------------------------------------------------------------
4646

47-
#define ZCL_MESSAGING_CLUSTER_TRANSMISSION_MASK (BIT(1) | BIT(0))
48-
#define ZCL_MESSAGING_CLUSTER_IMPORTANCE_MASK (BIT(3) | BIT(2))
49-
#define ZCL_MESSAGING_CLUSTER_CONFIRMATION_MASK BIT(7)
47+
#define ZCL_MESSAGING_CLUSTER_TRANSMISSION_MASK (EMBER_BIT(1) | EMBER_BIT(0))
48+
#define ZCL_MESSAGING_CLUSTER_IMPORTANCE_MASK (EMBER_BIT(3) | EMBER_BIT(2))
49+
#define ZCL_MESSAGING_CLUSTER_CONFIRMATION_MASK EMBER_BIT(7)
5050

5151
#define ZCL_MESSAGING_CLUSTER_START_TIME_NOW 0x00000000UL
5252
#define ZCL_MESSAGING_CLUSTER_END_TIME_NEVER 0xFFFFFFFFUL

src/app/clusters/messaging-server/messaging-server.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ static EmberAfPluginMessagingServerMessage msgTable[EMBER_AF_MESSAGING_CLUSTER_S
5151

5252
// These bits are used by the messageStatusControl to indicate whether or not
5353
// a message is valid, active, or if it is a "send now" message
54-
#define VALID BIT(0)
55-
#define ACTIVE BIT(1)
56-
#define NOW BIT(2)
54+
#define VALID EMBER_BIT(0)
55+
#define ACTIVE EMBER_BIT(1)
56+
#define NOW EMBER_BIT(2)
5757

5858
#define messageIsValid(ep) (msgTable[ep].messageStatusControl & VALID)
5959
#define messageIsActive(ep) (msgTable[ep].messageStatusControl & ACTIVE)

src/app/clusters/messaging-server/messaging-server.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
// Message Control byte
4545
// ----------------------------------------------------------------------------
4646

47-
#define ZCL_MESSAGING_CLUSTER_TRANSMISSION_MASK (BIT(1) | BIT(0))
48-
#define ZCL_MESSAGING_CLUSTER_IMPORTANCE_MASK (BIT(3) | BIT(2))
49-
#define ZCL_MESSAGING_CLUSTER_RESERVED_MASK (BIT(6) | BIT(5) | BIT(4))
50-
#define ZCL_MESSAGING_CLUSTER_CONFIRMATION_MASK BIT(7)
47+
#define ZCL_MESSAGING_CLUSTER_TRANSMISSION_MASK (EMBER_BIT(1) | EMBER_BIT(0))
48+
#define ZCL_MESSAGING_CLUSTER_IMPORTANCE_MASK (EMBER_BIT(3) | EMBER_BIT(2))
49+
#define ZCL_MESSAGING_CLUSTER_RESERVED_MASK (EMBER_BIT(6) | EMBER_BIT(5) | EMBER_BIT(4))
50+
#define ZCL_MESSAGING_CLUSTER_CONFIRMATION_MASK EMBER_BIT(7)
5151

5252
#define ZCL_MESSAGING_CLUSTER_START_TIME_NOW 0x00000000UL
5353
#define ZCL_MESSAGING_CLUSTER_END_TIME_NEVER 0xFFFFFFFFUL

src/app/clusters/scenes/scenes.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void emberAfScenesClusterServerInitCallback(EndpointId endpoint)
106106
#ifdef EMBER_AF_PLUGIN_SCENES_NAME_SUPPORT
107107
{
108108
// The high bit of Name Support indicates whether scene names are supported.
109-
uint8_t nameSupport = BIT(7);
109+
uint8_t nameSupport = EMBER_BIT(7);
110110
writeServerAttribute(endpoint, ZCL_SCENES_CLUSTER_ID, ZCL_SCENE_NAME_SUPPORT_ATTRIBUTE_ID, "name support",
111111
(uint8_t *) &nameSupport, ZCL_BITMAP8_ATTRIBUTE_TYPE);
112112
}

src/app/clusters/zll-on-off-server/zll-on-off-server.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#include "zll-on-off-server.h"
5656
#include "../../include/af.h"
5757

58-
#define ZLL_ON_OFF_CLUSTER_ON_OFF_CONTROL_ACCEPT_ONLY_WHEN_ON_MASK BIT(0)
58+
#define ZLL_ON_OFF_CLUSTER_ON_OFF_CONTROL_ACCEPT_ONLY_WHEN_ON_MASK EMBER_BIT(0)
5959

6060
#define readOnOff(endpoint, onOff) readBoolean((endpoint), ZCL_ON_OFF_ATTRIBUTE_ID, "on/off", (onOff))
6161
#define writeOnOff(endpoint, onOff) writeBoolean((endpoint), ZCL_ON_OFF_ATTRIBUTE_ID, "on/off", (onOff))

src/app/clusters/zll-scenes-server/zll-scenes-server.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#include "../../include/af.h"
5656
#include "../scenes/scenes.h"
5757

58-
#define ZCL_SCENES_CLUSTER_MODE_COPY_ALL_SCENES_MASK BIT(0)
58+
#define ZCL_SCENES_CLUSTER_MODE_COPY_ALL_SCENES_MASK EMBER_BIT(0)
5959

6060
bool emberAfScenesClusterEnhancedAddSceneCallback(uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName,
6161
uint8_t * extensionFieldSets)

src/app/reporting/reporting.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ static void putReportableChangeInResp(const EmberAfPluginReportingEntry * entry,
10431043
uint32_t value = entry->data.reported.reportableChange;
10441044
for (; bytes > 0; bytes--)
10451045
{
1046-
uint8_t b = BYTE_0(value);
1046+
uint8_t b = EMBER_BYTE_0(value);
10471047
emberAfPutInt8uInResp(b);
10481048
value >>= 8;
10491049
}

src/app/util/af.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -1670,18 +1670,18 @@ EmberStatus emberAfInitiatePartnerLinkKeyExchange(EmberNodeId target, chip::Endp
16701670
// @{
16711671
// Frame control fields (8 bits total)
16721672
// Bits 0 and 1 are Frame Type Sub-field
1673-
#define ZCL_FRAME_CONTROL_FRAME_TYPE_MASK (BIT(0) | BIT(1))
1674-
#define ZCL_CLUSTER_SPECIFIC_COMMAND BIT(0)
1673+
#define ZCL_FRAME_CONTROL_FRAME_TYPE_MASK (EMBER_BIT(0) | EMBER_BIT(1))
1674+
#define ZCL_CLUSTER_SPECIFIC_COMMAND EMBER_BIT(0)
16751675
#define ZCL_PROFILE_WIDE_COMMAND 0
16761676
#define ZCL_GLOBAL_COMMAND (ZCL_PROFILE_WIDE_COMMAND)
16771677
// Bit 2 is Manufacturer Specific Sub-field
1678-
#define ZCL_MANUFACTURER_SPECIFIC_MASK BIT(2)
1678+
#define ZCL_MANUFACTURER_SPECIFIC_MASK EMBER_BIT(2)
16791679
// Bit 3 is Direction Sub-field
1680-
#define ZCL_FRAME_CONTROL_DIRECTION_MASK BIT(3)
1681-
#define ZCL_FRAME_CONTROL_SERVER_TO_CLIENT BIT(3)
1680+
#define ZCL_FRAME_CONTROL_DIRECTION_MASK EMBER_BIT(3)
1681+
#define ZCL_FRAME_CONTROL_SERVER_TO_CLIENT EMBER_BIT(3)
16821682
#define ZCL_FRAME_CONTROL_CLIENT_TO_SERVER 0
16831683
// Bit 4 is Disable Default Response Sub-field
1684-
#define ZCL_DISABLE_DEFAULT_RESPONSE_MASK BIT(4)
1684+
#define ZCL_DISABLE_DEFAULT_RESPONSE_MASK EMBER_BIT(4)
16851685
// Bits 5 to 7 are reserved
16861686

16871687
#define ZCL_DIRECTION_CLIENT_TO_SERVER 0
@@ -1695,8 +1695,8 @@ EmberStatus emberAfInitiatePartnerLinkKeyExchange(EmberNodeId target, chip::Endp
16951695
#define EMBER_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD 5
16961696

16971697
// Permitted values for emberAfSetFormAndJoinMode
1698-
#define FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ BIT(0)
1699-
#define FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ BIT(1)
1698+
#define FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ EMBER_BIT(0)
1699+
#define FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ EMBER_BIT(1)
17001700
#define FIND_AND_JOIN_MODE_ALLOW_BOTH (FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ | FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ)
17011701

17021702
/** @} END ZCL macros */

src/app/util/attribute-table.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ EmberAfStatus emberAfAppendAttributeReportFields(EndpointId endpoint, ClusterId
438438
goto kickout;
439439
}
440440

441-
buffer[(*bufIndex)++] = LOW_BYTE(attributeId);
442-
buffer[(*bufIndex)++] = HIGH_BYTE(attributeId);
441+
buffer[(*bufIndex)++] = EMBER_LOW_BYTE(attributeId);
442+
buffer[(*bufIndex)++] = EMBER_HIGH_BYTE(attributeId);
443443
buffer[(*bufIndex)++] = type;
444444
#if (BIGENDIAN_CPU)
445445
if (isThisDataTypeSentLittleEndianOTA(type))

src/app/util/client-api.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ static uint16_t vFillBuffer(uint8_t * buffer, uint16_t bufferLen, uint8_t frameC
8585
buffer[bytes++] = frameControl;
8686
if (manufacturerCode != EMBER_AF_NULL_MANUFACTURER_CODE)
8787
{
88-
buffer[bytes++] = LOW_BYTE(manufacturerCode);
89-
buffer[bytes++] = HIGH_BYTE(manufacturerCode);
88+
buffer[bytes++] = EMBER_LOW_BYTE(manufacturerCode);
89+
buffer[bytes++] = EMBER_HIGH_BYTE(manufacturerCode);
9090
}
9191
buffer[bytes++] = emberAfNextSequence();
9292
buffer[bytes++] = commandId;
@@ -202,7 +202,7 @@ static uint16_t vFillBuffer(uint8_t * buffer, uint16_t bufferLen, uint8_t frameC
202202
// endian format.
203203
for (; 0 < valueLen; valueLen--)
204204
{
205-
buffer[bytes++] = LOW_BYTE(value);
205+
buffer[bytes++] = EMBER_LOW_BYTE(value);
206206
value = value >> 8;
207207
}
208208

src/app/util/message.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ uint8_t * emberAfPutInt8uInResp(uint8_t value)
9494

9595
uint16_t * emberAfPutInt16uInResp(uint16_t value)
9696
{
97-
uint8_t * low = emberAfPutInt8uInResp(LOW_BYTE(value));
98-
uint8_t * high = emberAfPutInt8uInResp(HIGH_BYTE(value));
97+
uint8_t * low = emberAfPutInt8uInResp(EMBER_LOW_BYTE(value));
98+
uint8_t * high = emberAfPutInt8uInResp(EMBER_HIGH_BYTE(value));
9999

100100
if (low && high)
101101
{
@@ -109,10 +109,10 @@ uint16_t * emberAfPutInt16uInResp(uint16_t value)
109109

110110
uint32_t * emberAfPutInt32uInResp(uint32_t value)
111111
{
112-
uint8_t * a = emberAfPutInt8uInResp(BYTE_0(value));
113-
uint8_t * b = emberAfPutInt8uInResp(BYTE_1(value));
114-
uint8_t * c = emberAfPutInt8uInResp(BYTE_2(value));
115-
uint8_t * d = emberAfPutInt8uInResp(BYTE_3(value));
112+
uint8_t * a = emberAfPutInt8uInResp(EMBER_BYTE_0(value));
113+
uint8_t * b = emberAfPutInt8uInResp(EMBER_BYTE_1(value));
114+
uint8_t * c = emberAfPutInt8uInResp(EMBER_BYTE_2(value));
115+
uint8_t * d = emberAfPutInt8uInResp(EMBER_BYTE_3(value));
116116

117117
if (a && b && c && d)
118118
{
@@ -126,9 +126,9 @@ uint32_t * emberAfPutInt32uInResp(uint32_t value)
126126

127127
uint32_t * emberAfPutInt24uInResp(uint32_t value)
128128
{
129-
uint8_t * a = emberAfPutInt8uInResp(BYTE_0(value));
130-
uint8_t * b = emberAfPutInt8uInResp(BYTE_1(value));
131-
uint8_t * c = emberAfPutInt8uInResp(BYTE_2(value));
129+
uint8_t * a = emberAfPutInt8uInResp(EMBER_BYTE_0(value));
130+
uint8_t * b = emberAfPutInt8uInResp(EMBER_BYTE_1(value));
131+
uint8_t * c = emberAfPutInt8uInResp(EMBER_BYTE_2(value));
132132

133133
if (a && b && c)
134134
{

0 commit comments

Comments
 (0)