if(radio->protocol==NEW_PROTOCOL) {
schedule_high_priority();
#ifdef SOAPYSDR
- } else if(radio->device==SOAPYSDR_USB_DEVICE) {
+ } else if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
soapy_protocol_set_rx_antenna(receiver[0],adc[0].antenna);
#endif
}
if(radio->protocol==NEW_PROTOCOL) {
schedule_high_priority();
#ifdef SOAPYSDR
- } else if(radio->device==SOAPYSDR_USB_DEVICE) {
+ } else if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
soapy_protocol_set_tx_antenna(transmitter,dac->antenna);
#endif
}
gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
#ifdef SOAPYSDR
- if(radio->device!=SOAPYSDR_USB_DEVICE) {
+ if(radio->protocol != SOAPYSDR_PROTOCOL || radio->device!=SOAPYSDR_USB_DEVICE) {
#endif
GtkWidget *hf_rb=gtk_radio_button_new_with_label(NULL,"HF");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hf_rb),TRUE);
}
#ifdef SOAPYSDR
- if(radio->device==SOAPYSDR_USB_DEVICE) {
+ if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
int i;
g_print("rx_antennas=%ld\n",radio->info.soapy.rx_antennas);
}
#ifdef SOAPYSDR
- if(d->device!=SOAPYSDR_USB_DEVICE) {
+ if(d->protocol != SOAPYSDR_PROTOCOL || d->device!=SOAPYSDR_USB_DEVICE) {
#endif
// if not on the same subnet then cannot start it
if((d->info.network.interface_address.sin_addr.s_addr&d->info.network.interface_netmask.sin_addr.s_addr) != (d->info.network.address.sin_addr.s_addr&d->info.network.interface_netmask.sin_addr.s_addr)) {
iqswap=0;
#ifdef SOAPYSDR
- if(device==SOAPYSDR_USB_DEVICE) {
+ if(protocol == SOAPYSDR_PROTOCOL && device==SOAPYSDR_USB_DEVICE) {
iqswap=1;
receivers=1;
}
adc[0].preamp=FALSE;
adc[0].attenuation=0;
#ifdef SOAPYSDR
- adc[0].antenna=0;
- if(device==SOAPYSDR_USB_DEVICE) {
- adc[0].rx_gain=malloc(radio->info.soapy.rx_gains*sizeof(gint));
- for (size_t i = 0; i < radio->info.soapy.rx_gains; i++) {
- adc[0].rx_gain[i]=0;
- }
- adc[0].agc=FALSE;
- dac[0].antenna=1;
- dac[0].tx_gain=malloc(radio->info.soapy.tx_gains*sizeof(gint));
- for (size_t i = 0; i < radio->info.soapy.tx_gains; i++) {
- dac[0].tx_gain[i]=0;
+ if (protocol == SOAPYSDR_PROTOCOL) {
+ adc[0].antenna=0;
+ if(device==SOAPYSDR_USB_DEVICE) {
+ adc[0].rx_gain=malloc(radio->info.soapy.rx_gains*sizeof(gint));
+ for (size_t i = 0; i < radio->info.soapy.rx_gains; i++) {
+ adc[0].rx_gain[i]=0;
+ }
+ adc[0].agc=FALSE;
+ dac[0].antenna=1;
+ dac[0].tx_gain=malloc(radio->info.soapy.tx_gains*sizeof(gint));
+ for (size_t i = 0; i < radio->info.soapy.tx_gains; i++) {
+ dac[0].tx_gain[i]=0;
+ }
}
}
#endif
adc[1].preamp=FALSE;
adc[1].attenuation=0;
#ifdef SOAPYSDR
- adc[1].antenna=0;
- if(device==SOAPYSDR_USB_DEVICE) {
- adc[1].rx_gain=malloc(radio->info.soapy.rx_gains*sizeof(gint));
- for (size_t i = 0; i < radio->info.soapy.rx_gains; i++) {
- adc[1].rx_gain[i]=0;
- }
- adc[1].agc=FALSE;
+ if (protocol == SOAPYSDR_PROTOCOL) {
+ adc[1].antenna=0;
+ if(device==SOAPYSDR_USB_DEVICE) {
+ adc[1].rx_gain=malloc(radio->info.soapy.rx_gains*sizeof(gint));
+ for (size_t i = 0; i < radio->info.soapy.rx_gains; i++) {
+ adc[1].rx_gain[i]=0;
+ }
+ adc[1].agc=FALSE;
- dac[1].tx_gain=malloc(radio->info.soapy.tx_gains*sizeof(gint));
- for (size_t i = 0; i < radio->info.soapy.tx_gains; i++) {
- dac[1].tx_gain[i]=0;
+ dac[1].tx_gain=malloc(radio->info.soapy.tx_gains*sizeof(gint));
+ for (size_t i = 0; i < radio->info.soapy.tx_gains; i++) {
+ dac[1].tx_gain[i]=0;
+ }
}
- }
- radio_sample_rate=radio->info.soapy.sample_rate;
+ radio_sample_rate=radio->info.soapy.sample_rate;
+ }
#endif
//g_print("meter_calibration=%f display_calibration=%f\n", meter_calibration, display_calibration);
if(value) mute_rx_while_transmitting=atoi(value);
#ifdef SOAPYSDR
- if(device==SOAPYSDR_USB_DEVICE) {
+ if(protocol == SOAPYSDR_PROTOCOL && device==SOAPYSDR_USB_DEVICE) {
char name[128];
for(int i=0;i<radio->info.soapy.rx_gains;i++) {
sprintf(name,"radio.adc[0].rx_gain.%s",radio->info.soapy.rx_gain[i]) ;
setProperty("rx_gain_calibration",value);
#ifdef SOAPYSDR
- if(device==SOAPYSDR_USB_DEVICE) {
+ if(protocol == SOAPYSDR_PROTOCOL && device==SOAPYSDR_USB_DEVICE) {
char name[128];
for(int i=0;i<radio->info.soapy.rx_gains;i++) {
sprintf(name,"radio.adc[0].rx_gain.%s",radio->info.soapy.rx_gain[i]);
ADC *adc=(ADC *)data;
active_receiver->rf_gain=gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget));
- if(radio->device==SOAPYSDR_USB_DEVICE) {
+ if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
soapy_protocol_set_gain(receiver[0],active_receiver->rf_gain);
}
static void rx_gain_value_changed_cb(GtkWidget *widget, gpointer data) {
ADC *adc=(ADC *)data;
int gain;
- if(radio->device==SOAPYSDR_USB_DEVICE) {
+ if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
gain=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
soapy_protocol_set_gain_element(receiver[0],(char *)gtk_widget_get_name(widget),gain);
static void drive_gain_value_changed_cb(GtkWidget *widget, gpointer data) {
DAC *dac=(DAC *)data;
- if(radio->device==SOAPYSDR_USB_DEVICE) {
+ if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
transmitter->drive=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
soapy_protocol_set_tx_gain(transmitter,(double)transmitter->drive);
/*
static void tx_gain_value_changed_cb(GtkWidget *widget, gpointer data) {
DAC *dac=(DAC *)data;
int gain;
- if(radio->device==SOAPYSDR_USB_DEVICE) {
+ if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
gain=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
soapy_protocol_set_tx_gain_element(transmitter,(char *)gtk_widget_get_name(widget),gain);
/*
static void dac0_gain_value_changed_cb(GtkWidget *widget, gpointer data) {
DAC *dac=(DAC *)data;
int gain;
- if(radio->device==SOAPYSDR_USB_DEVICE) {
+ if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
gain=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
soapy_protocol_set_tx_gain_element(radio->transmitter,(char *)gtk_widget_get_name(widget),gain);
for(int i=0;i<radio->discovered->info.soapy.tx_gains;i++) {
#ifdef SOAPYSDR
col=0;
- if(radio->device==SOAPYSDR_USB_DEVICE) {
+ if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
int i;
/*
if(radio->info.soapy.rx_gains>0) {
}
fprintf(stderr,"create_receiver: id=%d default adc=%d\n",rx->id, rx->adc);
#ifdef SOAPYSDR
- if(radio->device==SOAPYSDR_USB_DEVICE) {
+ if(radio->protocol == SOAPYSDR_PROTOCOL && radio->device==SOAPYSDR_USB_DEVICE) {
rx->sample_rate=radio->info.soapy.sample_rate;
rx->resampler=NULL;
rx->resample_buffer=NULL;
fprintf(stderr,"RIGCTL: BD - current band=%d\n",cur_band);
#endif
if(cur_band == 0) {
+ cur_band = band6;
#ifdef SOAPYSDR
- cur_band = band472;
- #else
- cur_band = band6;
+ if (radio->protocol == SOAPYSDR_PROTOCOL) cur_band = band472;
#endif
} else {
--cur_band;