diff --git a/sdrbase/resources/index.html b/sdrbase/resources/index.html index fef38669e..b8d11c92f 100644 --- a/sdrbase/resources/index.html +++ b/sdrbase/resources/index.html @@ -1630,15 +1630,15 @@ margin-bottom: 20px;
  • instanceDelete
  • -
  • - instanceDeviceSetsDelete +
  • + instanceDeviceSetDelete +
  • +
  • + instanceDeviceSetPost
  • instanceDeviceSetsGet
  • -
  • - instanceDeviceSetsPost -
  • instanceDevices
  • @@ -9683,10 +9683,10 @@ except ApiException as e:
    -
    -
    +
    +
    -

    instanceDeviceSetsDelete

    +

    instanceDeviceSetDelete

    @@ -9695,29 +9695,29 @@ except ApiException as e:

    Remove last device set. The GUI version does not remove the first device.


    -
    /sdrangel/devicesets
    +
    /sdrangel/deviceset

    Usage and SDK Samples

    -
    -
    curl -X DELETE "http://localhost:8091/sdrangel/devicesets"
    +
    +
    curl -X DELETE "http://localhost:8091/sdrangel/deviceset"
    -
    +
    import SWGSDRangel.*;
     import SWGSDRangel.auth.*;
     import SWGSDRangel.model.*;
    @@ -9732,17 +9732,17 @@ public class InstanceApiExample {
             
             InstanceApi apiInstance = new InstanceApi();
             try {
    -            SuccessResponse result = apiInstance.instanceDeviceSetsDelete();
    +            SuccessResponse result = apiInstance.instanceDeviceSetDelete();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceDeviceSetsDelete");
    +            System.err.println("Exception when calling InstanceApi#instanceDeviceSetDelete");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    import SWGSDRangel.api.InstanceApi;
     
     public class InstanceApiExample {
    @@ -9750,24 +9750,24 @@ public class InstanceApiExample {
         public static void main(String[] args) {
             InstanceApi apiInstance = new InstanceApi();
             try {
    -            SuccessResponse result = apiInstance.instanceDeviceSetsDelete();
    +            SuccessResponse result = apiInstance.instanceDeviceSetDelete();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceDeviceSetsDelete");
    +            System.err.println("Exception when calling InstanceApi#instanceDeviceSetDelete");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    
     InstanceApi *apiInstance = [[InstanceApi alloc] init];
     
    -[apiInstance instanceDeviceSetsDeleteWithCompletionHandler: 
    +[apiInstance instanceDeviceSetDeleteWithCompletionHandler: 
                   ^(SuccessResponse output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
    @@ -9779,7 +9779,7 @@ InstanceApi *apiInstance = [[InstanceApi alloc] init];
     
    -
    +
    var SdRangel = require('sd_rangel');
     
     var api = new SdRangel.InstanceApi()
    @@ -9791,14 +9791,14 @@ var callback = function(error, data, response) {
         console.log('API called successfully. Returned data: ' + data);
       }
     };
    -api.instanceDeviceSetsDelete(callback);
    +api.instanceDeviceSetDelete(callback);
     
    - -
    +
    using System;
     using System.Diagnostics;
     using SWGSDRangel.Api;
    @@ -9807,7 +9807,7 @@ using SWGSDRangel.Model;
     
     namespace Example
     {
    -    public class instanceDeviceSetsDeleteExample
    +    public class instanceDeviceSetDeleteExample
         {
             public void main()
             {
    @@ -9816,12 +9816,12 @@ namespace Example
     
                 try
                 {
    -                SuccessResponse result = apiInstance.instanceDeviceSetsDelete();
    +                SuccessResponse result = apiInstance.instanceDeviceSetDelete();
                     Debug.WriteLine(result);
                 }
                 catch (Exception e)
                 {
    -                Debug.Print("Exception when calling InstanceApi.instanceDeviceSetsDelete: " + e.Message );
    +                Debug.Print("Exception when calling InstanceApi.instanceDeviceSetDelete: " + e.Message );
                 }
             }
         }
    @@ -9829,22 +9829,22 @@ namespace Example
     
    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\InstanceApi();
     
     try {
    -    $result = $api_instance->instanceDeviceSetsDelete();
    +    $result = $api_instance->instanceDeviceSetDelete();
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceDeviceSetsDelete: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling InstanceApi->instanceDeviceSetDelete: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use SWGSDRangel::Configuration;
     use SWGSDRangel::InstanceApi;
    @@ -9852,15 +9852,15 @@ use SWGSDRangel::InstanceApi;
     my $api_instance = SWGSDRangel::InstanceApi->new();
     
     eval { 
    -    my $result = $api_instance->instanceDeviceSetsDelete();
    +    my $result = $api_instance->instanceDeviceSetDelete();
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling InstanceApi->instanceDeviceSetsDelete: $@\n";
    +    warn "Exception when calling InstanceApi->instanceDeviceSetDelete: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_sdrangel
    @@ -9871,10 +9871,10 @@ from pprint import pprint
     api_instance = swagger_sdrangel.InstanceApi()
     
     try: 
    -    api_response = api_instance.instance_device_sets_delete()
    +    api_response = api_instance.instance_device_set_delete()
         pprint(api_response)
     except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceDeviceSetsDelete: %s\n" % e)
    + print("Exception when calling InstanceApi->instanceDeviceSetDelete: %s\n" % e)
    @@ -9890,14 +9890,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +
    @@ -9933,14 +9933,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +
    @@ -9976,14 +9976,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +
    @@ -10019,14 +10019,14 @@ except ApiException as e:
    -
    -
    +
    +
    - + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceDeviceSetPost

    +

    +
    +
    +
    +

    +

    Add (append) a new device set with default values

    +

    +
    +
    /sdrangel/deviceset
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost:8091/sdrangel/deviceset?tx="
    +
    +
    +
    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();
    +        Integer tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    +        try {
    +            SuccessResponse result = apiInstance.instanceDeviceSetPost(tx);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceDeviceSetPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        Integer tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    +        try {
    +            SuccessResponse result = apiInstance.instanceDeviceSetPost(tx);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceDeviceSetPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *tx = 56; // Set to non zero (true) for a Tx device set (default Rx) (optional)
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceDeviceSetPostWith:tx
    +              completionHandler: ^(SuccessResponse output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var opts = { 
    +  'tx': 56 // {Integer} Set to non zero (true) for a Tx device set (default Rx)
    +};
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceDeviceSetPost(opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceDeviceSetPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var tx = 56;  // Integer | Set to non zero (true) for a Tx device set (default Rx) (optional) 
    +
    +            try
    +            {
    +                SuccessResponse result = apiInstance.instanceDeviceSetPost(tx);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceDeviceSetPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    +
    +try {
    +    $result = $api_instance->instanceDeviceSetPost($tx);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceDeviceSetPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $tx = 56; # Integer | Set to non zero (true) for a Tx device set (default Rx)
    +
    +eval { 
    +    my $result = $api_instance->instanceDeviceSetPost(tx => $tx);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceDeviceSetPost: $@\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()
    +tx = 56 # Integer | Set to non zero (true) for a Tx device set (default Rx) (optional)
    +
    +try: 
    +    api_response = api_instance.instance_device_set_post(tx=tx)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceDeviceSetPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + + + +
    Query parameters
    + + + + + + + + + +
    NameDescription
    tx + + +
    +
    +
    + + Integer + + +
    + Set to non zero (true) for a Tx device set (default Rx) +
    +
    +
    +
    +
    + +

    Responses

    +

    Status: 202 - Message to add a new device set was sent successfully

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    +
    @@ -10396,379 +10769,6 @@ except ApiException as e:

    -
    -
    -
    -

    instanceDeviceSetsPost

    -

    -
    -
    -
    -

    -

    Add (append) a new device set with default values

    -

    -
    -
    /sdrangel/devicesets
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X POST "http://localhost:8091/sdrangel/devicesets?tx="
    -
    -
    -
    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();
    -        Integer tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    -        try {
    -            SuccessResponse result = apiInstance.instanceDeviceSetsPost(tx);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceDeviceSetsPost");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        Integer tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    -        try {
    -            SuccessResponse result = apiInstance.instanceDeviceSetsPost(tx);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceDeviceSetsPost");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    Integer *tx = 56; // Set to non zero (true) for a Tx device set (default Rx) (optional)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceDeviceSetsPostWith:tx
    -              completionHandler: ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var opts = { 
    -  'tx': 56 // {Integer} Set to non zero (true) for a Tx device set (default Rx)
    -};
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceDeviceSetsPost(opts, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceDeviceSetsPostExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var tx = 56;  // Integer | Set to non zero (true) for a Tx device set (default Rx) (optional) 
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceDeviceSetsPost(tx);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceDeviceSetsPost: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    -
    -try {
    -    $result = $api_instance->instanceDeviceSetsPost($tx);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceDeviceSetsPost: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $tx = 56; # Integer | Set to non zero (true) for a Tx device set (default Rx)
    -
    -eval { 
    -    my $result = $api_instance->instanceDeviceSetsPost(tx => $tx);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceDeviceSetsPost: $@\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()
    -tx = 56 # Integer | Set to non zero (true) for a Tx device set (default Rx) (optional)
    -
    -try: 
    -    api_response = api_instance.instance_device_sets_post(tx=tx)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceDeviceSetsPost: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - -
    Query parameters
    - - - - - - - - - -
    NameDescription
    tx - - -
    -
    -
    - - Integer - - -
    - Set to non zero (true) for a Tx device set (default Rx) -
    -
    -
    -
    -
    - -

    Responses

    -

    Status: 202 - Message to add a new device set was sent successfully

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    @@ -16202,7 +16202,7 @@ except ApiException as e:
    - Generated 2017-12-21T22:33:40.914+01:00 + Generated 2017-12-22T01:05:47.414+01:00
    diff --git a/sdrbase/webapi/webapiadapterinterface.cpp b/sdrbase/webapi/webapiadapterinterface.cpp index 3096754d5..54990d0de 100644 --- a/sdrbase/webapi/webapiadapterinterface.cpp +++ b/sdrbase/webapi/webapiadapterinterface.cpp @@ -29,6 +29,7 @@ QString WebAPIAdapterInterface::instancePresetsURL = "/sdrangel/presets"; QString WebAPIAdapterInterface::instancePresetURL = "/sdrangel/preset"; QString WebAPIAdapterInterface::instancePresetFileURL = "/sdrangel/preset/file"; QString WebAPIAdapterInterface::instanceDeviceSetsURL = "/sdrangel/devicesets"; +QString WebAPIAdapterInterface::instanceDeviceSetURL = "/sdrangel/deviceset"; std::regex WebAPIAdapterInterface::devicesetURLRe("^/sdrangel/deviceset/([0-9]{1,2})$"); std::regex WebAPIAdapterInterface::devicesetDeviceURLRe("^/sdrangel/deviceset/([0-9]{1,2})/device$"); diff --git a/sdrbase/webapi/webapiadapterinterface.h b/sdrbase/webapi/webapiadapterinterface.h index 6964c9981..47113db0e 100644 --- a/sdrbase/webapi/webapiadapterinterface.h +++ b/sdrbase/webapi/webapiadapterinterface.h @@ -309,10 +309,10 @@ public: } /** - * Handler of /sdrangel/devicesets (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * Handler of /sdrangel/deviceset (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels * returns the Http status code (default 501: not implemented) */ - virtual int instanceDeviceSetsPost( + virtual int instanceDeviceSetPost( bool tx __attribute__((unused)), SWGSDRangel::SWGSuccessResponse& response __attribute__((unused)), SWGSDRangel::SWGErrorResponse& error) @@ -323,10 +323,10 @@ public: } /** - * Handler of /sdrangel/devicesets (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * Handler of /sdrangel/deviceset (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels * returns the Http status code (default 501: not implemented) */ - virtual int instanceDeviceSetsDelete( + virtual int instanceDeviceSetDelete( SWGSDRangel::SWGSuccessResponse& response __attribute__((unused)), SWGSDRangel::SWGErrorResponse& error) { @@ -506,6 +506,7 @@ public: static QString instancePresetURL; static QString instancePresetFileURL; static QString instanceDeviceSetsURL; + static QString instanceDeviceSetURL; static std::regex devicesetURLRe; static std::regex devicesetDeviceURLRe; static std::regex devicesetDeviceSettingsURLRe; diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 50dfef189..a3396b8bf 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -90,6 +90,8 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http instancePresetFileService(request, response); } else if (path == WebAPIAdapterInterface::instanceDeviceSetsURL) { instanceDeviceSetsService(request, response); + } else if (path == WebAPIAdapterInterface::instanceDeviceSetURL) { + instanceDeviceSetService(request, response); } else { @@ -715,7 +717,21 @@ void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& reque response.write(errorResponse.asJson().toUtf8()); } } - else if (request.getMethod() == "POST") + else + { + response.setStatus(405,"Invalid HTTP method"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid HTTP method"; + response.write(errorResponse.asJson().toUtf8()); + } +} + +void WebAPIRequestMapper::instanceDeviceSetService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) +{ + SWGSDRangel::SWGErrorResponse errorResponse; + response.setHeader("Content-Type", "application/json"); + + if (request.getMethod() == "POST") { SWGSDRangel::SWGSuccessResponse normalResponse; QByteArray txStr = request.getParameter("tx"); @@ -725,7 +741,7 @@ void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& reque tx = !(txStr == "0"); } - int status = m_adapter->instanceDeviceSetsPost(tx, normalResponse, errorResponse); + int status = m_adapter->instanceDeviceSetPost(tx, normalResponse, errorResponse); response.setStatus(status); if (status/100 == 2) { @@ -737,7 +753,7 @@ void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& reque else if (request.getMethod() == "DELETE") { SWGSDRangel::SWGSuccessResponse normalResponse; - int status = m_adapter->instanceDeviceSetsDelete(normalResponse, errorResponse); + int status = m_adapter->instanceDeviceSetDelete(normalResponse, errorResponse); response.setStatus(status); if (status/100 == 2) { diff --git a/sdrbase/webapi/webapirequestmapper.h b/sdrbase/webapi/webapirequestmapper.h index dec8004b0..54b6de536 100644 --- a/sdrbase/webapi/webapirequestmapper.h +++ b/sdrbase/webapi/webapirequestmapper.h @@ -56,6 +56,7 @@ private: void instancePresetService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instancePresetFileService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instanceDeviceSetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); + void instanceDeviceSetService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void devicesetService(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void devicesetDeviceService(const std::string& indexStr, qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); diff --git a/sdrgui/webapi/webapiadaptergui.cpp b/sdrgui/webapi/webapiadaptergui.cpp index 795642e70..6e28edba6 100644 --- a/sdrgui/webapi/webapiadaptergui.cpp +++ b/sdrgui/webapi/webapiadaptergui.cpp @@ -560,7 +560,7 @@ int WebAPIAdapterGUI::instanceDeviceSetsGet( return 200; } -int WebAPIAdapterGUI::instanceDeviceSetsPost( +int WebAPIAdapterGUI::instanceDeviceSetPost( bool tx, SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGErrorResponse& error __attribute__((unused))) @@ -574,7 +574,7 @@ int WebAPIAdapterGUI::instanceDeviceSetsPost( return 202; } -int WebAPIAdapterGUI::instanceDeviceSetsDelete( +int WebAPIAdapterGUI::instanceDeviceSetDelete( SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGErrorResponse& error) { diff --git a/sdrgui/webapi/webapiadaptergui.h b/sdrgui/webapi/webapiadaptergui.h index 8242228ef..6135f6b59 100644 --- a/sdrgui/webapi/webapiadaptergui.h +++ b/sdrgui/webapi/webapiadaptergui.h @@ -101,12 +101,12 @@ public: SWGSDRangel::SWGDeviceSetList& response, SWGSDRangel::SWGErrorResponse& error); - virtual int instanceDeviceSetsPost( + virtual int instanceDeviceSetPost( bool tx, SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGErrorResponse& error); - virtual int instanceDeviceSetsDelete( + virtual int instanceDeviceSetDelete( SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGErrorResponse& error); diff --git a/sdrsrv/webapi/webapiadaptersrv.cpp b/sdrsrv/webapi/webapiadaptersrv.cpp index ec49f9758..ac3dc5e9e 100644 --- a/sdrsrv/webapi/webapiadaptersrv.cpp +++ b/sdrsrv/webapi/webapiadaptersrv.cpp @@ -688,7 +688,7 @@ int WebAPIAdapterSrv::instanceDeviceSetsGet( return 200; } -int WebAPIAdapterSrv::instanceDeviceSetsPost( +int WebAPIAdapterSrv::instanceDeviceSetPost( bool tx, SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGErrorResponse& error __attribute__((unused))) @@ -702,7 +702,7 @@ int WebAPIAdapterSrv::instanceDeviceSetsPost( return 202; } -int WebAPIAdapterSrv::instanceDeviceSetsDelete( +int WebAPIAdapterSrv::instanceDeviceSetDelete( SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGErrorResponse& error) { diff --git a/sdrsrv/webapi/webapiadaptersrv.h b/sdrsrv/webapi/webapiadaptersrv.h index 9c3d244e7..f5d4919c3 100644 --- a/sdrsrv/webapi/webapiadaptersrv.h +++ b/sdrsrv/webapi/webapiadaptersrv.h @@ -116,12 +116,12 @@ public: SWGSDRangel::SWGDeviceSetList& response, SWGSDRangel::SWGErrorResponse& error); - virtual int instanceDeviceSetsPost( + virtual int instanceDeviceSetPost( bool tx, SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGErrorResponse& error); - virtual int instanceDeviceSetsDelete( + virtual int instanceDeviceSetDelete( SWGSDRangel::SWGSuccessResponse& response, SWGSDRangel::SWGErrorResponse& error); diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index 57e1ec68e..68a52dee1 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -499,9 +499,12 @@ paths: $ref: "#/responses/Response_500" "501": $ref: "#/responses/Response_501" + + /sdrangel/deviceset: + x-swagger-router-controller: instance post: description: Add (append) a new device set with default values - operationId: instanceDeviceSetsPost + operationId: instanceDeviceSetPost tags: - Instance parameters: @@ -521,7 +524,7 @@ paths: $ref: "#/responses/Response_501" delete: description: Remove last device set. The GUI version does not remove the first device. - operationId: instanceDeviceSetsDelete + operationId: instanceDeviceSetDelete tags: - Instance responses: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index fef38669e..b8d11c92f 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1630,15 +1630,15 @@ margin-bottom: 20px;
  • instanceDelete
  • -
  • - instanceDeviceSetsDelete +
  • + instanceDeviceSetDelete +
  • +
  • + instanceDeviceSetPost
  • instanceDeviceSetsGet
  • -
  • - instanceDeviceSetsPost -
  • instanceDevices
  • @@ -9683,10 +9683,10 @@ except ApiException as e:

    -
    -
    +
    +
    -

    instanceDeviceSetsDelete

    +

    instanceDeviceSetDelete

    @@ -9695,29 +9695,29 @@ except ApiException as e:

    Remove last device set. The GUI version does not remove the first device.


    -
    /sdrangel/devicesets
    +
    /sdrangel/deviceset

    Usage and SDK Samples

    -
    -
    curl -X DELETE "http://localhost:8091/sdrangel/devicesets"
    +
    +
    curl -X DELETE "http://localhost:8091/sdrangel/deviceset"
    -
    +
    import SWGSDRangel.*;
     import SWGSDRangel.auth.*;
     import SWGSDRangel.model.*;
    @@ -9732,17 +9732,17 @@ public class InstanceApiExample {
             
             InstanceApi apiInstance = new InstanceApi();
             try {
    -            SuccessResponse result = apiInstance.instanceDeviceSetsDelete();
    +            SuccessResponse result = apiInstance.instanceDeviceSetDelete();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceDeviceSetsDelete");
    +            System.err.println("Exception when calling InstanceApi#instanceDeviceSetDelete");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    import SWGSDRangel.api.InstanceApi;
     
     public class InstanceApiExample {
    @@ -9750,24 +9750,24 @@ public class InstanceApiExample {
         public static void main(String[] args) {
             InstanceApi apiInstance = new InstanceApi();
             try {
    -            SuccessResponse result = apiInstance.instanceDeviceSetsDelete();
    +            SuccessResponse result = apiInstance.instanceDeviceSetDelete();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceDeviceSetsDelete");
    +            System.err.println("Exception when calling InstanceApi#instanceDeviceSetDelete");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    
     InstanceApi *apiInstance = [[InstanceApi alloc] init];
     
    -[apiInstance instanceDeviceSetsDeleteWithCompletionHandler: 
    +[apiInstance instanceDeviceSetDeleteWithCompletionHandler: 
                   ^(SuccessResponse output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
    @@ -9779,7 +9779,7 @@ InstanceApi *apiInstance = [[InstanceApi alloc] init];
     
    -
    +
    var SdRangel = require('sd_rangel');
     
     var api = new SdRangel.InstanceApi()
    @@ -9791,14 +9791,14 @@ var callback = function(error, data, response) {
         console.log('API called successfully. Returned data: ' + data);
       }
     };
    -api.instanceDeviceSetsDelete(callback);
    +api.instanceDeviceSetDelete(callback);
     
    - -
    +
    using System;
     using System.Diagnostics;
     using SWGSDRangel.Api;
    @@ -9807,7 +9807,7 @@ using SWGSDRangel.Model;
     
     namespace Example
     {
    -    public class instanceDeviceSetsDeleteExample
    +    public class instanceDeviceSetDeleteExample
         {
             public void main()
             {
    @@ -9816,12 +9816,12 @@ namespace Example
     
                 try
                 {
    -                SuccessResponse result = apiInstance.instanceDeviceSetsDelete();
    +                SuccessResponse result = apiInstance.instanceDeviceSetDelete();
                     Debug.WriteLine(result);
                 }
                 catch (Exception e)
                 {
    -                Debug.Print("Exception when calling InstanceApi.instanceDeviceSetsDelete: " + e.Message );
    +                Debug.Print("Exception when calling InstanceApi.instanceDeviceSetDelete: " + e.Message );
                 }
             }
         }
    @@ -9829,22 +9829,22 @@ namespace Example
     
    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\InstanceApi();
     
     try {
    -    $result = $api_instance->instanceDeviceSetsDelete();
    +    $result = $api_instance->instanceDeviceSetDelete();
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceDeviceSetsDelete: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling InstanceApi->instanceDeviceSetDelete: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use SWGSDRangel::Configuration;
     use SWGSDRangel::InstanceApi;
    @@ -9852,15 +9852,15 @@ use SWGSDRangel::InstanceApi;
     my $api_instance = SWGSDRangel::InstanceApi->new();
     
     eval { 
    -    my $result = $api_instance->instanceDeviceSetsDelete();
    +    my $result = $api_instance->instanceDeviceSetDelete();
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling InstanceApi->instanceDeviceSetsDelete: $@\n";
    +    warn "Exception when calling InstanceApi->instanceDeviceSetDelete: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_sdrangel
    @@ -9871,10 +9871,10 @@ from pprint import pprint
     api_instance = swagger_sdrangel.InstanceApi()
     
     try: 
    -    api_response = api_instance.instance_device_sets_delete()
    +    api_response = api_instance.instance_device_set_delete()
         pprint(api_response)
     except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceDeviceSetsDelete: %s\n" % e)
    + print("Exception when calling InstanceApi->instanceDeviceSetDelete: %s\n" % e)
    @@ -9890,14 +9890,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +
    @@ -9933,14 +9933,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +
    @@ -9976,14 +9976,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +
    @@ -10019,14 +10019,14 @@ except ApiException as e:
    -
    -
    +
    +
    - + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceDeviceSetPost

    +

    +
    +
    +
    +

    +

    Add (append) a new device set with default values

    +

    +
    +
    /sdrangel/deviceset
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost:8091/sdrangel/deviceset?tx="
    +
    +
    +
    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();
    +        Integer tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    +        try {
    +            SuccessResponse result = apiInstance.instanceDeviceSetPost(tx);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceDeviceSetPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        Integer tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    +        try {
    +            SuccessResponse result = apiInstance.instanceDeviceSetPost(tx);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceDeviceSetPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *tx = 56; // Set to non zero (true) for a Tx device set (default Rx) (optional)
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceDeviceSetPostWith:tx
    +              completionHandler: ^(SuccessResponse output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var opts = { 
    +  'tx': 56 // {Integer} Set to non zero (true) for a Tx device set (default Rx)
    +};
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceDeviceSetPost(opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceDeviceSetPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var tx = 56;  // Integer | Set to non zero (true) for a Tx device set (default Rx) (optional) 
    +
    +            try
    +            {
    +                SuccessResponse result = apiInstance.instanceDeviceSetPost(tx);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceDeviceSetPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    +
    +try {
    +    $result = $api_instance->instanceDeviceSetPost($tx);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceDeviceSetPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $tx = 56; # Integer | Set to non zero (true) for a Tx device set (default Rx)
    +
    +eval { 
    +    my $result = $api_instance->instanceDeviceSetPost(tx => $tx);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceDeviceSetPost: $@\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()
    +tx = 56 # Integer | Set to non zero (true) for a Tx device set (default Rx) (optional)
    +
    +try: 
    +    api_response = api_instance.instance_device_set_post(tx=tx)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceDeviceSetPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + + + +
    Query parameters
    + + + + + + + + + +
    NameDescription
    tx + + +
    +
    +
    + + Integer + + +
    + Set to non zero (true) for a Tx device set (default Rx) +
    +
    +
    +
    +
    + +

    Responses

    +

    Status: 202 - Message to add a new device set was sent successfully

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    +
    @@ -10396,379 +10769,6 @@ except ApiException as e:

    -
    -
    -
    -

    instanceDeviceSetsPost

    -

    -
    -
    -
    -

    -

    Add (append) a new device set with default values

    -

    -
    -
    /sdrangel/devicesets
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X POST "http://localhost:8091/sdrangel/devicesets?tx="
    -
    -
    -
    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();
    -        Integer tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    -        try {
    -            SuccessResponse result = apiInstance.instanceDeviceSetsPost(tx);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceDeviceSetsPost");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        Integer tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    -        try {
    -            SuccessResponse result = apiInstance.instanceDeviceSetsPost(tx);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceDeviceSetsPost");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    Integer *tx = 56; // Set to non zero (true) for a Tx device set (default Rx) (optional)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceDeviceSetsPostWith:tx
    -              completionHandler: ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var opts = { 
    -  'tx': 56 // {Integer} Set to non zero (true) for a Tx device set (default Rx)
    -};
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceDeviceSetsPost(opts, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceDeviceSetsPostExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var tx = 56;  // Integer | Set to non zero (true) for a Tx device set (default Rx) (optional) 
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceDeviceSetsPost(tx);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceDeviceSetsPost: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$tx = 56; // Integer | Set to non zero (true) for a Tx device set (default Rx)
    -
    -try {
    -    $result = $api_instance->instanceDeviceSetsPost($tx);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceDeviceSetsPost: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $tx = 56; # Integer | Set to non zero (true) for a Tx device set (default Rx)
    -
    -eval { 
    -    my $result = $api_instance->instanceDeviceSetsPost(tx => $tx);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceDeviceSetsPost: $@\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()
    -tx = 56 # Integer | Set to non zero (true) for a Tx device set (default Rx) (optional)
    -
    -try: 
    -    api_response = api_instance.instance_device_sets_post(tx=tx)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceDeviceSetsPost: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - -
    Query parameters
    - - - - - - - - - -
    NameDescription
    tx - - -
    -
    -
    - - Integer - - -
    - Set to non zero (true) for a Tx device set (default Rx) -
    -
    -
    -
    -
    - -

    Responses

    -

    Status: 202 - Message to add a new device set was sent successfully

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    @@ -16202,7 +16202,7 @@ except ApiException as e:
    - Generated 2017-12-21T22:33:40.914+01:00 + Generated 2017-12-22T01:05:47.414+01:00
    diff --git a/swagger/sdrangel/examples/Readme.md b/swagger/sdrangel/examples/Readme.md index cbf779af5..e50d1dd92 100644 --- a/swagger/sdrangel/examples/Readme.md +++ b/swagger/sdrangel/examples/Readme.md @@ -25,8 +25,8 @@ It uses the following APIs: - URI: `/sdrangel/preset` - HTTP method: `PATCH` - To create a new device set: - - OperationID: `instanceDeviceSetsPost` - - URI: `/sdrangel/devicesets` + - OperationID: `instanceDeviceSetPost` + - URI: `/sdrangel/deviceset` - HTTP method: `POST` - Activate the DV serial dongle support for digital voice modes - OperationID: `instanceDVSerialPatch` @@ -44,8 +44,8 @@ Create a Tx device set with a LimeSDR Tx device and a NFM modulator channel conf It uses the following APIs: - To create a new device set: - - OperationID: `instanceDeviceSetsPost` - - URI: `/sdrangel/devicesets` + - OperationID: `instanceDeviceSetPost` + - URI: `/sdrangel/deviceset` - HTTP method: `POST` - To select a device in a device set: - Operation ID: `devicesetDevicePut` diff --git a/swagger/sdrangel/examples/devicesets_config.py b/swagger/sdrangel/examples/devicesets_config.py index edb97634e..a867ca7d1 100644 --- a/swagger/sdrangel/examples/devicesets_config.py +++ b/swagger/sdrangel/examples/devicesets_config.py @@ -14,10 +14,10 @@ base_url = "http://127.0.0.1:8091/sdrangel" commands = [ ["/deviceset/0/device", "PUT", None, {"hwType": "BladeRF"}, "setup BladeRF on Rx 0"], ["/preset", "PATCH", None, {"deviceSetIndex": 0, "preset": {"groupName": "OM144", "centerFrequency": 145640000, "type": "R", "name": "Repeaters extended"}}, "load preset on Rx 0"], - ["/devicesets", "POST", None, None, "add Rx 1 device set"], + ["/deviceset", "POST", None, None, "add Rx 1 device set"], ["/deviceset/1/device", "PUT", None, {"hwType": "SDRdaemonSource"}, "setup SDRdaemonSource on Rx 1"], ["/preset", "PATCH", None, {"deviceSetIndex": 1, "preset": {"groupName": "OM430", "centerFrequency": 439550000, "type": "R", "name": "F5ZKP Daemon RPi3 SUSE"}}, "load preset on Rx 1"], - ["/devicesets", "POST", None, None, "add Rx 2 device set"], + ["/deviceset", "POST", None, None, "add Rx 2 device set"], ["/deviceset/2/device", "PUT", None, {"hwType": "SDRplay1"}, "setup SDRplay on Rx 2"], ["/preset", "PATCH", None, {"deviceSetIndex": 2, "preset": {"groupName": "40m", "centerFrequency": 7130000, "type": "R", "name": "SSB low"}}, "load preset on Rx 2"], ["/dvserial", "PATCH", {"dvserial": 1}, None, "set DV serial processing for AMBE frames decoding"], diff --git a/swagger/sdrangel/examples/limesdr_tx.py b/swagger/sdrangel/examples/limesdr_tx.py index 606624b58..e5787a9aa 100644 --- a/swagger/sdrangel/examples/limesdr_tx.py +++ b/swagger/sdrangel/examples/limesdr_tx.py @@ -57,7 +57,7 @@ def main(): global base_url base_url = "http://%s/sdrangel" % options.address - r = callAPI("/devicesets", "POST", {"tx": 1}, None, "Add Tx device set") + r = callAPI("/deviceset", "POST", {"tx": 1}, None, "Add Tx device set") if r is None: exit(-1) diff --git a/swagger/sdrangel/examples/nfm_test.py b/swagger/sdrangel/examples/nfm_test.py index 25196a915..febbd1a8e 100644 --- a/swagger/sdrangel/examples/nfm_test.py +++ b/swagger/sdrangel/examples/nfm_test.py @@ -68,7 +68,7 @@ def main(): if r is None: exit(-1) - r = callAPI("/devicesets", "POST", {"tx": 1}, None, "Add Tx device set") + r = callAPI("/deviceset", "POST", {"tx": 1}, None, "Add Tx device set") if r is None: exit(-1)