From ba5128d69abb35624d0fdaaa6c2a242e8a4cb6ef Mon Sep 17 00:00:00 2001 From: DL1YCF Date: Sat, 4 Jan 2020 12:32:26 +0100 Subject: [PATCH] Support for HermesLite V1/V2 discrimination --- discovered.h | 35 ++++++++++++++++++----------------- hpsdrsim.c | 4 ++++ hpsdrsim.h | 4 ++-- new_discovery.c | 16 ++++++++-------- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/discovered.h b/discovered.h index 79e08fd..c6bca2c 100644 --- a/discovered.h +++ b/discovered.h @@ -30,28 +30,29 @@ // ANAN 7000DLE and 8000DLE uses 10 as the device type in old protocol // Newer STEMlab hpsdr emulators use 100 instead of 1 -#define DEVICE_METIS 0 -#define DEVICE_HERMES 1 -#define DEVICE_GRIFFIN 2 -#define DEVICE_ANGELIA 4 -#define DEVICE_ORION 5 -#define DEVICE_HERMES_LITE 6 -#define DEVICE_HERMES_LITE2 7 -#define DEVICE_ORION2 10 -#define DEVICE_STEMLAB 100 +// HermesLite V2 uses V1 board ID and software version >= 40 +#define DEVICE_METIS 0 +#define DEVICE_HERMES 1 +#define DEVICE_GRIFFIN 2 +#define DEVICE_ANGELIA 4 +#define DEVICE_ORION 5 +#define DEVICE_HERMES_LITE 6 +#define DEVICE_HERMES_LITE2 1006 +#define DEVICE_ORION2 10 +#define DEVICE_STEMLAB 100 #ifdef USBOZY #define DEVICE_OZY 7 #endif -#define NEW_DEVICE_ATLAS 0 -#define NEW_DEVICE_HERMES 1 -#define NEW_DEVICE_HERMES2 2 -#define NEW_DEVICE_ANGELIA 3 -#define NEW_DEVICE_ORION 4 -#define NEW_DEVICE_ORION2 5 -#define NEW_DEVICE_HERMES_LITE 6 -#define NEW_DEVICE_HERMES_LITE2 7 +#define NEW_DEVICE_ATLAS 0 +#define NEW_DEVICE_HERMES 1 +#define NEW_DEVICE_HERMES2 2 +#define NEW_DEVICE_ANGELIA 3 +#define NEW_DEVICE_ORION 4 +#define NEW_DEVICE_ORION2 5 +#define NEW_DEVICE_HERMES_LITE 6 +#define NEW_DEVICE_HERMES_LITE2 1006 #ifdef SOAPYSDR #define SOAPYSDR_USB_DEVICE 0 diff --git a/hpsdrsim.c b/hpsdrsim.c index ad26a3e..c8dc5d1 100644 --- a/hpsdrsim.c +++ b/hpsdrsim.c @@ -762,6 +762,10 @@ int main(int argc, char *argv[]) buffer[20]=2; buffer[21]=1; buffer[22]=3; + // HERMES_LITE2 is a HermesLite with a new software version + if (NEWDEVICE == NEW_DEVICE_HERMES_LITE2) { + buffer[11]=NEW_DEVICE_HERMES_LITE; + } sendto(sock_udp, buffer, 60, 0, (struct sockaddr *)&addr_from, sizeof(addr_from)); break; } diff --git a/hpsdrsim.h b/hpsdrsim.h index f7c16e8..1c602ca 100644 --- a/hpsdrsim.h +++ b/hpsdrsim.h @@ -22,7 +22,7 @@ #define DEVICE_ANGELIA 4 #define DEVICE_ORION 5 #define DEVICE_HERMES_LITE 6 -#define DEVICE_HERMES_LITE2 7 +#define DEVICE_HERMES_LITE2 1006 #define DEVICE_ORION2 10 #define DEVICE_C25 100 @@ -33,7 +33,7 @@ #define NEW_DEVICE_ORION 4 #define NEW_DEVICE_ORION2 5 #define NEW_DEVICE_HERMES_LITE 6 -#define NEW_DEVICE_HERMES_LITE2 7 +#define NEW_DEVICE_HERMES_LITE2 1006 EXTERN int OLDDEVICE; EXTERN int NEWDEVICE; diff --git a/new_discovery.c b/new_discovery.c index ac0e55a..4d7a497 100644 --- a/new_discovery.c +++ b/new_discovery.c @@ -217,6 +217,8 @@ gpointer new_discover_receive_thread(gpointer data) { if(devices