diff --git a/sdrbase/resources/index.html b/sdrbase/resources/index.html index 08b494756..a985d113c 100644 --- a/sdrbase/resources/index.html +++ b/sdrbase/resources/index.html @@ -1187,6 +1187,12 @@ margin-bottom: 20px; +
  • + devicesetDevicePut +
  • +
  • + devicesetGet +
  • instanceAudioGet
  • @@ -1262,6 +1268,772 @@ margin-bottom: 20px;

    Default

    +
    +
    +
    +

    devicesetDevicePut

    +

    +
    +
    +
    +

    +

    Set the device used in the device set

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/device
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost:10010/sdrangel/deviceset/{deviceSetIndex}/device"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.DefaultApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DefaultApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DefaultApi apiInstance = new DefaultApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSet result = apiInstance.devicesetDevicePut(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#devicesetDevicePut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.DefaultApi;
    +
    +public class DefaultApiExample {
    +
    +    public static void main(String[] args) {
    +        DefaultApi apiInstance = new DefaultApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSet result = apiInstance.devicesetDevicePut(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#devicesetDevicePut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +
    +DefaultApi *apiInstance = [[DefaultApi alloc] init];
    +
    +[apiInstance devicesetDevicePutWith:deviceSetIndex
    +              completionHandler: ^(DeviceSet output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DefaultApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetDevicePut(deviceSetIndex, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class devicesetDevicePutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DefaultApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +
    +            try
    +            {
    +                DeviceSet result = apiInstance.devicesetDevicePut(deviceSetIndex);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DefaultApi.devicesetDevicePut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DefaultApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +
    +try {
    +    $result = $api_instance->devicesetDevicePut($deviceSetIndex);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DefaultApi->devicesetDevicePut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::DefaultApi;
    +
    +my $api_instance = WWW::SwaggerClient::DefaultApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +
    +eval { 
    +    my $result = $api_instance->devicesetDevicePut(deviceSetIndex => $deviceSetIndex);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DefaultApi->devicesetDevicePut: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.DefaultApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +
    +try: 
    +    api_response = api_instance.deviceset_device_put(deviceSetIndex)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DefaultApi->devicesetDevicePut: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 200 - On success return details on the device set

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

    Status: 404 - Invalid device set index or device not found

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    devicesetGet

    +

    +
    +
    +
    +

    +

    Get device set information

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://localhost:10010/sdrangel/deviceset/{deviceSetIndex}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.DefaultApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DefaultApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DefaultApi apiInstance = new DefaultApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSet result = apiInstance.devicesetGet(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#devicesetGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.DefaultApi;
    +
    +public class DefaultApiExample {
    +
    +    public static void main(String[] args) {
    +        DefaultApi apiInstance = new DefaultApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSet result = apiInstance.devicesetGet(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#devicesetGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +
    +DefaultApi *apiInstance = [[DefaultApi alloc] init];
    +
    +[apiInstance devicesetGetWith:deviceSetIndex
    +              completionHandler: ^(DeviceSet output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DefaultApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetGet(deviceSetIndex, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class devicesetGetExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DefaultApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +
    +            try
    +            {
    +                DeviceSet result = apiInstance.devicesetGet(deviceSetIndex);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DefaultApi.devicesetGet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DefaultApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +
    +try {
    +    $result = $api_instance->devicesetGet($deviceSetIndex);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DefaultApi->devicesetGet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::DefaultApi;
    +
    +my $api_instance = WWW::SwaggerClient::DefaultApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +
    +eval { 
    +    my $result = $api_instance->devicesetGet(deviceSetIndex => $deviceSetIndex);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DefaultApi->devicesetGet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.DefaultApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +
    +try: 
    +    api_response = api_instance.deviceset_get(deviceSetIndex)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DefaultApi->devicesetGet: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 200 - On success return details on the device set

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

    Status: 404 - Invalid index

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

    + + + +
    +
    + +
    +
    +
    @@ -2839,9 +3611,44 @@ except ApiException as e:

    Status: 404 - No more device sets to be deleted

    +
    +
    + +
    + +

    Status: 500 - Error

    @@ -7638,7 +8445,7 @@ except ApiException as e:
    - Generated 2017-11-25T22:31:12.548+01:00 + Generated 2017-11-26T00:25:44.253+01:00
    diff --git a/sdrbase/webapi/webapiadapterinterface.cpp b/sdrbase/webapi/webapiadapterinterface.cpp index 0f5807ea4..7958099b0 100644 --- a/sdrbase/webapi/webapiadapterinterface.cpp +++ b/sdrbase/webapi/webapiadapterinterface.cpp @@ -27,3 +27,6 @@ QString WebAPIAdapterInterface::instanceLocationURL = "/sdrangel/location"; QString WebAPIAdapterInterface::instanceDVSerialURL = "/sdrangel/dvserial"; QString WebAPIAdapterInterface::instancePresetURL = "/sdrangel/preset"; QString WebAPIAdapterInterface::instanceDeviceSetsURL = "/sdrangel/devicesets"; + +std::regex WebAPIAdapterInterface::devicesetURLRe("^/sdrangel/deviceset/([0-9]+)$"); +std::regex WebAPIAdapterInterface::devicesetDeviceURLRe("^/sdrangel/deviceset/([0-9]+)/device$"); diff --git a/sdrbase/webapi/webapiadapterinterface.h b/sdrbase/webapi/webapiadapterinterface.h index ffd8e8a13..c3417bbe0 100644 --- a/sdrbase/webapi/webapiadapterinterface.h +++ b/sdrbase/webapi/webapiadapterinterface.h @@ -20,6 +20,7 @@ #define SDRBASE_WEBAPI_WEBAPIADAPTERINTERFACE_H_ #include +#include namespace Swagger { @@ -223,6 +224,8 @@ public: static QString instanceDVSerialURL; static QString instancePresetURL; static QString instanceDeviceSetsURL; + static std::regex devicesetURLRe; + static std::regex devicesetDeviceURLRe; }; diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index 66feafa25..ed972ad4e 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -429,6 +429,59 @@ paths: $ref: "#/definitions/ErrorResponse" "501": description: Function not implemented + /sdrangel/deviceset/{deviceSetIndex}: + x-swagger-router-controller: deviceset + get: + description: Get device set information + operationId: devicesetGet + parameters: + - in: path + name: deviceSetIndex + type: integer + required: true + description: Index of device set in the device set list + responses: + "200": + description: On success return details on the device set + schema: + $ref: "#/definitions/DeviceSet" + "404": + description: Invalid index + schema: + $ref: "#/definitions/ErrorResponse" + "500": + description: Error + schema: + $ref: "#/definitions/ErrorResponse" + "501": + description: Function not implemented + /sdrangel/deviceset/{deviceSetIndex}/device: + x-swagger-router-controller: deviceset + put: + description: Set the device used in the device set + operationId: devicesetDevicePut + parameters: + - in: path + name: deviceSetIndex + type: integer + required: true + description: Index of device set in the device set list + responses: + "200": + description: On success return details on the device set + schema: + $ref: "#/definitions/DeviceSet" + "404": + description: Invalid device set index or device not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + description: Error + schema: + $ref: "#/definitions/ErrorResponse" + "501": + description: Function not implemented + /swagger: x-swagger-pipe: swagger_raw # complex objects have schema definitions diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 08b494756..a985d113c 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1187,6 +1187,12 @@ margin-bottom: 20px; +
  • + devicesetDevicePut +
  • +
  • + devicesetGet +
  • instanceAudioGet
  • @@ -1262,6 +1268,772 @@ margin-bottom: 20px;

    Default

    +
    +
    +
    +

    devicesetDevicePut

    +

    +
    +
    +
    +

    +

    Set the device used in the device set

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/device
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost:10010/sdrangel/deviceset/{deviceSetIndex}/device"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.DefaultApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DefaultApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DefaultApi apiInstance = new DefaultApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSet result = apiInstance.devicesetDevicePut(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#devicesetDevicePut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.DefaultApi;
    +
    +public class DefaultApiExample {
    +
    +    public static void main(String[] args) {
    +        DefaultApi apiInstance = new DefaultApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSet result = apiInstance.devicesetDevicePut(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#devicesetDevicePut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +
    +DefaultApi *apiInstance = [[DefaultApi alloc] init];
    +
    +[apiInstance devicesetDevicePutWith:deviceSetIndex
    +              completionHandler: ^(DeviceSet output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DefaultApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetDevicePut(deviceSetIndex, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class devicesetDevicePutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DefaultApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +
    +            try
    +            {
    +                DeviceSet result = apiInstance.devicesetDevicePut(deviceSetIndex);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DefaultApi.devicesetDevicePut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DefaultApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +
    +try {
    +    $result = $api_instance->devicesetDevicePut($deviceSetIndex);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DefaultApi->devicesetDevicePut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::DefaultApi;
    +
    +my $api_instance = WWW::SwaggerClient::DefaultApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +
    +eval { 
    +    my $result = $api_instance->devicesetDevicePut(deviceSetIndex => $deviceSetIndex);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DefaultApi->devicesetDevicePut: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.DefaultApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +
    +try: 
    +    api_response = api_instance.deviceset_device_put(deviceSetIndex)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DefaultApi->devicesetDevicePut: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 200 - On success return details on the device set

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

    Status: 404 - Invalid device set index or device not found

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    devicesetGet

    +

    +
    +
    +
    +

    +

    Get device set information

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://localhost:10010/sdrangel/deviceset/{deviceSetIndex}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.DefaultApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DefaultApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DefaultApi apiInstance = new DefaultApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSet result = apiInstance.devicesetGet(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#devicesetGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.DefaultApi;
    +
    +public class DefaultApiExample {
    +
    +    public static void main(String[] args) {
    +        DefaultApi apiInstance = new DefaultApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        try {
    +            DeviceSet result = apiInstance.devicesetGet(deviceSetIndex);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#devicesetGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +
    +DefaultApi *apiInstance = [[DefaultApi alloc] init];
    +
    +[apiInstance devicesetGetWith:deviceSetIndex
    +              completionHandler: ^(DeviceSet output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DefaultApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetGet(deviceSetIndex, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class devicesetGetExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DefaultApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +
    +            try
    +            {
    +                DeviceSet result = apiInstance.devicesetGet(deviceSetIndex);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DefaultApi.devicesetGet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DefaultApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +
    +try {
    +    $result = $api_instance->devicesetGet($deviceSetIndex);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DefaultApi->devicesetGet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::DefaultApi;
    +
    +my $api_instance = WWW::SwaggerClient::DefaultApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +
    +eval { 
    +    my $result = $api_instance->devicesetGet(deviceSetIndex => $deviceSetIndex);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DefaultApi->devicesetGet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.DefaultApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +
    +try: 
    +    api_response = api_instance.deviceset_get(deviceSetIndex)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DefaultApi->devicesetGet: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 200 - On success return details on the device set

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

    Status: 404 - Invalid index

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

    + + + +
    +
    + +
    +
    +
    @@ -2839,9 +3611,44 @@ except ApiException as e:

    Status: 404 - No more device sets to be deleted

    +
    +
    + +
    + +

    Status: 500 - Error

    @@ -7638,7 +8445,7 @@ except ApiException as e:
    - Generated 2017-11-25T22:31:12.548+01:00 + Generated 2017-11-26T00:25:44.253+01:00
    diff --git a/swagger/sdrangel/code/qt5/client/SWGDefaultApi.cpp b/swagger/sdrangel/code/qt5/client/SWGDefaultApi.cpp index edfb05228..593bdd3d0 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDefaultApi.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDefaultApi.cpp @@ -28,6 +28,106 @@ SWGDefaultApi::SWGDefaultApi(QString host, QString basePath) { this->basePath = basePath; } +void +SWGDefaultApi::devicesetDevicePut(qint32 device_set_index) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device"); + + QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}"); + fullPath.replace(device_set_indexPathParam, stringValue(device_set_index)); + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "PUT"); + + + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGDefaultApi::devicesetDevicePutCallback); + + worker->execute(&input); +} + +void +SWGDefaultApi::devicesetDevicePutCallback(HttpRequestWorker * 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); + SWGDeviceSet* output = static_cast(create(json, QString("SWGDeviceSet"))); + worker->deleteLater(); + + emit devicesetDevicePutSignal(output); + emit devicesetDevicePutSignalE(output, error_type, error_str); +} + +void +SWGDefaultApi::devicesetGet(qint32 device_set_index) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}"); + + QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}"); + fullPath.replace(device_set_indexPathParam, stringValue(device_set_index)); + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "GET"); + + + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGDefaultApi::devicesetGetCallback); + + worker->execute(&input); +} + +void +SWGDefaultApi::devicesetGetCallback(HttpRequestWorker * 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); + SWGDeviceSet* output = static_cast(create(json, QString("SWGDeviceSet"))); + worker->deleteLater(); + + emit devicesetGetSignal(output); + emit devicesetGetSignalE(output, error_type, error_str); +} + void SWGDefaultApi::instanceAudioGet() { QString fullPath; diff --git a/swagger/sdrangel/code/qt5/client/SWGDefaultApi.h b/swagger/sdrangel/code/qt5/client/SWGDefaultApi.h index 364803ca8..7d34dc72a 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDefaultApi.h +++ b/swagger/sdrangel/code/qt5/client/SWGDefaultApi.h @@ -46,6 +46,8 @@ public: QString basePath; QMap defaultHeaders; + void devicesetDevicePut(qint32 device_set_index); + void devicesetGet(qint32 device_set_index); void instanceAudioGet(); void instanceAudioPatch(SWGAudioDevicesSelect body); void instanceChannels(qint32 tx); @@ -66,6 +68,8 @@ public: void instanceSummary(); private: + void devicesetDevicePutCallback (HttpRequestWorker * worker); + void devicesetGetCallback (HttpRequestWorker * worker); void instanceAudioGetCallback (HttpRequestWorker * worker); void instanceAudioPatchCallback (HttpRequestWorker * worker); void instanceChannelsCallback (HttpRequestWorker * worker); @@ -86,6 +90,8 @@ private: void instanceSummaryCallback (HttpRequestWorker * worker); signals: + void devicesetDevicePutSignal(SWGDeviceSet* summary); + void devicesetGetSignal(SWGDeviceSet* summary); void instanceAudioGetSignal(SWGAudioDevices* summary); void instanceAudioPatchSignal(SWGAudioDevicesSelect* summary); void instanceChannelsSignal(SWGInstanceChannelsResponse* summary); @@ -105,6 +111,8 @@ signals: void instancePresetPutSignal(SWGPresetIdentifier* summary); void instanceSummarySignal(SWGInstanceSummaryResponse* summary); + void devicesetDevicePutSignalE(SWGDeviceSet* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void devicesetGetSignalE(SWGDeviceSet* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioGetSignalE(SWGAudioDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioPatchSignalE(SWGAudioDevicesSelect* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceChannelsSignalE(SWGInstanceChannelsResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);