Skip to content
Snippets Groups Projects
Unverified Commit 7e431393 authored by Joakim Eriksson's avatar Joakim Eriksson Committed by GitHub
Browse files

Merge pull request #1588 from nfi/contrib/tsch-logging-64

Fixed TSCH logging to compile on 64 bit systems
parents 3a9add45 69b1d794
Branches filippon1-main-patch-99104
No related tags found
No related merge requests found
......@@ -47,6 +47,7 @@
#include "contiki.h"
#include <stdio.h>
#include <inttypes.h>
#include "net/mac/tsch/tsch.h"
#include "lib/ringbufindex.h"
#include "sys/log.h"
......@@ -79,10 +80,10 @@ tsch_log_process_pending(void)
while((log_index = ringbufindex_peek_get(&log_ringbuf)) != -1) {
struct tsch_log_t *log = &log_array[log_index];
if(log->link == NULL) {
printf("[INFO: TSCH-LOG ] {asn %02x.%08lx link-NULL} ", log->asn.ms1b, log->asn.ls4b);
printf("[INFO: TSCH-LOG ] {asn %02x.%08"PRIx32" link-NULL} ", log->asn.ms1b, log->asn.ls4b);
} else {
struct tsch_slotframe *sf = tsch_schedule_get_slotframe_by_handle(log->link->slotframe_handle);
printf("[INFO: TSCH-LOG ] {asn %02x.%08lx link %2u %3u %3u %2u %2u ch %2u} ",
printf("[INFO: TSCH-LOG ] {asn %02x.%08"PRIx32" link %2u %3u %3u %2u %2u ch %2u} ",
log->asn.ms1b, log->asn.ls4b,
log->link->slotframe_handle, sf ? sf->size.val : 0,
log->burst_count, log->link->timeslot + log->burst_count, log->channel_offset,
......
......@@ -57,6 +57,7 @@
#include "net/mac/mac-sequence.h"
#include "lib/random.h"
#include "net/routing/routing.h"
#include <inttypes.h>
#if TSCH_WITH_SIXTOP
#include "net/mac/tsch/sixtop/sixtop.h"
......@@ -451,7 +452,7 @@ eb_input(struct input_packet *current_input)
int32_t asn_diff = TSCH_ASN_DIFF(current_input->rx_asn, eb_ies.ie_asn);
if(asn_diff != 0) {
/* We disagree with our time source's ASN -- leave the network */
LOG_WARN("! ASN drifted by %ld, leaving the network\n", asn_diff);
LOG_WARN("! ASN drifted by %"PRId32", leaving the network\n", asn_diff);
tsch_disassociate();
}
......@@ -565,7 +566,7 @@ tsch_start_coordinator(void)
tsch_is_associated = 1;
tsch_join_priority = 0;
LOG_INFO("starting as coordinator, PAN ID %x, asn-%x.%lx\n",
LOG_INFO("starting as coordinator, PAN ID %x, asn-%x.%"PRIx32"\n",
frame802154_get_pan_id(), tsch_current_asn.ms1b, tsch_current_asn.ls4b);
/* Start slot operation */
......@@ -744,7 +745,7 @@ tsch_associate(const struct input_packet *input_eb, rtimer_clock_t timestamp)
#endif
tsch_association_count++;
LOG_INFO("association done (%u), sec %u, PAN ID %x, asn-%x.%lx, jp %u, timeslot id %u, hopping id %u, slotframe len %u with %u links, from ",
LOG_INFO("association done (%u), sec %u, PAN ID %x, asn-%x.%"PRIx32", jp %u, timeslot id %u, hopping id %u, slotframe len %u with %u links, from ",
tsch_association_count,
tsch_is_pan_secured,
frame.src_pid,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment