break;
#ifdef SOAPYSDR
case SOAPYSDR_PROTOCOL:
- sprintf(text,"%s (Protocol SOAPY_SDR %s) on USB",d->name,d->info.soapy.version);
+ sprintf(text,"%s (Protocol SOAPY_SDR %s) via Soapy lib",d->name,d->info.soapy.version);
break;
#endif
#ifdef STEMLAB_DISCOVERY
status_text(text);
- sprintf(text,"piHPSDR: %s (%s %s) %s (%s) on %s",
- radio->name,
- p,
- version,
- ip,
- mac,
- iface);
+ switch (protocol) {
+ case ORIGINAL_PROTOCOL:
+ case NEW_PROTOCOL:
+ sprintf(text,"piHPSDR: %s (%s %s) %s (%s) on %s",
+ radio->name,
+ p,
+ version,
+ ip,
+ mac,
+ iface);
+ break;
+ case SOAPSDR_PROTOCOL:
+ sprintf(text,"piHPSDR: %s (%s %s",
+ radio->name,
+ p,
+ version);
+ break;
+ }
gtk_window_set_title (GTK_WINDOW (top_window), text);
case NEW_PROTOCOL:
schedule_high_priority();
break;
+ case SOAPYSDR_PROTOCOL:
+ soapy_protocol_set_gain(active_receiver,value * 1.0);
+ break;
}
}
mutex_b_exists = 1;
}
+ //
+ // We *must* open the port non-blocking, otherwise launch_serial may block
+ // for a long time if e.g. the serial cable is un-plugged
+ //
fd = open (ser_port, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (fd < 0)
{
return 0;
}
+ //
+ // Note that we use hard-wired settings here: 8 data bits, no parity, 1 stop bit
+ //
TTY.c_cflag &= ~CSIZE;
TTY.c_cflag |= CS8;
// enable receiver, set local mode
TTY.c_cflag |= (CLOCAL | CREAD);
- // no parity
TTY.c_cflag &= ~PARENB;
- // 1 stop bit
TTY.c_cflag &= ~CSTOPB;
+ //
+ // Set baud rate for input and output
+ //
cfsetispeed(&TTY, serial_baud_rate);
cfsetospeed(&TTY, serial_baud_rate);
TTY.c_oflag &= ~OPOST;
// timeouts
- TTY.c_cc[VMIN] = 0;
- TTY.c_cc[VTIME] =5;
+ TTY.c_cc[VMIN] = 0; // Do not block if nothing is in the input queue
+ TTY.c_cc[VTIME] =5; // A "pause" of 0.5 bytes after successfully receiving one byte indicates nothing more is to come
if (tcsetattr(fd, TCSANOW, &TTY)) {
fprintf (stderr,"RIGCTL: Error %d setting attributes: %s: %s\n", errno, ser_port, strerror (errno));
sample_rate=768000;
} else if(strcmp(driver,"rtlsdr")==0) {
sample_rate=1048576;
+ } else if(strcmp(driver,"radioberry")==0) {
+ sample_rate=48000;
} else {
sample_rate=1048576;
}
}
if(strcmp(driver,"lime")==0) {
sprintf(discovered[devices].info.soapy.version,"fw=%s gw=%s hw=%s p=%s", fw_version, gw_version, hw_version, p_version);
+ } else if (strcmp(driver,"radioberry")==0) {
+ sprintf(discovered[devices].info.soapy.version,"fw=%s gw=%s", fw_version, gw_version);
} else {
strcpy(discovered[devices].info.soapy.version,"");
}