Skip to content

Commit

Permalink
Change MessageSendDestination into a type-safe Variant (#7037)
Browse files Browse the repository at this point in the history
* gen files

* Change MessageSendDestination into a type-safe Variant

* gen files

* Refine MessageSendDestination API

* gen files

* Resolve comment

* gen files

* Resolve comments
  • Loading branch information
kghost authored and pull[bot] committed Jul 8, 2021
1 parent abec935 commit 2143439
Show file tree
Hide file tree
Showing 38 changed files with 606 additions and 720 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
212 changes: 91 additions & 121 deletions examples/all-clusters-app/all-clusters-common/gen/callback.h

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions examples/bridge-app/bridge-common/gen/callback-stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
66 changes: 29 additions & 37 deletions examples/bridge-app/bridge-common/gen/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
*
Expand Down
5 changes: 2 additions & 3 deletions examples/lighting-app/lighting-common/gen/callback-stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit 2143439

Please sign in to comment.