From 9e9bfcd2c7342c38aff0d17d56c905b20f4d2def Mon Sep 17 00:00:00 2001 From: John Melton G0ORX Date: Wed, 18 Mar 2020 20:15:29 +0000 Subject: [PATCH] Fix 2 receivers in radio_menu --- new_discovery.c | 1 + old_discovery.c | 1 + radio_menu.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/new_discovery.c b/new_discovery.c index d6c3d46..6039d34 100644 --- a/new_discovery.c +++ b/new_discovery.c @@ -275,6 +275,7 @@ gpointer new_discover_receive_thread(gpointer data) { memcpy((void*)&discovered[devices].info.network.interface_netmask,(void*)&interface_netmask,sizeof(interface_netmask)); discovered[devices].info.network.interface_length=sizeof(interface_addr); strcpy(discovered[devices].info.network.interface_name,interface_name); + discovered[devices].supported_receivers=2; fprintf(stderr,"new_discover: found %d protocol=%d device=%d software_version=%d status=%d address=%s (%02X:%02X:%02X:%02X:%02X:%02X) on %s\n", devices, discovered[devices].protocol, diff --git a/old_discovery.c b/old_discovery.c index f28e313..9d53a32 100644 --- a/old_discovery.c +++ b/old_discovery.c @@ -484,6 +484,7 @@ g_print("old_discovery: name=%s min=%f max=%f\n",discovered[devices].name, disco discovered[devices].info.network.interface_length=sizeof(interface_addr); strcpy(discovered[devices].info.network.interface_name,interface_name); discovered[devices].use_tcp=0; + discovered[devices].supported_receivers=2; fprintf(stderr,"old_discovery: found device=%d software_version=%d status=%d address=%s (%02X:%02X:%02X:%02X:%02X:%02X) on %s min=%f max=%f\n", discovered[devices].device, discovered[devices].software_version, diff --git a/radio_menu.c b/radio_menu.c index 388ba4d..765ef01 100644 --- a/radio_menu.c +++ b/radio_menu.c @@ -25,6 +25,7 @@ #include #include "main.h" +#include "discovered.h" #include "new_menu.h" #include "radio_menu.h" #include "adc.h" @@ -440,7 +441,7 @@ void radio_menu(GtkWidget *parent) { row++; - if(receivers>1) { + if(radio->supported_receivers>1) { receivers_2=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(receivers_1),"2"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (receivers_2), receivers==2); gtk_grid_attach(GTK_GRID(grid),receivers_2,col,row,1,1); -- 2.45.2