From 21434390ca1edcb9af8b9042103e72a7fa5af7be Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Tue, 8 Jun 2021 00:05:49 +0800 Subject: [PATCH] Change MessageSendDestination into a type-safe Variant (#7037) * gen files * Change MessageSendDestination into a type-safe Variant * gen files * Refine MessageSendDestination API * gen files * Resolve comment * gen files * Resolve comments --- .../all-clusters-common/gen/callback-stub.cpp | 5 +- .../all-clusters-common/gen/callback.h | 212 ++++++++---------- .../bridge-common/gen/callback-stub.cpp | 5 +- .../bridge-app/bridge-common/gen/callback.h | 66 +++--- .../lighting-common/gen/callback-stub.cpp | 5 +- .../lighting-common/gen/callback.h | 56 +++-- .../lock-common/gen/callback-stub.cpp | 5 +- examples/lock-app/lock-common/gen/callback.h | 51 ++--- .../pump-common/gen/callback-stub.cpp | 5 +- examples/pump-app/pump-common/gen/callback.h | 65 +++--- .../gen/callback-stub.cpp | 5 +- .../pump-controller-common/gen/callback.h | 65 +++--- .../esp32/main/gen/callback-stub.cpp | 5 +- .../esp32/main/gen/callback.h | 47 ++-- .../media-playback/MediaPlaybackManager.cpp | 6 +- .../tv-app/tv-common/gen/callback-stub.cpp | 5 +- examples/tv-app/tv-common/gen/callback.h | 98 ++++---- .../window-app/common/gen/callback-stub.cpp | 5 +- examples/window-app/common/gen/callback.h | 19 +- .../ias-zone-client/ias-zone-client.cpp | 2 +- .../ias-zone-server/ias-zone-server.cpp | 5 +- .../messaging-client/messaging-client.cpp | 5 +- .../messaging-server/messaging-server.cpp | 4 +- src/app/reporting/reporting.cpp | 12 +- src/app/util/af-main-common.cpp | 121 +++++----- src/app/util/af-main.h | 8 +- src/app/util/af-types.h | 125 +++++++++-- src/app/util/af.h | 13 +- src/app/util/attribute-storage.cpp | 14 +- src/app/util/attribute-storage.h | 8 +- src/app/util/client-api.cpp | 11 +- src/app/util/types_stub.h | 32 --- src/app/util/util.cpp | 2 +- .../templates/app/callback-stub-src.zapt | 2 +- .../zap-templates/templates/app/callback.zapt | 4 +- .../data_model/gen/callback-stub.cpp | 5 +- src/controller/data_model/gen/callback.h | 189 +++++++--------- src/lib/support/Variant.h | 34 +-- 38 files changed, 606 insertions(+), 720 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp index d06155ed724a8c..f83cdc10c24a97 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp @@ -694,9 +694,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h index 6685d665a2571c..b5ec3158b52c37 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback.h +++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h @@ -462,9 +462,8 @@ void emberAfAccountLoginClusterServerManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfAccountLoginClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfAccountLoginClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Account Login Cluster Server Pre Attribute Changed * @@ -532,9 +531,9 @@ void emberAfApplicationBasicClusterServerManufacturerSpecificAttributeChangedCal * @param message The message that was sent * @param status The status of the sent message */ -void emberAfApplicationBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfApplicationBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Application Basic Cluster Server Pre Attribute Changed * @@ -603,9 +602,9 @@ void emberAfApplicationLauncherClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfApplicationLauncherClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfApplicationLauncherClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Application Launcher Cluster Server Pre Attribute Changed * @@ -674,9 +673,8 @@ void emberAfAudioOutputClusterServerManufacturerSpecificAttributeChangedCallback * @param message The message that was sent * @param status The status of the sent message */ -void emberAfAudioOutputClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfAudioOutputClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Audio Output Cluster Server Pre Attribute Changed * @@ -744,7 +742,7 @@ void emberAfBarrierControlClusterServerManufacturerSpecificAttributeChangedCallb * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBarrierControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfBarrierControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -814,8 +812,8 @@ void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Basic Cluster Server Pre Attribute Changed * @@ -883,9 +881,9 @@ void emberAfBinaryInputBasicClusterServerManufacturerSpecificAttributeChangedCal * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBinaryInputBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBinaryInputBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Binary Input (Basic) Cluster Server Pre Attribute Changed * @@ -954,9 +952,8 @@ void emberAfBindingClusterServerManufacturerSpecificAttributeChangedCallback(chi * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBindingClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfBindingClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Binding Cluster Server Pre Attribute Changed * @@ -1024,9 +1021,9 @@ void emberAfBridgedDeviceBasicClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBridgedDeviceBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBridgedDeviceBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Bridged Device Basic Cluster Server Pre Attribute Changed * @@ -1095,9 +1092,8 @@ void emberAfColorControlClusterServerManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfColorControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfColorControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Color Control Cluster Server Pre Attribute Changed * @@ -1165,7 +1161,7 @@ void emberAfContentLaunchClusterServerManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfContentLaunchClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfContentLaunchClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1235,9 +1231,8 @@ void emberAfDescriptorClusterServerManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfDescriptorClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfDescriptorClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Descriptor Cluster Server Pre Attribute Changed * @@ -1305,9 +1300,8 @@ void emberAfDoorLockClusterServerManufacturerSpecificAttributeChangedCallback(ch * @param message The message that was sent * @param status The status of the sent message */ -void emberAfDoorLockClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfDoorLockClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Door Lock Cluster Server Pre Attribute Changed * @@ -1376,8 +1370,7 @@ void emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttribute * @param message The message that was sent * @param status The status of the sent message */ -void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1448,9 +1441,8 @@ void emberAfFixedLabelClusterServerManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfFixedLabelClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfFixedLabelClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Fixed Label Cluster Server Pre Attribute Changed * @@ -1518,9 +1510,9 @@ void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Commissioning Cluster Server Pre Attribute Changed * @@ -1589,9 +1581,9 @@ void emberAfGeneralDiagnosticsClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Diagnostics Cluster Server Pre Attribute Changed * @@ -1660,9 +1652,9 @@ void emberAfGroupKeyManagementClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGroupKeyManagementClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGroupKeyManagementClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Group Key Management Cluster Server Pre Attribute Changed * @@ -1731,9 +1723,8 @@ void emberAfGroupsClusterServerManufacturerSpecificAttributeChangedCallback(chip * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGroupsClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfGroupsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Groups Cluster Server Pre Attribute Changed * @@ -1801,9 +1792,8 @@ void emberAfIasZoneClusterServerManufacturerSpecificAttributeChangedCallback(chi * @param message The message that was sent * @param status The status of the sent message */ -void emberAfIasZoneClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfIasZoneClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief IAS Zone Cluster Server Pre Attribute Changed * @@ -1871,9 +1861,8 @@ void emberAfIdentifyClusterServerManufacturerSpecificAttributeChangedCallback(ch * @param message The message that was sent * @param status The status of the sent message */ -void emberAfIdentifyClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfIdentifyClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Identify Cluster Server Pre Attribute Changed * @@ -1941,9 +1930,8 @@ void emberAfKeypadInputClusterServerManufacturerSpecificAttributeChangedCallback * @param message The message that was sent * @param status The status of the sent message */ -void emberAfKeypadInputClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfKeypadInputClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Keypad Input Cluster Server Pre Attribute Changed * @@ -2011,9 +1999,8 @@ void emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLevelControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Level Control Cluster Server Pre Attribute Changed * @@ -2081,9 +2068,8 @@ void emberAfLowPowerClusterServerManufacturerSpecificAttributeChangedCallback(ch * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLowPowerClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLowPowerClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Low Power Cluster Server Pre Attribute Changed * @@ -2151,9 +2137,8 @@ void emberAfMediaInputClusterServerManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfMediaInputClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfMediaInputClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Media Input Cluster Server Pre Attribute Changed * @@ -2221,7 +2206,7 @@ void emberAfMediaPlaybackClusterServerManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfMediaPlaybackClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfMediaPlaybackClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2291,9 +2276,9 @@ void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfNetworkCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Network Commissioning Cluster Server Pre Attribute Changed * @@ -2362,8 +2347,7 @@ void emberAfOtaSoftwareUpdateClientClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOtaSoftwareUpdateClientClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOtaSoftwareUpdateClientClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2434,8 +2418,7 @@ void emberAfOtaSoftwareUpdateServerClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOtaSoftwareUpdateServerClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOtaSoftwareUpdateServerClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2506,9 +2489,9 @@ void emberAfOccupancySensingClusterServerManufacturerSpecificAttributeChangedCal * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOccupancySensingClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfOccupancySensingClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Occupancy Sensing Cluster Server Pre Attribute Changed * @@ -2576,8 +2559,8 @@ void emberAfOnOffClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfOnOffClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief On/off Cluster Server Pre Attribute Changed * @@ -2645,8 +2628,7 @@ void emberAfOperationalCredentialsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOperationalCredentialsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2718,8 +2700,7 @@ void emberAfPumpConfigurationAndControlClusterServerManufacturerSpecificAttribut * @param message The message that was sent * @param status The status of the sent message */ -void emberAfPumpConfigurationAndControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfPumpConfigurationAndControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2791,8 +2772,7 @@ void emberAfRelativeHumidityMeasurementClusterServerManufacturerSpecificAttribut * @param message The message that was sent * @param status The status of the sent message */ -void emberAfRelativeHumidityMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfRelativeHumidityMeasurementClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2863,9 +2843,8 @@ void emberAfScenesClusterServerManufacturerSpecificAttributeChangedCallback(chip * @param message The message that was sent * @param status The status of the sent message */ -void emberAfScenesClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfScenesClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Scenes Cluster Server Pre Attribute Changed * @@ -2933,9 +2912,9 @@ void emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Software Diagnostics Cluster Server Pre Attribute Changed * @@ -3004,9 +2983,8 @@ void emberAfSwitchClusterServerManufacturerSpecificAttributeChangedCallback(chip * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSwitchClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfSwitchClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Switch Cluster Server Pre Attribute Changed * @@ -3074,9 +3052,8 @@ void emberAfTvChannelClusterServerManufacturerSpecificAttributeChangedCallback(c * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTvChannelClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfTvChannelClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief TV Channel Cluster Server Pre Attribute Changed * @@ -3144,7 +3121,7 @@ void emberAfTargetNavigatorClusterServerManufacturerSpecificAttributeChangedCall * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTargetNavigatorClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfTargetNavigatorClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -3215,8 +3192,7 @@ void emberAfTemperatureMeasurementClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTemperatureMeasurementClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -3287,9 +3263,8 @@ void emberAfTestClusterClusterServerManufacturerSpecificAttributeChangedCallback * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTestClusterClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfTestClusterClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Test Cluster Cluster Server Pre Attribute Changed * @@ -3357,9 +3332,8 @@ void emberAfThermostatClusterServerManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThermostatClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfThermostatClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Thermostat Cluster Server Pre Attribute Changed * @@ -3427,8 +3401,7 @@ void emberAfThreadNetworkDiagnosticsClusterServerManufacturerSpecificAttributeCh * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -3499,8 +3472,7 @@ void emberAfTrustedRootCertificatesClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -3571,9 +3543,8 @@ void emberAfWakeOnLanClusterServerManufacturerSpecificAttributeChangedCallback(c * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWakeOnLanClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfWakeOnLanClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Wake on LAN Cluster Server Pre Attribute Changed * @@ -3641,8 +3612,7 @@ void emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -3713,7 +3683,7 @@ void emberAfWindowCoveringClusterServerManufacturerSpecificAttributeChangedCallb * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWindowCoveringClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfWindowCoveringClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -4623,8 +4593,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/examples/bridge-app/bridge-common/gen/callback-stub.cpp b/examples/bridge-app/bridge-common/gen/callback-stub.cpp index b91341e57524b9..3b25b0157bdd52 100644 --- a/examples/bridge-app/bridge-common/gen/callback-stub.cpp +++ b/examples/bridge-app/bridge-common/gen/callback-stub.cpp @@ -430,9 +430,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/examples/bridge-app/bridge-common/gen/callback.h b/examples/bridge-app/bridge-common/gen/callback.h index 01de7ed4992c86..39b3978d71f47c 100644 --- a/examples/bridge-app/bridge-common/gen/callback.h +++ b/examples/bridge-app/bridge-common/gen/callback.h @@ -197,8 +197,8 @@ void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Basic Cluster Server Pre Attribute Changed * @@ -266,9 +266,8 @@ void emberAfDescriptorClusterServerManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfDescriptorClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfDescriptorClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Descriptor Cluster Server Pre Attribute Changed * @@ -337,8 +336,7 @@ void emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttribute * @param message The message that was sent * @param status The status of the sent message */ -void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -409,9 +407,8 @@ void emberAfFixedLabelClusterServerManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfFixedLabelClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfFixedLabelClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Fixed Label Cluster Server Pre Attribute Changed * @@ -479,9 +476,9 @@ void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Commissioning Cluster Server Pre Attribute Changed * @@ -550,9 +547,9 @@ void emberAfGeneralDiagnosticsClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Diagnostics Cluster Server Pre Attribute Changed * @@ -621,9 +618,8 @@ void emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLevelControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Level Control Cluster Server Pre Attribute Changed * @@ -691,9 +687,9 @@ void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfNetworkCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Network Commissioning Cluster Server Pre Attribute Changed * @@ -761,8 +757,8 @@ void emberAfOnOffClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfOnOffClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief On/off Cluster Server Pre Attribute Changed * @@ -830,8 +826,7 @@ void emberAfOperationalCredentialsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOperationalCredentialsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -902,9 +897,9 @@ void emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Software Diagnostics Cluster Server Pre Attribute Changed * @@ -973,8 +968,7 @@ void emberAfThreadNetworkDiagnosticsClusterServerManufacturerSpecificAttributeCh * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1045,8 +1039,7 @@ void emberAfTrustedRootCertificatesClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1117,8 +1110,7 @@ void emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1603,8 +1595,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/examples/lighting-app/lighting-common/gen/callback-stub.cpp b/examples/lighting-app/lighting-common/gen/callback-stub.cpp index 8963ee7cbeb02e..2ca7f37015a665 100644 --- a/examples/lighting-app/lighting-common/gen/callback-stub.cpp +++ b/examples/lighting-app/lighting-common/gen/callback-stub.cpp @@ -414,9 +414,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/examples/lighting-app/lighting-common/gen/callback.h b/examples/lighting-app/lighting-common/gen/callback.h index 5d05db8dcea6b2..18f4212d0eba0e 100644 --- a/examples/lighting-app/lighting-common/gen/callback.h +++ b/examples/lighting-app/lighting-common/gen/callback.h @@ -181,8 +181,8 @@ void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Basic Cluster Server Pre Attribute Changed * @@ -251,8 +251,7 @@ void emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttribute * @param message The message that was sent * @param status The status of the sent message */ -void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -323,9 +322,9 @@ void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Commissioning Cluster Server Pre Attribute Changed * @@ -394,9 +393,9 @@ void emberAfGeneralDiagnosticsClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Diagnostics Cluster Server Pre Attribute Changed * @@ -465,9 +464,8 @@ void emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLevelControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Level Control Cluster Server Pre Attribute Changed * @@ -535,9 +533,9 @@ void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfNetworkCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Network Commissioning Cluster Server Pre Attribute Changed * @@ -605,8 +603,8 @@ void emberAfOnOffClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfOnOffClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief On/off Cluster Server Pre Attribute Changed * @@ -674,8 +672,7 @@ void emberAfOperationalCredentialsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOperationalCredentialsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -746,9 +743,9 @@ void emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Software Diagnostics Cluster Server Pre Attribute Changed * @@ -817,8 +814,7 @@ void emberAfThreadNetworkDiagnosticsClusterServerManufacturerSpecificAttributeCh * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -889,8 +885,7 @@ void emberAfTrustedRootCertificatesClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -961,8 +956,7 @@ void emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1447,8 +1441,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/examples/lock-app/lock-common/gen/callback-stub.cpp b/examples/lock-app/lock-common/gen/callback-stub.cpp index 645fda99c1fb00..43852d578f78b5 100644 --- a/examples/lock-app/lock-common/gen/callback-stub.cpp +++ b/examples/lock-app/lock-common/gen/callback-stub.cpp @@ -406,9 +406,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/examples/lock-app/lock-common/gen/callback.h b/examples/lock-app/lock-common/gen/callback.h index 03311d91b363af..d6aa4569070269 100644 --- a/examples/lock-app/lock-common/gen/callback.h +++ b/examples/lock-app/lock-common/gen/callback.h @@ -173,8 +173,8 @@ void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Basic Cluster Server Pre Attribute Changed * @@ -243,8 +243,7 @@ void emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttribute * @param message The message that was sent * @param status The status of the sent message */ -void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -315,9 +314,9 @@ void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Commissioning Cluster Server Pre Attribute Changed * @@ -386,9 +385,9 @@ void emberAfGeneralDiagnosticsClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Diagnostics Cluster Server Pre Attribute Changed * @@ -457,9 +456,9 @@ void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfNetworkCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Network Commissioning Cluster Server Pre Attribute Changed * @@ -527,8 +526,8 @@ void emberAfOnOffClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfOnOffClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief On/off Cluster Server Pre Attribute Changed * @@ -596,8 +595,7 @@ void emberAfOperationalCredentialsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOperationalCredentialsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -668,9 +666,9 @@ void emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Software Diagnostics Cluster Server Pre Attribute Changed * @@ -739,8 +737,7 @@ void emberAfThreadNetworkDiagnosticsClusterServerManufacturerSpecificAttributeCh * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -811,8 +808,7 @@ void emberAfTrustedRootCertificatesClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -883,8 +879,7 @@ void emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1316,8 +1311,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/examples/pump-app/pump-common/gen/callback-stub.cpp b/examples/pump-app/pump-common/gen/callback-stub.cpp index b456632343536c..c4531bcde6e04e 100644 --- a/examples/pump-app/pump-common/gen/callback-stub.cpp +++ b/examples/pump-app/pump-common/gen/callback-stub.cpp @@ -430,9 +430,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/examples/pump-app/pump-common/gen/callback.h b/examples/pump-app/pump-common/gen/callback.h index 64227547dd4320..61e91499ea3729 100644 --- a/examples/pump-app/pump-common/gen/callback.h +++ b/examples/pump-app/pump-common/gen/callback.h @@ -197,8 +197,8 @@ void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Basic Cluster Server Pre Attribute Changed * @@ -267,8 +267,7 @@ void emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttribute * @param message The message that was sent * @param status The status of the sent message */ -void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -339,9 +338,9 @@ void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Commissioning Cluster Server Pre Attribute Changed * @@ -410,9 +409,9 @@ void emberAfGeneralDiagnosticsClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Diagnostics Cluster Server Pre Attribute Changed * @@ -481,9 +480,8 @@ void emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLevelControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Level Control Cluster Server Pre Attribute Changed * @@ -551,9 +549,9 @@ void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfNetworkCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Network Commissioning Cluster Server Pre Attribute Changed * @@ -621,8 +619,8 @@ void emberAfOnOffClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfOnOffClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief On/off Cluster Server Pre Attribute Changed * @@ -690,8 +688,7 @@ void emberAfOperationalCredentialsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOperationalCredentialsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -763,8 +760,7 @@ void emberAfPumpConfigurationAndControlClusterServerManufacturerSpecificAttribut * @param message The message that was sent * @param status The status of the sent message */ -void emberAfPumpConfigurationAndControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfPumpConfigurationAndControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -835,9 +831,9 @@ void emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Software Diagnostics Cluster Server Pre Attribute Changed * @@ -906,8 +902,7 @@ void emberAfTemperatureMeasurementClusterClientManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTemperatureMeasurementClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTemperatureMeasurementClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -978,8 +973,7 @@ void emberAfTemperatureMeasurementClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTemperatureMeasurementClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1050,8 +1044,7 @@ void emberAfThreadNetworkDiagnosticsClusterServerManufacturerSpecificAttributeCh * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1122,8 +1115,7 @@ void emberAfTrustedRootCertificatesClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1194,8 +1186,7 @@ void emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1679,8 +1670,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/examples/pump-controller-app/pump-controller-common/gen/callback-stub.cpp b/examples/pump-controller-app/pump-controller-common/gen/callback-stub.cpp index b456632343536c..c4531bcde6e04e 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/callback-stub.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/callback-stub.cpp @@ -430,9 +430,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/examples/pump-controller-app/pump-controller-common/gen/callback.h b/examples/pump-controller-app/pump-controller-common/gen/callback.h index 1c17daed149ada..ed2b0396ecf3df 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/callback.h +++ b/examples/pump-controller-app/pump-controller-common/gen/callback.h @@ -197,8 +197,8 @@ void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Basic Cluster Server Pre Attribute Changed * @@ -267,8 +267,7 @@ void emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttribute * @param message The message that was sent * @param status The status of the sent message */ -void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -339,9 +338,9 @@ void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Commissioning Cluster Server Pre Attribute Changed * @@ -410,9 +409,9 @@ void emberAfGeneralDiagnosticsClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Diagnostics Cluster Server Pre Attribute Changed * @@ -481,9 +480,8 @@ void emberAfLevelControlClusterClientManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLevelControlClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLevelControlClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Level Control Cluster Client Pre Attribute Changed * @@ -551,9 +549,9 @@ void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfNetworkCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Network Commissioning Cluster Server Pre Attribute Changed * @@ -621,8 +619,8 @@ void emberAfOnOffClusterClientManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOnOffClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfOnOffClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief On/off Cluster Client Pre Attribute Changed * @@ -690,8 +688,7 @@ void emberAfOperationalCredentialsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOperationalCredentialsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -763,8 +760,7 @@ void emberAfPumpConfigurationAndControlClusterClientManufacturerSpecificAttribut * @param message The message that was sent * @param status The status of the sent message */ -void emberAfPumpConfigurationAndControlClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfPumpConfigurationAndControlClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -835,9 +831,9 @@ void emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Software Diagnostics Cluster Server Pre Attribute Changed * @@ -906,8 +902,7 @@ void emberAfTemperatureMeasurementClusterClientManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTemperatureMeasurementClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTemperatureMeasurementClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -978,8 +973,7 @@ void emberAfTemperatureMeasurementClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTemperatureMeasurementClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1050,8 +1044,7 @@ void emberAfThreadNetworkDiagnosticsClusterServerManufacturerSpecificAttributeCh * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1122,8 +1115,7 @@ void emberAfTrustedRootCertificatesClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1194,8 +1186,7 @@ void emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1615,8 +1606,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp b/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp index b1cac21df17f6d..10c4f38551ad50 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp +++ b/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp @@ -398,9 +398,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/examples/temperature-measurement-app/esp32/main/gen/callback.h b/examples/temperature-measurement-app/esp32/main/gen/callback.h index 0380595193992d..8906a63e391e33 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/callback.h +++ b/examples/temperature-measurement-app/esp32/main/gen/callback.h @@ -165,8 +165,8 @@ void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Basic Cluster Server Pre Attribute Changed * @@ -235,8 +235,7 @@ void emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttribute * @param message The message that was sent * @param status The status of the sent message */ -void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -307,9 +306,9 @@ void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Commissioning Cluster Server Pre Attribute Changed * @@ -378,9 +377,9 @@ void emberAfGeneralDiagnosticsClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Diagnostics Cluster Server Pre Attribute Changed * @@ -449,9 +448,9 @@ void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfNetworkCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Network Commissioning Cluster Server Pre Attribute Changed * @@ -520,8 +519,7 @@ void emberAfOperationalCredentialsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOperationalCredentialsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -592,9 +590,9 @@ void emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Software Diagnostics Cluster Server Pre Attribute Changed * @@ -663,8 +661,7 @@ void emberAfTemperatureMeasurementClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTemperatureMeasurementClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -735,8 +732,7 @@ void emberAfTrustedRootCertificatesClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -807,8 +803,7 @@ void emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1222,8 +1217,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp index 3d3f5ffb5e5f1d..55c009d142c0d8 100644 --- a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp +++ b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp @@ -169,21 +169,21 @@ bool emberAfMediaPlaybackClusterMediaRewindCallback(chip::app::Command *) return true; } -bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback(chip::app::Command *, unsigned long long deltaPositionMilliseconds) +bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback(chip::app::Command *, uint64_t deltaPositionMilliseconds) { EmberAfMediaPlaybackStatus status = MediaPlaybackManager().proxyMediaPlaybackRequest(MediaPlaybackRequest::SkipBackward); sendResponse("MediaSkipBackward", ZCL_MEDIA_SKIP_BACKWARD_RESPONSE_COMMAND_ID, status); return true; } -bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(chip::app::Command *, unsigned long long deltaPositionMilliseconds) +bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(chip::app::Command *, uint64_t deltaPositionMilliseconds) { EmberAfMediaPlaybackStatus status = MediaPlaybackManager().proxyMediaPlaybackRequest(MediaPlaybackRequest::SkipForward); sendResponse("MediaSkipForward", ZCL_MEDIA_SKIP_FORWARD_RESPONSE_COMMAND_ID, status); return true; } -bool emberAfMediaPlaybackClusterMediaSkipSeekCallback(chip::app::Command *, unsigned long long positionMilliseconds) +bool emberAfMediaPlaybackClusterMediaSkipSeekCallback(chip::app::Command *, uint64_t positionMilliseconds) { EmberAfMediaPlaybackStatus status = MediaPlaybackManager().proxyMediaPlaybackRequest(MediaPlaybackRequest::Seek); sendResponse("MediaSeek", ZCL_MEDIA_SKIP_FORWARD_RESPONSE_COMMAND_ID, status); diff --git a/examples/tv-app/tv-common/gen/callback-stub.cpp b/examples/tv-app/tv-common/gen/callback-stub.cpp index 084030c05e0d87..a0eaf38ba7dd41 100644 --- a/examples/tv-app/tv-common/gen/callback-stub.cpp +++ b/examples/tv-app/tv-common/gen/callback-stub.cpp @@ -494,9 +494,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/examples/tv-app/tv-common/gen/callback.h b/examples/tv-app/tv-common/gen/callback.h index 5b6e2170ec7929..2b20d8a4089b9d 100644 --- a/examples/tv-app/tv-common/gen/callback.h +++ b/examples/tv-app/tv-common/gen/callback.h @@ -262,9 +262,8 @@ void emberAfAccountLoginClusterServerManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfAccountLoginClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfAccountLoginClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Account Login Cluster Server Pre Attribute Changed * @@ -332,9 +331,9 @@ void emberAfApplicationBasicClusterServerManufacturerSpecificAttributeChangedCal * @param message The message that was sent * @param status The status of the sent message */ -void emberAfApplicationBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfApplicationBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Application Basic Cluster Server Pre Attribute Changed * @@ -403,9 +402,9 @@ void emberAfApplicationLauncherClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfApplicationLauncherClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfApplicationLauncherClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Application Launcher Cluster Server Pre Attribute Changed * @@ -474,9 +473,8 @@ void emberAfAudioOutputClusterServerManufacturerSpecificAttributeChangedCallback * @param message The message that was sent * @param status The status of the sent message */ -void emberAfAudioOutputClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfAudioOutputClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Audio Output Cluster Server Pre Attribute Changed * @@ -544,7 +542,7 @@ void emberAfContentLaunchClusterServerManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfContentLaunchClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfContentLaunchClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -614,9 +612,8 @@ void emberAfDescriptorClusterServerManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfDescriptorClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfDescriptorClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Descriptor Cluster Server Pre Attribute Changed * @@ -685,8 +682,7 @@ void emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttribute * @param message The message that was sent * @param status The status of the sent message */ -void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -757,9 +753,9 @@ void emberAfGeneralDiagnosticsClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Diagnostics Cluster Server Pre Attribute Changed * @@ -828,9 +824,8 @@ void emberAfKeypadInputClusterServerManufacturerSpecificAttributeChangedCallback * @param message The message that was sent * @param status The status of the sent message */ -void emberAfKeypadInputClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfKeypadInputClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Keypad Input Cluster Server Pre Attribute Changed * @@ -898,9 +893,8 @@ void emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLevelControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Level Control Cluster Server Pre Attribute Changed * @@ -968,9 +962,8 @@ void emberAfLowPowerClusterServerManufacturerSpecificAttributeChangedCallback(ch * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLowPowerClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLowPowerClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Low Power Cluster Server Pre Attribute Changed * @@ -1038,9 +1031,8 @@ void emberAfMediaInputClusterServerManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfMediaInputClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfMediaInputClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Media Input Cluster Server Pre Attribute Changed * @@ -1108,7 +1100,7 @@ void emberAfMediaPlaybackClusterServerManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfMediaPlaybackClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfMediaPlaybackClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1177,8 +1169,8 @@ void emberAfOnOffClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfOnOffClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief On/off Cluster Server Pre Attribute Changed * @@ -1246,8 +1238,7 @@ void emberAfOperationalCredentialsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOperationalCredentialsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1318,9 +1309,9 @@ void emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Software Diagnostics Cluster Server Pre Attribute Changed * @@ -1389,9 +1380,8 @@ void emberAfTvChannelClusterServerManufacturerSpecificAttributeChangedCallback(c * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTvChannelClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfTvChannelClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief TV Channel Cluster Server Pre Attribute Changed * @@ -1459,7 +1449,7 @@ void emberAfTargetNavigatorClusterServerManufacturerSpecificAttributeChangedCall * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTargetNavigatorClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfTargetNavigatorClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1530,8 +1520,7 @@ void emberAfThreadNetworkDiagnosticsClusterServerManufacturerSpecificAttributeCh * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1602,8 +1591,7 @@ void emberAfTrustedRootCertificatesClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTrustedRootCertificatesClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1674,9 +1662,8 @@ void emberAfWakeOnLanClusterServerManufacturerSpecificAttributeChangedCallback(c * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWakeOnLanClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfWakeOnLanClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Wake on LAN Cluster Server Pre Attribute Changed * @@ -1744,8 +1731,7 @@ void emberAfWiFiNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfWiFiNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2151,8 +2137,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/examples/window-app/common/gen/callback-stub.cpp b/examples/window-app/common/gen/callback-stub.cpp index d84f774eaec88b..c432a0fd5ebc65 100644 --- a/examples/window-app/common/gen/callback-stub.cpp +++ b/examples/window-app/common/gen/callback-stub.cpp @@ -350,9 +350,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/examples/window-app/common/gen/callback.h b/examples/window-app/common/gen/callback.h index 2b5725fd3b3bcd..61de8ef6de1653 100644 --- a/examples/window-app/common/gen/callback.h +++ b/examples/window-app/common/gen/callback.h @@ -117,8 +117,8 @@ void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBasicClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Basic Cluster Server Pre Attribute Changed * @@ -186,9 +186,9 @@ void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfNetworkCommissioningClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Network Commissioning Cluster Server Pre Attribute Changed * @@ -257,8 +257,7 @@ void emberAfThreadNetworkDiagnosticsClusterServerManufacturerSpecificAttributeCh * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfThreadNetworkDiagnosticsClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -329,7 +328,7 @@ void emberAfWindowCoveringClusterServerManufacturerSpecificAttributeChangedCallb * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWindowCoveringClusterServerMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfWindowCoveringClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -714,8 +713,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/src/app/clusters/ias-zone-client/ias-zone-client.cpp b/src/app/clusters/ias-zone-client/ias-zone-client.cpp index fe17ebdb647ced..5bd9fddd28783f 100644 --- a/src/app/clusters/ias-zone-client/ias-zone-client.cpp +++ b/src/app/clusters/ias-zone-client/ias-zone-client.cpp @@ -390,7 +390,7 @@ static void removeServer(uint8_t * ieeeAddress) static EmberStatus sendCommand(EmberNodeId destAddress) { emberAfSetCommandEndpoints(myEndpoint, emberAfIasZoneClientKnownServers[currentIndex].endpoint); - EmberStatus status = emberAfSendCommandUnicast(EMBER_OUTGOING_DIRECT, destAddress); + EmberStatus status = emberAfSendCommandUnicast(MessageSendDestination::Direct(destAddress)); emberAfIasZoneClusterPrintln("Sent IAS Zone Client Command to 0x%2X (%d -> %d) status: 0x%X", destAddress, myEndpoint, emberAfIasZoneClientKnownServers[currentIndex].endpoint, status); if (status != EMBER_SUCCESS) diff --git a/src/app/clusters/ias-zone-server/ias-zone-server.cpp b/src/app/clusters/ias-zone-server/ias-zone-server.cpp index c39e401261d5dc..f9329b11437b47 100644 --- a/src/app/clusters/ias-zone-server/ias-zone-server.cpp +++ b/src/app/clusters/ias-zone-server/ias-zone-server.cpp @@ -762,9 +762,8 @@ void emberAfPluginIasZoneServerPrintQueueConfig(void) // destination when the destination is the only router the node is joined to. // In that case, the command will never have been sent, as the device will have // had no router by which to send the command. -void emberAfIasZoneClusterServerMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status) +void emberAfIasZoneClusterServerMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { #if defined(EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ENABLE_QUEUE) uint8_t frameControl; diff --git a/src/app/clusters/messaging-client/messaging-client.cpp b/src/app/clusters/messaging-client/messaging-client.cpp index 504b1168b76580..2e134edb6093b3 100644 --- a/src/app/clusters/messaging-client/messaging-client.cpp +++ b/src/app/clusters/messaging-client/messaging-client.cpp @@ -328,8 +328,9 @@ EmberAfStatus emberAfPluginMessagingClientConfirmMessage(EndpointId endpoint) emberAfGetCurrentTime(), 0x00, ""); // The source and destination are reversed for the confirmation. emberAfSetCommandEndpoints(messageTable[ep].clientEndpoint, esiEntry->endpoint); - status = ((emberAfSendCommandUnicast(EMBER_OUTGOING_DIRECT, nodeId) == EMBER_SUCCESS) ? EMBER_ZCL_STATUS_SUCCESS - : EMBER_ZCL_STATUS_FAILURE); + const MessageSendDestination destination = MessageSendDestination::Direct(nodeId); + status = + ((emberAfSendCommandUnicast(destination) == EMBER_SUCCESS) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); } } else diff --git a/src/app/clusters/messaging-server/messaging-server.cpp b/src/app/clusters/messaging-server/messaging-server.cpp index e5ad2086aa59b6..cfc2157d6696c8 100644 --- a/src/app/clusters/messaging-server/messaging-server.cpp +++ b/src/app/clusters/messaging-server/messaging-server.cpp @@ -226,7 +226,7 @@ void emberAfPluginMessagingServerDisplayMessage(EmberNodeId nodeId, uint8_t srcE message.startTime, message.durationInMinutes, message.message, message.extendedMessageControl); emberAfSetCommandEndpoints(srcEndpoint, dstEndpoint); emberAfGetCommandApsFrame()->options |= EMBER_APS_OPTION_SOURCE_EUI64; - status = emberAfSendCommandUnicast(EMBER_OUTGOING_DIRECT, nodeId); + status = emberAfSendCommandUnicast(MessageSendDestination::Direct(nodeId)); if (status != EMBER_SUCCESS) { emberAfMessagingClusterPrintln("Error in display %x", status); @@ -248,7 +248,7 @@ void emberAfPluginMessagingServerCancelMessage(EmberNodeId nodeId, uint8_t srcEn ZCL_CANCEL_MESSAGE_COMMAND_ID, "wu", message.messageId, message.messageControl); emberAfSetCommandEndpoints(srcEndpoint, dstEndpoint); emberAfGetCommandApsFrame()->options |= EMBER_APS_OPTION_SOURCE_EUI64; - status = emberAfSendCommandUnicast(EMBER_OUTGOING_DIRECT, nodeId); + status = emberAfSendCommandUnicast(MessageSendDestination::Direct(nodeId)); if (status != EMBER_SUCCESS) { emberAfMessagingClusterPrintln("Error in cancel %x", status); diff --git a/src/app/reporting/reporting.cpp b/src/app/reporting/reporting.cpp index fbde4972cde499..506318ba83e149 100644 --- a/src/app/reporting/reporting.cpp +++ b/src/app/reporting/reporting.cpp @@ -73,8 +73,8 @@ static void removeConfigurationAndScheduleTick(uint8_t index); static EmberAfStatus configureReceivedAttribute(const EmberAfClusterCommand * cmd, AttributeId attributeId, uint8_t mask, uint16_t timeout); static void putReportableChangeInResp(const EmberAfPluginReportingEntry * entry, EmberAfAttributeType dataType); -static void retrySendReport(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +static void retrySendReport(const MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); static uint32_t computeStringHash(uint8_t * data, uint8_t length); EmberEventControl emberAfPluginReportingTickEventControl; @@ -99,13 +99,13 @@ EmberAfStatus emberAfPluginReportingConfiguredCallback(const EmberAfPluginReport return EMBER_ZCL_STATUS_SUCCESS; } -static void retrySendReport(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +static void retrySendReport(const MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status) { // Retry once, and do so by unicasting without a pointer to this callback if (status != EMBER_SUCCESS) { - emberAfSendUnicast(type, destination, apsFrame, msgLen, message); + emberAfSendUnicast(destination, apsFrame, msgLen, message); } } @@ -364,7 +364,7 @@ static void conditionallySendReport(EndpointId endpoint, ClusterId clusterId) EmberStatus status; if (emberAfIsDeviceEnabled(endpoint) || clusterId == ZCL_IDENTIFY_CLUSTER_ID) { - status = emberAfSendCommandUnicastToBindingsWithCallback((EmberAfMessageSentFunction)(&retrySendReport)); + status = emberAfSendCommandUnicastToBindingsWithCallback(&retrySendReport); // If the callback table is full, attempt to send the message with no // callback. Note that this could lead to a message failing to transmit diff --git a/src/app/util/af-main-common.cpp b/src/app/util/af-main-common.cpp index 6ffd8cd5983822..5b332086df10f1 100644 --- a/src/app/util/af-main-common.cpp +++ b/src/app/util/af-main-common.cpp @@ -202,9 +202,8 @@ void emAfInitializeMessageSentCallbackArray(void) } } -static EmberStatus send(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t messageLength, uint8_t * message, bool broadcast, EmberNodeId alias, uint8_t sequence, - EmberAfMessageSentFunction callback) +static EmberStatus send(const MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t messageLength, + uint8_t * message, bool broadcast, EmberNodeId alias, uint8_t sequence, EmberAfMessageSentFunction callback) { EmberStatus status; uint8_t index; @@ -268,7 +267,7 @@ static EmberStatus send(EmberOutgoingMessageType type, MessageSendDestination de { EmberAfMessageStruct messageStruct = { - callback, apsFrame, message, destination, messageLength, type, broadcast, + callback, apsFrame, message, destination, messageLength, broadcast, }; // Called prior to fragmentation in case the mesasge does not go out over the // Zigbee radio, and instead goes to some other transport that does not require @@ -285,7 +284,7 @@ static EmberStatus send(EmberOutgoingMessageType type, MessageSendDestination de if (messageLength <= EMBER_AF_MAXIMUM_SEND_PAYLOAD_LENGTH) { - status = emAfSend(type, destination, apsFrame, (uint8_t) messageLength, message, &messageTag, alias, sequence); + status = emAfSend(destination, apsFrame, (uint8_t) messageLength, message, &messageTag, alias, sequence); } else { @@ -297,7 +296,7 @@ static EmberStatus send(EmberOutgoingMessageType type, MessageSendDestination de if ((status != EMBER_SUCCESS) && (callback == emberAfPluginCriticalMessageQueueEnqueueCallback || callback == emAfPluginCriticalMessageQueueRetryCallback)) { - callback(type, destination, apsFrame, messageLength, message, status); + callback(destination, apsFrame, messageLength, message, status); } #endif // EMBER_AF_PLUGIN_CRITICAL_MESSAGE_QUEUE @@ -331,8 +330,9 @@ EmberStatus emberAfSendMulticastWithAliasWithCallback(GroupId multicastId, Ember uint8_t * message, EmberNodeId alias, uint8_t sequence, EmberAfMessageSentFunction callback) { - apsFrame->groupId = multicastId; - return send(EMBER_OUTGOING_MULTICAST_WITH_ALIAS, MessageSendDestination(multicastId), apsFrame, messageLength, message, + apsFrame->groupId = multicastId; + const auto destination = MessageSendDestination::MulticastWithAlias(multicastId); + return send(destination, apsFrame, messageLength, message, true, // broadcast alias, sequence, callback); } @@ -340,8 +340,9 @@ EmberStatus emberAfSendMulticastWithAliasWithCallback(GroupId multicastId, Ember EmberStatus emberAfSendMulticastWithCallback(GroupId multicastId, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, EmberAfMessageSentFunction callback) { - apsFrame->groupId = multicastId; - return send(EMBER_OUTGOING_MULTICAST, MessageSendDestination(multicastId), apsFrame, messageLength, message, + apsFrame->groupId = multicastId; + const auto destination = MessageSendDestination::Multicast(multicastId); + return send(destination, apsFrame, messageLength, message, true, // broadcast? 0, // alias 0, // sequence @@ -422,13 +423,12 @@ EmberStatus emberAfSendMulticastToBindings(EmberApsFrame * apsFrame, uint16_t me // return emberAfSendBroadcastWithCallback(destination, apsFrame, messageLength, message, NULL); //} -EmberStatus emberAfSendUnicastWithCallback(EmberOutgoingMessageType type, MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, - EmberAfMessageSentFunction callback) +EmberStatus emberAfSendUnicastWithCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t messageLength, uint8_t * message, EmberAfMessageSentFunction callback) { // The source endpoint in the APS frame MAY NOT be valid at this point if the // outgoing type is "via binding." - if (type == EMBER_OUTGOING_VIA_BINDING) + if (destination.IsViaBinding()) { // If using binding, set the endpoints based on those in the binding. The // cluster in the binding is not used because bindings can be used to send @@ -436,7 +436,7 @@ EmberStatus emberAfSendUnicastWithCallback(EmberOutgoingMessageType type, Messag EmberBindingTableEntry binding; // TODO: This cast should go away once // https://github.com/project-chip/connectedhomeip/issues/3584 is fixed. - EmberStatus status = emberGetBinding(destination.mBindingIndex, &binding); + EmberStatus status = emberGetBinding(destination.GetBindingIndex(), &binding); if (status != EMBER_SUCCESS) { return status; @@ -444,17 +444,17 @@ EmberStatus emberAfSendUnicastWithCallback(EmberOutgoingMessageType type, Messag apsFrame->sourceEndpoint = binding.local; apsFrame->destinationEndpoint = binding.remote; } - return send(type, destination, apsFrame, messageLength, message, + return send(destination, apsFrame, messageLength, message, false, // broadcast? 0, // alias 0, // sequence callback); } -EmberStatus emberAfSendUnicast(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t messageLength, uint8_t * message) +EmberStatus emberAfSendUnicast(const MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t messageLength, + uint8_t * message) { - return emberAfSendUnicastWithCallback(type, destination, apsFrame, messageLength, message, NULL); + return emberAfSendUnicastWithCallback(destination, apsFrame, messageLength, message, NULL); } EmberStatus emberAfSendUnicastToBindingsWithCallback(EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, @@ -474,8 +474,9 @@ EmberStatus emberAfSendUnicastToBindingsWithCallback(EmberApsFrame * apsFrame, u if (binding.type == EMBER_UNICAST_BINDING && binding.local == apsFrame->sourceEndpoint && binding.clusterId == apsFrame->clusterId) { - apsFrame->destinationEndpoint = binding.remote; - status = send(EMBER_OUTGOING_VIA_BINDING, MessageSendDestination(i), apsFrame, messageLength, message, + apsFrame->destinationEndpoint = binding.remote; + const MessageSendDestination destination = MessageSendDestination::ViaBinding(i); + status = send(destination, apsFrame, messageLength, message, false, // broadcast? 0, // alias 0, // sequence @@ -547,7 +548,7 @@ void emAfPrintStatus(const char * task, EmberStatus status) // Functions called by the Serial Command Line Interface (CLI) // ****************************************************************** -static void printMessage(EmberIncomingMessageType type, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * messageContents) +static void printMessage(EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * messageContents) { emberAfAppPrint("Cluster: 0x%2X, %d bytes,", apsFrame->clusterId, messageLength); if (messageLength >= 3) @@ -558,14 +559,14 @@ static void printMessage(EmberIncomingMessageType type, EmberApsFrame * apsFrame emberAfAppPrintln(""); } -void emAfMessageSentHandler(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - EmberStatus status, uint16_t messageLength, uint8_t * messageContents, uint8_t messageTag) +void emAfMessageSentHandler(const MessageSendDestination & destination, EmberApsFrame * apsFrame, EmberStatus status, + uint16_t messageLength, uint8_t * messageContents, uint8_t messageTag) { EmberAfMessageSentFunction callback; if (status != EMBER_SUCCESS) { emberAfAppPrint("%ptx %x, ", "ERROR: ", status); - printMessage(type, apsFrame, messageLength, messageContents); + printMessage(apsFrame, messageLength, messageContents); } callback = getMessageSentCallback(messageTag); @@ -576,7 +577,7 @@ void emAfMessageSentHandler(EmberOutgoingMessageType type, MessageSendDestinatio if (messageContents != NULL && messageContents[0] & ZCL_CLUSTER_SPECIFIC_COMMAND) { emberAfClusterMessageSentWithMfgCodeCallback( - type, destination, apsFrame, messageLength, messageContents, status, + destination, apsFrame, messageLength, messageContents, status, // If the manufacturer specific flag is set // get read it as next part of message // else use null code. @@ -587,24 +588,23 @@ void emAfMessageSentHandler(EmberOutgoingMessageType type, MessageSendDestinatio if (callback != NULL) { - (*callback)(type, destination, apsFrame, messageLength, messageContents, status); + (*callback)(destination, apsFrame, messageLength, messageContents, status); } #ifdef EMBER_AF_GENERATED_PLUGIN_MESSAGE_SENT_FUNCTION_CALLS EMBER_AF_GENERATED_PLUGIN_MESSAGE_SENT_FUNCTION_CALLS #endif - emberAfMessageSentCallback(type, destination, apsFrame, messageLength, messageContents, status); + emberAfMessageSentCallback(destination, apsFrame, messageLength, messageContents, status); } #ifdef EMBER_AF_PLUGIN_FRAGMENTATION -void emAfFragmentationMessageSentHandler(EmberOutgoingMessageType type, MessageSendDestination destination, - EmberApsFrame * apsFrame, uint8_t * buffer, uint16_t bufLen, EmberStatus status, - uint8_t messageTag) +void emAfFragmentationMessageSentHandler(const MessageSendDestination & destination, EmberApsFrame * apsFrame, uint8_t * buffer, + uint16_t bufLen, EmberStatus status, uint8_t messageTag) { // the fragmented message is no longer in process emberAfDebugPrintln("%pend.", "Fragmentation:"); - emAfMessageSentHandler(type, destination, apsFrame, status, bufLen, buffer, messageTag); + emAfMessageSentHandler(destination, apsFrame, status, bufLen, buffer, messageTag); // EMZIGBEE-4437: setting back the buffers to the original in case someone set // that to something else. @@ -612,8 +612,8 @@ void emAfFragmentationMessageSentHandler(EmberOutgoingMessageType type, MessageS } #endif // EMBER_AF_PLUGIN_FRAGMENTATION -EmberStatus emAfSend(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint8_t messageLength, uint8_t * message, uint8_t * messageTag, EmberNodeId alias, uint8_t sequence) +EmberStatus emAfSend(const MessageSendDestination & destination, EmberApsFrame * apsFrame, uint8_t messageLength, uint8_t * message, + uint8_t * messageTag, EmberNodeId alias, uint8_t sequence) { // TODO: There's an impedance mismatch here in a few ways: // 1) The caller expects to get a messageTag out that will identify this @@ -630,52 +630,31 @@ EmberStatus emAfSend(EmberOutgoingMessageType type, MessageSendDestination desti // tracks this. *messageTag = INVALID_MESSAGE_TAG; EmberStatus status = EMBER_SUCCESS; - switch (type) + if (destination.IsViaBinding()) { - case EMBER_OUTGOING_VIA_BINDING: { EmberBindingTableEntry binding; - status = emberGetBinding(destination.mBindingIndex, &binding); + status = emberGetBinding(destination.GetBindingIndex(), &binding); if (status != EMBER_SUCCESS) { - break; + return status; } if (binding.type != EMBER_UNICAST_BINDING) { - status = EMBER_INVALID_BINDING_INDEX; - break; + return EMBER_INVALID_BINDING_INDEX; } - status = chipSendUnicast(binding.nodeId, apsFrame, messageLength, message); - break; + return chipSendUnicast(binding.nodeId, apsFrame, messageLength, message); } - case EMBER_OUTGOING_VIA_ADDRESS_TABLE: - // No implementation yet. - status = EMBER_ERR_FATAL; - break; - case EMBER_OUTGOING_DIRECT: - status = chipSendUnicast(destination.mNodeId, apsFrame, messageLength, message); - break; - case EMBER_OUTGOING_MULTICAST: - // No implementation yet. - status = EMBER_ERR_FATAL; - break; - case EMBER_OUTGOING_MULTICAST_WITH_ALIAS: - // No implementation yet. - status = EMBER_ERR_FATAL; - break; - case EMBER_OUTGOING_BROADCAST: - // No implementation yet. - status = EMBER_ERR_FATAL; - break; - case EMBER_OUTGOING_BROADCAST_WITH_ALIAS: + else if (destination.IsDirect()) + { + return chipSendUnicast(destination.GetDirectNodeId(), apsFrame, messageLength, message); + } + else if (destination.IsViaExchange()) + { + return chipSendUnicast(destination.GetExchangeContext(), apsFrame, messageLength, message); + } + else + { // No implementation yet. - status = EMBER_ERR_FATAL; - break; - case EMBER_OUTGOING_VIA_EXCHANGE: - status = chipSendUnicast(destination.mExchangeContext, apsFrame, messageLength, message); - break; - default: - status = EMBER_BAD_ARGUMENT; - break; + return EMBER_ERR_FATAL; } - return status; } diff --git a/src/app/util/af-main.h b/src/app/util/af-main.h index 777fde0ebe4b90..24a3a01aa373c0 100644 --- a/src/app/util/af-main.h +++ b/src/app/util/af-main.h @@ -121,10 +121,10 @@ bool emAfProcessZdo(EmberNodeId sender, EmberApsFrame * apsFrame, uint8_t * mess void emAfIncomingMessageHandler(EmberIncomingMessageType type, EmberApsFrame * apsFrame, uint8_t lastHopLqi, int8_t lastHopRssi, uint16_t messageLength, uint8_t * messageContents); -EmberStatus emAfSend(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint8_t messageLength, uint8_t * message, uint8_t * messageTag, EmberNodeId alias, uint8_t sequence); -void emAfMessageSentHandler(EmberOutgoingMessageType type, uint64_t indexOrDestination, EmberApsFrame * apsFrame, - EmberStatus status, uint16_t messageLength, uint8_t * messageContents, uint8_t messageTag); +EmberStatus emAfSend(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint8_t messageLength, + uint8_t * message, uint8_t * messageTag, EmberNodeId alias, uint8_t sequence); +void emAfMessageSentHandler(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, EmberStatus status, + uint16_t messageLength, uint8_t * messageContents, uint8_t messageTag); void emAfStackStatusHandler(EmberStatus status); void emAfNetworkInit(void); diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index 7df8c212ca8b7d..23df492ff91e77 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -56,6 +56,7 @@ #include // For various types. #include +#include #ifdef EZSP_HOST #include "app/util/ezsp/ezsp-enum.h" @@ -1252,26 +1253,103 @@ typedef void (*EmberAfDefaultResponseFunction)(chip::EndpointId endpoint, chip:: namespace chip { /** - * @brief a type that represents where we are trying to send a message. This - * must always be paired with an EmberOutgoingMessageType that identifies - * which arm of the union is in use. - */ -union MessageSendDestination -{ - explicit constexpr MessageSendDestination(uint8_t aBindingIndex) : mBindingIndex(aBindingIndex) {} - explicit constexpr MessageSendDestination(NodeId aNodeId) : mNodeId(aNodeId) {} - explicit constexpr MessageSendDestination(GroupId aGroupId) : mGroupId(aGroupId) {} - explicit constexpr MessageSendDestination(Messaging::ExchangeContext * aExchangeContext) : mExchangeContext(aExchangeContext) {} - - // Used when the type is EMBER_OUTGOING_VIA_BINDING - uint8_t mBindingIndex; - // Used when the type is EMBER_OUTGOING_DIRECT - NodeId mNodeId; - // Used when the type is EMBER_OUTGOING_MULTICAST or - // EMBER_OUTGOING_MULTICAST_WITH_ALIAS - GroupId mGroupId; - // Used when the type is EMBER_OUTGOING_VIA_EXCHANGE - Messaging::ExchangeContext * mExchangeContext; + * @brief a type that represents where we are trying to send a message. + * The variant type identifies which arm of the union is in use. + */ +class MessageSendDestination +{ +public: + MessageSendDestination(MessageSendDestination & that) = default; + MessageSendDestination(const MessageSendDestination & that) = default; + MessageSendDestination(MessageSendDestination && that) = default; + + static MessageSendDestination ViaBinding(uint8_t bindingIndex) + { + return MessageSendDestination(VariantViaBinding(bindingIndex)); + } + + static MessageSendDestination Direct(NodeId nodeId) { return MessageSendDestination(VariantDirect(nodeId)); } + + static MessageSendDestination Multicast(GroupId groupId) { return MessageSendDestination(VariantMulticast(groupId)); } + + static MessageSendDestination MulticastWithAlias(GroupId groupId) + { + return MessageSendDestination(VariantMulticastWithAlias(groupId)); + } + + static MessageSendDestination ViaExchange(Messaging::ExchangeContext * exchangeContext) + { + return MessageSendDestination(VariantViaExchange(exchangeContext)); + } + + bool IsViaBinding() const { return mDestination.Is(); } + bool IsDirect() const { return mDestination.Is(); } + bool IsViaExchange() const { return mDestination.Is(); } + + uint8_t GetBindingIndex() const { return mDestination.Get().mBindingIndex; } + NodeId GetDirectNodeId() const { return mDestination.Get().mNodeId; } + Messaging::ExchangeContext * GetExchangeContext() const { return mDestination.Get().mExchangeContext; } + +private: + struct VariantViaBinding + { + static constexpr const std::size_t VariantId = 1; + explicit VariantViaBinding(uint8_t bindingIndex) : mBindingIndex(bindingIndex) {} + uint8_t mBindingIndex; + }; + + struct VariantViaAddressTable + { + static constexpr const std::size_t VariantId = 2; + }; + + struct VariantDirect + { + static constexpr const std::size_t VariantId = 3; + explicit VariantDirect(NodeId nodeId) : mNodeId(nodeId) {} + NodeId mNodeId; + }; + + struct VariantMulticast + { + static constexpr const std::size_t VariantId = 4; + explicit VariantMulticast(GroupId groupId) : mGroupId(groupId) {} + GroupId mGroupId; + }; + + struct VariantMulticastWithAlias + { + static constexpr const std::size_t VariantId = 5; + explicit VariantMulticastWithAlias(GroupId groupId) : mGroupId(groupId) {} + GroupId mGroupId; + }; + + struct VariantBroadcast + { + static constexpr const std::size_t VariantId = 6; + }; + + struct VariantBroadcastWithAlias + { + static constexpr const std::size_t VariantId = 7; + }; + + struct VariantViaExchange + { + static constexpr const std::size_t VariantId = 8; + explicit VariantViaExchange(Messaging::ExchangeContext * exchangeContext) : mExchangeContext(exchangeContext) {} + Messaging::ExchangeContext * mExchangeContext; + }; + + template + MessageSendDestination(Destination && destination) + { + mDestination.Set(std::forward(destination)); + } + + Variant + mDestination; }; } // namespace chip @@ -1280,8 +1358,8 @@ union MessageSendDestination * * This function is called when a message is sent. */ -typedef void (*EmberAfMessageSentFunction)(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +typedef void (*EmberAfMessageSentFunction)(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** * @brief The EmberAfMessageStruct is a struct wrapper that @@ -1293,9 +1371,8 @@ typedef struct EmberAfMessageSentFunction callback; EmberApsFrame * apsFrame; uint8_t * message; - chip::MessageSendDestination destination; + const chip::MessageSendDestination destination; uint16_t messageLength; - EmberOutgoingMessageType type; bool broadcast; } EmberAfMessageStruct; diff --git a/src/app/util/af.h b/src/app/util/af.h index 239a8ba183227f..ae8128aa0cf54d 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -1297,15 +1297,14 @@ EmberStatus emberAfSendMulticastWithCallback(chip::GroupId multicastId, EmberAps /** * @brief Sends unicast. */ -EmberStatus emberAfSendUnicast(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t messageLength, uint8_t * message); +EmberStatus emberAfSendUnicast(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t messageLength, + uint8_t * message); /** * @brief Sends unicast with attached message sent callback. */ -EmberStatus emberAfSendUnicastWithCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, - EmberAfMessageSentFunction callback); +EmberStatus emberAfSendUnicastWithCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t messageLength, uint8_t * message, EmberAfMessageSentFunction callback); /** * @brief Unicasts the message to each remote node in the binding table that @@ -1391,12 +1390,12 @@ EmberStatus emberAfSendCommandMulticastToBindings(void); * using the emberAfFill... macros from the client command API. * It will be sent as unicast. */ -EmberStatus emberAfSendCommandUnicast(EmberOutgoingMessageType type, uint16_t indexOrDestination); +EmberStatus emberAfSendCommandUnicast(const chip::MessageSendDestination & destination); /** * @brief emberAfSendCommandUnicast with attached message sent callback. */ -EmberStatus emberAfSendCommandUnicastWithCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, +EmberStatus emberAfSendCommandUnicastWithCallback(const chip::MessageSendDestination & destination, EmberAfMessageSentFunction callback); /** diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 25012098efd9b3..ff1e102de4a0c1 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -300,9 +300,8 @@ void emberAfClusterDefaultResponseCallback(EndpointId endpoint, ClusterId cluste } // This function is used to call the per-cluster message sent callback -void emberAfClusterMessageSentWithMfgCodeCallback(EmberOutgoingMessageType type, MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status, - uint16_t mfgCode) +void emberAfClusterMessageSentWithMfgCodeCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status, uint16_t mfgCode) { if (apsFrame != NULL && message != NULL && msgLen != 0) { @@ -317,7 +316,7 @@ void emberAfClusterMessageSentWithMfgCodeCallback(EmberOutgoingMessageType type, if (f != NULL) { // emberAfPushEndpointNetworkIndex(apsFrame->sourceEndpoint); - ((EmberAfMessageSentFunction) f)(type, destination, apsFrame, msgLen, message, status); + ((EmberAfMessageSentFunction) f)(destination, apsFrame, msgLen, message, status); // emberAfPopNetworkIndex(); } } @@ -327,11 +326,10 @@ void emberAfClusterMessageSentWithMfgCodeCallback(EmberOutgoingMessageType type, // This function is used to call the per-cluster message sent callback, and // wraps the emberAfClusterMessageSentWithMfgCodeCallback with a // EMBER_AF_NULL_MANUFACTURER_CODE. -void emberAfClusterMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +void emberAfClusterMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status) { - emberAfClusterMessageSentWithMfgCodeCallback(type, destination, apsFrame, msgLen, message, status, - EMBER_AF_NULL_MANUFACTURER_CODE); + emberAfClusterMessageSentWithMfgCodeCallback(destination, apsFrame, msgLen, message, status, EMBER_AF_NULL_MANUFACTURER_CODE); } // This function is used to call the per-cluster attribute changed callback diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index af40271be5ec5d..912e153c7adbf5 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -218,12 +218,12 @@ void emberAfClusterDefaultResponseWithMfgCodeCallback(chip::EndpointId endpoint, EmberAfStatus status, uint8_t clientServerMask, uint16_t manufacturerCode); // Calls the message sent callback for a specific cluster, and wraps emberAfClusterMessageSentWithMfgCodeCallback -void emberAfClusterMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfClusterMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); // Calls the message sent callback for a specific cluster. -void emberAfClusterMessageSentWithMfgCodeCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status, +void emberAfClusterMessageSentWithMfgCodeCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status, uint16_t manufacturerCode); // Used to retrieve a manufacturer code from an attribute metadata diff --git a/src/app/util/client-api.cpp b/src/app/util/client-api.cpp index efae02ecec684a..b4b2d0c24bf381 100644 --- a/src/app/util/client-api.cpp +++ b/src/app/util/client-api.cpp @@ -330,16 +330,15 @@ EmberStatus emberAfSendCommandMulticastToBindings(void) return emberAfSendMulticastToBindings(emAfCommandApsFrame, *emAfResponseLengthPtr, emAfZclBuffer); } -// EmberStatus emberAfSendCommandUnicastWithCallback(EmberOutgoingMessageType type, uint16_t indexOrDestination, -// EmberAfMessageSentFunction callback) +// EmberStatus emberAfSendCommandUnicastWithCallback(const chip::MessageSendDestination & destination, EmberAfMessageSentFunction +// callback) // { -// return emberAfSendUnicastWithCallback(type, indexOrDestination, emAfCommandApsFrame, *emAfResponseLengthPtr, emAfZclBuffer, -// callback); +// return emberAfSendUnicastWithCallback(destination, emAfCommandApsFrame, *emAfResponseLengthPtr, emAfZclBuffer, callback); // } -// EmberStatus emberAfSendCommandUnicast(EmberOutgoingMessageType type, uint16_t indexOrDestination) +// EmberStatus emberAfSendCommandUnicast(const chip::MessageSendDestination & destination) // { -// return emberAfSendCommandUnicastWithCallback(type, indexOrDestination, NULL); +// return emberAfSendCommandUnicastWithCallback(destination, NULL); // } // EmberStatus emberAfSendCommandBroadcastWithCallback(EmberNodeId destination, EmberAfMessageSentFunction callback) diff --git a/src/app/util/types_stub.h b/src/app/util/types_stub.h index 3446702bb84510..37382566ff6684 100644 --- a/src/app/util/types_stub.h +++ b/src/app/util/types_stub.h @@ -365,38 +365,6 @@ enum EMBER_INCOMING_BROADCAST_LOOPBACK }; -/** - * @brief Defines the possible outgoing message types. - */ -#ifdef DOXYGEN_SHOULD_SKIP_THIS -enum EmberOutgoingMessageType -#else -typedef uint8_t EmberOutgoingMessageType; -enum -#endif -{ - /** Unicast sent directly to an EmberNodeId. */ - EMBER_OUTGOING_DIRECT, - /** Unicast sent using an entry in the address table. */ - EMBER_OUTGOING_VIA_ADDRESS_TABLE, - /** Unicast sent using an entry in the binding table. */ - EMBER_OUTGOING_VIA_BINDING, - /** Multicast message. This value is passed to emberMessageSentHandler() only. - * It may not be passed to emberSendUnicast(). */ - EMBER_OUTGOING_MULTICAST, - /** An aliased multicast message. This value is passed to emberMessageSentHandler() only. - * It may not be passed to emberSendUnicast(). */ - EMBER_OUTGOING_MULTICAST_WITH_ALIAS, - /** An aliased Broadcast message. This value is passed to emberMessageSentHandler() only. - * It may not be passed to emberSendUnicast(). */ - EMBER_OUTGOING_BROADCAST_WITH_ALIAS, - /** A broadcast message. This value is passed to emberMessageSentHandler() only. - * It may not be passed to emberSendUnicast(). */ - EMBER_OUTGOING_BROADCAST, - /** A messaging going via some existing exchange. */ - EMBER_OUTGOING_VIA_EXCHANGE, -}; - /** @brief Endpoint information (a ZigBee Simple Descriptor). * * This is a ZigBee Simple Descriptor and contains information diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index baa2595416054a..1101e44177a744 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -749,7 +749,7 @@ EmberStatus emberAfSendResponseWithCallback(EmberAfMessageSentFunction callback) else if (!isBroadcastDestination(emberAfResponseDestination)) { label = 'U'; - status = emberAfSendUnicastWithCallback(EMBER_OUTGOING_VIA_EXCHANGE, MessageSendDestination(emberAfResponseDestination), + status = emberAfSendUnicastWithCallback(MessageSendDestination::ViaExchange(emberAfResponseDestination), &emberAfResponseApsFrame, appResponseLength, appResponseData, callback); } else diff --git a/src/app/zap-templates/templates/app/callback-stub-src.zapt b/src/app/zap-templates/templates/app/callback-stub-src.zapt index efec64805fcd48..13198d56ef0d53 100644 --- a/src/app/zap-templates/templates/app/callback-stub-src.zapt +++ b/src/app/zap-templates/templates/app/callback-stub-src.zapt @@ -323,7 +323,7 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback( * @param status Ver.: always */ bool __attribute__((weak)) emberAfMessageSentCallback( - EmberOutgoingMessageType type, MessageSendDestination destination, + const MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status) { diff --git a/src/app/zap-templates/templates/app/callback.zapt b/src/app/zap-templates/templates/app/callback.zapt index ea1e06e2bdf558..61cc5d70d8cd2a 100644 --- a/src/app/zap-templates/templates/app/callback.zapt +++ b/src/app/zap-templates/templates/app/callback.zapt @@ -81,7 +81,7 @@ void emberAf{{asCamelCased name false}}Cluster{{asCamelCased side false}}Manufac * @param message The message that was sent * @param status The status of the sent message */ -void emberAf{{asCamelCased name false}}Cluster{{asCamelCased side false}}MessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAf{{asCamelCased name false}}Cluster{{asCamelCased side false}}MessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief {{name}} Cluster {{asCamelCased side false}} Pre Attribute Changed * @@ -372,7 +372,7 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change diff --git a/src/controller/data_model/gen/callback-stub.cpp b/src/controller/data_model/gen/callback-stub.cpp index b10ba5b241e36f..3313e9dd75aa61 100644 --- a/src/controller/data_model/gen/callback-stub.cpp +++ b/src/controller/data_model/gen/callback-stub.cpp @@ -646,9 +646,8 @@ bool __attribute__((weak)) emberAfPreMessageSendCallback(EmberAfMessageStruct * * @param message Ver.: always * @param status Ver.: always */ -bool __attribute__((weak)) -emberAfMessageSentCallback(EmberOutgoingMessageType type, MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status) +bool __attribute__((weak)) emberAfMessageSentCallback(const MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status) { return false; } diff --git a/src/controller/data_model/gen/callback.h b/src/controller/data_model/gen/callback.h index 85902a2da3542d..f346545604d57d 100644 --- a/src/controller/data_model/gen/callback.h +++ b/src/controller/data_model/gen/callback.h @@ -414,9 +414,8 @@ void emberAfAccountLoginClusterClientManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfAccountLoginClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfAccountLoginClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Account Login Cluster Client Pre Attribute Changed * @@ -484,9 +483,9 @@ void emberAfApplicationBasicClusterClientManufacturerSpecificAttributeChangedCal * @param message The message that was sent * @param status The status of the sent message */ -void emberAfApplicationBasicClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfApplicationBasicClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Application Basic Cluster Client Pre Attribute Changed * @@ -555,9 +554,9 @@ void emberAfApplicationLauncherClusterClientManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfApplicationLauncherClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfApplicationLauncherClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Application Launcher Cluster Client Pre Attribute Changed * @@ -626,9 +625,8 @@ void emberAfAudioOutputClusterClientManufacturerSpecificAttributeChangedCallback * @param message The message that was sent * @param status The status of the sent message */ -void emberAfAudioOutputClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfAudioOutputClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Audio Output Cluster Client Pre Attribute Changed * @@ -696,7 +694,7 @@ void emberAfBarrierControlClusterClientManufacturerSpecificAttributeChangedCallb * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBarrierControlClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfBarrierControlClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -766,8 +764,8 @@ void emberAfBasicClusterClientManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBasicClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBasicClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Basic Cluster Client Pre Attribute Changed * @@ -835,9 +833,9 @@ void emberAfBinaryInputBasicClusterClientManufacturerSpecificAttributeChangedCal * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBinaryInputBasicClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBinaryInputBasicClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Binary Input (Basic) Cluster Client Pre Attribute Changed * @@ -906,9 +904,8 @@ void emberAfBindingClusterClientManufacturerSpecificAttributeChangedCallback(chi * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBindingClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfBindingClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Binding Cluster Client Pre Attribute Changed * @@ -976,9 +973,9 @@ void emberAfBridgedDeviceBasicClusterClientManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBridgedDeviceBasicClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfBridgedDeviceBasicClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Bridged Device Basic Cluster Client Pre Attribute Changed * @@ -1047,9 +1044,8 @@ void emberAfColorControlClusterClientManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfColorControlClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfColorControlClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Color Control Cluster Client Pre Attribute Changed * @@ -1117,7 +1113,7 @@ void emberAfContentLaunchClusterClientManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfContentLaunchClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfContentLaunchClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1187,9 +1183,8 @@ void emberAfDescriptorClusterClientManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfDescriptorClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfDescriptorClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Descriptor Cluster Client Pre Attribute Changed * @@ -1257,9 +1252,8 @@ void emberAfDoorLockClusterClientManufacturerSpecificAttributeChangedCallback(ch * @param message The message that was sent * @param status The status of the sent message */ -void emberAfDoorLockClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfDoorLockClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Door Lock Cluster Client Pre Attribute Changed * @@ -1328,8 +1322,7 @@ void emberAfEthernetNetworkDiagnosticsClusterClientManufacturerSpecificAttribute * @param message The message that was sent * @param status The status of the sent message */ -void emberAfEthernetNetworkDiagnosticsClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfEthernetNetworkDiagnosticsClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -1400,9 +1393,8 @@ void emberAfFixedLabelClusterClientManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfFixedLabelClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfFixedLabelClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Fixed Label Cluster Client Pre Attribute Changed * @@ -1470,9 +1462,9 @@ void emberAfGeneralCommissioningClusterClientManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralCommissioningClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralCommissioningClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Commissioning Cluster Client Pre Attribute Changed * @@ -1541,9 +1533,9 @@ void emberAfGeneralDiagnosticsClusterClientManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralDiagnosticsClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGeneralDiagnosticsClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief General Diagnostics Cluster Client Pre Attribute Changed * @@ -1612,9 +1604,9 @@ void emberAfGroupKeyManagementClusterClientManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGroupKeyManagementClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfGroupKeyManagementClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Group Key Management Cluster Client Pre Attribute Changed * @@ -1683,9 +1675,8 @@ void emberAfGroupsClusterClientManufacturerSpecificAttributeChangedCallback(chip * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGroupsClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfGroupsClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Groups Cluster Client Pre Attribute Changed * @@ -1753,9 +1744,8 @@ void emberAfIdentifyClusterClientManufacturerSpecificAttributeChangedCallback(ch * @param message The message that was sent * @param status The status of the sent message */ -void emberAfIdentifyClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfIdentifyClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Identify Cluster Client Pre Attribute Changed * @@ -1823,9 +1813,8 @@ void emberAfKeypadInputClusterClientManufacturerSpecificAttributeChangedCallback * @param message The message that was sent * @param status The status of the sent message */ -void emberAfKeypadInputClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfKeypadInputClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Keypad Input Cluster Client Pre Attribute Changed * @@ -1893,9 +1882,8 @@ void emberAfLevelControlClusterClientManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLevelControlClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLevelControlClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Level Control Cluster Client Pre Attribute Changed * @@ -1963,9 +1951,8 @@ void emberAfLowPowerClusterClientManufacturerSpecificAttributeChangedCallback(ch * @param message The message that was sent * @param status The status of the sent message */ -void emberAfLowPowerClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLowPowerClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Low Power Cluster Client Pre Attribute Changed * @@ -2033,9 +2020,8 @@ void emberAfMediaInputClusterClientManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfMediaInputClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfMediaInputClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Media Input Cluster Client Pre Attribute Changed * @@ -2103,7 +2089,7 @@ void emberAfMediaPlaybackClusterClientManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfMediaPlaybackClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfMediaPlaybackClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2173,9 +2159,9 @@ void emberAfNetworkCommissioningClusterClientManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfNetworkCommissioningClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Network Commissioning Cluster Client Pre Attribute Changed * @@ -2243,8 +2229,8 @@ void emberAfOnOffClusterClientManufacturerSpecificAttributeChangedCallback(chip: * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOnOffClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfOnOffClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief On/off Cluster Client Pre Attribute Changed * @@ -2312,8 +2298,7 @@ void emberAfOperationalCredentialsClusterClientManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOperationalCredentialsClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfOperationalCredentialsClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2385,8 +2370,7 @@ void emberAfPumpConfigurationAndControlClusterClientManufacturerSpecificAttribut * @param message The message that was sent * @param status The status of the sent message */ -void emberAfPumpConfigurationAndControlClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfPumpConfigurationAndControlClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2458,8 +2442,7 @@ void emberAfRelativeHumidityMeasurementClusterClientManufacturerSpecificAttribut * @param message The message that was sent * @param status The status of the sent message */ -void emberAfRelativeHumidityMeasurementClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfRelativeHumidityMeasurementClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2530,9 +2513,8 @@ void emberAfScenesClusterClientManufacturerSpecificAttributeChangedCallback(chip * @param message The message that was sent * @param status The status of the sent message */ -void emberAfScenesClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfScenesClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Scenes Cluster Client Pre Attribute Changed * @@ -2600,9 +2582,9 @@ void emberAfSoftwareDiagnosticsClusterClientManufacturerSpecificAttributeChanged * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSoftwareDiagnosticsClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfSoftwareDiagnosticsClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); /** @brief Software Diagnostics Cluster Client Pre Attribute Changed * @@ -2671,9 +2653,8 @@ void emberAfSwitchClusterClientManufacturerSpecificAttributeChangedCallback(chip * @param message The message that was sent * @param status The status of the sent message */ -void emberAfSwitchClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfSwitchClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Switch Cluster Client Pre Attribute Changed * @@ -2741,9 +2722,8 @@ void emberAfTvChannelClusterClientManufacturerSpecificAttributeChangedCallback(c * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTvChannelClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfTvChannelClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief TV Channel Cluster Client Pre Attribute Changed * @@ -2811,7 +2791,7 @@ void emberAfTargetNavigatorClusterClientManufacturerSpecificAttributeChangedCall * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTargetNavigatorClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfTargetNavigatorClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2882,8 +2862,7 @@ void emberAfTemperatureMeasurementClusterClientManufacturerSpecificAttributeChan * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTemperatureMeasurementClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTemperatureMeasurementClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -2954,9 +2933,8 @@ void emberAfTestClusterClusterClientManufacturerSpecificAttributeChangedCallback * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTestClusterClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfTestClusterClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Test Cluster Cluster Client Pre Attribute Changed * @@ -3024,9 +3002,8 @@ void emberAfThermostatClusterClientManufacturerSpecificAttributeChangedCallback( * @param message The message that was sent * @param status The status of the sent message */ -void emberAfThermostatClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfThermostatClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Thermostat Cluster Client Pre Attribute Changed * @@ -3094,8 +3071,7 @@ void emberAfTrustedRootCertificatesClusterClientManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTrustedRootCertificatesClusterClientMessageSentCallback(EmberOutgoingMessageType type, - chip::MessageSendDestination destination, +void emberAfTrustedRootCertificatesClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -3166,9 +3142,8 @@ void emberAfWakeOnLanClusterClientManufacturerSpecificAttributeChangedCallback(c * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWakeOnLanClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfWakeOnLanClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); /** @brief Wake on LAN Cluster Client Pre Attribute Changed * @@ -3236,7 +3211,7 @@ void emberAfWindowCoveringClusterClientManufacturerSpecificAttributeChangedCallb * @param message The message that was sent * @param status The status of the sent message */ -void emberAfWindowCoveringClusterClientMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, +void emberAfWindowCoveringClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); @@ -3953,8 +3928,8 @@ bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberSt * @param message Ver.: always * @param status Ver.: always */ -bool emberAfMessageSentCallback(EmberOutgoingMessageType type, chip::MessageSendDestination destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +bool emberAfMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, uint16_t msgLen, + uint8_t * message, EmberStatus status); /** @brief Pre Attribute Change * diff --git a/src/lib/support/Variant.h b/src/lib/support/Variant.h index 168840ea49c17d..fa494113a398bd 100644 --- a/src/lib/support/Variant.h +++ b/src/lib/support/Variant.h @@ -96,8 +96,8 @@ template struct Variant { private: - static constexpr std::size_t kDataSize = std::max(sizeof(Ts)...); - static constexpr std::size_t kDataAlign = std::max(alignof(Ts)...); + static constexpr std::size_t kDataSize = std::max({ sizeof(Ts)... }); + static constexpr std::size_t kDataAlign = std::max({ alignof(Ts)... }); static constexpr std::size_t kInvalidType = SIZE_MAX; using Data = typename std::aligned_storage::type; @@ -118,7 +118,7 @@ struct Variant that.mTypeId = kInvalidType; } - Variant & operator=(Variant & that) + Variant & operator=(const Variant & that) { Curry::Destroy(mTypeId, &mData); mTypeId = that.mTypeId; @@ -137,12 +137,14 @@ struct Variant } template - bool Is() + bool Is() const { return (mTypeId == T::VariantId); } - bool Valid() { return (mTypeId != kInvalidType); } + std::size_t GetType() const { return mTypeId; } + + bool Valid() const { return (mTypeId != kInvalidType); } template void Set(Args &&... args) @@ -155,29 +157,15 @@ struct Variant template T & Get() { - if (mTypeId == T::VariantId) - { - return *reinterpret_cast(&mData); - } - else - { - assert(false); - return *static_cast(nullptr); - } + VerifyOrDie(mTypeId == T::VariantId); + return *reinterpret_cast(&mData); } template const T & Get() const { - if (mTypeId == T::VariantId) - { - return *reinterpret_cast(&mData); - } - else - { - assert(false); - return *static_cast(nullptr); - } + VerifyOrDie(mTypeId == T::VariantId); + return *reinterpret_cast(&mData); } ~Variant() { Curry::Destroy(mTypeId, &mData); }