summaryrefslogtreecommitdiffstats
path: root/servers/gpib_server_lin/src/gpib_conn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/gpib_server_lin/src/gpib_conn.cpp')
-rw-r--r--servers/gpib_server_lin/src/gpib_conn.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/servers/gpib_server_lin/src/gpib_conn.cpp b/servers/gpib_server_lin/src/gpib_conn.cpp
index c211f84..df5be78 100644
--- a/servers/gpib_server_lin/src/gpib_conn.cpp
+++ b/servers/gpib_server_lin/src/gpib_conn.cpp
@@ -549,6 +549,27 @@ void GPIBSocket::commandLoop() {
writeEndOfFrame();
}
}
+ else if (m_instrumentCommand == "GETPERMITTEDSDIVS") { // Want to get permitted seconds/div settings
+ double* permitted_array;
+ int permitted_count;
+ TQ_INT32 value;
+ ds >> value;
+ if (scope_get_permitted_seconds_div_settings(&permitted_count, &permitted_array, m_serverParent->m_scopeType.ascii(), m_serverParent->m_scopeDeviceSocket) == 0) {
+ long i;
+ TQDoubleList permittedValues;
+ for (i=0; i<permitted_count; i++) {
+ permittedValues.append(permitted_array[i]);
+ }
+ free(permitted_array);
+ ds << TQString("ACK");
+ ds << permittedValues;
+ writeEndOfFrame();
+ }
+ else {
+ ds << TQString("NCK");
+ writeEndOfFrame();
+ }
+ }
else {
printf("[WARNING] Received unknown command %s from host %s\n\r", m_instrumentCommand.ascii(), m_remoteHost.ascii()); fflush(stdout);
ds << TQString("NCK");
@@ -1116,20 +1137,20 @@ int GPIBServer::readConfig() {
printf("[FAIL] Unable to open serial device %s\n\r", m_serialDevice.ascii()); fflush(stdout);
return 1;
}
-
+
tcgetattr(m_serialDeviceSocket, &oldtio); // Save current port settings
bzero(&newtio, sizeof(newtio));
newtio.c_cflag = m_serialBaud | CS8 | CLOCAL | CREAD;
newtio.c_iflag = IGNPAR;
newtio.c_oflag = 0;
-
+
// Set input mode (non-canonical, no echo,...)
newtio.c_lflag = 0;
-
+
newtio.c_cc[VTIME] = 0; // Inter-character timer unused
newtio.c_cc[VMIN] = 0; // Blocking read unused
-
+
tcflush(m_serialDeviceSocket, TCIFLUSH);
tcsetattr(m_serialDeviceSocket, TCSANOW, &newtio);