diff --git a/mainwindow.cpp b/mainwindow.cpp index 61a1535..ae208f2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -7188,7 +7188,7 @@ void MainWindow::buildQueryMenu(QMenu * menu, QString call){ addMessageText(QString("%1>[MESSAGE]").arg(selectedCall), true, true); }); - auto qsoQueryAction = menu->addAction(QString("%1 QUERY [CALLSIGN]? - Please acknowledge you can communicate directly with [CALLSIGN]").arg(call).trimmed()); + auto qsoQueryAction = menu->addAction(QString("%1 QUERY CALL [CALLSIGN]? - Please acknowledge you can communicate directly with [CALLSIGN]").arg(call).trimmed()); connect(qsoQueryAction, &QAction::triggered, this, [this](){ QString selectedCall = callsignSelected(); @@ -7196,7 +7196,7 @@ void MainWindow::buildQueryMenu(QMenu * menu, QString call){ return; } - addMessageText(QString("%1 QUERY [CALLSIGN]?").arg(selectedCall), true, true); + addMessageText(QString("%1 QUERY CALL [CALLSIGN]?").arg(selectedCall), true, true); }); auto agnAction = menu->addAction(QString("%1 AGN? - Please automatically repeat your last transmission").arg(call).trimmed()); @@ -9597,13 +9597,19 @@ void MainWindow::processCommandActivity() { // PROCESS BUFFERED QUERY else if (d.cmd == " QUERY" && ui->autoReplyButton->isChecked()){ + qDebug() << "received raw query" << d.text; + + // NOOP + continue; + } + + // PROCESS BUFFERED QUERY CALL + else if (d.cmd == " QUERY CALL" && ui->autoReplyButton->isChecked()){ auto who = d.text; if(who.isEmpty()){ continue; } - // TODO: here is where we would process arbitrary queries if we wanted - auto callsigns = Varicode::parseCallsigns(who); if(callsigns.isEmpty()){ continue; @@ -9622,6 +9628,11 @@ void MainWindow::processCommandActivity() { replies.append(r); } } + + if(!replies.isEmpty()){ + replies.prepend(QString("%1 YES").arg(d.from)); + } + reply = replies.join("\n"); if(!reply.isEmpty()){ diff --git a/varicode.cpp b/varicode.cpp index 86f5bbd..44a323f 100644 --- a/varicode.cpp +++ b/varicode.cpp @@ -62,7 +62,8 @@ QMap directed_cmds = { {" STATUS?", 6 }, // query idle message //{"!", 7 }, // unused - //{"#", 8 }, // unused + + {" HEARING", 8 }, // these are the stations i'm hearing {" TU", 9 }, // thank you @@ -70,9 +71,9 @@ QMap directed_cmds = { // {" ", 10 }, // unused // {" ", 11 }, // unused - {" HEARING", 12 }, // these are the stations i'm hearing - {" QUERY", 13 }, // can you transmit a ping to callsign? + {" QUERY", 12 }, // issue a generic query + {" QUERY CALL", 13 }, // can you transmit a ping to callsign? {" APRS:", 14 }, // send an aprs packet @@ -99,19 +100,20 @@ QMap directed_cmds = { QSet allowed_cmds = {-1, 0, 1, 2, 3, 4, 5, 6, /*7,*/ /*8,*/ 9, /*10,*/ /*11,*/ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, /*24,*/ 25, 26, 27, 28, 29, 30, 31}; -QSet buffered_cmds = {3, 5, /*6,*/ /*7,*/ 13, 14, 15}; +QSet buffered_cmds = {3, 5, /*6,*/ /*7,*/ 12, 13, 14, 15}; QSet snr_cmds = {25, 29}; QMap checksum_cmds = { { 5, 16 }, + { 12, 16 }, { 13, 16 }, { 14, 16 }, { 15, 0 } }; QString callsign_pattern = QString("(?[@]?[A-Z0-9/]+)"); -QString optional_cmd_pattern = QString("(?\\s?(?:AGN[?]|QSL[?]|HW CPY[?]|APRS[:]|SNR[?]|QTC[?]|QTH[?]|GRID[?]|STATUS[?]|HEARING[?]|(?:(?:HEARING|QUERY|ACK|73|YES|NO|SNR|QSL|RR|SK|FB|QTH|QTC|GRID|TU)(?=[ ]|$))|[?> ]))?"); +QString optional_cmd_pattern = QString("(?\\s?(?:AGN[?]|QSL[?]|HW CPY[?]|APRS[:]|SNR[?]|QTC[?]|QTH[?]|GRID[?]|STATUS[?]|HEARING[?]|(?:(?:HEARING|QUERY CALL|QUERY|ACK|73|YES|NO|SNR|QSL|RR|SK|FB|QTH|QTC|GRID|TU)(?=[ ]|$))|[?> ]))?"); QString optional_grid_pattern = QString("(?\\s?[A-R]{2}[0-9]{2})?"); QString optional_extended_grid_pattern = QString("^(?\\s?(?:[A-R]{2}[0-9]{2}(?:[A-X]{2}(?:[0-9]{2})?)*))?"); QString optional_num_pattern = QString("(?(?<=SNR|ACK)\\s?[-+]?(?:3[01]|[0-2]?[0-9]))?");