From: drowe67 Date: Tue, 30 Jun 2015 01:34:36 +0000 (+0000) Subject: disabled short varicode, callsign info only updates on gd checksum in checksum mode X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=c578db5a27d3e0ec89adfc78083cbc4915d4fa28;p=freetel-svn-tracking.git disabled short varicode, callsign info only updates on gd checksum in checksum mode git-svn-id: https://svn.code.sf.net/p/freetel/code@2228 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2-dev/README.txt b/fdmdv2-dev/README.txt index 542ab478..dcf2f571 100644 --- a/fdmdv2-dev/README.txt +++ b/fdmdv2-dev/README.txt @@ -163,11 +163,10 @@ TODO [X] On TX, intermittently PTT will cause signal to be heard in speakers. Toggle PTT or Stop/Start toggle and then starts working. - [X] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB) + [ ] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB) [X] space bar keys PTT when entering text info box - [ ] checksum based txt reception can't be verified - + too many bit errors - + add FEC? Would this need frame sync? + [ ] checksum based txt reception + + only print if valid [ ] short varicode doesn't work + cld be broken in freedv_api diff --git a/fdmdv2-dev/src/dlg_options.cpp b/fdmdv2-dev/src/dlg_options.cpp index 2ddfe5e2..9189feba 100644 --- a/fdmdv2-dev/src/dlg_options.cpp +++ b/fdmdv2-dev/src/dlg_options.cpp @@ -85,11 +85,13 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL); +#ifdef SHORT_VARICODE m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0); m_rb_textEncoding1->SetValue(true); sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1); m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0); sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1); +#endif m_ckboxEnableChecksum = new wxCheckBox(this, wxID_ANY, _("Use Checksum on Rx"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE); sbSizer_encoding->Add(m_ckboxEnableChecksum, 0, wxALIGN_LEFT, 0); @@ -235,10 +237,12 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent) m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable); m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port)); +#ifdef SHORT_VARICODE if (wxGetApp().m_textEncoding == 1) m_rb_textEncoding1->SetValue(true); if (wxGetApp().m_textEncoding == 2) m_rb_textEncoding2->SetValue(true); +#endif m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum); m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip); @@ -271,17 +275,21 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent) m_txt_udp_port->GetValue().ToLong(&port); wxGetApp().m_udp_port = (int)port; +#ifdef SHORT_VARICODE if (m_rb_textEncoding1->GetValue()) wxGetApp().m_textEncoding = 1; if (m_rb_textEncoding2->GetValue()) wxGetApp().m_textEncoding = 2; +#endif wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue(); wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue(); if (storePersistent) { pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign); +#ifdef SHORT_VARICODE pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding); +#endif pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum); pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events); diff --git a/fdmdv2-dev/src/fdmdv2_main.cpp b/fdmdv2-dev/src/fdmdv2_main.cpp index 10c9346b..fd66a30b 100644 --- a/fdmdv2-dev/src/fdmdv2_main.cpp +++ b/fdmdv2-dev/src/fdmdv2_main.cpp @@ -970,7 +970,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt) if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) { unsigned int i; - //printf("callsign: %s\n", callsign); + //fprintf(g_logfile, "tx callsign: %s.\n", callsign); /* optionally append checksum */ @@ -991,6 +991,8 @@ void MainFrame::OnTimer(wxTimerEvent &evt) callsign[strlen(callsign)+1] = 0; } + //fprintf(g_logfile, "tx callsign: %s.\n", callsign); + // write chars to tx data fifo for(i=0; i MAX_CALLSIGN-1)) { // CR completes line *m_pcallsign = 0; + + /* Checksums can be disabled, e.g. for compatability with + older vesions. In that case we print msg but don't do + any event processing. If checksums enabled, only print + out when checksum is good. */ - // checksums can be disabled, e.g. for compatability - // with older vesions. In that case we print msg but - // don't do any event processing - - if (!wxGetApp().m_enable_checksum) { - m_txtCtrlCallSign->SetValue(m_callsign); - } - else { + if (wxGetApp().m_enable_checksum) { // lets see if checksum is OK unsigned char checksum_rx = 0; @@ -1024,7 +1025,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt) } unsigned int checksum_tx; int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx); - //printf("m_callsign: %s checksums: %2x %2x\n", m_callsign, checksum_tx, checksum_rx); + //fprintf(g_logfile, "rx callsign: %s.\n checksum tx: %02x checksum rx: %02x\n", m_callsign, checksum_tx, checksum_rx); wxString s; if (ret && (checksum_tx == checksum_rx)) { @@ -1047,14 +1048,18 @@ void MainFrame::OnTimer(wxTimerEvent &evt) } } - //fprintf(stderr,"resetting callsign %s %d\n", m_callsign, m_pcallsign-m_callsign); + //fprintf(g_logfile,"resetting callsign %s %ld\n", m_callsign, m_pcallsign-m_callsign); // reset ptr to start of string m_pcallsign = m_callsign; } - else - { - //printf("new char %d %c\n", ashort, (char)ashort); + else { + //fprintf(g_logfile, "new char %d %c\n", ashort, (char)ashort); *m_pcallsign++ = (char)ashort; + } + + /* If checksums disabled, display txt chars as they arrive */ + + if (!wxGetApp().m_enable_checksum) { m_txtCtrlCallSign->SetValue(m_callsign); } }