Skip to content

Commit

Permalink
Replaced frame count calculation by libosmogsm function
Browse files Browse the repository at this point in the history
  • Loading branch information
romankh committed Sep 13, 2015
1 parent dfe7009 commit 9a54c7b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/misc_utils/bursts_printer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
#include <algorithm>
#include "bursts_printer_impl.h"
#include <unistd.h>

#include <iostream>
extern "C" {
#include <osmocom/gsm/a5.h>
}

namespace gr {
namespace gsm {
Expand Down Expand Up @@ -77,12 +79,8 @@ namespace gr {

if (d_prepend_frame_count)
{
// calculate frame count for A5
uint16_t t1 = frame_nr/1326;
uint8_t t2 = frame_nr % 26;
uint8_t t3 = frame_nr % 51;
uint32_t frame_count = (t1<<11)|(t3<<5)|t2;
std::cout << frame_count;
// calculate fn count using libosmogsm
std::cout << osmo_a5_fn_count(frame_nr);
}

if (d_prepend_fnr || d_prepend_frame_count)
Expand Down

0 comments on commit 9a54c7b

Please sign in to comment.