From: pa3gsb Date: Sat, 26 May 2018 12:00:52 +0000 (+0200) Subject: radioberry must work with localhost X-Git-Url: https://git.rkrishnan.org/%5B/flags/-?a=commitdiff_plain;h=98c534121d0ae34fe2e2b73fdad19d89d3752373;p=pihpsdr.git radioberry must work with localhost --- diff --git a/discovered.h b/discovered.h index cc0ac10..1eab594 100644 --- a/discovered.h +++ b/discovered.h @@ -34,6 +34,7 @@ #define DEVICE_ANGELIA 4 #define DEVICE_ORION 5 #define DEVICE_HERMES_LITE 6 +#define DEVICE_RADIOBERRY 7 // 8000DLE uses 10 as the device type in old protocol #define DEVICE_ORION2 10 diff --git a/old_discovery.c b/old_discovery.c index 87992da..57ea09e 100644 --- a/old_discovery.c +++ b/old_discovery.c @@ -178,7 +178,11 @@ fprintf(stderr,"discover_receive_thread\n"); strcpy(discovered[devices].name,"Orion"); break; case DEVICE_HERMES_LITE: - strcpy(discovered[devices].name,"Hermes Lite"); + #ifdef RADIOBERRY + strcpy(discovered[devices].name,"Radioberry"); + #else + strcpy(discovered[devices].name,"Hermes Lite"); + #endif break; case DEVICE_ORION2: strcpy(discovered[devices].name,"Orion 2"); @@ -229,11 +233,18 @@ fprintf(stderr,"old_discovery\n"); while (ifa) { g_main_context_iteration(NULL, 0); if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET) { + #ifdef RADIOBERRY + if((ifa->ifa_flags&IFF_UP)==IFF_UP + && (ifa->ifa_flags&IFF_RUNNING)==IFF_RUNNING) { + discover(ifa); + } + #else if((ifa->ifa_flags&IFF_UP)==IFF_UP && (ifa->ifa_flags&IFF_RUNNING)==IFF_RUNNING && (ifa->ifa_flags&IFF_LOOPBACK)!=IFF_LOOPBACK) { discover(ifa); } + #endif } ifa = ifa->ifa_next; }