Pocsag improvements (#20)

* Update analog_audio_app.cpp (#353)

* Adding phase field (extracted from @jamesshao8 repo)
This commit is contained in:
Erwin Ried 2020-05-09 13:13:21 +02:00 committed by GitHub
parent 3e15baa251
commit 4aaac8545b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 51 additions and 11 deletions

View file

@ -71,6 +71,7 @@ bool POCSAGTXView::start_tx() {
return false;
}
}
MessageType phase = (MessageType)options_phase.selected_index_value();
pocsag_encode(type, BCH_code, options_function.selected_index_value(), message, address, codewords);
@ -79,6 +80,9 @@ bool POCSAGTXView::start_tx() {
progressbar.set_max(total_frames);
transmitter_model.set_sampling_rate(2280000);
transmitter_model.set_rf_amp(true);
transmitter_model.set_lna(40);
transmitter_model.set_vga(40);
transmitter_model.set_baseband_bandwidth(1750000);
transmitter_model.enable();
@ -86,7 +90,11 @@ bool POCSAGTXView::start_tx() {
bi = 0;
for (i = 0; i < codewords.size(); i++) {
if (phase == 0)
codeword = ~(codewords[i]);
else
codeword = codewords[i];
data_ptr[bi++] = (codeword >> 24) & 0xFF;
data_ptr[bi++] = (codeword >> 16) & 0xFF;
data_ptr[bi++] = (codeword >> 8) & 0xFF;
@ -126,6 +134,7 @@ POCSAGTXView::POCSAGTXView(
&field_address,
&options_type,
&options_function,
&options_phase,
&text_message,
&button_message,
&progressbar,