Skip to content

Commit

Permalink
trx/txtime_setter: print error if reference fn is missing
Browse files Browse the repository at this point in the history
Change-Id: I2a6e3f41b6fe79b92d85ff98bc2cd9afd9bdc568
  • Loading branch information
axilirator committed Dec 20, 2018
1 parent b73b4a8 commit dc342dc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/transmitter/txtime_setter_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,20 @@ namespace gr {

void txtime_setter_impl::process_txtime_of_burst(pmt::pmt_t msg_in)
{
if (d_fn_ref == UNKNOWN_FN)
return;

pmt::pmt_t blob = pmt::cdr(msg_in);

// Extract GSMTAP header from message
gsmtap_hdr *header = (gsmtap_hdr *) pmt::blob_data(blob);
uint32_t frame_nr = be32toh(header->frame_number);
uint32_t ts_num = header->timeslot;

if (d_fn_ref == UNKNOWN_FN) {
std::cout << "Missing reference TDMA frame number, dropping "
<< format("burst (fn=%u, tn=%u)", frame_nr, ts_num)
<< std::endl;
return;
}

time_format txtime = fn_time_delta_cpp(d_fn_ref, d_time_ref,
frame_nr, d_time_hint, ts_num, d_ts_ref);

Expand Down

0 comments on commit dc342dc

Please sign in to comment.