Skip to content

Commit

Permalink
FHSS WS: Added temporary debug traces
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Apr 11, 2019
1 parent 7d8dab4 commit 0306276
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/Service_Libs/fhss/fhss_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,12 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
fhss_structure->ws->drift_per_millisecond_ns += drift_per_ms_tmp;
}
tr_debug("synch to parent: %s, drift: %"PRIi32"ms in %"PRIu32" seconds, compensation: %"PRIi32"ns per ms", trace_array(eui64, 8), true_bc_interval_offset - own_bc_interval_offset + ((int32_t)(fhss_structure->ws->bc_slot - own_bc_slot) * bc_timing_info->broadcast_interval), US_TO_S(time_since_last_synch_us), fhss_structure->ws->drift_per_millisecond_ns);
// Temporary debug traces (IOTTHD-3426)
int32_t drift_tmp = true_bc_interval_offset - own_bc_interval_offset + ((int32_t)(fhss_structure->ws->bc_slot - own_bc_slot) * bc_timing_info->broadcast_interval);
if ((drift_tmp > 5) || (drift_tmp < -5)) {
tr_debug("High drift");
}
tr_debug("%"PRIu32" tr_bc_int_off: %"PRIu32", own_bc_int_off: %"PRIu32", received bc slot: %u, slots since RX: %u, own slot: %u, time from RX: %"PRIu32", prev synch: %"PRIu32", timeout: %"PRIu32", is BC: %i", fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api), true_bc_interval_offset, own_bc_interval_offset, bc_timing_info->broadcast_slot, slots_since_reception, own_bc_slot, time_from_reception_ms, prev_synchronization_time, timeout, fhss_structure->ws->is_on_bc_channel);
}
return 0;
}
Expand Down

0 comments on commit 0306276

Please sign in to comment.