diff --git a/plugins/feature/ambe/ambe.cpp b/plugins/feature/ambe/ambe.cpp index f62e825f8..7457f06da 100644 --- a/plugins/feature/ambe/ambe.cpp +++ b/plugins/feature/ambe/ambe.cpp @@ -330,7 +330,7 @@ void AMBE::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response) { // serial - SWGSDRangel::SWGDVSerialDevices_2 *swgDVSerialDevices = response.getAmbeReport()->getSerial(); + SWGSDRangel::SWGDVSerialDevices *swgDVSerialDevices = response.getAmbeReport()->getSerial(); swgDVSerialDevices->init(); QList qDeviceNames; @@ -347,7 +347,7 @@ void AMBE::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response) // devices - SWGSDRangel::SWGAMBEDevices_2 *swgAMBEDevices = response.getAmbeReport()->getDevices(); + SWGSDRangel::SWGAMBEDevices *swgAMBEDevices = response.getAmbeReport()->getDevices(); swgAMBEDevices->init(); qDeviceNames.clear(); @@ -393,7 +393,7 @@ int AMBE::webapiActionsPost( { unknownAction = false; bool updated = false; - SWGSDRangel::SWGAMBEDevices_2 *swgAMBEDevices = swgAMBEActions->getUpdateDevices(); + SWGSDRangel::SWGAMBEDevices *swgAMBEDevices = swgAMBEActions->getUpdateDevices(); QList *ambeList = swgAMBEDevices->getAmbeDevices(); for (QList::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it) diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index ea79bf8c3..136e97d20 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1253,7 +1253,7 @@ margin-bottom: 20px; "properties" : { "updateDevices" : { "description" : "Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing", - "$ref" : "#/definitions/AMBEDevices_2" + "$ref" : "#/definitions/AMBEDevices" }, "removeAll" : { "type" : "integer", @@ -1274,19 +1274,6 @@ margin-bottom: 20px; } }, "description" : "AMBE devices active in the system" -}; - defs.AMBEDevice_2 = { - "properties" : { - "deviceRef" : { - "type" : "string", - "description" : "Serial device name or server address" - }, - "delete" : { - "type" : "integer", - "description" : "1 if device is to be removed from active list" - } - }, - "description" : "AMBE devices active in the system" }; defs.AMBEDevices = { "required" : [ "nbDevices" ], @@ -1304,33 +1291,16 @@ margin-bottom: 20px; } }, "description" : "List of AMBE devices (serial or server address)" -}; - defs.AMBEDevices_2 = { - "required" : [ "nbDevices" ], - "properties" : { - "nbDevices" : { - "type" : "integer", - "description" : "Number of DV serial devices" - }, - "ambeDevices" : { - "type" : "array", - "description" : "List of AMBE devices", - "items" : { - "$ref" : "#/definitions/AMBEDevice" - } - } - }, - "description" : "List of AMBE devices (serial or server address)" }; defs.AMBEReport = { "properties" : { "serial" : { - "description" : "List of available DV serial devices", - "$ref" : "#/definitions/DVSerialDevices_2" + "description" : "List of AMBE serial devices in the system", + "$ref" : "#/definitions/DVSerialDevices" }, "devices" : { - "description" : "List of AMBE devices (serial or address) used for AMBE frames processing", - "$ref" : "#/definitions/AMBEDevices_2" + "description" : "List of AMBE devices or servers in use", + "$ref" : "#/definitions/AMBEDevices" } }, "description" : "AMBE" @@ -4711,15 +4681,6 @@ margin-bottom: 20px; } }, "description" : "DV serial device details" -}; - defs.DVSerialDevice_2 = { - "properties" : { - "deviceName" : { - "type" : "string", - "description" : "Name of the serial device in the system" - } - }, - "description" : "DV serial device details" }; defs.DVSerialDevices = { "required" : [ "nbDevices" ], @@ -4737,23 +4698,6 @@ margin-bottom: 20px; } }, "description" : "List of DV serial devices available in the system" -}; - defs.DVSerialDevices_2 = { - "required" : [ "nbDevices" ], - "properties" : { - "nbDevices" : { - "type" : "integer", - "description" : "Number of DV serial devices" - }, - "dvSerialDevices" : { - "type" : "array", - "description" : "Device names of DV serial devices", - "items" : { - "$ref" : "#/definitions/DVSerialDevice" - } - } - }, - "description" : "List of DV serial devices available in the system" }; defs.DemodAnalyzerSettings = { "properties" : { @@ -14837,21 +14781,6 @@ margin-bottom: 20px; featuresetPresetPut -
  • - instanceAMBEDevicesDelete -
  • -
  • - instanceAMBEDevicesGet -
  • -
  • - instanceAMBEDevicesPatch -
  • -
  • - instanceAMBEDevicesPut -
  • -
  • - instanceAMBESerialGet -
  • instanceAudioGet
  • @@ -38965,1785 +38894,6 @@ $(document).ready(function() {

    Instance

    -
    -
    -
    -

    instanceAMBEDevicesDelete

    -

    -
    -
    -
    -

    -

    Emtpy the active devices thus effectively closing down AMBE devices support

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X DELETE "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesDelete");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesDelete");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesDeleteWithCompletionHandler: 
    -              ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesDelete(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesDeleteExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesDelete: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesDelete();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesDelete: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesDelete();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesDelete: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_delete()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesDelete: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - Success.

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesGet

    -

    -
    -
    -
    -

    -

    get the list of AMBE devices (serial or address) used for AMBE frames decoding in digital voice modes

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesGetWithCompletionHandler: 
    -              ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of devices possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesPatch

    -

    -
    -
    -
    -

    -

    Add and/or delete devices to/from the active list

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PATCH "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPatch");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPatch");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    AMBEDevices *body = ; // List of AMBE devices (serial or address)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesPatchWith:body
    -              completionHandler: ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {AMBEDevices} List of AMBE devices (serial or address)
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesPatch(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesPatchExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new AMBEDevices(); // AMBEDevices | List of AMBE devices (serial or address)
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesPatch: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesPatch($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesPatch: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::AMBEDevices->new(); # AMBEDevices | List of AMBE devices (serial or address)
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesPatch(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesPatch: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # AMBEDevices | List of AMBE devices (serial or address)
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_patch(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesPatch: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - On success return list of devices

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesPut

    -

    -
    -
    -
    -

    -

    Replace the list of active devices

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PUT "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    AMBEDevices *body = ; // List of AMBE devices (serial or address)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesPutWith:body
    -              completionHandler: ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {AMBEDevices} List of AMBE devices (serial or address)
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesPut(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesPutExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new AMBEDevices(); // AMBEDevices | List of AMBE devices (serial or address)
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesPut: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesPut($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesPut: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::AMBEDevices->new(); # AMBEDevices | List of AMBE devices (serial or address)
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesPut(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesPut: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # AMBEDevices | List of AMBE devices (serial or address)
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_put(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesPut: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - On success return list of devices

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBESerialGet

    -

    -
    -
    -
    -

    -

    get a list of available DV serial devices

    -

    -
    -
    /sdrangel/ambe/serial
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/ambe/serial"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBESerialGetWithCompletionHandler: 
    -              ^(DVSerialDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBESerialGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBESerialGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBESerialGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBESerialGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBESerialGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBESerialGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBESerialGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_serial_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBESerialGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of device paths possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    @@ -57890,7 +56040,7 @@ except ApiException as e:
    - Generated 2022-05-24T21:52:35.030+02:00 + Generated 2022-05-24T23:13:14.725+02:00
    diff --git a/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml b/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml index 9b4d070ef..275857baf 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml @@ -23,10 +23,10 @@ AMBEReport: description: AMBE properties: serial: - description: List of available DV serial devices + description: List of AMBE serial devices in the system $ref: "/doc/swagger/include/AMBE.yaml#/definitions/DVSerialDevices" devices: - description: List of AMBE devices (serial or address) used for AMBE frames processing + description: List of AMBE devices or servers in use $ref: "/doc/swagger/include/AMBE.yaml#/definitions/AMBEDevices" AMBEActions: diff --git a/sdrbase/resources/webapi/doc/swagger/swagger.yaml b/sdrbase/resources/webapi/doc/swagger/swagger.yaml index 5c3799cfe..fed3b778b 100644 --- a/sdrbase/resources/webapi/doc/swagger/swagger.yaml +++ b/sdrbase/resources/webapi/doc/swagger/swagger.yaml @@ -454,100 +454,6 @@ paths: "501": $ref: "#/responses/Response_501" - /sdrangel/ambe/serial: - x-swagger-router-controller: instance - get: - description: get a list of available DV serial devices - operationId: instanceAMBESerialGet - tags: - - Instance - responses: - "200": - description: On success return list of device paths possibly empty - schema: - $ref: "#/definitions/DVSerialDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/ambe/devices: - x-swagger-router-controller: instance - get: - description: get the list of AMBE devices (serial or address) used for AMBE frames decoding in digital voice modes - operationId: InstanceAMBEDevicesGet - tags: - - Instance - responses: - "200": - description: On success return list of devices possibly empty - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - put: - description: Replace the list of active devices - operationId: InstanceAMBEDevicesPut - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: List of AMBE devices (serial or address) - required: true - schema: - $ref: "#/definitions/AMBEDevices" - responses: - "200": - description: On success return list of devices - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - delete: - description: Emtpy the active devices thus effectively closing down AMBE devices support - operationId: InstanceAMBEDevicesDelete - tags: - - Instance - responses: - "200": - description: Success. - schema: - $ref: "#/definitions/SuccessResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - patch: - description: Add and/or delete devices to/from the active list - operationId: InstanceAMBEDevicesPatch - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: List of AMBE devices (serial or address) - required: true - schema: - $ref: "#/definitions/AMBEDevices" - responses: - "200": - description: On success return list of devices - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - /sdrangel/presets: x-swagger-router-controller: instance get: @@ -3311,51 +3217,6 @@ definitions: type: number format: float - DVSerialDevices: - description: "List of DV serial devices available in the system" - required: - - nbDevices - properties: - nbDevices: - description: "Number of DV serial devices" - type: integer - dvSerialDevices: - description: "Device names of DV serial devices" - type: array - items: - $ref: "#/definitions/DVSerialDevice" - - DVSerialDevice: - description: "DV serial device details" - properties: - deviceName: - description: "Name of the serial device in the system" - type: string - - AMBEDevices: - description: "List of AMBE devices (serial or server address)" - required: - - nbDevices - properties: - nbDevices: - description: "Number of DV serial devices" - type: integer - ambeDevices: - description: "List of AMBE devices" - type: array - items: - $ref: "#/definitions/AMBEDevice" - - AMBEDevice: - description: "AMBE devices active in the system" - properties: - deviceRef: - description: "Serial device name or server address" - type: string - delete: - description: "1 if device is to be removed from active list" - type: integer - LimeRFEDevices: description: "List of LimeRFE devices (serial or server address)" required: diff --git a/sdrbase/webapi/webapiadapter.cpp b/sdrbase/webapi/webapiadapter.cpp index b7c30ad7f..1a6e57976 100644 --- a/sdrbase/webapi/webapiadapter.cpp +++ b/sdrbase/webapi/webapiadapter.cpp @@ -51,9 +51,6 @@ #include "SWGDeviceListItem.h" #include "SWGAudioDevices.h" #include "SWGLocationInformation.h" -#include "SWGDVSerialDevices.h" -#include "SWGDVSerialDevice.h" -#include "SWGAMBEDevices.h" #include "SWGPresets.h" #include "SWGPresetGroup.h" #include "SWGPresetItem.h" @@ -753,182 +750,6 @@ int WebAPIAdapter::instanceLocationPut( return 200; } -int WebAPIAdapter::instanceDVSerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - response.init(); - - std::vector deviceNames; - dspEngine->getDVSerialNames(deviceNames); - response.setNbDevices((int) deviceNames.size()); - QList *deviceNamesList = response.getDvSerialDevices(); - - std::vector::iterator it = deviceNames.begin(); - - while (it != deviceNames.end()) - { - deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice); - deviceNamesList->back()->init(); - *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it); - ++it; - } - - return 200; -} - -int WebAPIAdapter::instanceDVSerialPatch( - bool dvserial, - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - dspEngine->setDVSerialSupport(dvserial); - - MainCore::MsgDVSerial *msg = MainCore::MsgDVSerial::create(dvserial); - m_mainCore->m_mainMessageQueue->push(msg); - response.init(); - - if (dvserial) - { - std::vector deviceNames; - dspEngine->getDVSerialNames(deviceNames); - response.setNbDevices((int) deviceNames.size()); - QList *deviceNamesList = response.getDvSerialDevices(); - - std::vector::iterator it = deviceNames.begin(); - - while (it != deviceNames.end()) - { - deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice); - deviceNamesList->back()->init(); - *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it); - ++it; - } - } - else - { - response.setNbDevices(0); - } - - return 200; -} - -int WebAPIAdapter::instanceAMBESerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - response.init(); - - std::vector deviceNames; - std::vector qDeviceNames; - dspEngine->getAMBEEngine()->scan(qDeviceNames); - - for (std::vector::const_iterator it = qDeviceNames.begin(); it != qDeviceNames.end(); ++it) { - deviceNames.push_back(it->toStdString()); - } - - response.setNbDevices((int) deviceNames.size()); - QList *deviceNamesList = response.getDvSerialDevices(); - - std::vector::iterator it = deviceNames.begin(); - - while (it != deviceNames.end()) - { - deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice); - deviceNamesList->back()->init(); - *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it); - ++it; - } - - return 200; -} - -int WebAPIAdapter::instanceAMBEDevicesGet( - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - response.init(); - - std::vector deviceNames; - dspEngine->getDVSerialNames(deviceNames); - response.setNbDevices((int) deviceNames.size()); - QList *deviceNamesList = response.getAmbeDevices(); - - std::vector::iterator it = deviceNames.begin(); - - while (it != deviceNames.end()) - { - deviceNamesList->append(new SWGSDRangel::SWGAMBEDevice); - deviceNamesList->back()->init(); - *deviceNamesList->back()->getDeviceRef() = QString::fromStdString(*it); - deviceNamesList->back()->setDelete(0); - ++it; - } - - return 200; -} - -int WebAPIAdapter::instanceAMBEDevicesDelete( - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - dspEngine->getAMBEEngine()->releaseAll(); - - response.init(); - *response.getMessage() = QString("All AMBE devices released"); - - return 200; -} - -int WebAPIAdapter::instanceAMBEDevicesPut( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - DSPEngine *dspEngine = DSPEngine::instance(); - dspEngine->getAMBEEngine()->releaseAll(); - - QList *ambeList = query.getAmbeDevices(); - - for (QList::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it) { - dspEngine->getAMBEEngine()->registerController((*it)->getDeviceRef()->toStdString()); - } - - instanceAMBEDevicesGet(response, error); - return 200; -} - -int WebAPIAdapter::instanceAMBEDevicesPatch( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - DSPEngine *dspEngine = DSPEngine::instance(); - QList *ambeList = query.getAmbeDevices(); - - for (QList::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it) - { - if ((*it)->getDelete()) { - dspEngine->getAMBEEngine()->releaseController((*it)->getDeviceRef()->toStdString()); - } else { - dspEngine->getAMBEEngine()->registerController((*it)->getDeviceRef()->toStdString()); - } - } - - instanceAMBEDevicesGet(response, error); - return 200; -} - int WebAPIAdapter::instancePresetsGet( SWGSDRangel::SWGPresets& response, SWGSDRangel::SWGErrorResponse& error) diff --git a/sdrbase/webapi/webapiadapter.h b/sdrbase/webapi/webapiadapter.h index 22e6aaddb..efcc1a4d4 100644 --- a/sdrbase/webapi/webapiadapter.h +++ b/sdrbase/webapi/webapiadapter.h @@ -115,37 +115,6 @@ public: SWGSDRangel::SWGLocationInformation& response, SWGSDRangel::SWGErrorResponse& error); - virtual int instanceDVSerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceDVSerialPatch( - bool dvserial, - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBESerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBEDevicesGet( - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBEDevicesPut( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBEDevicesPatch( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBEDevicesDelete( - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error); - virtual int instancePresetsGet( SWGSDRangel::SWGPresets& response, SWGSDRangel::SWGErrorResponse& error); diff --git a/sdrbase/webapi/webapiadapterinterface.cpp b/sdrbase/webapi/webapiadapterinterface.cpp index 9c3e15048..125cc3e3e 100644 --- a/sdrbase/webapi/webapiadapterinterface.cpp +++ b/sdrbase/webapi/webapiadapterinterface.cpp @@ -31,8 +31,6 @@ QString WebAPIAdapterInterface::instanceAudioOutputParametersURL = "/sdrangel/au QString WebAPIAdapterInterface::instanceAudioInputCleanupURL = "/sdrangel/audio/input/cleanup"; QString WebAPIAdapterInterface::instanceAudioOutputCleanupURL = "/sdrangel/audio/output/cleanup"; QString WebAPIAdapterInterface::instanceLocationURL = "/sdrangel/location"; -QString WebAPIAdapterInterface::instanceAMBESerialURL = "/sdrangel/ambe/serial"; -QString WebAPIAdapterInterface::instanceAMBEDevicesURL = "/sdrangel/ambe/devices"; QString WebAPIAdapterInterface::instancePresetsURL = "/sdrangel/presets"; QString WebAPIAdapterInterface::instancePresetURL = "/sdrangel/preset"; QString WebAPIAdapterInterface::instancePresetFileURL = "/sdrangel/preset/file"; diff --git a/sdrbase/webapi/webapiadapterinterface.h b/sdrbase/webapi/webapiadapterinterface.h index 302dfb3c0..cd1862c6b 100644 --- a/sdrbase/webapi/webapiadapterinterface.h +++ b/sdrbase/webapi/webapiadapterinterface.h @@ -41,8 +41,6 @@ namespace SWGSDRangel class SWGAudioInputDevice; class SWGAudioOutputDevice; class SWGLocationInformation; - class SWGDVSerialDevices; - class SWGAMBEDevices; class SWGLimeRFEDevices; class SWGLimeRFESettings; class SWGLimeRFEPower; @@ -401,80 +399,6 @@ public: return 501; } - /** - * Handler of /sdrangel/ambe/serial (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBESerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - - /** - * Handler of /sdrangel/ambe/devices (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBEDevicesGet( - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - - /** - * Handler of /sdrangel/ambe/devices (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBEDevicesPut( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) query; - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - - /** - * Handler of /sdrangel/ambe/devices (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBEDevicesPatch( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) query; - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - - /** - * Handler of /sdrangel/ambe/devices (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBEDevicesDelete( - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - /** * Handler of /sdrangel/limerfe/serial (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels * returns the Http status code (default 501: not implemented) @@ -1770,8 +1694,6 @@ public: static QString instanceAudioInputCleanupURL; static QString instanceAudioOutputCleanupURL; static QString instanceLocationURL; - static QString instanceAMBESerialURL; - static QString instanceAMBEDevicesURL; static QString instancePresetsURL; static QString instancePresetURL; static QString instancePresetFileURL; diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 77ed69f22..291ccb590 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -33,7 +33,6 @@ #include "SWGInstanceFeaturesResponse.h" #include "SWGAudioDevices.h" #include "SWGLocationInformation.h" -#include "SWGDVSerialDevices.h" #include "SWGAMBEDevices.h" #include "SWGLimeRFEDevices.h" #include "SWGLimeRFESettings.h" @@ -138,10 +137,6 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http instanceAudioOutputCleanupService(request, response); } else if (path == WebAPIAdapterInterface::instanceLocationURL) { instanceLocationService(request, response); - } else if (path == WebAPIAdapterInterface::instanceAMBESerialURL) { - instanceAMBESerialService(request, response); - } else if (path == WebAPIAdapterInterface::instanceAMBEDevicesURL) { - instanceAMBEDevicesService(request, response); } else if (path == WebAPIAdapterInterface::instancePresetsURL) { instancePresetsService(request, response); } else if (path == WebAPIAdapterInterface::instancePresetURL) { @@ -799,118 +794,6 @@ void WebAPIRequestMapper::instanceLocationService(qtwebapp::HttpRequest& request } } -void WebAPIRequestMapper::instanceAMBESerialService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) -{ - SWGSDRangel::SWGErrorResponse errorResponse; - response.setHeader("Content-Type", "application/json"); - response.setHeader("Access-Control-Allow-Origin", "*"); - - if (request.getMethod() == "GET") - { - SWGSDRangel::SWGDVSerialDevices normalResponse; - - int status = m_adapter->instanceAMBESerialGet(normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(405,"Invalid HTTP method"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid HTTP method"; - response.write(errorResponse.asJson().toUtf8()); - } -} - -void WebAPIRequestMapper::instanceAMBEDevicesService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) -{ - SWGSDRangel::SWGErrorResponse errorResponse; - response.setHeader("Content-Type", "application/json"); - response.setHeader("Access-Control-Allow-Origin", "*"); - - if (request.getMethod() == "GET") - { - SWGSDRangel::SWGAMBEDevices normalResponse; - - int status = m_adapter->instanceAMBEDevicesGet(normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else if ((request.getMethod() == "PATCH") || (request.getMethod() == "PUT")) - { - SWGSDRangel::SWGAMBEDevices query; - SWGSDRangel::SWGAMBEDevices normalResponse; - QString jsonStr = request.getBody(); - QJsonObject jsonObject; - - if (parseJsonBody(jsonStr, jsonObject, response)) - { - if (validateAMBEDevices(query, jsonObject)) - { - int status; - - if (request.getMethod() == "PATCH") { - status = m_adapter->instanceAMBEDevicesPatch(query, normalResponse, errorResponse); - } else { - status = m_adapter->instanceAMBEDevicesPut(query, normalResponse, errorResponse); - } - - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"Invalid JSON request"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid JSON request"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"Invalid JSON format"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid JSON format"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else if (request.getMethod() == "DELETE") - { - SWGSDRangel::SWGSuccessResponse normalResponse; - - int status = m_adapter->instanceAMBEDevicesDelete(normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(405,"Invalid HTTP method"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid HTTP method"; - response.write(errorResponse.asJson().toUtf8()); - } -} - void WebAPIRequestMapper::instancePresetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) { SWGSDRangel::SWGErrorResponse errorResponse; @@ -4057,47 +3940,6 @@ bool WebAPIRequestMapper::validateAudioOutputDevice( return true; } -bool WebAPIRequestMapper::validateAMBEDevices(SWGSDRangel::SWGAMBEDevices& ambeDevices, QJsonObject& jsonObject) -{ - if (jsonObject.contains("nbDevices")) - { - int nbDevices = jsonObject["nbDevices"].toInt(); - - if (jsonObject.contains("ambeDevices")) - { - QJsonArray ambeDevicesJson = jsonObject["ambeDevices"].toArray(); - - if (nbDevices != ambeDevicesJson.size()) { - return false; - } - - ambeDevices.init(); - ambeDevices.setNbDevices(nbDevices); - QList *ambeList = ambeDevices.getAmbeDevices(); - - for (int i = 0; i < nbDevices; i++) - { - QJsonObject ambeDeviceJson = ambeDevicesJson.at(i).toObject(); - if (ambeDeviceJson.contains("deviceRef") && ambeDeviceJson.contains("delete")) - { - ambeList->push_back(new SWGSDRangel::SWGAMBEDevice()); - ambeList->back()->init(); - ambeList->back()->setDeviceRef(new QString(ambeDeviceJson["deviceRef"].toString())); - ambeList->back()->setDelete(ambeDeviceJson["delete"].toInt()); - } - else - { - return false; - } - } - - return true; - } - } - - return false; -} - bool WebAPIRequestMapper::validateSpectrumSettings(SWGSDRangel::SWGGLSpectrum& spectrumSettings, QJsonObject& jsonObject, QStringList& spectrumSettingsKeys) { extractKeys(jsonObject, spectrumSettingsKeys); diff --git a/sdrbase/webapi/webapirequestmapper.h b/sdrbase/webapi/webapirequestmapper.h index 2bf22e846..5c7f0dec8 100644 --- a/sdrbase/webapi/webapirequestmapper.h +++ b/sdrbase/webapi/webapirequestmapper.h @@ -66,9 +66,6 @@ private: void instanceAudioInputCleanupService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instanceAudioOutputCleanupService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instanceLocationService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceDVSerialService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceAMBESerialService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceAMBEDevicesService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instancePresetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instancePresetService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instancePresetFileService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); @@ -126,7 +123,6 @@ private: bool validateFeatureActions(SWGSDRangel::SWGFeatureActions& featureActions, QJsonObject& jsonObject, QStringList& featureActionsKeys); bool validateAudioInputDevice(SWGSDRangel::SWGAudioInputDevice& audioInputDevice, QJsonObject& jsonObject, QStringList& audioInputDeviceKeys); bool validateAudioOutputDevice(SWGSDRangel::SWGAudioOutputDevice& audioOutputDevice, QJsonObject& jsonObject, QStringList& audioOutputDeviceKeys); - bool validateAMBEDevices(SWGSDRangel::SWGAMBEDevices& ambeDevices, QJsonObject& jsonObject); bool validateConfig(SWGSDRangel::SWGInstanceConfigResponse& config, QJsonObject& jsonObject, WebAPIAdapterInterface::ConfigKeys& configKeys); bool validateWorkspaceInfo(SWGSDRangel::SWGWorkspaceInfo& workspaceInfo, QJsonObject& jsonObject); bool validateConfigurationIdentifier(SWGSDRangel::SWGConfigurationIdentifier& configurationIdentifier); diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index 70b12dfad..321c79e11 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -454,100 +454,6 @@ paths: "501": $ref: "#/responses/Response_501" - /sdrangel/ambe/serial: - x-swagger-router-controller: instance - get: - description: get a list of available DV serial devices - operationId: instanceAMBESerialGet - tags: - - Instance - responses: - "200": - description: On success return list of device paths possibly empty - schema: - $ref: "#/definitions/DVSerialDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/ambe/devices: - x-swagger-router-controller: instance - get: - description: get the list of AMBE devices (serial or address) used for AMBE frames decoding in digital voice modes - operationId: InstanceAMBEDevicesGet - tags: - - Instance - responses: - "200": - description: On success return list of devices possibly empty - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - put: - description: Replace the list of active devices - operationId: InstanceAMBEDevicesPut - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: List of AMBE devices (serial or address) - required: true - schema: - $ref: "#/definitions/AMBEDevices" - responses: - "200": - description: On success return list of devices - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - delete: - description: Emtpy the active devices thus effectively closing down AMBE devices support - operationId: InstanceAMBEDevicesDelete - tags: - - Instance - responses: - "200": - description: Success. - schema: - $ref: "#/definitions/SuccessResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - patch: - description: Add and/or delete devices to/from the active list - operationId: InstanceAMBEDevicesPatch - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: List of AMBE devices (serial or address) - required: true - schema: - $ref: "#/definitions/AMBEDevices" - responses: - "200": - description: On success return list of devices - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - /sdrangel/presets: x-swagger-router-controller: instance get: @@ -3311,51 +3217,6 @@ definitions: type: number format: float - DVSerialDevices: - description: "List of DV serial devices available in the system" - required: - - nbDevices - properties: - nbDevices: - description: "Number of DV serial devices" - type: integer - dvSerialDevices: - description: "Device names of DV serial devices" - type: array - items: - $ref: "#/definitions/DVSerialDevice" - - DVSerialDevice: - description: "DV serial device details" - properties: - deviceName: - description: "Name of the serial device in the system" - type: string - - AMBEDevices: - description: "List of AMBE devices (serial or server address)" - required: - - nbDevices - properties: - nbDevices: - description: "Number of DV serial devices" - type: integer - ambeDevices: - description: "List of AMBE devices" - type: array - items: - $ref: "#/definitions/AMBEDevice" - - AMBEDevice: - description: "AMBE devices active in the system" - properties: - deviceRef: - description: "Serial device name or server address" - type: string - delete: - description: "1 if device is to be removed from active list" - type: integer - LimeRFEDevices: description: "List of LimeRFE devices (serial or server address)" required: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index ea79bf8c3..136e97d20 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1253,7 +1253,7 @@ margin-bottom: 20px; "properties" : { "updateDevices" : { "description" : "Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing", - "$ref" : "#/definitions/AMBEDevices_2" + "$ref" : "#/definitions/AMBEDevices" }, "removeAll" : { "type" : "integer", @@ -1274,19 +1274,6 @@ margin-bottom: 20px; } }, "description" : "AMBE devices active in the system" -}; - defs.AMBEDevice_2 = { - "properties" : { - "deviceRef" : { - "type" : "string", - "description" : "Serial device name or server address" - }, - "delete" : { - "type" : "integer", - "description" : "1 if device is to be removed from active list" - } - }, - "description" : "AMBE devices active in the system" }; defs.AMBEDevices = { "required" : [ "nbDevices" ], @@ -1304,33 +1291,16 @@ margin-bottom: 20px; } }, "description" : "List of AMBE devices (serial or server address)" -}; - defs.AMBEDevices_2 = { - "required" : [ "nbDevices" ], - "properties" : { - "nbDevices" : { - "type" : "integer", - "description" : "Number of DV serial devices" - }, - "ambeDevices" : { - "type" : "array", - "description" : "List of AMBE devices", - "items" : { - "$ref" : "#/definitions/AMBEDevice" - } - } - }, - "description" : "List of AMBE devices (serial or server address)" }; defs.AMBEReport = { "properties" : { "serial" : { - "description" : "List of available DV serial devices", - "$ref" : "#/definitions/DVSerialDevices_2" + "description" : "List of AMBE serial devices in the system", + "$ref" : "#/definitions/DVSerialDevices" }, "devices" : { - "description" : "List of AMBE devices (serial or address) used for AMBE frames processing", - "$ref" : "#/definitions/AMBEDevices_2" + "description" : "List of AMBE devices or servers in use", + "$ref" : "#/definitions/AMBEDevices" } }, "description" : "AMBE" @@ -4711,15 +4681,6 @@ margin-bottom: 20px; } }, "description" : "DV serial device details" -}; - defs.DVSerialDevice_2 = { - "properties" : { - "deviceName" : { - "type" : "string", - "description" : "Name of the serial device in the system" - } - }, - "description" : "DV serial device details" }; defs.DVSerialDevices = { "required" : [ "nbDevices" ], @@ -4737,23 +4698,6 @@ margin-bottom: 20px; } }, "description" : "List of DV serial devices available in the system" -}; - defs.DVSerialDevices_2 = { - "required" : [ "nbDevices" ], - "properties" : { - "nbDevices" : { - "type" : "integer", - "description" : "Number of DV serial devices" - }, - "dvSerialDevices" : { - "type" : "array", - "description" : "Device names of DV serial devices", - "items" : { - "$ref" : "#/definitions/DVSerialDevice" - } - } - }, - "description" : "List of DV serial devices available in the system" }; defs.DemodAnalyzerSettings = { "properties" : { @@ -14837,21 +14781,6 @@ margin-bottom: 20px; featuresetPresetPut -
  • - instanceAMBEDevicesDelete -
  • -
  • - instanceAMBEDevicesGet -
  • -
  • - instanceAMBEDevicesPatch -
  • -
  • - instanceAMBEDevicesPut -
  • -
  • - instanceAMBESerialGet -
  • instanceAudioGet
  • @@ -38965,1785 +38894,6 @@ $(document).ready(function() {

    Instance

    -
    -
    -
    -

    instanceAMBEDevicesDelete

    -

    -
    -
    -
    -

    -

    Emtpy the active devices thus effectively closing down AMBE devices support

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X DELETE "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesDelete");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesDelete");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesDeleteWithCompletionHandler: 
    -              ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesDelete(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesDeleteExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesDelete: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesDelete();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesDelete: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesDelete();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesDelete: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_delete()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesDelete: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - Success.

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesGet

    -

    -
    -
    -
    -

    -

    get the list of AMBE devices (serial or address) used for AMBE frames decoding in digital voice modes

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesGetWithCompletionHandler: 
    -              ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of devices possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesPatch

    -

    -
    -
    -
    -

    -

    Add and/or delete devices to/from the active list

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PATCH "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPatch");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPatch");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    AMBEDevices *body = ; // List of AMBE devices (serial or address)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesPatchWith:body
    -              completionHandler: ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {AMBEDevices} List of AMBE devices (serial or address)
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesPatch(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesPatchExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new AMBEDevices(); // AMBEDevices | List of AMBE devices (serial or address)
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesPatch: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesPatch($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesPatch: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::AMBEDevices->new(); # AMBEDevices | List of AMBE devices (serial or address)
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesPatch(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesPatch: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # AMBEDevices | List of AMBE devices (serial or address)
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_patch(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesPatch: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - On success return list of devices

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesPut

    -

    -
    -
    -
    -

    -

    Replace the list of active devices

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PUT "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    AMBEDevices *body = ; // List of AMBE devices (serial or address)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesPutWith:body
    -              completionHandler: ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {AMBEDevices} List of AMBE devices (serial or address)
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesPut(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesPutExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new AMBEDevices(); // AMBEDevices | List of AMBE devices (serial or address)
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesPut: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesPut($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesPut: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::AMBEDevices->new(); # AMBEDevices | List of AMBE devices (serial or address)
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesPut(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesPut: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # AMBEDevices | List of AMBE devices (serial or address)
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_put(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesPut: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - On success return list of devices

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBESerialGet

    -

    -
    -
    -
    -

    -

    get a list of available DV serial devices

    -

    -
    -
    /sdrangel/ambe/serial
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/ambe/serial"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBESerialGetWithCompletionHandler: 
    -              ^(DVSerialDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBESerialGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBESerialGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBESerialGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBESerialGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBESerialGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBESerialGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBESerialGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_serial_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBESerialGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of device paths possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    @@ -57890,7 +56040,7 @@ except ApiException as e:
    - Generated 2022-05-24T21:52:35.030+02:00 + Generated 2022-05-24T23:13:14.725+02:00
    diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp index 4a6079e5f..3b1891dd0 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp @@ -40,7 +40,7 @@ SWGAMBEActions::~SWGAMBEActions() { void SWGAMBEActions::init() { - update_devices = new SWGAMBEDevices_2(); + update_devices = new SWGAMBEDevices(); m_update_devices_isSet = false; remove_all = 0; m_remove_all_isSet = false; @@ -65,7 +65,7 @@ SWGAMBEActions::fromJson(QString &json) { void SWGAMBEActions::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&update_devices, pJson["updateDevices"], "SWGAMBEDevices_2", "SWGAMBEDevices_2"); + ::SWGSDRangel::setValue(&update_devices, pJson["updateDevices"], "SWGAMBEDevices", "SWGAMBEDevices"); ::SWGSDRangel::setValue(&remove_all, pJson["removeAll"], "qint32", ""); @@ -86,7 +86,7 @@ QJsonObject* SWGAMBEActions::asJsonObject() { QJsonObject* obj = new QJsonObject(); if((update_devices != nullptr) && (update_devices->isSet())){ - toJsonValue(QString("updateDevices"), update_devices, obj, QString("SWGAMBEDevices_2")); + toJsonValue(QString("updateDevices"), update_devices, obj, QString("SWGAMBEDevices")); } if(m_remove_all_isSet){ obj->insert("removeAll", QJsonValue(remove_all)); @@ -95,12 +95,12 @@ SWGAMBEActions::asJsonObject() { return obj; } -SWGAMBEDevices_2* +SWGAMBEDevices* SWGAMBEActions::getUpdateDevices() { return update_devices; } void -SWGAMBEActions::setUpdateDevices(SWGAMBEDevices_2* update_devices) { +SWGAMBEActions::setUpdateDevices(SWGAMBEDevices* update_devices) { this->update_devices = update_devices; this->m_update_devices_isSet = true; } diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEActions.h b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.h index a742b6071..6ef64370d 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEActions.h +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.h @@ -22,7 +22,7 @@ #include -#include "SWGAMBEDevices_2.h" +#include "SWGAMBEDevices.h" #include "SWGObject.h" #include "export.h" @@ -42,8 +42,8 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGAMBEActions* fromJson(QString &jsonString) override; - SWGAMBEDevices_2* getUpdateDevices(); - void setUpdateDevices(SWGAMBEDevices_2* update_devices); + SWGAMBEDevices* getUpdateDevices(); + void setUpdateDevices(SWGAMBEDevices* update_devices); qint32 getRemoveAll(); void setRemoveAll(qint32 remove_all); @@ -52,7 +52,7 @@ public: virtual bool isSet() override; private: - SWGAMBEDevices_2* update_devices; + SWGAMBEDevices* update_devices; bool m_update_devices_isSet; qint32 remove_all; diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.cpp deleted file mode 100644 index 9cfff94c3..000000000 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/** - * SDRangel - * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- - * - * OpenAPI spec version: 7.0.0 - * Contact: f4exb06@gmail.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -#include "SWGAMBEDevice_2.h" - -#include "SWGHelpers.h" - -#include -#include -#include -#include - -namespace SWGSDRangel { - -SWGAMBEDevice_2::SWGAMBEDevice_2(QString* json) { - init(); - this->fromJson(*json); -} - -SWGAMBEDevice_2::SWGAMBEDevice_2() { - device_ref = nullptr; - m_device_ref_isSet = false; - _delete = 0; - m__delete_isSet = false; -} - -SWGAMBEDevice_2::~SWGAMBEDevice_2() { - this->cleanup(); -} - -void -SWGAMBEDevice_2::init() { - device_ref = new QString(""); - m_device_ref_isSet = false; - _delete = 0; - m__delete_isSet = false; -} - -void -SWGAMBEDevice_2::cleanup() { - if(device_ref != nullptr) { - delete device_ref; - } - -} - -SWGAMBEDevice_2* -SWGAMBEDevice_2::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; -} - -void -SWGAMBEDevice_2::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&device_ref, pJson["deviceRef"], "QString", "QString"); - - ::SWGSDRangel::setValue(&_delete, pJson["delete"], "qint32", ""); - -} - -QString -SWGAMBEDevice_2::asJson () -{ - QJsonObject* obj = this->asJsonObject(); - - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - delete obj; - return QString(bytes); -} - -QJsonObject* -SWGAMBEDevice_2::asJsonObject() { - QJsonObject* obj = new QJsonObject(); - if(device_ref != nullptr && *device_ref != QString("")){ - toJsonValue(QString("deviceRef"), device_ref, obj, QString("QString")); - } - if(m__delete_isSet){ - obj->insert("delete", QJsonValue(_delete)); - } - - return obj; -} - -QString* -SWGAMBEDevice_2::getDeviceRef() { - return device_ref; -} -void -SWGAMBEDevice_2::setDeviceRef(QString* device_ref) { - this->device_ref = device_ref; - this->m_device_ref_isSet = true; -} - -qint32 -SWGAMBEDevice_2::getDelete() { - return _delete; -} -void -SWGAMBEDevice_2::setDelete(qint32 _delete) { - this->_delete = _delete; - this->m__delete_isSet = true; -} - - -bool -SWGAMBEDevice_2::isSet(){ - bool isObjectUpdated = false; - do{ - if(device_ref && *device_ref != QString("")){ - isObjectUpdated = true; break; - } - if(m__delete_isSet){ - isObjectUpdated = true; break; - } - }while(false); - return isObjectUpdated; -} -} - diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.h b/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.h deleted file mode 100644 index 7decb9e28..000000000 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEDevice_2.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * SDRangel - * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- - * - * OpenAPI spec version: 7.0.0 - * Contact: f4exb06@gmail.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/* - * SWGAMBEDevice_2.h - * - * AMBE devices active in the system - */ - -#ifndef SWGAMBEDevice_2_H_ -#define SWGAMBEDevice_2_H_ - -#include - - -#include - -#include "SWGObject.h" -#include "export.h" - -namespace SWGSDRangel { - -class SWG_API SWGAMBEDevice_2: public SWGObject { -public: - SWGAMBEDevice_2(); - SWGAMBEDevice_2(QString* json); - virtual ~SWGAMBEDevice_2(); - void init(); - void cleanup(); - - virtual QString asJson () override; - virtual QJsonObject* asJsonObject() override; - virtual void fromJsonObject(QJsonObject &json) override; - virtual SWGAMBEDevice_2* fromJson(QString &jsonString) override; - - QString* getDeviceRef(); - void setDeviceRef(QString* device_ref); - - qint32 getDelete(); - void setDelete(qint32 _delete); - - - virtual bool isSet() override; - -private: - QString* device_ref; - bool m_device_ref_isSet; - - qint32 _delete; - bool m__delete_isSet; - -}; - -} - -#endif /* SWGAMBEDevice_2_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.cpp deleted file mode 100644 index e3b3935ab..000000000 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/** - * SDRangel - * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- - * - * OpenAPI spec version: 7.0.0 - * Contact: f4exb06@gmail.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -#include "SWGAMBEDevices_2.h" - -#include "SWGHelpers.h" - -#include -#include -#include -#include - -namespace SWGSDRangel { - -SWGAMBEDevices_2::SWGAMBEDevices_2(QString* json) { - init(); - this->fromJson(*json); -} - -SWGAMBEDevices_2::SWGAMBEDevices_2() { - nb_devices = 0; - m_nb_devices_isSet = false; - ambe_devices = nullptr; - m_ambe_devices_isSet = false; -} - -SWGAMBEDevices_2::~SWGAMBEDevices_2() { - this->cleanup(); -} - -void -SWGAMBEDevices_2::init() { - nb_devices = 0; - m_nb_devices_isSet = false; - ambe_devices = new QList(); - m_ambe_devices_isSet = false; -} - -void -SWGAMBEDevices_2::cleanup() { - - if(ambe_devices != nullptr) { - auto arr = ambe_devices; - for(auto o: *arr) { - delete o; - } - delete ambe_devices; - } -} - -SWGAMBEDevices_2* -SWGAMBEDevices_2::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; -} - -void -SWGAMBEDevices_2::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&nb_devices, pJson["nbDevices"], "qint32", ""); - - - ::SWGSDRangel::setValue(&ambe_devices, pJson["ambeDevices"], "QList", "SWGAMBEDevice"); -} - -QString -SWGAMBEDevices_2::asJson () -{ - QJsonObject* obj = this->asJsonObject(); - - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - delete obj; - return QString(bytes); -} - -QJsonObject* -SWGAMBEDevices_2::asJsonObject() { - QJsonObject* obj = new QJsonObject(); - if(m_nb_devices_isSet){ - obj->insert("nbDevices", QJsonValue(nb_devices)); - } - if(ambe_devices && ambe_devices->size() > 0){ - toJsonArray((QList*)ambe_devices, obj, "ambeDevices", "SWGAMBEDevice"); - } - - return obj; -} - -qint32 -SWGAMBEDevices_2::getNbDevices() { - return nb_devices; -} -void -SWGAMBEDevices_2::setNbDevices(qint32 nb_devices) { - this->nb_devices = nb_devices; - this->m_nb_devices_isSet = true; -} - -QList* -SWGAMBEDevices_2::getAmbeDevices() { - return ambe_devices; -} -void -SWGAMBEDevices_2::setAmbeDevices(QList* ambe_devices) { - this->ambe_devices = ambe_devices; - this->m_ambe_devices_isSet = true; -} - - -bool -SWGAMBEDevices_2::isSet(){ - bool isObjectUpdated = false; - do{ - if(m_nb_devices_isSet){ - isObjectUpdated = true; break; - } - if(ambe_devices && (ambe_devices->size() > 0)){ - isObjectUpdated = true; break; - } - }while(false); - return isObjectUpdated; -} -} - diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.h b/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.h deleted file mode 100644 index c60b61f99..000000000 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEDevices_2.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * SDRangel - * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- - * - * OpenAPI spec version: 7.0.0 - * Contact: f4exb06@gmail.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/* - * SWGAMBEDevices_2.h - * - * List of AMBE devices (serial or server address) - */ - -#ifndef SWGAMBEDevices_2_H_ -#define SWGAMBEDevices_2_H_ - -#include - - -#include "SWGAMBEDevice.h" -#include - -#include "SWGObject.h" -#include "export.h" - -namespace SWGSDRangel { - -class SWG_API SWGAMBEDevices_2: public SWGObject { -public: - SWGAMBEDevices_2(); - SWGAMBEDevices_2(QString* json); - virtual ~SWGAMBEDevices_2(); - void init(); - void cleanup(); - - virtual QString asJson () override; - virtual QJsonObject* asJsonObject() override; - virtual void fromJsonObject(QJsonObject &json) override; - virtual SWGAMBEDevices_2* fromJson(QString &jsonString) override; - - qint32 getNbDevices(); - void setNbDevices(qint32 nb_devices); - - QList* getAmbeDevices(); - void setAmbeDevices(QList* ambe_devices); - - - virtual bool isSet() override; - -private: - qint32 nb_devices; - bool m_nb_devices_isSet; - - QList* ambe_devices; - bool m_ambe_devices_isSet; - -}; - -} - -#endif /* SWGAMBEDevices_2_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp index 9f22650d4..a3b8c8fd7 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp @@ -40,9 +40,9 @@ SWGAMBEReport::~SWGAMBEReport() { void SWGAMBEReport::init() { - serial = new SWGDVSerialDevices_2(); + serial = new SWGDVSerialDevices(); m_serial_isSet = false; - devices = new SWGAMBEDevices_2(); + devices = new SWGAMBEDevices(); m_devices_isSet = false; } @@ -67,9 +67,9 @@ SWGAMBEReport::fromJson(QString &json) { void SWGAMBEReport::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&serial, pJson["serial"], "SWGDVSerialDevices_2", "SWGDVSerialDevices_2"); + ::SWGSDRangel::setValue(&serial, pJson["serial"], "SWGDVSerialDevices", "SWGDVSerialDevices"); - ::SWGSDRangel::setValue(&devices, pJson["devices"], "SWGAMBEDevices_2", "SWGAMBEDevices_2"); + ::SWGSDRangel::setValue(&devices, pJson["devices"], "SWGAMBEDevices", "SWGAMBEDevices"); } @@ -88,31 +88,31 @@ QJsonObject* SWGAMBEReport::asJsonObject() { QJsonObject* obj = new QJsonObject(); if((serial != nullptr) && (serial->isSet())){ - toJsonValue(QString("serial"), serial, obj, QString("SWGDVSerialDevices_2")); + toJsonValue(QString("serial"), serial, obj, QString("SWGDVSerialDevices")); } if((devices != nullptr) && (devices->isSet())){ - toJsonValue(QString("devices"), devices, obj, QString("SWGAMBEDevices_2")); + toJsonValue(QString("devices"), devices, obj, QString("SWGAMBEDevices")); } return obj; } -SWGDVSerialDevices_2* +SWGDVSerialDevices* SWGAMBEReport::getSerial() { return serial; } void -SWGAMBEReport::setSerial(SWGDVSerialDevices_2* serial) { +SWGAMBEReport::setSerial(SWGDVSerialDevices* serial) { this->serial = serial; this->m_serial_isSet = true; } -SWGAMBEDevices_2* +SWGAMBEDevices* SWGAMBEReport::getDevices() { return devices; } void -SWGAMBEReport::setDevices(SWGAMBEDevices_2* devices) { +SWGAMBEReport::setDevices(SWGAMBEDevices* devices) { this->devices = devices; this->m_devices_isSet = true; } diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h index 45f3f1d32..feef5985b 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h @@ -22,8 +22,8 @@ #include -#include "SWGAMBEDevices_2.h" -#include "SWGDVSerialDevices_2.h" +#include "SWGAMBEDevices.h" +#include "SWGDVSerialDevices.h" #include "SWGObject.h" #include "export.h" @@ -43,20 +43,20 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGAMBEReport* fromJson(QString &jsonString) override; - SWGDVSerialDevices_2* getSerial(); - void setSerial(SWGDVSerialDevices_2* serial); + SWGDVSerialDevices* getSerial(); + void setSerial(SWGDVSerialDevices* serial); - SWGAMBEDevices_2* getDevices(); - void setDevices(SWGAMBEDevices_2* devices); + SWGAMBEDevices* getDevices(); + void setDevices(SWGAMBEDevices* devices); virtual bool isSet() override; private: - SWGDVSerialDevices_2* serial; + SWGDVSerialDevices* serial; bool m_serial_isSet; - SWGAMBEDevices_2* devices; + SWGAMBEDevices* devices; bool m_devices_isSet; }; diff --git a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.cpp b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.cpp deleted file mode 100644 index 06bba95f3..000000000 --- a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/** - * SDRangel - * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- - * - * OpenAPI spec version: 7.0.0 - * Contact: f4exb06@gmail.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -#include "SWGDVSerialDevice_2.h" - -#include "SWGHelpers.h" - -#include -#include -#include -#include - -namespace SWGSDRangel { - -SWGDVSerialDevice_2::SWGDVSerialDevice_2(QString* json) { - init(); - this->fromJson(*json); -} - -SWGDVSerialDevice_2::SWGDVSerialDevice_2() { - device_name = nullptr; - m_device_name_isSet = false; -} - -SWGDVSerialDevice_2::~SWGDVSerialDevice_2() { - this->cleanup(); -} - -void -SWGDVSerialDevice_2::init() { - device_name = new QString(""); - m_device_name_isSet = false; -} - -void -SWGDVSerialDevice_2::cleanup() { - if(device_name != nullptr) { - delete device_name; - } -} - -SWGDVSerialDevice_2* -SWGDVSerialDevice_2::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; -} - -void -SWGDVSerialDevice_2::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&device_name, pJson["deviceName"], "QString", "QString"); - -} - -QString -SWGDVSerialDevice_2::asJson () -{ - QJsonObject* obj = this->asJsonObject(); - - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - delete obj; - return QString(bytes); -} - -QJsonObject* -SWGDVSerialDevice_2::asJsonObject() { - QJsonObject* obj = new QJsonObject(); - if(device_name != nullptr && *device_name != QString("")){ - toJsonValue(QString("deviceName"), device_name, obj, QString("QString")); - } - - return obj; -} - -QString* -SWGDVSerialDevice_2::getDeviceName() { - return device_name; -} -void -SWGDVSerialDevice_2::setDeviceName(QString* device_name) { - this->device_name = device_name; - this->m_device_name_isSet = true; -} - - -bool -SWGDVSerialDevice_2::isSet(){ - bool isObjectUpdated = false; - do{ - if(device_name && *device_name != QString("")){ - isObjectUpdated = true; break; - } - }while(false); - return isObjectUpdated; -} -} - diff --git a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.h b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.h deleted file mode 100644 index 92a21c6be..000000000 --- a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevice_2.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * SDRangel - * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- - * - * OpenAPI spec version: 7.0.0 - * Contact: f4exb06@gmail.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/* - * SWGDVSerialDevice_2.h - * - * DV serial device details - */ - -#ifndef SWGDVSerialDevice_2_H_ -#define SWGDVSerialDevice_2_H_ - -#include - - -#include - -#include "SWGObject.h" -#include "export.h" - -namespace SWGSDRangel { - -class SWG_API SWGDVSerialDevice_2: public SWGObject { -public: - SWGDVSerialDevice_2(); - SWGDVSerialDevice_2(QString* json); - virtual ~SWGDVSerialDevice_2(); - void init(); - void cleanup(); - - virtual QString asJson () override; - virtual QJsonObject* asJsonObject() override; - virtual void fromJsonObject(QJsonObject &json) override; - virtual SWGDVSerialDevice_2* fromJson(QString &jsonString) override; - - QString* getDeviceName(); - void setDeviceName(QString* device_name); - - - virtual bool isSet() override; - -private: - QString* device_name; - bool m_device_name_isSet; - -}; - -} - -#endif /* SWGDVSerialDevice_2_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.cpp b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.cpp deleted file mode 100644 index 18304ef01..000000000 --- a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/** - * SDRangel - * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- - * - * OpenAPI spec version: 7.0.0 - * Contact: f4exb06@gmail.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -#include "SWGDVSerialDevices_2.h" - -#include "SWGHelpers.h" - -#include -#include -#include -#include - -namespace SWGSDRangel { - -SWGDVSerialDevices_2::SWGDVSerialDevices_2(QString* json) { - init(); - this->fromJson(*json); -} - -SWGDVSerialDevices_2::SWGDVSerialDevices_2() { - nb_devices = 0; - m_nb_devices_isSet = false; - dv_serial_devices = nullptr; - m_dv_serial_devices_isSet = false; -} - -SWGDVSerialDevices_2::~SWGDVSerialDevices_2() { - this->cleanup(); -} - -void -SWGDVSerialDevices_2::init() { - nb_devices = 0; - m_nb_devices_isSet = false; - dv_serial_devices = new QList(); - m_dv_serial_devices_isSet = false; -} - -void -SWGDVSerialDevices_2::cleanup() { - - if(dv_serial_devices != nullptr) { - auto arr = dv_serial_devices; - for(auto o: *arr) { - delete o; - } - delete dv_serial_devices; - } -} - -SWGDVSerialDevices_2* -SWGDVSerialDevices_2::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; -} - -void -SWGDVSerialDevices_2::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&nb_devices, pJson["nbDevices"], "qint32", ""); - - - ::SWGSDRangel::setValue(&dv_serial_devices, pJson["dvSerialDevices"], "QList", "SWGDVSerialDevice"); -} - -QString -SWGDVSerialDevices_2::asJson () -{ - QJsonObject* obj = this->asJsonObject(); - - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - delete obj; - return QString(bytes); -} - -QJsonObject* -SWGDVSerialDevices_2::asJsonObject() { - QJsonObject* obj = new QJsonObject(); - if(m_nb_devices_isSet){ - obj->insert("nbDevices", QJsonValue(nb_devices)); - } - if(dv_serial_devices && dv_serial_devices->size() > 0){ - toJsonArray((QList*)dv_serial_devices, obj, "dvSerialDevices", "SWGDVSerialDevice"); - } - - return obj; -} - -qint32 -SWGDVSerialDevices_2::getNbDevices() { - return nb_devices; -} -void -SWGDVSerialDevices_2::setNbDevices(qint32 nb_devices) { - this->nb_devices = nb_devices; - this->m_nb_devices_isSet = true; -} - -QList* -SWGDVSerialDevices_2::getDvSerialDevices() { - return dv_serial_devices; -} -void -SWGDVSerialDevices_2::setDvSerialDevices(QList* dv_serial_devices) { - this->dv_serial_devices = dv_serial_devices; - this->m_dv_serial_devices_isSet = true; -} - - -bool -SWGDVSerialDevices_2::isSet(){ - bool isObjectUpdated = false; - do{ - if(m_nb_devices_isSet){ - isObjectUpdated = true; break; - } - if(dv_serial_devices && (dv_serial_devices->size() > 0)){ - isObjectUpdated = true; break; - } - }while(false); - return isObjectUpdated; -} -} - diff --git a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.h b/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.h deleted file mode 100644 index d0065a428..000000000 --- a/swagger/sdrangel/code/qt5/client/SWGDVSerialDevices_2.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * SDRangel - * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- - * - * OpenAPI spec version: 7.0.0 - * Contact: f4exb06@gmail.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/* - * SWGDVSerialDevices_2.h - * - * List of DV serial devices available in the system - */ - -#ifndef SWGDVSerialDevices_2_H_ -#define SWGDVSerialDevices_2_H_ - -#include - - -#include "SWGDVSerialDevice.h" -#include - -#include "SWGObject.h" -#include "export.h" - -namespace SWGSDRangel { - -class SWG_API SWGDVSerialDevices_2: public SWGObject { -public: - SWGDVSerialDevices_2(); - SWGDVSerialDevices_2(QString* json); - virtual ~SWGDVSerialDevices_2(); - void init(); - void cleanup(); - - virtual QString asJson () override; - virtual QJsonObject* asJsonObject() override; - virtual void fromJsonObject(QJsonObject &json) override; - virtual SWGDVSerialDevices_2* fromJson(QString &jsonString) override; - - qint32 getNbDevices(); - void setNbDevices(qint32 nb_devices); - - QList* getDvSerialDevices(); - void setDvSerialDevices(QList* dv_serial_devices); - - - virtual bool isSet() override; - -private: - qint32 nb_devices; - bool m_nb_devices_isSet; - - QList* dv_serial_devices; - bool m_dv_serial_devices_isSet; - -}; - -} - -#endif /* SWGDVSerialDevices_2_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp index ab13b9f45..08f2ff927 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp @@ -28,272 +28,6 @@ SWGInstanceApi::SWGInstanceApi(QString host, QString basePath) { this->basePath = basePath; } -void -SWGInstanceApi::instanceAMBEDevicesDelete() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/devices"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "DELETE"); - - - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBEDevicesDeleteCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBEDevicesDeleteCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGSuccessResponse* output = static_cast(create(json, QString("SWGSuccessResponse"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBEDevicesDeleteSignal(output); - } else { - emit instanceAMBEDevicesDeleteSignalE(output, error_type, error_str); - emit instanceAMBEDevicesDeleteSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceAMBEDevicesGet() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/devices"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "GET"); - - - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBEDevicesGetCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBEDevicesGetCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGAMBEDevices* output = static_cast(create(json, QString("SWGAMBEDevices"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBEDevicesGetSignal(output); - } else { - emit instanceAMBEDevicesGetSignalE(output, error_type, error_str); - emit instanceAMBEDevicesGetSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceAMBEDevicesPatch(SWGAMBEDevices& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/devices"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "PATCH"); - - - - QString output = body.asJson(); - input.request_body.append(output.toUtf8()); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBEDevicesPatchCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBEDevicesPatchCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGAMBEDevices* output = static_cast(create(json, QString("SWGAMBEDevices"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBEDevicesPatchSignal(output); - } else { - emit instanceAMBEDevicesPatchSignalE(output, error_type, error_str); - emit instanceAMBEDevicesPatchSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceAMBEDevicesPut(SWGAMBEDevices& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/devices"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "PUT"); - - - - QString output = body.asJson(); - input.request_body.append(output.toUtf8()); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBEDevicesPutCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBEDevicesPutCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGAMBEDevices* output = static_cast(create(json, QString("SWGAMBEDevices"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBEDevicesPutSignal(output); - } else { - emit instanceAMBEDevicesPutSignalE(output, error_type, error_str); - emit instanceAMBEDevicesPutSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceAMBESerialGet() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/serial"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "GET"); - - - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBESerialGetCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBESerialGetCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGDVSerialDevices* output = static_cast(create(json, QString("SWGDVSerialDevices"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBESerialGetSignal(output); - } else { - emit instanceAMBESerialGetSignalE(output, error_type, error_str); - emit instanceAMBESerialGetSignalEFull(worker, error_type, error_str); - } -} - void SWGInstanceApi::instanceAudioGet() { QString fullPath; diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h index 61a178a99..3ea0cb05d 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h @@ -15,7 +15,6 @@ #include "SWGHttpRequest.h" -#include "SWGAMBEDevices.h" #include "SWGAudioDevices.h" #include "SWGAudioInputDevice.h" #include "SWGAudioOutputDevice.h" @@ -23,7 +22,6 @@ #include "SWGConfigurationIdentifier.h" #include "SWGConfigurationImportExport.h" #include "SWGConfigurations.h" -#include "SWGDVSerialDevices.h" #include "SWGDeviceSetList.h" #include "SWGErrorResponse.h" #include "SWGFeaturePresetIdentifier.h" @@ -58,11 +56,6 @@ public: QString basePath; QMap defaultHeaders; - void instanceAMBEDevicesDelete(); - void instanceAMBEDevicesGet(); - void instanceAMBEDevicesPatch(SWGAMBEDevices& body); - void instanceAMBEDevicesPut(SWGAMBEDevices& body); - void instanceAMBESerialGet(); void instanceAudioGet(); void instanceAudioInputCleanupPatch(); void instanceAudioInputDelete(SWGAudioInputDevice& body); @@ -105,11 +98,6 @@ public: void instanceSummary(); private: - void instanceAMBEDevicesDeleteCallback (SWGHttpRequestWorker * worker); - void instanceAMBEDevicesGetCallback (SWGHttpRequestWorker * worker); - void instanceAMBEDevicesPatchCallback (SWGHttpRequestWorker * worker); - void instanceAMBEDevicesPutCallback (SWGHttpRequestWorker * worker); - void instanceAMBESerialGetCallback (SWGHttpRequestWorker * worker); void instanceAudioGetCallback (SWGHttpRequestWorker * worker); void instanceAudioInputCleanupPatchCallback (SWGHttpRequestWorker * worker); void instanceAudioInputDeleteCallback (SWGHttpRequestWorker * worker); @@ -152,11 +140,6 @@ private: void instanceSummaryCallback (SWGHttpRequestWorker * worker); signals: - void instanceAMBEDevicesDeleteSignal(SWGSuccessResponse* summary); - void instanceAMBEDevicesGetSignal(SWGAMBEDevices* summary); - void instanceAMBEDevicesPatchSignal(SWGAMBEDevices* summary); - void instanceAMBEDevicesPutSignal(SWGAMBEDevices* summary); - void instanceAMBESerialGetSignal(SWGDVSerialDevices* summary); void instanceAudioGetSignal(SWGAudioDevices* summary); void instanceAudioInputCleanupPatchSignal(SWGSuccessResponse* summary); void instanceAudioInputDeleteSignal(SWGAudioInputDevice* summary); @@ -198,11 +181,6 @@ signals: void instancePresetPutSignal(SWGPresetIdentifier* summary); void instanceSummarySignal(SWGInstanceSummaryResponse* summary); - void instanceAMBEDevicesDeleteSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesGetSignalE(SWGAMBEDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesPatchSignalE(SWGAMBEDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesPutSignalE(SWGAMBEDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBESerialGetSignalE(SWGDVSerialDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioGetSignalE(SWGAudioDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioInputCleanupPatchSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioInputDeleteSignalE(SWGAudioInputDevice* summary, QNetworkReply::NetworkError error_type, QString& error_str); @@ -244,11 +222,6 @@ signals: void instancePresetPutSignalE(SWGPresetIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceSummarySignalE(SWGInstanceSummaryResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBESerialGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioInputCleanupPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioInputDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 3d7f6bfc6..5d387a7fa 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -27,9 +27,7 @@ #include "SWGAISSettings.h" #include "SWGAMBEActions.h" #include "SWGAMBEDevice.h" -#include "SWGAMBEDevice_2.h" #include "SWGAMBEDevices.h" -#include "SWGAMBEDevices_2.h" #include "SWGAMBEReport.h" #include "SWGAMBESettings.h" #include "SWGAMDemodReport.h" @@ -99,9 +97,7 @@ #include "SWGDSDDemodReport.h" #include "SWGDSDDemodSettings.h" #include "SWGDVSerialDevice.h" -#include "SWGDVSerialDevice_2.h" #include "SWGDVSerialDevices.h" -#include "SWGDVSerialDevices_2.h" #include "SWGDemodAnalyzerSettings.h" #include "SWGDeviceActions.h" #include "SWGDeviceConfig.h" @@ -401,21 +397,11 @@ namespace SWGSDRangel { obj->init(); return obj; } - if(QString("SWGAMBEDevice_2").compare(type) == 0) { - SWGAMBEDevice_2 *obj = new SWGAMBEDevice_2(); - obj->init(); - return obj; - } if(QString("SWGAMBEDevices").compare(type) == 0) { SWGAMBEDevices *obj = new SWGAMBEDevices(); obj->init(); return obj; } - if(QString("SWGAMBEDevices_2").compare(type) == 0) { - SWGAMBEDevices_2 *obj = new SWGAMBEDevices_2(); - obj->init(); - return obj; - } if(QString("SWGAMBEReport").compare(type) == 0) { SWGAMBEReport *obj = new SWGAMBEReport(); obj->init(); @@ -761,21 +747,11 @@ namespace SWGSDRangel { obj->init(); return obj; } - if(QString("SWGDVSerialDevice_2").compare(type) == 0) { - SWGDVSerialDevice_2 *obj = new SWGDVSerialDevice_2(); - obj->init(); - return obj; - } if(QString("SWGDVSerialDevices").compare(type) == 0) { SWGDVSerialDevices *obj = new SWGDVSerialDevices(); obj->init(); return obj; } - if(QString("SWGDVSerialDevices_2").compare(type) == 0) { - SWGDVSerialDevices_2 *obj = new SWGDVSerialDevices_2(); - obj->init(); - return obj; - } if(QString("SWGDemodAnalyzerSettings").compare(type) == 0) { SWGDemodAnalyzerSettings *obj = new SWGDemodAnalyzerSettings(); obj->init();