@@ -747,7 +747,8 @@ static int ieee802154_set_parameters(uint64_t mgmt_request,
747747 return - EINVAL ;
748748 }
749749
750- if (mgmt_request == NET_REQUEST_IEEE802154_SET_EXT_ADDR ) {
750+ if ((mgmt_request == NET_REQUEST_IEEE802154_SET_EXT_ADDR ) ||
751+ (mgmt_request == NET_REQUEST_IEEE802154_SET_COORD_EXT_ADDR )) {
751752 if (len != IEEE802154_EXT_ADDR_LENGTH ) {
752753 return - EINVAL ;
753754 }
@@ -791,6 +792,10 @@ static int ieee802154_set_parameters(uint64_t mgmt_request,
791792 ctx -> pan_id = value ;
792793 ieee802154_radio_filter_pan_id (iface , ctx -> pan_id );
793794 }
795+ } else if (mgmt_request == NET_REQUEST_IEEE802154_SET_COORD_EXT_ADDR ) {
796+ sys_memcpy_swap (ctx -> coord_ext_addr , data , IEEE802154_EXT_ADDR_LENGTH );
797+ } else if (mgmt_request == NET_REQUEST_IEEE802154_SET_COORD_SHORT_ADDR ) {
798+ ctx -> coord_short_addr = value ;
794799 } else if (mgmt_request == NET_REQUEST_IEEE802154_SET_EXT_ADDR ) {
795800 uint8_t ext_addr_le [IEEE802154_EXT_ADDR_LENGTH ];
796801
@@ -853,6 +858,12 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_SET_SHORT_ADDR,
853858NET_MGMT_REGISTER_REQUEST_HANDLER (NET_REQUEST_IEEE802154_SET_TX_POWER ,
854859 ieee802154_set_parameters );
855860
861+ NET_MGMT_REGISTER_REQUEST_HANDLER (NET_REQUEST_IEEE802154_SET_COORD_EXT_ADDR ,
862+ ieee802154_set_parameters );
863+
864+ NET_MGMT_REGISTER_REQUEST_HANDLER (NET_REQUEST_IEEE802154_SET_COORD_SHORT_ADDR ,
865+ ieee802154_set_parameters );
866+
856867static int ieee802154_get_parameters (uint64_t mgmt_request ,
857868 struct net_if * iface ,
858869 void * data , size_t len )
@@ -865,7 +876,8 @@ static int ieee802154_get_parameters(uint64_t mgmt_request,
865876 return - EINVAL ;
866877 }
867878
868- if (mgmt_request == NET_REQUEST_IEEE802154_GET_EXT_ADDR ) {
879+ if (mgmt_request == NET_REQUEST_IEEE802154_GET_EXT_ADDR ||
880+ mgmt_request == NET_REQUEST_IEEE802154_GET_COORD_EXT_ADDR ) {
869881 if (len != IEEE802154_EXT_ADDR_LENGTH ) {
870882 NET_ERR ("Could not get parameter: invalid extended address length" );
871883 return - EINVAL ;
@@ -889,6 +901,10 @@ static int ieee802154_get_parameters(uint64_t mgmt_request,
889901 sys_memcpy_swap (data , ctx -> ext_addr , IEEE802154_EXT_ADDR_LENGTH );
890902 } else if (mgmt_request == NET_REQUEST_IEEE802154_GET_SHORT_ADDR ) {
891903 * value = ctx -> short_addr ;
904+ } else if (mgmt_request == NET_REQUEST_IEEE802154_GET_COORD_EXT_ADDR ) {
905+ sys_memcpy_swap (data , ctx -> coord_ext_addr , IEEE802154_EXT_ADDR_LENGTH );
906+ } else if (mgmt_request == NET_REQUEST_IEEE802154_GET_COORD_SHORT_ADDR ) {
907+ * value = ctx -> coord_short_addr ;
892908 } else if (mgmt_request == NET_REQUEST_IEEE802154_GET_TX_POWER ) {
893909 int16_t * s_value = (int16_t * )data ;
894910
@@ -911,6 +927,12 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_GET_EXT_ADDR,
911927NET_MGMT_REGISTER_REQUEST_HANDLER (NET_REQUEST_IEEE802154_GET_SHORT_ADDR ,
912928 ieee802154_get_parameters );
913929
930+ NET_MGMT_REGISTER_REQUEST_HANDLER (NET_REQUEST_IEEE802154_GET_COORD_EXT_ADDR ,
931+ ieee802154_get_parameters );
932+
933+ NET_MGMT_REGISTER_REQUEST_HANDLER (NET_REQUEST_IEEE802154_GET_COORD_SHORT_ADDR ,
934+ ieee802154_get_parameters );
935+
914936NET_MGMT_REGISTER_REQUEST_HANDLER (NET_REQUEST_IEEE802154_GET_TX_POWER ,
915937 ieee802154_get_parameters );
916938
0 commit comments