@@ -88,7 +88,6 @@ static int thread_parent_request_build(protocol_interface_info_entry_t *cur);
88
88
static int thread_attach_child_id_request_build (protocol_interface_info_entry_t * cur );
89
89
static int thread_end_device_synch_response_validate (protocol_interface_info_entry_t * cur , uint8_t * ptr , uint16_t data_length , uint8_t linkMargin , uint8_t * src_address , mle_security_header_t * securityHeader );
90
90
91
- static uint8_t * thread_single_address_registration_tlv_write (uint8_t * ptr , lowpan_context_t * ctx , uint8_t * addressPtr );
92
91
static int8_t thread_end_device_synch_start (protocol_interface_info_entry_t * cur );
93
92
94
93
@@ -1028,25 +1027,6 @@ static bool thread_child_id_req_timeout(int8_t interface_id, uint16_t msgId, boo
1028
1027
return false;
1029
1028
}
1030
1029
1031
- static uint8_t * thread_single_address_registration_tlv_write (uint8_t * ptr , lowpan_context_t * ctx , uint8_t * addressPtr )
1032
- {
1033
- * ptr ++ = MLE_TYPE_ADDRESS_REGISTRATION ;
1034
- if (ctx ) {
1035
- * ptr ++ = 9 ;
1036
- //Write TLV to list
1037
- * ptr ++ = (ctx -> cid | 0x80 );
1038
- memcpy (ptr , addressPtr + 8 , 8 );
1039
- ptr += 8 ;
1040
- } else {
1041
- * ptr ++ = 17 ;
1042
- //Write TLV to list
1043
- * ptr ++ = 0 ;
1044
- memcpy (ptr , addressPtr , 16 );
1045
- ptr += 16 ;
1046
- }
1047
- return ptr ;
1048
- }
1049
-
1050
1030
static int thread_attach_child_id_request_build (protocol_interface_info_entry_t * cur )
1051
1031
{
1052
1032
uint8_t * ptr , * address_ptr ;
@@ -1069,8 +1049,6 @@ static int thread_attach_child_id_request_build(protocol_interface_info_entry_t
1069
1049
thread_management_get_current_keysequence (cur -> id , & keySequence );
1070
1050
mle_service_msg_update_security_params (buf_id , 5 , 2 , keySequence );
1071
1051
1072
- lowpan_context_t * ctx ;
1073
- uint8_t ml64 [16 ];
1074
1052
uint8_t request_tlv_list [3 ];
1075
1053
uint8_t macShort [2 ];
1076
1054
uint8_t reqTlvCnt ;
@@ -1088,15 +1066,10 @@ static int thread_attach_child_id_request_build(protocol_interface_info_entry_t
1088
1066
ptr = mle_tlv_write_response (ptr , scan_parent -> challengeData , scan_parent -> chal_len );
1089
1067
1090
1068
//Add ML-EID
1091
- memcpy (ml64 , thread_info (cur )-> threadPrivatePrefixInfo .ulaPrefix , 8 );
1092
- memcpy (& ml64 [8 ], cur -> iid_slaac , 8 );
1093
1069
if ((mode & MLE_FFD_DEV ) == 0 ) {
1094
- ctx = lowpan_context_get_by_address (& cur -> lowpan_contexts , ml64 );
1095
- if (ctx ) {
1096
- //Write TLV to list
1097
- ptr = thread_single_address_registration_tlv_write (ptr , ctx , ml64 );
1098
- }
1070
+ ptr = thread_address_registration_tlv_write (ptr , cur );
1099
1071
}
1072
+
1100
1073
reqTlvCnt = 2 ;
1101
1074
request_tlv_list [0 ] = MLE_TYPE_NETWORK_DATA ;
1102
1075
0 commit comments