]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Support for HermesLite V1/V2 discrimination
authorDL1YCF <dl1ycf@darc.de>
Sat, 4 Jan 2020 11:32:26 +0000 (12:32 +0100)
committerDL1YCF <dl1ycf@darc.de>
Sat, 4 Jan 2020 11:32:26 +0000 (12:32 +0100)
discovered.h
hpsdrsim.c
hpsdrsim.h
new_discovery.c

index 79e08fdd9e5ff84e17c804b15543b9e3e073931b..c6bca2ce7419f1af656d2756fa3a8810a85548c5 100644 (file)
 
 // 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
index ad26a3eedcd9466d71efe46a82f19249bf5eca0d..c8dc5d1ed03e08a23bd5dfbe49d55877233608c0 100644 (file)
@@ -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;
                                }
index f7c16e87269ce7d75adf355bd0dabe50af972082..1c602ca23100f55b8a28174f4f80c1ce13d07878 100644 (file)
@@ -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;
index ac0e55a3b5535d3c1afebbac4d16ce01b2c8d413..4d7a4975d362f7394ae034ce5b19fa54e7b35bf5 100644 (file)
@@ -217,6 +217,8 @@ gpointer new_discover_receive_thread(gpointer data) {
                 if(devices<MAX_DEVICES) {
                     discovered[devices].protocol=NEW_PROTOCOL;
                     discovered[devices].device=buffer[11]&0xFF;
+                    discovered[devices].software_version=buffer[13]&0xFF;
+                    discovered[devices].status=status;
                     switch(discovered[devices].device) {
                        case NEW_DEVICE_ATLAS:
                             strcpy(discovered[devices].name,"Atlas");
@@ -249,12 +251,12 @@ gpointer new_discover_receive_thread(gpointer data) {
                             frequency_max=61440000.0;
                             break;
                        case NEW_DEVICE_HERMES_LITE:
-                            strcpy(discovered[devices].name,"Hermes Lite");
-                            frequency_min=0.0;
-                            frequency_max=30720000.0;
-                            break;
-                       case NEW_DEVICE_HERMES_LITE2:
-                            strcpy(discovered[devices].name,"Hermes Lite 2");
+                           if (discovered[devices].software_version < 40) {
+                              strcpy(discovered[devices].name,"Hermes Lite V1");
+                           } else {
+                              strcpy(discovered[devices].name,"Hermes Lite V2");
+                             discovered[devices].device = NEW_DEVICE_HERMES_LITE2;
+                           }
                             frequency_min=0.0;
                             frequency_max=30720000.0;
                             break;
@@ -264,11 +266,9 @@ gpointer new_discover_receive_thread(gpointer data) {
                             frequency_max=30720000.0;
                             break;
                     }
-                    discovered[devices].software_version=buffer[13]&0xFF;
                     for(i=0;i<6;i++) {
                         discovered[devices].info.network.mac_address[i]=buffer[i+5];
                     }
-                    discovered[devices].status=status;
                     memcpy((void*)&discovered[devices].info.network.address,(void*)&addr,sizeof(addr));
                     discovered[devices].info.network.address_length=sizeof(addr);
                     memcpy((void*)&discovered[devices].info.network.interface_address,(void*)&interface_addr,sizeof(interface_addr));