Skip to content

Commit 3ece393

Browse files
author
Mika Leppänen
committed
Corrected compilation warnings from tracing and UT stubs
1 parent 13e68c3 commit 3ece393

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

source/6LoWPAN/ws/ws_pae_controller.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ int8_t ws_pae_controller_gtk_update(int8_t interface_id, uint8_t *gtk[4])
753753
uint32_t lifetime = sec_prot_keys_gtk_install_order_last_lifetime_get(&controller->gtks);
754754
lifetime += controller->timer_settings.gtk_expire_offset;
755755
if (sec_prot_keys_gtk_set(&controller->gtks, i, gtk[i], lifetime) >= 0) {
756-
tr_info("GTK set index: %i, lifetime %i, system time: %i", i, lifetime, protocol_core_monotonic_time / 10);
756+
tr_info("GTK set index: %i, lifetime %"PRIx32", system time: %"PRIx32"", i, lifetime, protocol_core_monotonic_time / 10);
757757
}
758758
}
759759
}

source/6LoWPAN/ws/ws_pae_controller.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ void ws_pae_controller_slow_timer(uint16_t seconds);
427427
#define ws_pae_controller_stop(interface_ptr)
428428
#define ws_pae_controller_delete(interface_ptr)
429429
#define ws_pae_controller_cb_register(interface_ptr, completed, nw_key_insert, nw_send_key_index_set, pan_ver_increment) 1
430-
#define ws_pae_controller_timer(ticks)
431430

432431
#endif
433432

source/6LoWPAN/ws/ws_pae_lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ void ws_pae_lib_supp_list_slow_timer_update(supp_list_t *supp_list, timer_settin
213213
{
214214
ns_list_foreach(supp_entry_t, entry, supp_list) {
215215
if (sec_prot_keys_pmk_lifetime_decrement(&entry->sec_keys, timer_settings->pmk_lifetime, seconds)) {
216-
tr_info("PMK and PTK expired, eui-64: %s, system time: %i", trace_array(kmp_address_eui_64_get(entry->addr), 8), protocol_core_monotonic_time / 10);
216+
tr_info("PMK and PTK expired, eui-64: %s, system time: %"PRIx32"", trace_array(kmp_address_eui_64_get(entry->addr), 8), protocol_core_monotonic_time / 10);
217217
}
218218
if (sec_prot_keys_ptk_lifetime_decrement(&entry->sec_keys, timer_settings->ptk_lifetime, seconds)) {
219-
tr_info("PTK expired, eui-64: %s, system time: %i", trace_array(kmp_address_eui_64_get(entry->addr), 8), protocol_core_monotonic_time / 10);
219+
tr_info("PTK expired, eui-64: %s, system time: %"PRIx32"", trace_array(kmp_address_eui_64_get(entry->addr), 8), protocol_core_monotonic_time / 10);
220220
}
221221
}
222222

source/6LoWPAN/ws/ws_pae_timers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static void ws_pae_timers_calculate(timer_settings_t *timer_settings)
117117
time_to_update = gtk_revocation_lifetime - new_activation_time;
118118
}
119119

120-
tr_info("Key timers revocation lifetime: %i, new activation time: %i, max mismatch %i, time to update: %i", gtk_revocation_lifetime, new_activation_time, timer_settings->gtk_max_mismatch, time_to_update);
120+
tr_info("Key timers revocation lifetime: %"PRIx32", new activation time: %"PRIx32", max mismatch %i, time to update: %"PRIx32"", gtk_revocation_lifetime, new_activation_time, timer_settings->gtk_max_mismatch, time_to_update);
121121

122122
// If time to update results smaller GTK request Imax use it for calculation otherwise use GTK max mismatch
123123
if (time_to_update < timer_settings->gtk_max_mismatch) {

source/Security/protocols/sec_prot_keys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ bool sec_prot_keys_gtks_hash_update(sec_prot_gtk_keys_t *gtks, uint8_t *gtkhash)
564564
if (sec_prot_keys_gtk_is_set(gtks, i)) {
565565
uint32_t lifetime = sec_prot_keys_gtk_lifetime_get(gtks, i);
566566
if (lifetime > GTK_EXPIRE_MISMATCH_TIME) {
567-
tr_info("GTK mismatch %i expired time, lifetime: %i", i, lifetime);
567+
tr_info("GTK mismatch %i expired time, lifetime: %"PRIx32"", i, lifetime);
568568
mismatch = true;
569569
}
570570
sec_prot_keys_gtk_clear(gtks, i);
@@ -626,7 +626,7 @@ int8_t sec_prot_keys_gtk_install_order_last_get(sec_prot_gtk_keys_t *gtks)
626626
int8_t sec_prot_keys_gtk_install_order_last_index_get(sec_prot_gtk_keys_t *gtks)
627627
{
628628
int8_t install_order = -1;
629-
uint8_t index = -1;
629+
int8_t index = -1;
630630

631631
// Gets the last key index
632632
for (uint8_t i = 0; i < GTK_NUM; i++) {

source/Security/protocols/sec_prot_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ int8_t sec_prot_lib_gtk_read(uint8_t *kde, uint16_t kde_len, sec_prot_keys_t *se
402402
}
403403
}
404404

405-
tr_info("GTK recv index %i lifetime %i", gtk_index, sec_prot_keys_gtk_lifetime_get(sec_keys->gtks, gtk_index));
405+
tr_info("GTK recv index %i lifetime %"PRIx32"", gtk_index, sec_prot_keys_gtk_lifetime_get(sec_keys->gtks, gtk_index));
406406

407407
return 0;
408408
}

test/nanostack/unittest/stub/ws_pae_controller_stub.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@
3939
#include "NWK_INTERFACE/Include/protocol.h"
4040
#include "6LoWPAN/Bootstraps/protocol_6lowpan_interface.h"
4141

42-
void ws_pae_controller_timer(uint16_t ticks)
42+
void ws_pae_controller_fast_timer(uint16_t ticks)
43+
{
44+
45+
}
46+
47+
void ws_pae_controller_slow_timer(uint16_t seconds)
4348
{
4449

4550
}

0 commit comments

Comments
 (0)