Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package soapy-airspy for openSUSE:Factory 
checked in at 2021-06-07 22:43:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/soapy-airspy (Old)
 and      /work/SRC/openSUSE:Factory/.soapy-airspy.new.32437 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "soapy-airspy"

Mon Jun  7 22:43:48 2021 rev:4 rq:897959 version:0.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/soapy-airspy/soapy-airspy.changes        
2018-12-14 20:56:57.208758836 +0100
+++ /work/SRC/openSUSE:Factory/.soapy-airspy.new.32437/soapy-airspy.changes     
2021-06-07 22:44:16.172563051 +0200
@@ -1,0 +2,6 @@
+Sat Jun  5 20:15:56 UTC 2021 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 0.2.0
+  * Support opening the device by serial convention
+
+-------------------------------------------------------------------

Old:
----
  soapy-airspy-0.1.2.tar.gz

New:
----
  soapy-airspy-0.2.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ soapy-airspy.spec ++++++
--- /var/tmp/diff_new_pack.OqPFgq/_old  2021-06-07 22:44:16.680563909 +0200
+++ /var/tmp/diff_new_pack.OqPFgq/_new  2021-06-07 22:44:16.680563909 +0200
@@ -1,8 +1,8 @@
 #
 # spec file for package soapy-airspy
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
-# Copyright (c) 2017, Martin Hauke <mar...@gmx.de>
+# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2017-2021, Martin Hauke <mar...@gmx.de>
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -13,18 +13,19 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 %define soapy_modver 0.7
 %define soapy_modname soapysdr%{soapy_modver}-module-airspy
 Name:           soapy-airspy
-Version:        0.1.2
+Version:        0.2.0
 Release:        0
 Summary:        SoapySDR Airspy module
 License:        MIT
 Group:          Hardware/Other
-Url:            https://github.com/pothosware/SoapyAirspy/wiki
+URL:            https://github.com/pothosware/SoapyAirspy/wiki
 #Git-Clone:     https://github.com/pothosware/SoapyAirspy.git
 Source:         
https://github.com/pothosware/SoapyAirspy/archive/%{name}-%{version}.tar.gz
 BuildRequires:  cmake

++++++ soapy-airspy-0.1.2.tar.gz -> soapy-airspy-0.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyAirspy-soapy-airspy-0.1.2/CMakeLists.txt 
new/SoapyAirspy-soapy-airspy-0.2.0/CMakeLists.txt
--- old/SoapyAirspy-soapy-airspy-0.1.2/CMakeLists.txt   2018-12-08 
04:15:51.000000000 +0100
+++ new/SoapyAirspy-soapy-airspy-0.2.0/CMakeLists.txt   2021-06-02 
15:54:16.000000000 +0200
@@ -51,7 +51,7 @@
     TARGET airspySupport
     SOURCES
         SoapyAirspy.hpp
-        Registation.cpp
+        Registration.cpp
         Settings.cpp
         Streaming.cpp
     LIBRARIES
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyAirspy-soapy-airspy-0.1.2/Changelog.txt 
new/SoapyAirspy-soapy-airspy-0.2.0/Changelog.txt
--- old/SoapyAirspy-soapy-airspy-0.1.2/Changelog.txt    2018-12-08 
04:15:51.000000000 +0100
+++ new/SoapyAirspy-soapy-airspy-0.2.0/Changelog.txt    2021-06-02 
15:54:16.000000000 +0200
@@ -1,3 +1,8 @@
+Release 0.2.0 (2021-06-02)
+==========================
+
+- Support opening the device by serial convention
+
 Release 0.1.2 (2018-12-07)
 ==========================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyAirspy-soapy-airspy-0.1.2/Registation.cpp 
new/SoapyAirspy-soapy-airspy-0.2.0/Registation.cpp
--- old/SoapyAirspy-soapy-airspy-0.1.2/Registation.cpp  2018-12-08 
04:15:51.000000000 +0100
+++ new/SoapyAirspy-soapy-airspy-0.2.0/Registation.cpp  1970-01-01 
01:00:00.000000000 +0100
@@ -1,146 +0,0 @@
-/*
- * The MIT License (MIT)
- * 
- * Copyright (c) 2015 Charles J. Cliffe
-
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
-
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
-
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include "SoapyAirspy.hpp"
-#include <SoapySDR/Registry.hpp>
-#include <cstdlib> //malloc
-#include <algorithm>
-
-static std::vector<SoapySDR::Kwargs> findAirspy(const SoapySDR::Kwargs &args)
-{
-    std::vector<SoapySDR::Kwargs> results;
-    
-    airspy_lib_version_t asVersion;
-    airspy_lib_version(&asVersion);
-    
-    // SoapySDR_setLogLevel(SOAPY_SDR_DEBUG);
-    
-    SoapySDR_logf(SOAPY_SDR_DEBUG, "AirSpy Lib v%d.%d rev %d", 
asVersion.major_version, asVersion.minor_version, asVersion.revision);
-
-    int numDevices = 0;
-   
-    std::vector< struct airspy_device * > foundDevices;
-   
-    int status = 0;
-   
-    // if (args.count("serial") != 0) {
-    //     std::stringstream serialstr;
-    //
-    //     uint32_t serialNum[2];
-    //     std::string serial_in(args.at("serial"));
-    //     std::replace( serial_in.begin(), serial_in.end(), ':', ' ');
-    //     serialstr.str(serial_in);
-    //     serialstr << std::hex;
-    //     serialstr >> serialNum[0];
-    //     serialstr >> serialNum[1];
-    //
-    //     uint64_t serial64 = ((uint64_t) serialNum[0] << 32) | serialNum[1]);
-    //
-    //     SoapySDR_logf(SOAPY_SDR_DEBUG, "Serial? '%s' %u %u 64: %llu", 
serialstr.str().c_str(), serialNum[0], serialNum[1], serial64);
-    //
-    //     struct airspy_device *searchDev = nullptr;
-    //     status = airspy_open_sn(&searchDev, serial64);
-    //
-    //     SoapySDR_logf(SOAPY_SDR_DEBUG, "Search done..");
-    //
-    //     if (status == AIRSPY_SUCCESS) {
-    //         foundDevices.push_back(searchDev);
-    //     } else {
-    //         SoapySDR_logf(SOAPY_SDR_DEBUG, "Error finding by serial..");
-    //     }
-    // } else
-    {    
-        for (int i = 0, iMax = MAX_DEVICES; i < iMax; i++) {
-            struct airspy_device *searchDev = nullptr;
-            status = airspy_open(&searchDev);
-        
-            if (status != AIRSPY_SUCCESS) {
-                break;
-            }
-        
-            foundDevices.push_back(searchDev);
-        }
-    }
-   
-    SoapySDR_logf(SOAPY_SDR_DEBUG, "%d AirSpy boards found.", 
foundDevices.size());
-    int devId = 0;
-    
-    for (std::vector< struct airspy_device * >::iterator i = 
foundDevices.begin(); i != foundDevices.end(); i++) {
-        uint8_t id = AIRSPY_BOARD_ID_INVALID;
-        airspy_read_partid_serialno_t serial;
-        
-        status = airspy_board_id_read(*i, &id);
-               if (status != AIRSPY_SUCCESS) {
-            continue;
-               }
-        
-               status = airspy_board_partid_serialno_read(*i, &serial);
-               if (status != AIRSPY_SUCCESS) {
-                       continue;
-               }
-
-        std::string boardName(airspy_board_id_name((enum airspy_board_id)id));
-        std::stringstream serialstr;
-        
-        serialstr.str("");
-        serialstr << std::hex << serial.serial_no[2] << ":" << 
serial.serial_no[3];
-        
-        SoapySDR_logf(SOAPY_SDR_DEBUG, "Serial %s", serialstr.str().c_str());  
      
-
-        SoapySDR::Kwargs soapyInfo;
-
-        soapyInfo["device_id"] = std::to_string(devId);
-        soapyInfo["label"] = boardName + " [" + serialstr.str() + "]";
-        soapyInfo["serial"] = serialstr.str();
-        devId++;
-                
-        // if (args.count("serial") != 0) {
-        //     if (args.at("serial") != soapyInfo.at("serial")) {
-        //         continue;
-        //     }
-        //     SoapySDR_logf(SOAPY_SDR_DEBUG, "Found device by serial %s", 
soapyInfo.at("serial").c_str());
-        // } else
-        if (args.count("device_id") != 0) {
-            if (args.at("device_id") != soapyInfo.at("device_id")) {
-                continue;
-            }
-            SoapySDR_logf(SOAPY_SDR_DEBUG, "Found device by device_id %s", 
soapyInfo.at("device_id").c_str());
-        }
-        
-        results.push_back(soapyInfo);
-    }
-   
-    for (std::vector< struct airspy_device * >::iterator i = 
foundDevices.begin(); i != foundDevices.end(); i++) {
-        airspy_close(*i);
-    }
-
-    return results;
-}
-
-static SoapySDR::Device *makeAirspy(const SoapySDR::Kwargs &args)
-{
-    return new SoapyAirspy(args);
-}
-
-static SoapySDR::Registry registerAirspy("airspy", &findAirspy, &makeAirspy, 
SOAPY_SDR_ABI_VERSION);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyAirspy-soapy-airspy-0.1.2/Registration.cpp 
new/SoapyAirspy-soapy-airspy-0.2.0/Registration.cpp
--- old/SoapyAirspy-soapy-airspy-0.1.2/Registration.cpp 1970-01-01 
01:00:00.000000000 +0100
+++ new/SoapyAirspy-soapy-airspy-0.2.0/Registration.cpp 2021-06-02 
15:54:16.000000000 +0200
@@ -0,0 +1,78 @@
+/*
+ * The MIT License (MIT)
+ * 
+ * Copyright (c) 2015 Charles J. Cliffe
+
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "SoapyAirspy.hpp"
+#include <SoapySDR/Registry.hpp>
+#include <cstdlib> //malloc
+#include <algorithm>
+
+static std::vector<SoapySDR::Kwargs> findAirspy(const SoapySDR::Kwargs &args)
+{
+    std::vector<SoapySDR::Kwargs> results;
+    
+    airspy_lib_version_t asVersion;
+    airspy_lib_version(&asVersion);
+    
+    SoapySDR_logf(SOAPY_SDR_DEBUG, "AirSpy Lib v%d.%d rev %d", 
asVersion.major_version, asVersion.minor_version, asVersion.revision);
+
+    uint64_t serials[MAX_DEVICES];
+    int count = airspy_list_devices(serials, MAX_DEVICES);
+    if (count < 0) {
+        SoapySDR_logf(SOAPY_SDR_ERROR, "libairspy error listing devices");
+        return results;
+    }
+
+    SoapySDR_logf(SOAPY_SDR_DEBUG, "%d AirSpy boards found.", count);
+    
+    for (int i = 0; i < count; i++) {
+        std::stringstream serialstr;
+        
+        serialstr.str("");
+        serialstr << std::hex << serials[i];
+        
+        SoapySDR_logf(SOAPY_SDR_DEBUG, "Serial %s", serialstr.str().c_str());  
      
+
+        SoapySDR::Kwargs soapyInfo;
+
+        soapyInfo["label"] = "AirSpy One [" + serialstr.str() + "]";
+        soapyInfo["serial"] = serialstr.str();
+
+        if (args.count("serial") != 0) {
+            if (args.at("serial") != soapyInfo.at("serial")) {
+                continue;
+            }
+            SoapySDR_logf(SOAPY_SDR_DEBUG, "Found device by serial %s", 
soapyInfo.at("serial").c_str());
+        }
+
+        results.push_back(soapyInfo);
+    }
+    return results;
+}
+
+static SoapySDR::Device *makeAirspy(const SoapySDR::Kwargs &args)
+{
+    return new SoapyAirspy(args);
+}
+
+static SoapySDR::Registry registerAirspy("airspy", &findAirspy, &makeAirspy, 
SOAPY_SDR_ABI_VERSION);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyAirspy-soapy-airspy-0.1.2/Settings.cpp 
new/SoapyAirspy-soapy-airspy-0.2.0/Settings.cpp
--- old/SoapyAirspy-soapy-airspy-0.1.2/Settings.cpp     2018-12-08 
04:15:51.000000000 +0100
+++ new/SoapyAirspy-soapy-airspy-0.2.0/Settings.cpp     2021-06-02 
15:54:16.000000000 +0200
@@ -26,8 +26,6 @@
 
 SoapyAirspy::SoapyAirspy(const SoapySDR::Kwargs &args)
 {
-    deviceId = -1;
-
     sampleRate = 3000000;
     centerFrequency = 0;
 
@@ -47,51 +45,30 @@
 
     lnaGain = mixerGain = vgaGain = 0;
 
-    if (args.count("device_id") != 0)
+    dev = nullptr;
+    std::stringstream serialstr;
+    serialstr.str("");
+
+    if (args.count("serial") != 0)
     {
         try {
-            deviceId = std::stoi(args.at("device_id"));
+            serial = std::stoull(args.at("serial"), nullptr, 16);
         } catch (const std::invalid_argument &) {
-            throw std::runtime_error("device_id invalid.");
+            throw std::runtime_error("serial is not a hex number");
+        } catch (const std::out_of_range &) {
+            throw std::runtime_error("serial value of out range");
         }
-
-        std::vector<struct airspy_device *> allDevs;
-
-        int status;
-        for (int i = 0, iMax = deviceId; i <= iMax; i++) {
-            struct airspy_device *searchDev = nullptr;
-            status = airspy_open(&searchDev);
-
-            if (status != AIRSPY_SUCCESS) {
-                continue;
-            }
-
-            allDevs.push_back(searchDev);
+        serialstr << std::hex << serial;
+        if (airspy_open_sn(&dev, serial) != AIRSPY_SUCCESS) {
+            throw std::runtime_error("Unable to open AirSpy device with serial 
" + serialstr.str());
         }
-
-        int numDevices = allDevs.size();
-
-        if (deviceId < 0 || deviceId >= numDevices) {
-            for (std::vector< struct airspy_device * >::iterator i = 
allDevs.begin(); i != allDevs.end(); i++) {
-                airspy_close(*i);
-            }
-
-            throw std::runtime_error("Airspy device_id out of range [0 .. " + 
std::to_string(numDevices) + "].");
-        }
-
-        dev = allDevs[deviceId];
-
-        for (std::vector< struct airspy_device * >::iterator i = 
allDevs.begin(); i != allDevs.end(); i++) {
-            if (*i != dev) {
-                airspy_close(*i);
-            }
-        }
-
-        SoapySDR_logf(SOAPY_SDR_DEBUG, "Found Airspy device using 'device_id' 
= %d", deviceId);
+        SoapySDR_logf(SOAPY_SDR_DEBUG, "Found AirSpy device: serial = %16Lx", 
serial);
     }
-
-    if (deviceId == -1) {
-        throw std::runtime_error("device_id missing.");
+    else
+    {
+        if (airspy_open(&dev) != AIRSPY_SUCCESS) {
+            throw std::runtime_error("Unable to open AirSpy device");
+        }
     }
 
     //apply arguments to settings when they match
@@ -127,8 +104,10 @@
     //this also gets printed in --probe
     SoapySDR::Kwargs args;
 
-    args["origin"] = "https://github.com/pothosware/SoapyAirspy";;
-    args["device_id"] = std::to_string(deviceId);
+    std::stringstream serialstr;
+    serialstr.str("");
+    serialstr << std::hex << serial;
+    args["serial"] = serialstr.str();
 
     return args;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyAirspy-soapy-airspy-0.1.2/SoapyAirspy.hpp 
new/SoapyAirspy-soapy-airspy-0.2.0/SoapyAirspy.hpp
--- old/SoapyAirspy-soapy-airspy-0.1.2/SoapyAirspy.hpp  2018-12-08 
04:15:51.000000000 +0100
+++ new/SoapyAirspy-soapy-airspy-0.2.0/SoapyAirspy.hpp  2021-06-02 
15:54:16.000000000 +0200
@@ -206,7 +206,7 @@
 private:
 
     //device handle
-    int deviceId;
+    uint64_t serial;
     struct airspy_device *dev;
 
     //cached settings
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyAirspy-soapy-airspy-0.1.2/debian/changelog 
new/SoapyAirspy-soapy-airspy-0.2.0/debian/changelog
--- old/SoapyAirspy-soapy-airspy-0.1.2/debian/changelog 2018-12-08 
04:15:51.000000000 +0100
+++ new/SoapyAirspy-soapy-airspy-0.2.0/debian/changelog 2021-06-02 
15:54:16.000000000 +0200
@@ -1,3 +1,9 @@
+soapyairspy (0.2.0-1) unstable; urgency=low
+
+  * Release 0.2.0 (2021-06-02)
+
+ -- Josh Blum <j...@pothosware.com>  Wed, 02 Jun 2021 08:53:50 -0000
+
 soapyairspy (0.1.2-1) unstable; urgency=low
 
   * Release 0.1.2 (2018-12-07)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyAirspy-soapy-airspy-0.1.2/debian/control 
new/SoapyAirspy-soapy-airspy-0.2.0/debian/control
--- old/SoapyAirspy-soapy-airspy-0.1.2/debian/control   2018-12-08 
04:15:51.000000000 +0100
+++ new/SoapyAirspy-soapy-airspy-0.2.0/debian/control   2021-06-02 
15:54:16.000000000 +0200
@@ -8,7 +8,7 @@
     cmake,
     libsoapysdr-dev,
     libairspy-dev
-Standards-Version: 4.1.4
+Standards-Version: 4.5.0
 Homepage: https://github.com/pothosware/SoapyAirspy/wiki
 Vcs-Git: https://github.com/pothosware/SoapyAirspy.git
 Vcs-Browser: https://github.com/pothosware/SoapyAirspy

Reply via email to