aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <ikj1234i@yahoo.com>2017-03-08 10:08:38 -0500
committerMax <ikj1234i@yahoo.com>2017-03-08 10:08:38 -0500
commitd403abb8825ac96450414b8dc658b23560518b3a (patch)
tree2db2fe2f0b9a11da5b13fb58fd0cb7a1db2369e0
parent89ef1f32976b47e053b45674d766232ec5d2e236 (diff)
dstar cleanup
-rw-r--r--op25/gr-op25_repeater/lib/dstar_tx_sb_impl.cc16
-rw-r--r--op25/gr-op25_repeater/lib/dstar_tx_sb_impl.h1
-rw-r--r--op25/gr-op25_repeater/lib/p25p2_vf.cc9
3 files changed, 19 insertions, 7 deletions
diff --git a/op25/gr-op25_repeater/lib/dstar_tx_sb_impl.cc b/op25/gr-op25_repeater/lib/dstar_tx_sb_impl.cc
index eea2043..7c58dd2 100644
--- a/op25/gr-op25_repeater/lib/dstar_tx_sb_impl.cc
+++ b/op25/gr-op25_repeater/lib/dstar_tx_sb_impl.cc
@@ -52,6 +52,9 @@ static inline void print_result(char title[], const uint8_t r[], int len) {
}
#endif
+static const uint8_t FS[24] = { 1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,0,0,1,1,0,1,0,0,0 };
+static const uint8_t FS_DUMMY[24] = { 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1 };
+
namespace gr {
namespace op25_repeater {
@@ -78,7 +81,8 @@ static const int MAX_OUT = 1;
gr::io_signature::make (MIN_IN, MAX_IN, sizeof(short)),
gr::io_signature::make (MIN_OUT, MAX_OUT, sizeof(char))),
d_verbose_flag(verbose_flag),
- d_config_file(config_file)
+ d_config_file(config_file),
+ d_frame_counter(0)
{
set_output_multiple(96);
d_encoder.set_dstar_mode();
@@ -119,8 +123,8 @@ dstar_tx_sb_impl::forecast(int nof_output_items, gr_vector_int &nof_input_items_
{
// each 96-bit output frame contains one voice code word=160 samples input
const size_t nof_inputs = nof_input_items_reqd.size();
- const int nof_vcw = nof_output_items / 480.0;
- const int nof_samples_reqd = nof_vcw * 5 * 160;
+ const int nof_vcw = nof_output_items / 96.0;
+ const int nof_samples_reqd = nof_vcw * 160;
std::fill(&nof_input_items_reqd[0], &nof_input_items_reqd[nof_inputs], nof_samples_reqd);
}
@@ -142,6 +146,12 @@ dstar_tx_sb_impl::general_work (int noutput_items,
if (ninput_items[0] - nconsumed < 160)
break;
d_encoder.encode(in, out);
+ if (d_frame_counter == 0)
+ memcpy(out+72, FS, 24);
+ else
+ memcpy(out+72, FS_DUMMY, 24);
+ d_frame_counter += 1;
+ d_frame_counter = (d_frame_counter + 1) % 21;
in += 160;
nconsumed += 160;
nframes += 1;
diff --git a/op25/gr-op25_repeater/lib/dstar_tx_sb_impl.h b/op25/gr-op25_repeater/lib/dstar_tx_sb_impl.h
index 567c24c..8480bd4 100644
--- a/op25/gr-op25_repeater/lib/dstar_tx_sb_impl.h
+++ b/op25/gr-op25_repeater/lib/dstar_tx_sb_impl.h
@@ -58,6 +58,7 @@ namespace gr {
int d_verbose_flag;
const char * d_config_file;
ambe_encoder d_encoder;
+ int d_frame_counter;
};
} // namespace op25_repeater
diff --git a/op25/gr-op25_repeater/lib/p25p2_vf.cc b/op25/gr-op25_repeater/lib/p25p2_vf.cc
index 492d8ce..d6efc63 100644
--- a/op25/gr-op25_repeater/lib/p25p2_vf.cc
+++ b/op25/gr-op25_repeater/lib/p25p2_vf.cc
@@ -838,6 +838,7 @@ void p25p2_vf::encode_dstar(uint8_t result[72], const int b[9]) {
pbuf[21] = (b[4] >> 2) & 1;
pbuf[22] = (b[5] >> 3) & 1;
pbuf[23] = (b[5] >> 2) & 1;
+ pbuf[24] = 0; /* ? */
pbuf[25] = (b[5] >> 1) & 1;
pbuf[26] = b[5] & 1;
pbuf[27] = (b[6] >> 3) & 1;
@@ -875,10 +876,10 @@ void p25p2_vf::encode_dstar(uint8_t result[72], const int b[9]) {
int c3 = u3;
uint8_t ambe_fr[4][24];
- store_reg(c0, ambe_fr[0], 24);
- store_reg(c1, ambe_fr[1], 23);
- store_reg(c2, ambe_fr[2], 11);
- store_reg(c3, ambe_fr[3], 14);
+ dump_i(ambe_fr[0], c0, 24);
+ dump_i(ambe_fr[1], c1, 23);
+ dump_i(ambe_fr[2], c2, 11);
+ dump_i(ambe_fr[3], c3, 14);
result[0] = ambe_fr[0][10];
result[1] = ambe_fr[0][22];