From 8b1d31b0d723aeb293ca8fe8c5e96b1dd7358115 Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Wed, 3 Sep 2025 16:21:51 +0900 Subject: [PATCH] zigbee: Change callbacks typedef to using --- src/zigbee/model/zigbee-aps.h | 100 +++++++++++--------------- src/zigbee/model/zigbee-nwk.h | 132 ++++++++++++++-------------------- 2 files changed, 95 insertions(+), 137 deletions(-) diff --git a/src/zigbee/model/zigbee-aps.h b/src/zigbee/model/zigbee-aps.h index 30f459458..86fd931d3 100644 --- a/src/zigbee/model/zigbee-aps.h +++ b/src/zigbee/model/zigbee-aps.h @@ -261,65 +261,6 @@ struct ApsmeRemoveAllGroupsConfirmParams uint8_t m_endPoint{1}; //!< The endpoint from which all groups are being removed. }; -////////////////////// -// Callbacks // -////////////////////// - -/** - * @ingroup zigbee - * - * This callback is called to confirm a successfully transmission of an ASDU. - */ -typedef Callback ApsdeDataConfirmCallback; - -/** - * @ingroup zigbee - * - * This callback is called after a ASDU has successfully received and - * APS push it to deliver it to the next higher layer (typically the application framework). - */ -typedef Callback> ApsdeDataIndicationCallback; - -/** - * @ingroup zigbee - * - * This callback is called to confirm a successfully addition of a destination - * into the binding table. - */ -typedef Callback ApsmeBindConfirmCallback; - -/** - * @ingroup zigbee - * - * This callback is called to confirm a successfully unbind request performed - * into the binding table. - */ -typedef Callback ApsmeUnbindConfirmCallback; - -/** - * @ingroup zigbee - * - * This callback is called to confirm a successfully addition of a group address - * and or endPoint into the group table. - */ -typedef Callback ApsmeAddGroupConfirmCallback; - -/** - * @ingroup zigbee - * - * This callback is called to confirm a successfully removal of a group address - * and or endPoint from the group table. - */ -typedef Callback ApsmeRemoveGroupConfirmCallback; - -/** - * @ingroup zigbee - * - * This callback is called to confirm a successfully removal of an endpoint from - * all the the groups. - */ -typedef Callback ApsmeRemoveAllGroupsConfirmCallback; - /** * @ingroup zigbee * @@ -342,6 +283,47 @@ class ZigbeeAps : public Object ZigbeeAps(); ~ZigbeeAps() override; + /** + * This callback is called to confirm a successfully transmission of an ASDU. + */ + using ApsdeDataConfirmCallback = Callback; + + /** + * This callback is called after a ASDU has successfully received and + * APS push it to deliver it to the next higher layer (typically the application framework). + */ + using ApsdeDataIndicationCallback = Callback>; + + /** + * This callback is called to confirm a successfully addition of a destination + * into the binding table. + */ + using ApsmeBindConfirmCallback = Callback; + + /** + * This callback is called to confirm a successfully unbind request performed + * into the binding table. + */ + using ApsmeUnbindConfirmCallback = Callback; + + /** + * This callback is called to confirm a successfully addition of a group address + * and or endPoint into the group table. + */ + using ApsmeAddGroupConfirmCallback = Callback; + + /** + * This callback is called to confirm a successfully removal of a group address + * and or endPoint from the group table. + */ + using ApsmeRemoveGroupConfirmCallback = Callback; + + /** + * This callback is called to confirm a successfully removal of an endpoint from + * all the the groups. + */ + using ApsmeRemoveAllGroupsConfirmCallback = Callback; + /** * Set the underlying NWK to use in this Zigbee APS * diff --git a/src/zigbee/model/zigbee-nwk.h b/src/zigbee/model/zigbee-nwk.h index 74e78db66..2476000ce 100644 --- a/src/zigbee/model/zigbee-nwk.h +++ b/src/zigbee/model/zigbee-nwk.h @@ -605,84 +605,6 @@ struct NlmeStartRouterConfirmParams //!< the corresponding request. }; -////////////////////// -// Callbacks // -////////////////////// - -/** - * @ingroup Zigbee - * - * This callback is called after a NSDU has successfully received and - * NWK push it to deliver it to the next higher layer. - * - */ -typedef Callback> NldeDataIndicationCallback; - -/** - * @ingroup Zigbee - * - * This callback is used to notify the next higher layer with a confirmation in response to - * a previously issued NLDE-DATA.request. - * - */ -typedef Callback NldeDataConfirmCallback; - -/** - * @ingroup Zigbee - * - * This callback is used to notify the next higher layer with a confirmation in response to - * a previously issued NLME-NETWORK-FORMATION.request. - */ -typedef Callback NlmeNetworkFormationConfirmCallback; - -/** - * @ingroup Zigbee - * - * This callback is used to notify the next higher layer with a confirmation in response to - * a previously issued NLME-NETWORK-DISCOVERY.request. - */ -typedef Callback NlmeNetworkDiscoveryConfirmCallback; - -/** - * @ingroup Zigbee - * - * This callback is used to notify the next higher layer with a confirmation in response to - * a previously issued NLME-ROUTE-DISCOVERY.request. - */ -typedef Callback NlmeRouteDiscoveryConfirmCallback; - -/** - * @ingroup Zigbee - * - * This callback is used to notify the next higher layer with a confirmation in response to - * a previously issued NLME-DIRECT-JOIN.request. - */ -typedef Callback NlmeDirectJoinConfirmCallback; - -/** - * @ingroup Zigbee - * - * This callback is used to notify the next higher layer with a confirmation in response to - * a previously issued NLME-JOIN.request. - */ -typedef Callback NlmeJoinConfirmCallback; - -/** - * @ingroup Zigbee - * - * This callback is used to notify the next higher layer with an indication that a new - * device has successfully joined its network by association or rejoining. - */ -typedef Callback NlmeJoinIndicationCallback; - -/** - * @ingroup Zigbee - * - * This callback is used to notify the next higher layer with a confirmation in response to - * a previously issued NLME-START-ROUTER.request. - */ -typedef Callback NlmeStartRouterConfirmCallback; - /** * @ingroup Zigbee * @@ -704,6 +626,60 @@ class ZigbeeNwk : public Object ZigbeeNwk(); ~ZigbeeNwk() override; + /** + * This callback is called after a NSDU has successfully received and + * NWK push it to deliver it to the next higher layer. + */ + using NldeDataIndicationCallback = Callback>; + + /** + * This callback is used to notify the next higher layer with a confirmation in response to + * a previously issued NLDE-DATA.request. + */ + using NldeDataConfirmCallback = Callback; + + /** + * This callback is used to notify the next higher layer with a confirmation in response to + * a previously issued NLME-NETWORK-FORMATION.request. + */ + using NlmeNetworkFormationConfirmCallback = Callback; + + /** + * This callback is used to notify the next higher layer with a confirmation in response to + * a previously issued NLME-NETWORK-DISCOVERY.request. + */ + using NlmeNetworkDiscoveryConfirmCallback = Callback; + + /** + * This callback is used to notify the next higher layer with a confirmation in response to + * a previously issued NLME-ROUTE-DISCOVERY.request. + */ + using NlmeRouteDiscoveryConfirmCallback = Callback; + + /** + * This callback is used to notify the next higher layer with a confirmation in response to + * a previously issued NLME-DIRECT-JOIN.request. + */ + using NlmeDirectJoinConfirmCallback = Callback; + + /** + * This callback is used to notify the next higher layer with a confirmation in response to + * a previously issued NLME-JOIN.request. + */ + using NlmeJoinConfirmCallback = Callback; + + /** + * This callback is used to notify the next higher layer with an indication that a new + * device has successfully joined its network by association or rejoining. + */ + using NlmeJoinIndicationCallback = Callback; + + /** + * This callback is used to notify the next higher layer with a confirmation in response to + * a previously issued NLME-START-ROUTER.request. + */ + using NlmeStartRouterConfirmCallback = Callback; + /** * Set the underlying MAC to use in this Zigbee NWK *