Remove unused arguments to sftx_sub(). Fix a bug transmitting with empty OTP key.

This commit is contained in:
Joe Taylor 2024-09-17 14:44:54 -04:00
parent 7895172d3f
commit e7c0cde160
2 changed files with 5 additions and 14 deletions

View File

@ -1,4 +1,4 @@
subroutine sftx_sub(fname,foxcall0,ckey0) subroutine sftx_sub(ckey0)
! This routine is required in order to create a SuperFox transmission. ! This routine is required in order to create a SuperFox transmission.
@ -13,13 +13,11 @@ subroutine sftx_sub(fname,foxcall0,ckey0)
use qpc_mod use qpc_mod
use sfox_mod use sfox_mod
character*(*) fname !Corrected path for sfox_1.dat
character*120 line !List of SuperFox message pieces character*120 line !List of SuperFox message pieces
character*40 cmsg !Old-style Fox messages character*40 cmsg !Old-style Fox messages
character*26 freeTextMsg character*26 freeTextMsg
character*(*) ckey0 character*(*) ckey0
character*10 ckey character*10 ckey
character*(*) foxcall0
character*11 foxcall character*11 foxcall
logical*1 bMoreCQs,bSendMsg logical*1 bMoreCQs,bSendMsg
integer*1 xin(0:49) !Packed message as 7-bit symbols integer*1 xin(0:49) !Packed message as 7-bit symbols

View File

@ -182,7 +182,7 @@ extern "C" {
void sfox_wave_gfsk_(char const * fname, FCL len); void sfox_wave_gfsk_(char const * fname, FCL len);
void sftx_sub_(char const * fname, char const * foxcall, char const * otp_key, FCL len1, FCL len2, FCL len3); void sftx_sub_(char const * otp_key, FCL len1);
void plotsave_(float swide[], int* m_w , int* m_h1, int* irow); void plotsave_(float swide[], int* m_w , int* m_h1, int* irow);
@ -11429,8 +11429,7 @@ void MainWindow::on_jt65Button_clicked()
void MainWindow::sfox_tx() { void MainWindow::sfox_tx() {
auto fname{QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()}; auto fname{QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()};
QStringList args{fname}; QString ckey{"OTP:000000"};
args.append(m_config.my_callsign());
LOG_INFO(QString("sfox_tx: OTP code is %1").arg(foxOTPcode())); LOG_INFO(QString("sfox_tx: OTP code is %1").arg(foxOTPcode()));
#ifdef FOX_OTP #ifdef FOX_OTP
qint32 otp_key = 0; qint32 otp_key = 0;
@ -11448,7 +11447,7 @@ void MainWindow::sfox_tx() {
otp_key = 0; otp_key = 0;
LOG_INFO(QString("TOTP SF: Incorrect length")); LOG_INFO(QString("TOTP SF: Incorrect length"));
} }
args.append(QString("OTP:%1").arg(otp_key)); ckey=(QString("OTP:%1").arg(otp_key));
} else } else
{ {
showStatusMessage (tr ("TOTP SF: seed not long enough.")); showStatusMessage (tr ("TOTP SF: seed not long enough."));
@ -11456,13 +11455,7 @@ void MainWindow::sfox_tx() {
} }
} }
#endif #endif
LOG_INFO(QString("%1 %2").arg(QDir::toNativeSeparators(m_appDir)+QDir::separator()+"sftx").arg(args.join(" ")).toStdString()); sftx_sub_(ckey.toLatin1().constData(), (FCL)ckey.size());
auto fname1 {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()};
// qDebug() << "aa" << fname1;
// qDebug() << "bb" << args[0] << args[1] << args[2];
sftx_sub_(fname1.constData(), args[1].toLatin1().constData() , args[2].toLatin1().constData(), (FCL)fname1.size(),
(FCL)args[1].size(), (FCL)args[2].size());
auto fname2 {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_2.dat")).toLocal8Bit()}; auto fname2 {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_2.dat")).toLocal8Bit()};
sfox_wave_gfsk_(fname2.constData(), (FCL)fname2.size()); sfox_wave_gfsk_(fname2.constData(), (FCL)fname2.size());
} }