Skip to content

Commit fde5104

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
Function parameter and name refactor.
Change-Id: I2219bfc9cecb637edf718947714533143a64adcd
1 parent 13b3b05 commit fde5104

19 files changed

+70
-70
lines changed

source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan_bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ void mle_6lowpan_message_handler(int8_t interface_id, mle_message_t *mle_msg, ml
11501150
mle_neigh_entry_frame_counter_update(entry_temp, mle_msg->data_ptr, mle_msg->data_length, cur, security_headers->KeyIndex);
11511151
// If MLE frame counter was invalid update its value since three way handshake is complete
11521152
if (security_headers->invalid_frame_counter) {
1153-
mle_service_frame_counter_table_add(interface_id, entry_temp->attribute_index, security_headers->frameCounter);
1153+
mle_service_frame_counter_entry_add(interface_id, entry_temp->attribute_index, security_headers->frameCounter);
11541154
}
11551155
break;
11561156

source/6LoWPAN/MAC/mac_data_poll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ void mac_mlme_poll_confirm(protocol_interface_info_entry_t *cur, const mlme_poll
335335
break;
336336
}
337337
if (thread_info(cur) && entry) {
338-
thread_neighbor_commucation_update(cur, entry->attribute_index);
338+
thread_neighbor_communication_update(cur, entry->attribute_index);
339339
}
340340

341341
mac_poll_timer_trig(poll_time, cur);

source/6LoWPAN/Thread/thread_common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ static uint8_t *thread_linkquality_write(int8_t interface_id, uint8_t *buffer)
11341134
ns_list_foreach(mle_neigh_table_entry_t, cur, neigh_list) {
11351135
if (thread_is_router_addr(cur->short_adr)) {
11361136
// Only count routers to link quality
1137-
uint16_t link_margin = thread_neighbor_class_linkmargin_get(&interface_ptr->thread_info->neighbor_class, cur->attribute_index);
1137+
uint16_t link_margin = thread_neighbor_entry_linkmargin_get(&interface_ptr->thread_info->neighbor_class, cur->attribute_index);
11381138
thread_link_quality = thread_link_margin_to_quality(link_margin);
11391139
switch (thread_link_quality) {
11401140
case QUALITY_20dB:
@@ -1872,7 +1872,7 @@ void thread_reset_neighbour_info(protocol_interface_info_entry_t *cur, mle_neigh
18721872
thread_router_bootstrap_reset_child_info(cur, neighbour);
18731873
protocol_6lowpan_release_long_link_address_from_neighcache(cur, neighbour->mac64);
18741874
mac_helper_devicetable_remove(cur->mac_api, neighbour->attribute_index);
1875-
thread_neighbor_class_table_remove(&cur->thread_info->neighbor_class, neighbour->attribute_index);
1875+
thread_neighbor_class_entry_remove(&cur->thread_info->neighbor_class, neighbour->attribute_index);
18761876
}
18771877

18781878
uint8_t thread_get_router_count_from_route_tlv(mle_tlv_info_t *routeTlv)
@@ -1948,9 +1948,9 @@ void thread_old_partition_data_purge(protocol_interface_info_entry_t *cur)
19481948

19491949
}
19501950

1951-
void thread_neighbor_commucation_update(protocol_interface_info_entry_t *cur, uint8_t neighbor_attribute_index)
1951+
void thread_neighbor_communication_update(protocol_interface_info_entry_t *cur, uint8_t neighbor_attribute_index)
19521952
{
1953-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, neighbor_attribute_index);
1953+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, neighbor_attribute_index);
19541954
}
19551955

19561956
#endif

source/6LoWPAN/Thread/thread_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ void thread_calculate_key_guard_timer(protocol_interface_info_entry_t *cur, link
432432
void thread_set_link_local_address(protocol_interface_info_entry_t *cur);
433433
void thread_mcast_group_change(struct protocol_interface_info_entry *interface, struct if_group_entry *group, bool group_added);
434434
void thread_old_partition_data_purge(protocol_interface_info_entry_t *cur);
435-
void thread_neighbor_commucation_update(protocol_interface_info_entry_t *cur, uint8_t neighbor_attribute_index);
435+
void thread_neighbor_communication_update(protocol_interface_info_entry_t *cur, uint8_t neighbor_attribute_index);
436436

437437
#else // HAVE_THREAD
438438

@@ -454,7 +454,7 @@ NS_DUMMY_DEFINITIONS_OK
454454
#define thread_link_reject_send(interface, ll64) 0
455455
#define thread_addr_is_mesh_local_16(addr, cur) false
456456
#define thread_mcast_group_change(interface, group, group_added) ((void)0)
457-
#define thread_neighbor_commucation_update(cur, neighbor_attribute_index) ((void)0)
457+
#define thread_neighbor_communication_update(cur, neighbor_attribute_index) ((void)0)
458458
#endif // HAVE_THREAD
459459

460460
#endif /* LOWPAN_THREAD_H_ */

source/6LoWPAN/Thread/thread_host_bootstrap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ static bool thread_parent_discover_timeout_cb(int8_t interface_id, uint16_t msgI
163163
return false;
164164
}
165165
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index, parent->linkMarginToParent, new_entry_created);
166-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
166+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
167167

168168
entry_temp->short_adr = parent->shortAddress;
169169
entry_temp->priorityFlag = true;
170170

171-
mle_service_frame_counter_table_add(interface_id, entry_temp->attribute_index, parent->mleFrameCounter);
171+
mle_service_frame_counter_entry_add(interface_id, entry_temp->attribute_index, parent->mleFrameCounter);
172172

173173
thread_management_key_sets_calc(cur, linkConfiguration, cur->thread_info->thread_attach_scanned_parent->keySequence);
174174
thread_calculate_key_guard_timer(cur, linkConfiguration, true);
@@ -336,7 +336,7 @@ static int thread_end_device_synch_response_validate(protocol_interface_info_ent
336336
return -2;
337337
}
338338
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index, linkMargin, new_entry_created);
339-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
339+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
340340
/*
341341
342342
*/
@@ -799,7 +799,7 @@ static void thread_mle_child_request_receive_cb(int8_t interface_id, mle_message
799799
return;
800800
}
801801
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index, thread_compute_link_margin(mle_msg->dbm), new_entry_created);
802-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
802+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
803803

804804
//Parse mandatory TLV's
805805
if (!thread_leader_data_parse(mle_msg->data_ptr, mle_msg->data_length, &leaderData)) {
@@ -961,7 +961,7 @@ void thread_endevice_synch_start(protocol_interface_info_entry_t *cur)
961961
if (entry_temp) {
962962
//Add link margin 64
963963
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index,64, new_entry_created);
964-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
964+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
965965

966966
entry_temp->short_adr = cur->thread_info->thread_endnode_parent->shortAddress;
967967
entry_temp->handshakeReady = 1;

source/6LoWPAN/Thread/thread_management_if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ void thread_comm_status_indication_cb(int8_t if_id, const mlme_comm_status_t* st
812812
case MLME_DATA_POLL_NOTIFICATION:
813813
entry = mle_refresh_entry_timeout(if_id, status->SrcAddr, (addrtype_t)status->SrcAddrMode, false);
814814
if (entry) {
815-
thread_neighbor_commucation_update(cur, entry->attribute_index);
815+
thread_neighbor_communication_update(cur, entry->attribute_index);
816816
}
817817
break;
818818
default:

source/6LoWPAN/Thread/thread_mle_message_handler.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static void thread_update_mle_entry(protocol_interface_info_entry_t *cur, mle_me
284284
mle_neigh_entry_frame_counter_update(entry_temp, mle_msg->data_ptr, mle_msg->data_length, cur, security_headers->KeyIndex);
285285

286286
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index,linkMargin, false);
287-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
287+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
288288

289289
if (!thread_attach_active_router(cur) && !thread_check_is_this_my_parent(cur, entry_temp)) {
290290
mle_entry_timeout_refresh(entry_temp);
@@ -349,7 +349,7 @@ static void thread_parse_advertisement(protocol_interface_info_entry_t *cur, mle
349349
entry_temp = mle_class_get_entry_by_ll64(cur->id, mle_msg->packet_src_address, false, NULL);
350350
if (entry_temp) {
351351
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index, linkMargin, false);
352-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
352+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
353353
}
354354

355355
// Check if this is from my parent
@@ -459,7 +459,7 @@ static void thread_parse_accept(protocol_interface_info_entry_t *cur, mle_messag
459459
return;
460460
}
461461
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index, linkMargin, new_entry_created);
462-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
462+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
463463

464464
if (security_headers->KeyIdMode == MAC_KEY_ID_MODE_SRC4_IDX) {
465465
thread_management_key_synch_req(cur->id, common_read_32_bit(security_headers->Keysource));
@@ -471,7 +471,7 @@ static void thread_parse_accept(protocol_interface_info_entry_t *cur, mle_messag
471471
}
472472

473473
entry_temp->short_adr = shortAddress;
474-
mle_service_frame_counter_table_add(cur->id, entry_temp->attribute_index, mleFrameCounter);
474+
mle_service_frame_counter_entry_add(cur->id, entry_temp->attribute_index, mleFrameCounter);
475475
// Set full data as REED needs full data and SED will not make links
476476
entry_temp->mode |= MLE_THREAD_REQ_FULL_DATA_SET;
477477
mlme_device_descriptor_t device_desc;
@@ -573,7 +573,7 @@ static void thread_parse_data_response(protocol_interface_info_entry_t *cur, mle
573573
entry_temp = mle_class_get_entry_by_ll64(cur->id, mle_msg->packet_src_address, false, NULL);
574574
if (entry_temp) {
575575
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index, linkMargin, false);
576-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
576+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
577577
}
578578

579579
if(cur->thread_info->thread_device_mode == THREAD_DEVICE_MODE_ROUTER ||
@@ -734,7 +734,7 @@ static void thread_host_child_update_request_process(protocol_interface_info_ent
734734
}
735735

736736
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index, linkMargin, false);
737-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
737+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
738738

739739
mle_tlv_read_tlv(MLE_TYPE_CHALLENGE, mle_msg->data_ptr, mle_msg->data_length, &challengeTlv);
740740
mle_tlv_read_tlv(MLE_TYPE_TLV_REQUEST, mle_msg->data_ptr, mle_msg->data_length, &tlv_req);
@@ -817,7 +817,7 @@ static void thread_parse_child_update_response(protocol_interface_info_entry_t *
817817

818818
if (security_headers->KeyIdMode == MAC_KEY_ID_MODE_SRC4_IDX) {
819819
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index, linkMargin, false);
820-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
820+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
821821
thread_management_key_synch_req(cur->id, common_read_32_bit(security_headers->Keysource));
822822
} else {
823823
tr_debug("Key ID Mode 2 not used; dropped.");

source/6LoWPAN/Thread/thread_nd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static int thread_nd_address_query_lookup(int8_t interface_id, const uint8_t tar
237237
mle_entry = thread_nd_child_mleid_get(cur, &n->ll_address[2], mleid_ptr);
238238
if (mle_entry) {
239239
//Get MLEID from Child
240-
uint32_t last_contact = thread_neighbor_last_communincation_time(&cur->thread_info->neighbor_class, mle_entry->attribute_index);
240+
uint32_t last_contact = thread_neighbor_last_communication_time_get(&cur->thread_info->neighbor_class, mle_entry->attribute_index);
241241
*last_transaction_time = (protocol_core_monotonic_time - last_contact) / 10; /* Both variables are count of 100ms ticks. */
242242
*proxy = true;
243243
return 0;

source/6LoWPAN/Thread/thread_neighbor_class.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ uint8_t * thread_neighbor_class_get_mleid(struct thread_neighbor_class_s *class_
7777
return entry->mlEid;
7878
}
7979

80-
void thread_neighbor_last_communincation_time_update(thread_neighbor_class_t *class_ptr, uint8_t attribute_index)
80+
void thread_neighbor_last_communication_time_update(thread_neighbor_class_t *class_ptr, uint8_t attribute_index)
8181
{
8282
thread_neigh_table_entry_t *entry = thread_neighbor_class_table_entry_get(class_ptr,attribute_index);
8383
if (!entry) {
@@ -100,7 +100,7 @@ void thread_neighbor_class_update_link(thread_neighbor_class_t *class_ptr, uint8
100100
}
101101
}
102102

103-
uint16_t thread_neighbor_class_linkmargin_get(thread_neighbor_class_t *class_ptr, uint8_t attribute_index)
103+
uint16_t thread_neighbor_entry_linkmargin_get(thread_neighbor_class_t *class_ptr, uint8_t attribute_index)
104104
{
105105
thread_neigh_table_entry_t *entry = thread_neighbor_class_table_entry_get(class_ptr,attribute_index);
106106
if (!entry) {
@@ -109,7 +109,7 @@ uint16_t thread_neighbor_class_linkmargin_get(thread_neighbor_class_t *class_ptr
109109
return entry->link_margin;
110110
}
111111

112-
uint32_t thread_neighbor_last_communincation_time(thread_neighbor_class_t *class_ptr, uint8_t attribute_index)
112+
uint32_t thread_neighbor_last_communication_time_get(thread_neighbor_class_t *class_ptr, uint8_t attribute_index)
113113
{
114114
thread_neigh_table_entry_t *entry = thread_neighbor_class_table_entry_get(class_ptr,attribute_index);
115115
if (!entry) {
@@ -127,7 +127,7 @@ bool thread_neighbor_class_mleid_compare(thread_neighbor_class_t *class_ptr, uin
127127
return true;
128128
}
129129

130-
void thread_neighbor_class_table_remove(thread_neighbor_class_t *class_ptr, uint8_t attribute_index)
130+
void thread_neighbor_class_entry_remove(thread_neighbor_class_t *class_ptr, uint8_t attribute_index)
131131
{
132132
thread_neigh_table_entry_t *entry = thread_neighbor_class_table_entry_get(class_ptr,attribute_index);
133133
if (entry) {

source/6LoWPAN/Thread/thread_neighbor_class.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ uint8_t * thread_neighbor_class_get_mleid(struct thread_neighbor_class_s *class_
3232

3333
void thread_neighbor_class_update_link(struct thread_neighbor_class_s *class_ptr, uint8_t attribute_index, uint8_t linkmargin, bool new_link);
3434

35-
void thread_neighbor_last_communincation_time_update(thread_neighbor_class_t *class_ptr, uint8_t attribute_index);
35+
void thread_neighbor_last_communication_time_update(thread_neighbor_class_t *class_ptr, uint8_t attribute_index);
3636

37-
uint16_t thread_neighbor_class_linkmargin_get(struct thread_neighbor_class_s *class_ptr, uint8_t attribute_index);
37+
uint16_t thread_neighbor_entry_linkmargin_get(struct thread_neighbor_class_s *class_ptr, uint8_t attribute_index);
3838

39-
uint32_t thread_neighbor_last_communincation_time(struct thread_neighbor_class_s *class_ptr, uint8_t attribute_index);
39+
uint32_t thread_neighbor_last_communication_time_get(struct thread_neighbor_class_s *class_ptr, uint8_t attribute_index);
4040

4141
bool thread_neighbor_class_mleid_compare(struct thread_neighbor_class_s *class_ptr, uint8_t attribute_index, const uint8_t *mleid);
4242

43-
void thread_neighbor_class_table_remove(struct thread_neighbor_class_s *class_ptr, uint8_t attribute_index);
43+
void thread_neighbor_class_entry_remove(struct thread_neighbor_class_s *class_ptr, uint8_t attribute_index);
4444

4545
#endif /* THREAD_NEIGHBOR_CLASS_H_ */

source/6LoWPAN/Thread/thread_network_synch.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void thread_dynamic_storage_child_info_store(int8_t interface_id, mle_neigh_tabl
168168
return;
169169
}
170170

171-
uint32_t mle_frame_counter = mle_service_frame_counter_get(interface_id, child->attribute_index);
171+
uint32_t mle_frame_counter = mle_service_neighbor_frame_counter_get(interface_id, child->attribute_index);
172172

173173
thread_sync_child_info_t *child_info = thread_dynamic_storage_child_info_find(interface_id, child);
174174
if (child_info) {
@@ -269,7 +269,7 @@ void thread_dynamic_storage_build_mle_table(int8_t interface_id)
269269
if (entry) {
270270

271271
entry->short_adr = storeEntry->networ_dynamic_data_parameters.children[i].short_addr;
272-
mle_service_frame_counter_table_add(interface_id, entry->attribute_index, storeEntry->networ_dynamic_data_parameters.children[i].mle_frame_counter);
272+
mle_service_frame_counter_entry_add(interface_id, entry->attribute_index, storeEntry->networ_dynamic_data_parameters.children[i].mle_frame_counter);
273273
entry->mode = storeEntry->networ_dynamic_data_parameters.children[i].mode;
274274

275275
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
@@ -278,7 +278,7 @@ void thread_dynamic_storage_build_mle_table(int8_t interface_id)
278278
// Set MAC layer frame counter for the child
279279
mlme_device_descriptor_t device_desc;
280280
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry->attribute_index,64, new_entry_created);
281-
thread_neighbor_last_communincation_time_update(&cur->thread_info->neighbor_class, entry->attribute_index);
281+
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry->attribute_index);
282282
mac_helper_device_description_write(cur, &device_desc, entry->mac64, entry->short_adr,storeEntry->networ_dynamic_data_parameters.children[i].mac_frame_counter, false);
283283
mac_helper_devicetable_set(&device_desc, cur, entry->attribute_index, cur->mac_parameters->mac_default_key_index, new_entry_created);
284284
}

0 commit comments

Comments
 (0)