Skip to content

Commit

Permalink
[nrfconnect] Fix compilation warnings and turn on -Werror for examples (
Browse files Browse the repository at this point in the history
#4528)

Rename BIT/BYTE_x macros from the ember code to fix the BIT
macro redeclaration (the same macro is provided by Zephyr).
  • Loading branch information
Damian-Nordic authored Jan 27, 2021
1 parent 1f3e4ed commit 8c93ec6
Show file tree
Hide file tree
Showing 22 changed files with 83 additions and 74 deletions.
2 changes: 2 additions & 0 deletions examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)

project(chip-nrf52840-lighting-example)

zephyr_compile_options(-Werror)

target_include_directories(app PRIVATE
main/include
${LIGHTING_COMMON}
Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)

project(chip-nrf52840-lock-example)

zephyr_compile_options(-Werror)

target_include_directories(app PRIVATE
main/include
${LOCK_COMMON}
Expand Down
2 changes: 2 additions & 0 deletions examples/pigweed-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)

project(chip-nrf52840-pigweed-example)

zephyr_compile_options(-Werror)

target_include_directories(app PRIVATE main/include
${NRFCONNECT_COMMON}/util/include
${PIGWEED_ROOT}/pw_sys_io/public
Expand Down
2 changes: 2 additions & 0 deletions examples/shell/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)

project(chip-nrf52840-shell-example)

zephyr_compile_options(-Werror)

target_include_directories(app PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${APP_ROOT}/shell_common/include)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ bool emberAfDoorLockClusterSetWeekdayScheduleCallback(uint8_t scheduleId, uint16
emberAfReadServerAttribute(DOOR_LOCK_SERVER_ENDPOINT, ZCL_DOOR_LOCK_CLUSTER_ID, ZCL_RF_PROGRAMMING_EVENT_MASK_ATTRIBUTE_ID,
(uint8_t *) &rfProgrammingEventMask, sizeof(rfProgrammingEventMask));

if (rfProgrammingEventMask & BIT(0))
if (rfProgrammingEventMask & EMBER_BIT(0))
{
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
ZCL_PROGRAMMING_EVENT_NOTIFICATION_COMMAND_ID, "uuvsuuws", 0x01, 0x00, userId, &userPin, 0x00,
Expand Down
12 changes: 6 additions & 6 deletions src/app/clusters/door-lock-server/door-lock-server-user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ bool emberAfDoorLockClusterSetPinCallback(uint16_t userId, uint8_t userStatus, u
uint16_t rfProgrammingEventMask = 0xffff; // send event by default
emberAfReadServerAttribute(DOOR_LOCK_SERVER_ENDPOINT, ZCL_DOOR_LOCK_CLUSTER_ID, ZCL_RF_PROGRAMMING_EVENT_MASK_ATTRIBUTE_ID,
(uint8_t *) &rfProgrammingEventMask, sizeof(rfProgrammingEventMask));
if ((rfProgrammingEventMask & BIT(2)) && !status && (pin != NULL))
if ((rfProgrammingEventMask & EMBER_BIT(2)) && !status && (pin != NULL))
{
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
ZCL_PROGRAMMING_EVENT_NOTIFICATION_COMMAND_ID, "uuvsuuws", EMBER_ZCL_DOOR_LOCK_EVENT_SOURCE_RF,
Expand Down Expand Up @@ -350,14 +350,14 @@ bool emberAfDoorLockClusterClearPinCallback(uint16_t userId)
uint8_t userPin = 0x00; // Zero length Zigbee string
emberAfReadServerAttribute(DOOR_LOCK_SERVER_ENDPOINT, ZCL_DOOR_LOCK_CLUSTER_ID, ZCL_RF_PROGRAMMING_EVENT_MASK_ATTRIBUTE_ID,
(uint8_t *) &rfProgrammingEventMask, sizeof(rfProgrammingEventMask));
if ((rfProgrammingEventMask & BIT(2)) && !status)
if ((rfProgrammingEventMask & EMBER_BIT(2)) && !status)
{
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
ZCL_PROGRAMMING_EVENT_NOTIFICATION_COMMAND_ID, "uuvsuuws", 0x01, 0x03, userId, &userPin, 0x00,
0x00, 0x00, &userPin);
SEND_COMMAND_UNICAST_TO_BINDINGS();
}
else if ((rfProgrammingEventMask & BIT(0)) && status)
else if ((rfProgrammingEventMask & EMBER_BIT(0)) && status)
{
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
ZCL_PROGRAMMING_EVENT_NOTIFICATION_COMMAND_ID, "uuvsuuws", 0x01, 0x00, userId, &userPin, 0x00,
Expand Down Expand Up @@ -550,15 +550,15 @@ bool emberAfDoorLockClusterLockDoorCallback(uint8_t * PIN)
// Possibly send operation event
if (doorLocked)
{
if (rfOperationEventMask & BIT(1) && (PIN != NULL))
if (rfOperationEventMask & EMBER_BIT(1) && (PIN != NULL))
{
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
ZCL_OPERATION_EVENT_NOTIFICATION_COMMAND_ID, "uuvsws", 0x01, 0x03, userId, PIN, 0X00, PIN);
}
}
else
{
if (rfOperationEventMask & BIT(3) && (PIN != NULL))
if (rfOperationEventMask & EMBER_BIT(3) && (PIN != NULL))
{
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
ZCL_OPERATION_EVENT_NOTIFICATION_COMMAND_ID, "uuvsws", 0x01, 0x03, userId, PIN, 0x00, PIN);
Expand Down Expand Up @@ -599,7 +599,7 @@ bool emberAfDoorLockClusterUnlockDoorCallback(uint8_t * pin)
(uint8_t *) &rfOperationEventMask, sizeof(rfOperationEventMask));

// send operation event
if (doorUnlocked && (rfOperationEventMask & BIT(2)) && (pin != NULL))
if (doorUnlocked && (rfOperationEventMask & EMBER_BIT(2)) && (pin != NULL))
{
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_DOOR_LOCK_CLUSTER_ID,
ZCL_OPERATION_EVENT_NOTIFICATION_COMMAND_ID, "uuvsws", EMBER_ZCL_DOOR_LOCK_EVENT_SOURCE_RF,
Expand Down
8 changes: 4 additions & 4 deletions src/app/clusters/groups-server/groups-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ bool emberAfGroupsClusterGetGroupMembershipCallback(uint8_t groupCount, uint8_t
status = emberGetBinding(i, &entry);
if ((status == EMBER_SUCCESS) && (entry.type == EMBER_MULTICAST_BINDING) && (entry.local == emberAfCurrentEndpoint()))
{
list[listLen] = LOW_BYTE(entry.groupId);
list[listLen + 1] = HIGH_BYTE(entry.groupId);
list[listLen] = EMBER_LOW_BYTE(entry.groupId);
list[listLen + 1] = EMBER_HIGH_BYTE(entry.groupId);
listLen = static_cast<uint8_t>(listLen + 2);
count++;
}
Expand All @@ -254,8 +254,8 @@ bool emberAfGroupsClusterGetGroupMembershipCallback(uint8_t groupCount, uint8_t
{
if (entry.local == emberAfCurrentEndpoint() && entry.groupId == groupId)
{
list[listLen] = LOW_BYTE(groupId);
list[listLen + 1] = HIGH_BYTE(groupId);
list[listLen] = EMBER_LOW_BYTE(groupId);
list[listLen + 1] = EMBER_HIGH_BYTE(groupId);
listLen = static_cast<uint8_t>(listLen + 2);
count++;
}
Expand Down
14 changes: 7 additions & 7 deletions src/app/clusters/ias-zone-client/ias-zone-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ static EmberStatus sendCommand(EmberNodeId destAddress)
static void setCieAddress(EmberNodeId destAddress)
{
uint8_t writeAttributes[] = {
LOW_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
HIGH_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
EMBER_LOW_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
EMBER_HIGH_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE,
0,
0,
Expand Down Expand Up @@ -488,11 +488,11 @@ void emberAfPluginIasZoneClientZdoMessageReceivedCallback(EmberNodeId emberNodeI
void readIasZoneServerAttributes(EmberNodeId nodeId)
{
uint8_t iasZoneAttributeIds[] = {
LOW_BYTE(ZCL_ZONE_STATE_ATTRIBUTE_ID), HIGH_BYTE(ZCL_ZONE_STATE_ATTRIBUTE_ID),
EMBER_LOW_BYTE(ZCL_ZONE_STATE_ATTRIBUTE_ID), EMBER_HIGH_BYTE(ZCL_ZONE_STATE_ATTRIBUTE_ID),

LOW_BYTE(ZCL_ZONE_TYPE_ATTRIBUTE_ID), HIGH_BYTE(ZCL_ZONE_TYPE_ATTRIBUTE_ID),
EMBER_LOW_BYTE(ZCL_ZONE_TYPE_ATTRIBUTE_ID), EMBER_HIGH_BYTE(ZCL_ZONE_TYPE_ATTRIBUTE_ID),

LOW_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID), HIGH_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID),
EMBER_LOW_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID), EMBER_HIGH_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID),
};
emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), ZCL_IAS_ZONE_CLUSTER_ID,
ZCL_READ_ATTRIBUTES_COMMAND_ID, "b", iasZoneAttributeIds, sizeof(iasZoneAttributeIds));
Expand All @@ -505,8 +505,8 @@ void readIasZoneServerAttributes(EmberNodeId nodeId)
void readIasZoneServerCieAddress(EmberNodeId nodeId)
{
uint8_t iasZoneAttributeIds[] = {
LOW_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
HIGH_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
EMBER_LOW_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
EMBER_HIGH_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID),
};
emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), ZCL_IAS_ZONE_CLUSTER_ID,
ZCL_READ_ATTRIBUTES_COMMAND_ID, "b", iasZoneAttributeIds, sizeof(iasZoneAttributeIds));
Expand Down
11 changes: 6 additions & 5 deletions src/app/clusters/messaging-client/messaging-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void esiDeletionCallback(uint8_t esiIndex)
uint8_t i;
for (i = 0; i < EMBER_AF_MESSAGING_CLUSTER_CLIENT_ENDPOINT_COUNT; i++)
{
messageTable[i].esiBitmask &= ~BIT(esiIndex);
messageTable[i].esiBitmask &= ~EMBER_BIT(esiIndex);
}
}

Expand Down Expand Up @@ -159,9 +159,10 @@ bool emberAfMessagingClusterDisplayMessageCallback(uint32_t messageId, uint8_t m
if (messageId == messageTable[ep].messageId)
{
// Duplicate message from a different ESI, add the ESI to the bitmask
if (esiIndex < EMBER_AF_PLUGIN_ESI_MANAGEMENT_ESI_TABLE_SIZE && (messageTable[ep].esiBitmask & BIT(esiIndex)) == 0)
if (esiIndex < EMBER_AF_PLUGIN_ESI_MANAGEMENT_ESI_TABLE_SIZE &&
(messageTable[ep].esiBitmask & EMBER_BIT(esiIndex)) == 0)
{
messageTable[ep].esiBitmask |= BIT(esiIndex);
messageTable[ep].esiBitmask |= EMBER_BIT(esiIndex);
}
// Either way, we send back a default response.
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS);
Expand All @@ -179,7 +180,7 @@ bool emberAfMessagingClusterDisplayMessageCallback(uint32_t messageId, uint8_t m

if (esiIndex < EMBER_AF_PLUGIN_ESI_MANAGEMENT_ESI_TABLE_SIZE)
{
messageTable[ep].esiBitmask = BIT(esiIndex);
messageTable[ep].esiBitmask = EMBER_BIT(esiIndex);
}

messageTable[ep].clientEndpoint = emberAfCurrentCommand()->apsFrame->destinationEndpoint;
Expand Down Expand Up @@ -314,7 +315,7 @@ EmberAfStatus emberAfPluginMessagingClientConfirmMessage(EndpointId endpoint)
{
EmberAfPluginEsiManagementEsiEntry * esiEntry = emberAfPluginEsiManagementEsiLookUpByIndex(i);
EmberNodeId nodeId;
if ((messageTable[ep].esiBitmask & BIT(i)) == 0 || esiEntry == NULL)
if ((messageTable[ep].esiBitmask & EMBER_BIT(i)) == 0 || esiEntry == NULL)
{
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/clusters/messaging-client/messaging-client.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
// Message Control byte
// ----------------------------------------------------------------------------

#define ZCL_MESSAGING_CLUSTER_TRANSMISSION_MASK (BIT(1) | BIT(0))
#define ZCL_MESSAGING_CLUSTER_IMPORTANCE_MASK (BIT(3) | BIT(2))
#define ZCL_MESSAGING_CLUSTER_CONFIRMATION_MASK BIT(7)
#define ZCL_MESSAGING_CLUSTER_TRANSMISSION_MASK (EMBER_BIT(1) | EMBER_BIT(0))
#define ZCL_MESSAGING_CLUSTER_IMPORTANCE_MASK (EMBER_BIT(3) | EMBER_BIT(2))
#define ZCL_MESSAGING_CLUSTER_CONFIRMATION_MASK EMBER_BIT(7)

#define ZCL_MESSAGING_CLUSTER_START_TIME_NOW 0x00000000UL
#define ZCL_MESSAGING_CLUSTER_END_TIME_NEVER 0xFFFFFFFFUL
Expand Down
6 changes: 3 additions & 3 deletions src/app/clusters/messaging-server/messaging-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ static EmberAfPluginMessagingServerMessage msgTable[EMBER_AF_MESSAGING_CLUSTER_S

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

#define messageIsValid(ep) (msgTable[ep].messageStatusControl & VALID)
#define messageIsActive(ep) (msgTable[ep].messageStatusControl & ACTIVE)
Expand Down
8 changes: 4 additions & 4 deletions src/app/clusters/messaging-server/messaging-server.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
// Message Control byte
// ----------------------------------------------------------------------------

#define ZCL_MESSAGING_CLUSTER_TRANSMISSION_MASK (BIT(1) | BIT(0))
#define ZCL_MESSAGING_CLUSTER_IMPORTANCE_MASK (BIT(3) | BIT(2))
#define ZCL_MESSAGING_CLUSTER_RESERVED_MASK (BIT(6) | BIT(5) | BIT(4))
#define ZCL_MESSAGING_CLUSTER_CONFIRMATION_MASK BIT(7)
#define ZCL_MESSAGING_CLUSTER_TRANSMISSION_MASK (EMBER_BIT(1) | EMBER_BIT(0))
#define ZCL_MESSAGING_CLUSTER_IMPORTANCE_MASK (EMBER_BIT(3) | EMBER_BIT(2))
#define ZCL_MESSAGING_CLUSTER_RESERVED_MASK (EMBER_BIT(6) | EMBER_BIT(5) | EMBER_BIT(4))
#define ZCL_MESSAGING_CLUSTER_CONFIRMATION_MASK EMBER_BIT(7)

#define ZCL_MESSAGING_CLUSTER_START_TIME_NOW 0x00000000UL
#define ZCL_MESSAGING_CLUSTER_END_TIME_NEVER 0xFFFFFFFFUL
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/scenes/scenes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void emberAfScenesClusterServerInitCallback(EndpointId endpoint)
#ifdef EMBER_AF_PLUGIN_SCENES_NAME_SUPPORT
{
// The high bit of Name Support indicates whether scene names are supported.
uint8_t nameSupport = BIT(7);
uint8_t nameSupport = EMBER_BIT(7);
writeServerAttribute(endpoint, ZCL_SCENES_CLUSTER_ID, ZCL_SCENE_NAME_SUPPORT_ATTRIBUTE_ID, "name support",
(uint8_t *) &nameSupport, ZCL_BITMAP8_ATTRIBUTE_TYPE);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/zll-on-off-server/zll-on-off-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#include "zll-on-off-server.h"
#include "../../include/af.h"

#define ZLL_ON_OFF_CLUSTER_ON_OFF_CONTROL_ACCEPT_ONLY_WHEN_ON_MASK BIT(0)
#define ZLL_ON_OFF_CLUSTER_ON_OFF_CONTROL_ACCEPT_ONLY_WHEN_ON_MASK EMBER_BIT(0)

#define readOnOff(endpoint, onOff) readBoolean((endpoint), ZCL_ON_OFF_ATTRIBUTE_ID, "on/off", (onOff))
#define writeOnOff(endpoint, onOff) writeBoolean((endpoint), ZCL_ON_OFF_ATTRIBUTE_ID, "on/off", (onOff))
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/zll-scenes-server/zll-scenes-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#include "../../include/af.h"
#include "../scenes/scenes.h"

#define ZCL_SCENES_CLUSTER_MODE_COPY_ALL_SCENES_MASK BIT(0)
#define ZCL_SCENES_CLUSTER_MODE_COPY_ALL_SCENES_MASK EMBER_BIT(0)

bool emberAfScenesClusterEnhancedAddSceneCallback(uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName,
uint8_t * extensionFieldSets)
Expand Down
2 changes: 1 addition & 1 deletion src/app/reporting/reporting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ static void putReportableChangeInResp(const EmberAfPluginReportingEntry * entry,
uint32_t value = entry->data.reported.reportableChange;
for (; bytes > 0; bytes--)
{
uint8_t b = BYTE_0(value);
uint8_t b = EMBER_BYTE_0(value);
emberAfPutInt8uInResp(b);
value >>= 8;
}
Expand Down
16 changes: 8 additions & 8 deletions src/app/util/af.h
Original file line number Diff line number Diff line change
Expand Up @@ -1670,18 +1670,18 @@ EmberStatus emberAfInitiatePartnerLinkKeyExchange(EmberNodeId target, chip::Endp
// @{
// Frame control fields (8 bits total)
// Bits 0 and 1 are Frame Type Sub-field
#define ZCL_FRAME_CONTROL_FRAME_TYPE_MASK (BIT(0) | BIT(1))
#define ZCL_CLUSTER_SPECIFIC_COMMAND BIT(0)
#define ZCL_FRAME_CONTROL_FRAME_TYPE_MASK (EMBER_BIT(0) | EMBER_BIT(1))
#define ZCL_CLUSTER_SPECIFIC_COMMAND EMBER_BIT(0)
#define ZCL_PROFILE_WIDE_COMMAND 0
#define ZCL_GLOBAL_COMMAND (ZCL_PROFILE_WIDE_COMMAND)
// Bit 2 is Manufacturer Specific Sub-field
#define ZCL_MANUFACTURER_SPECIFIC_MASK BIT(2)
#define ZCL_MANUFACTURER_SPECIFIC_MASK EMBER_BIT(2)
// Bit 3 is Direction Sub-field
#define ZCL_FRAME_CONTROL_DIRECTION_MASK BIT(3)
#define ZCL_FRAME_CONTROL_SERVER_TO_CLIENT BIT(3)
#define ZCL_FRAME_CONTROL_DIRECTION_MASK EMBER_BIT(3)
#define ZCL_FRAME_CONTROL_SERVER_TO_CLIENT EMBER_BIT(3)
#define ZCL_FRAME_CONTROL_CLIENT_TO_SERVER 0
// Bit 4 is Disable Default Response Sub-field
#define ZCL_DISABLE_DEFAULT_RESPONSE_MASK BIT(4)
#define ZCL_DISABLE_DEFAULT_RESPONSE_MASK EMBER_BIT(4)
// Bits 5 to 7 are reserved

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

// Permitted values for emberAfSetFormAndJoinMode
#define FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ BIT(0)
#define FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ BIT(1)
#define FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ EMBER_BIT(0)
#define FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ EMBER_BIT(1)
#define FIND_AND_JOIN_MODE_ALLOW_BOTH (FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ | FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ)

/** @} END ZCL macros */
Expand Down
4 changes: 2 additions & 2 deletions src/app/util/attribute-table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ EmberAfStatus emberAfAppendAttributeReportFields(EndpointId endpoint, ClusterId
goto kickout;
}

buffer[(*bufIndex)++] = LOW_BYTE(attributeId);
buffer[(*bufIndex)++] = HIGH_BYTE(attributeId);
buffer[(*bufIndex)++] = EMBER_LOW_BYTE(attributeId);
buffer[(*bufIndex)++] = EMBER_HIGH_BYTE(attributeId);
buffer[(*bufIndex)++] = type;
#if (BIGENDIAN_CPU)
if (isThisDataTypeSentLittleEndianOTA(type))
Expand Down
6 changes: 3 additions & 3 deletions src/app/util/client-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ static uint16_t vFillBuffer(uint8_t * buffer, uint16_t bufferLen, uint8_t frameC
buffer[bytes++] = frameControl;
if (manufacturerCode != EMBER_AF_NULL_MANUFACTURER_CODE)
{
buffer[bytes++] = LOW_BYTE(manufacturerCode);
buffer[bytes++] = HIGH_BYTE(manufacturerCode);
buffer[bytes++] = EMBER_LOW_BYTE(manufacturerCode);
buffer[bytes++] = EMBER_HIGH_BYTE(manufacturerCode);
}
buffer[bytes++] = emberAfNextSequence();
buffer[bytes++] = commandId;
Expand Down Expand Up @@ -202,7 +202,7 @@ static uint16_t vFillBuffer(uint8_t * buffer, uint16_t bufferLen, uint8_t frameC
// endian format.
for (; 0 < valueLen; valueLen--)
{
buffer[bytes++] = LOW_BYTE(value);
buffer[bytes++] = EMBER_LOW_BYTE(value);
value = value >> 8;
}

Expand Down
18 changes: 9 additions & 9 deletions src/app/util/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ uint8_t * emberAfPutInt8uInResp(uint8_t value)

uint16_t * emberAfPutInt16uInResp(uint16_t value)
{
uint8_t * low = emberAfPutInt8uInResp(LOW_BYTE(value));
uint8_t * high = emberAfPutInt8uInResp(HIGH_BYTE(value));
uint8_t * low = emberAfPutInt8uInResp(EMBER_LOW_BYTE(value));
uint8_t * high = emberAfPutInt8uInResp(EMBER_HIGH_BYTE(value));

if (low && high)
{
Expand All @@ -109,10 +109,10 @@ uint16_t * emberAfPutInt16uInResp(uint16_t value)

uint32_t * emberAfPutInt32uInResp(uint32_t value)
{
uint8_t * a = emberAfPutInt8uInResp(BYTE_0(value));
uint8_t * b = emberAfPutInt8uInResp(BYTE_1(value));
uint8_t * c = emberAfPutInt8uInResp(BYTE_2(value));
uint8_t * d = emberAfPutInt8uInResp(BYTE_3(value));
uint8_t * a = emberAfPutInt8uInResp(EMBER_BYTE_0(value));
uint8_t * b = emberAfPutInt8uInResp(EMBER_BYTE_1(value));
uint8_t * c = emberAfPutInt8uInResp(EMBER_BYTE_2(value));
uint8_t * d = emberAfPutInt8uInResp(EMBER_BYTE_3(value));

if (a && b && c && d)
{
Expand All @@ -126,9 +126,9 @@ uint32_t * emberAfPutInt32uInResp(uint32_t value)

uint32_t * emberAfPutInt24uInResp(uint32_t value)
{
uint8_t * a = emberAfPutInt8uInResp(BYTE_0(value));
uint8_t * b = emberAfPutInt8uInResp(BYTE_1(value));
uint8_t * c = emberAfPutInt8uInResp(BYTE_2(value));
uint8_t * a = emberAfPutInt8uInResp(EMBER_BYTE_0(value));
uint8_t * b = emberAfPutInt8uInResp(EMBER_BYTE_1(value));
uint8_t * c = emberAfPutInt8uInResp(EMBER_BYTE_2(value));

if (a && b && c)
{
Expand Down
Loading

0 comments on commit 8c93ec6

Please sign in to comment.