Set serial of connected device in *IDN? response

This commit is contained in:
Jan Käberich 2025-03-13 11:35:56 +01:00
parent 8d219c0523
commit 345ab827c0
3 changed files with 13 additions and 2 deletions

View file

@ -212,7 +212,11 @@ VNA:FREQ:SPAN? # Read the current span
\section{Commands}
\subsection{General Commands}
\subsubsection{*IDN}
\query{Returns the identifications string}{*IDN?}{None}{LibreVNA,LibreVNA-GUI,dummy\_serial,<software version>}
\query{Returns the identifications string}{*IDN?}{None}{LibreVNA,LibreVNA-GUI,<serial>,<software version>}
\begin{itemize}
\item The serial number is the serial number from the connected LibreVNA. If none is connected, it will be set to ``Not connected''
\item The software version is the version of the \gui{}, not the firmware version of the connected \vna{}
\end{itemize}
\subsubsection{*RST}
\event{Resets the GUI (and any connected device) to the default state}{*RST}{None}
\subsubsection{*CLS}

View file

@ -516,7 +516,14 @@ void AppWindow::CreateToolbars()
void AppWindow::SetupSCPI()
{
scpi.add(new SCPICommand("*IDN", nullptr, [=](QStringList){
return "LibreVNA,LibreVNA-GUI,dummy_serial,"+appVersion;
QString ret = "LibreVNA,LibreVNA-GUI,";
if(device) {
ret += device->getSerial();
} else {
ret += "Not connected";
}
ret += ","+appVersion;
return ret;
}));
scpi.add(new SCPICommand("*RST", [=](QStringList){
SetResetState();