diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 3fadfd089..eaf1e78c0 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -2040,6 +2040,32 @@ margin-bottom: 20px; } }, "description" : "Channel summarized information" +}; + defs.ChannelActions = { + "required" : [ "channelType", "direction" ], + "discriminator" : "channelType", + "properties" : { + "channelType" : { + "type" : "string", + "description" : "Channel type code" + }, + "direction" : { + "type" : "integer", + "description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" + }, + "originatorDeviceSetIndex" : { + "type" : "integer", + "description" : "Optional for reverse API. This is the device set index from where the message comes from." + }, + "originatorChannelIndex" : { + "type" : "integer", + "description" : "Optional for reverse API. This is the channel index from where the message comes from." + }, + "FileSourceActions" : { + "$ref" : "#/definitions/FileSourceActions" + } + }, + "description" : "Base channel actions. Only the channel actions corresponding to the channel specified in the channelType field is or should be present." }; defs.ChannelAnalyzerSettings = { "properties" : { @@ -3014,6 +3040,28 @@ margin-bottom: 20px; } }, "description" : "List of DV serial devices available in the system" +}; + defs.DeviceActions = { + "required" : [ "deviceHwType", "direction" ], + "discriminator" : "deviceHwType", + "properties" : { + "deviceHwType" : { + "type" : "string", + "description" : "Device hardware type code" + }, + "direction" : { + "type" : "integer", + "description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" + }, + "originatorIndex" : { + "type" : "integer", + "description" : "Optional for reverse API. This is the device set index from where the message comes from." + }, + "rtlSdrActions" : { + "$ref" : "#/definitions/RtlSdrActions" + } + }, + "description" : "Base device actions. Only the device actions corresponding to the device specified in the deviceHwType field is or should be present." }; defs.DeviceConfig = { "properties" : { @@ -3545,6 +3593,15 @@ margin-bottom: 20px; } }, "description" : "FileInput" +}; + defs.FileSourceActions = { + "properties" : { + "play" : { + "type" : "integer", + "description" : "Play or Pause stream\n * 0 - Pause\n * 1 - Play\n" + } + }, + "description" : "FileSource" }; defs.FileSourceReport = { "properties" : { @@ -5995,6 +6052,15 @@ margin-bottom: 20px; } }, "description" : "Remote channel source settings" +}; + defs.RtlSdrActions = { + "properties" : { + "record" : { + "type" : "integer", + "description" : "Record IQ stream action\n * 0 - stop recording\n * 1 - start recording\n" + } + }, + "description" : "RTLSDR" }; defs.RtlSdrReport = { "properties" : { @@ -7772,6 +7838,13 @@ margin-bottom: 20px;
  • instanceDeviceSetPost
  • + +
  • + devicesetChannelActionsPost +
  • +
  • + devicesetDeviceActionsPost +
  • instanceAMBEDevicesDelete @@ -18502,6 +18575,1068 @@ except ApiException as e:
    +
    +

    Deviceset

    +
    +
    +
    +

    devicesetChannelActionsPost

    +

    +
    +
    +
    +

    +

    post an action or actions on a channel

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/actions
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/actions"
    +
    +
    +
    import SWGSDRangel.*;
    +import SWGSDRangel.auth.*;
    +import SWGSDRangel.model.*;
    +import SWGSDRangel.api.DevicesetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DevicesetApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DevicesetApi apiInstance = new DevicesetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        Integer channelIndex = 56; // Integer | Index of the channel in the channels list for this device set
    +        ChannelActions body = ; // ChannelActions | Action(s) to apply to the channel
    +        try {
    +            SuccessResponse result = apiInstance.devicesetChannelActionsPost(deviceSetIndex, channelIndex, body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DevicesetApi#devicesetChannelActionsPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.DevicesetApi;
    +
    +public class DevicesetApiExample {
    +
    +    public static void main(String[] args) {
    +        DevicesetApi apiInstance = new DevicesetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        Integer channelIndex = 56; // Integer | Index of the channel in the channels list for this device set
    +        ChannelActions body = ; // ChannelActions | Action(s) to apply to the channel
    +        try {
    +            SuccessResponse result = apiInstance.devicesetChannelActionsPost(deviceSetIndex, channelIndex, body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DevicesetApi#devicesetChannelActionsPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +Integer *channelIndex = 56; // Index of the channel in the channels list for this device set
    +ChannelActions *body = ; // Action(s) to apply to the channel
    +
    +DevicesetApi *apiInstance = [[DevicesetApi alloc] init];
    +
    +[apiInstance devicesetChannelActionsPostWith:deviceSetIndex
    +    channelIndex:channelIndex
    +    body:body
    +              completionHandler: ^(SuccessResponse output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DevicesetApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +var channelIndex = 56; // {Integer} Index of the channel in the channels list for this device set
    +
    +var body = ; // {ChannelActions} Action(s) to apply to the channel
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetChannelActionsPost(deviceSetIndex, channelIndex, body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class devicesetChannelActionsPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DevicesetApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +            var channelIndex = 56;  // Integer | Index of the channel in the channels list for this device set
    +            var body = new ChannelActions(); // ChannelActions | Action(s) to apply to the channel
    +
    +            try
    +            {
    +                SuccessResponse result = apiInstance.devicesetChannelActionsPost(deviceSetIndex, channelIndex, body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DevicesetApi.devicesetChannelActionsPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DevicesetApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +$channelIndex = 56; // Integer | Index of the channel in the channels list for this device set
    +$body = ; // ChannelActions | Action(s) to apply to the channel
    +
    +try {
    +    $result = $api_instance->devicesetChannelActionsPost($deviceSetIndex, $channelIndex, $body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DevicesetApi->devicesetChannelActionsPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::DevicesetApi;
    +
    +my $api_instance = SWGSDRangel::DevicesetApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +my $channelIndex = 56; # Integer | Index of the channel in the channels list for this device set
    +my $body = SWGSDRangel::Object::ChannelActions->new(); # ChannelActions | Action(s) to apply to the channel
    +
    +eval { 
    +    my $result = $api_instance->devicesetChannelActionsPost(deviceSetIndex => $deviceSetIndex, channelIndex => $channelIndex, body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DevicesetApi->devicesetChannelActionsPost: $@\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.DevicesetApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +channelIndex = 56 # Integer | Index of the channel in the channels list for this device set
    +body =  # ChannelActions | Action(s) to apply to the channel
    +
    +try: 
    +    api_response = api_instance.deviceset_channel_actions_post(deviceSetIndex, channelIndex, body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DevicesetApi->devicesetChannelActionsPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    channelIndex* + + +
    +
    +
    + + Integer + + +
    + Index of the channel in the channels list for this device set +
    +
    +
    + Required +
    +
    +
    +
    + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - Message to perform action was sent successfully

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

    Status: 400 - Invalid device set or channel index

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

    Status: 404 - Device or channel not found

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    devicesetDeviceActionsPost

    +

    +
    +
    +
    +

    +

    post an action on a device

    +

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

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/deviceset/{deviceSetIndex}/device/actions"
    +
    +
    +
    import SWGSDRangel.*;
    +import SWGSDRangel.auth.*;
    +import SWGSDRangel.model.*;
    +import SWGSDRangel.api.DevicesetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DevicesetApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DevicesetApi apiInstance = new DevicesetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        DeviceActions body = ; // DeviceActions | Action(s) to apply to the device
    +        try {
    +            SuccessResponse result = apiInstance.devicesetDeviceActionsPost(deviceSetIndex, body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DevicesetApi#devicesetDeviceActionsPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.DevicesetApi;
    +
    +public class DevicesetApiExample {
    +
    +    public static void main(String[] args) {
    +        DevicesetApi apiInstance = new DevicesetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        DeviceActions body = ; // DeviceActions | Action(s) to apply to the device
    +        try {
    +            SuccessResponse result = apiInstance.devicesetDeviceActionsPost(deviceSetIndex, body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DevicesetApi#devicesetDeviceActionsPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +DeviceActions *body = ; // Action(s) to apply to the device
    +
    +DevicesetApi *apiInstance = [[DevicesetApi alloc] init];
    +
    +[apiInstance devicesetDeviceActionsPostWith:deviceSetIndex
    +    body:body
    +              completionHandler: ^(SuccessResponse output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DevicesetApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +var body = ; // {DeviceActions} Action(s) to apply to the device
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetDeviceActionsPost(deviceSetIndex, body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class devicesetDeviceActionsPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DevicesetApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +            var body = new DeviceActions(); // DeviceActions | Action(s) to apply to the device
    +
    +            try
    +            {
    +                SuccessResponse result = apiInstance.devicesetDeviceActionsPost(deviceSetIndex, body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DevicesetApi.devicesetDeviceActionsPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DevicesetApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +$body = ; // DeviceActions | Action(s) to apply to the device
    +
    +try {
    +    $result = $api_instance->devicesetDeviceActionsPost($deviceSetIndex, $body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DevicesetApi->devicesetDeviceActionsPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::DevicesetApi;
    +
    +my $api_instance = SWGSDRangel::DevicesetApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +my $body = SWGSDRangel::Object::DeviceActions->new(); # DeviceActions | Action(s) to apply to the device
    +
    +eval { 
    +    my $result = $api_instance->devicesetDeviceActionsPost(deviceSetIndex => $deviceSetIndex, body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DevicesetApi->devicesetDeviceActionsPost: $@\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.DevicesetApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +body =  # DeviceActions | Action(s) to apply to the device
    +
    +try: 
    +    api_response = api_instance.deviceset_device_actions_post(deviceSetIndex, body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DevicesetApi->devicesetDeviceActionsPost: %s\n" % e)
    +
    +
    + +

    Parameters

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

    Responses

    +

    Status: 202 - Message to perform action was sent successfully

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

    Status: 400 - Invalid device set index

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

    Status: 404 - Device not found

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    Instance

    @@ -32624,7 +33759,7 @@ except ApiException as e:
    - Generated 2020-03-08T20:37:07.112+01:00 + Generated 2020-03-08T23:59:21.736+01:00
    diff --git a/sdrbase/resources/webapi/doc/swagger/include/ChannelActions.yaml b/sdrbase/resources/webapi/doc/swagger/include/ChannelActions.yaml new file mode 100644 index 000000000..1c384737a --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/ChannelActions.yaml @@ -0,0 +1,21 @@ +ChannelActions: + description: Base channel actions. Only the channel actions corresponding to the channel specified in the channelType field is or should be present. + discriminator: channelType + required: + - channelType + - direction + properties: + channelType: + description: Channel type code + type: string + direction: + description: 0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0) + type: integer + originatorDeviceSetIndex: + description: Optional for reverse API. This is the device set index from where the message comes from. + type: integer + originatorChannelIndex: + description: Optional for reverse API. This is the channel index from where the message comes from. + type: integer + FileSourceActions: + $ref: "/doc/swagger/include/FileSource.yaml#/FileSourceActions" diff --git a/sdrbase/resources/webapi/doc/swagger/include/DeviceActions.yaml b/sdrbase/resources/webapi/doc/swagger/include/DeviceActions.yaml new file mode 100644 index 000000000..7083bedaa --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/DeviceActions.yaml @@ -0,0 +1,18 @@ +DeviceActions: + description: Base device actions. Only the device actions corresponding to the device specified in the deviceHwType field is or should be present. + discriminator: deviceHwType + required: + - deviceHwType + - direction + properties: + deviceHwType: + description: Device hardware type code + type: string + direction: + description: 0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0) + type: integer + originatorIndex: + description: Optional for reverse API. This is the device set index from where the message comes from. + type: integer + rtlSdrActions: + $ref: "/doc/swagger/include/RtlSdr.yaml#/RtlSdrActions" diff --git a/sdrbase/resources/webapi/doc/swagger/include/FileSource.yaml b/sdrbase/resources/webapi/doc/swagger/include/FileSource.yaml index 06654d4b1..ea78881de 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FileSource.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FileSource.yaml @@ -59,3 +59,13 @@ FileSourceReport: description: power transmitted in channel (dB) type: number format: float + +FileSourceActions: + description: FileSource + properties: + play: + type: integer + description: > + Play or Pause stream + * 0 - Pause + * 1 - Play diff --git a/sdrbase/resources/webapi/doc/swagger/include/RtlSdr.yaml b/sdrbase/resources/webapi/doc/swagger/include/RtlSdr.yaml index f68313c7b..764e64bbd 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/RtlSdr.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/RtlSdr.yaml @@ -43,7 +43,7 @@ RtlSdrSettings: reverseAPIPort: type: integer reverseAPIDeviceIndex: - type: integer + type: integer RtlSdrReport: description: RTLSDR @@ -51,4 +51,14 @@ RtlSdrReport: gains: type: array items: - $ref: "/doc/swagger/include/Structs.yaml#/Gain" \ No newline at end of file + $ref: "/doc/swagger/include/Structs.yaml#/Gain" + +RtlSdrActions: + description: RTLSDR + properties: + record: + type: integer + description: > + Record IQ stream action + * 0 - stop recording + * 1 - start recording diff --git a/sdrbase/resources/webapi/doc/swagger/swagger.yaml b/sdrbase/resources/webapi/doc/swagger/swagger.yaml index cdd5f320f..c467f2418 100644 --- a/sdrbase/resources/webapi/doc/swagger/swagger.yaml +++ b/sdrbase/resources/webapi/doc/swagger/swagger.yaml @@ -1382,6 +1382,42 @@ paths: "501": $ref: "#/responses/Response_501" + /sdrangel/deviceset/{deviceSetIndex}/device/actions: + x-swagger-router-controller: deviceset + post: + description: post an action on a device + operationId: devicesetDeviceActionsPost + tags: + - Deviceset + parameters: + - in: path + name: deviceSetIndex + type: integer + required: true + description: Index of device set in the device set list + - name: body + in: body + description: Action(s) to apply to the device + required: true + schema: + $ref: "/doc/swagger/include/DeviceActions.yaml#/DeviceActions" + responses: + "202": + description: Message to perform action was sent successfully + schema: + $ref: "#/definitions/SuccessResponse" + "400": + description: Invalid device set index + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Device not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" /sdrangel/deviceset/{deviceSetIndex}/channel: x-swagger-router-controller: deviceset @@ -1605,6 +1641,48 @@ paths: "501": $ref: "#/responses/Response_501" + /sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/actions: + x-swagger-router-controller: deviceset + post: + description: post an action or actions on a channel + operationId: devicesetChannelActionsPost + tags: + - Deviceset + parameters: + - in: path + name: deviceSetIndex + type: integer + required: true + description: Index of device set in the device set list + - in: path + name: channelIndex + type: integer + required: true + description: Index of the channel in the channels list for this device set + - name: body + in: body + description: Action(s) to apply to the channel + required: true + schema: + $ref: "/doc/swagger/include/ChannelActions.yaml#/ChannelActions" + responses: + "202": + description: Message to perform action was sent successfully + schema: + $ref: "#/definitions/SuccessResponse" + "400": + description: Invalid device set or channel index + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Device or channel not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + /swagger: x-swagger-pipe: swagger_raw diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 3fadfd089..eaf1e78c0 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -2040,6 +2040,32 @@ margin-bottom: 20px; } }, "description" : "Channel summarized information" +}; + defs.ChannelActions = { + "required" : [ "channelType", "direction" ], + "discriminator" : "channelType", + "properties" : { + "channelType" : { + "type" : "string", + "description" : "Channel type code" + }, + "direction" : { + "type" : "integer", + "description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" + }, + "originatorDeviceSetIndex" : { + "type" : "integer", + "description" : "Optional for reverse API. This is the device set index from where the message comes from." + }, + "originatorChannelIndex" : { + "type" : "integer", + "description" : "Optional for reverse API. This is the channel index from where the message comes from." + }, + "FileSourceActions" : { + "$ref" : "#/definitions/FileSourceActions" + } + }, + "description" : "Base channel actions. Only the channel actions corresponding to the channel specified in the channelType field is or should be present." }; defs.ChannelAnalyzerSettings = { "properties" : { @@ -3014,6 +3040,28 @@ margin-bottom: 20px; } }, "description" : "List of DV serial devices available in the system" +}; + defs.DeviceActions = { + "required" : [ "deviceHwType", "direction" ], + "discriminator" : "deviceHwType", + "properties" : { + "deviceHwType" : { + "type" : "string", + "description" : "Device hardware type code" + }, + "direction" : { + "type" : "integer", + "description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" + }, + "originatorIndex" : { + "type" : "integer", + "description" : "Optional for reverse API. This is the device set index from where the message comes from." + }, + "rtlSdrActions" : { + "$ref" : "#/definitions/RtlSdrActions" + } + }, + "description" : "Base device actions. Only the device actions corresponding to the device specified in the deviceHwType field is or should be present." }; defs.DeviceConfig = { "properties" : { @@ -3545,6 +3593,15 @@ margin-bottom: 20px; } }, "description" : "FileInput" +}; + defs.FileSourceActions = { + "properties" : { + "play" : { + "type" : "integer", + "description" : "Play or Pause stream\n * 0 - Pause\n * 1 - Play\n" + } + }, + "description" : "FileSource" }; defs.FileSourceReport = { "properties" : { @@ -5995,6 +6052,15 @@ margin-bottom: 20px; } }, "description" : "Remote channel source settings" +}; + defs.RtlSdrActions = { + "properties" : { + "record" : { + "type" : "integer", + "description" : "Record IQ stream action\n * 0 - stop recording\n * 1 - start recording\n" + } + }, + "description" : "RTLSDR" }; defs.RtlSdrReport = { "properties" : { @@ -7772,6 +7838,13 @@ margin-bottom: 20px;
  • instanceDeviceSetPost
  • + +
  • + devicesetChannelActionsPost +
  • +
  • + devicesetDeviceActionsPost +
  • instanceAMBEDevicesDelete @@ -18502,6 +18575,1068 @@ except ApiException as e:
  • +
    +

    Deviceset

    +
    +
    +
    +

    devicesetChannelActionsPost

    +

    +
    +
    +
    +

    +

    post an action or actions on a channel

    +

    +
    +
    /sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/actions
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/actions"
    +
    +
    +
    import SWGSDRangel.*;
    +import SWGSDRangel.auth.*;
    +import SWGSDRangel.model.*;
    +import SWGSDRangel.api.DevicesetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DevicesetApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DevicesetApi apiInstance = new DevicesetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        Integer channelIndex = 56; // Integer | Index of the channel in the channels list for this device set
    +        ChannelActions body = ; // ChannelActions | Action(s) to apply to the channel
    +        try {
    +            SuccessResponse result = apiInstance.devicesetChannelActionsPost(deviceSetIndex, channelIndex, body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DevicesetApi#devicesetChannelActionsPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.DevicesetApi;
    +
    +public class DevicesetApiExample {
    +
    +    public static void main(String[] args) {
    +        DevicesetApi apiInstance = new DevicesetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        Integer channelIndex = 56; // Integer | Index of the channel in the channels list for this device set
    +        ChannelActions body = ; // ChannelActions | Action(s) to apply to the channel
    +        try {
    +            SuccessResponse result = apiInstance.devicesetChannelActionsPost(deviceSetIndex, channelIndex, body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DevicesetApi#devicesetChannelActionsPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +Integer *channelIndex = 56; // Index of the channel in the channels list for this device set
    +ChannelActions *body = ; // Action(s) to apply to the channel
    +
    +DevicesetApi *apiInstance = [[DevicesetApi alloc] init];
    +
    +[apiInstance devicesetChannelActionsPostWith:deviceSetIndex
    +    channelIndex:channelIndex
    +    body:body
    +              completionHandler: ^(SuccessResponse output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DevicesetApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +var channelIndex = 56; // {Integer} Index of the channel in the channels list for this device set
    +
    +var body = ; // {ChannelActions} Action(s) to apply to the channel
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetChannelActionsPost(deviceSetIndex, channelIndex, body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class devicesetChannelActionsPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DevicesetApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +            var channelIndex = 56;  // Integer | Index of the channel in the channels list for this device set
    +            var body = new ChannelActions(); // ChannelActions | Action(s) to apply to the channel
    +
    +            try
    +            {
    +                SuccessResponse result = apiInstance.devicesetChannelActionsPost(deviceSetIndex, channelIndex, body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DevicesetApi.devicesetChannelActionsPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DevicesetApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +$channelIndex = 56; // Integer | Index of the channel in the channels list for this device set
    +$body = ; // ChannelActions | Action(s) to apply to the channel
    +
    +try {
    +    $result = $api_instance->devicesetChannelActionsPost($deviceSetIndex, $channelIndex, $body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DevicesetApi->devicesetChannelActionsPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::DevicesetApi;
    +
    +my $api_instance = SWGSDRangel::DevicesetApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +my $channelIndex = 56; # Integer | Index of the channel in the channels list for this device set
    +my $body = SWGSDRangel::Object::ChannelActions->new(); # ChannelActions | Action(s) to apply to the channel
    +
    +eval { 
    +    my $result = $api_instance->devicesetChannelActionsPost(deviceSetIndex => $deviceSetIndex, channelIndex => $channelIndex, body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DevicesetApi->devicesetChannelActionsPost: $@\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.DevicesetApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +channelIndex = 56 # Integer | Index of the channel in the channels list for this device set
    +body =  # ChannelActions | Action(s) to apply to the channel
    +
    +try: 
    +    api_response = api_instance.deviceset_channel_actions_post(deviceSetIndex, channelIndex, body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DevicesetApi->devicesetChannelActionsPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + + + + + +
    NameDescription
    deviceSetIndex* + + +
    +
    +
    + + Integer + + +
    + Index of device set in the device set list +
    +
    +
    + Required +
    +
    +
    +
    channelIndex* + + +
    +
    +
    + + Integer + + +
    + Index of the channel in the channels list for this device set +
    +
    +
    + Required +
    +
    +
    +
    + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - Message to perform action was sent successfully

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

    Status: 400 - Invalid device set or channel index

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

    Status: 404 - Device or channel not found

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    devicesetDeviceActionsPost

    +

    +
    +
    +
    +

    +

    post an action on a device

    +

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

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/deviceset/{deviceSetIndex}/device/actions"
    +
    +
    +
    import SWGSDRangel.*;
    +import SWGSDRangel.auth.*;
    +import SWGSDRangel.model.*;
    +import SWGSDRangel.api.DevicesetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DevicesetApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        DevicesetApi apiInstance = new DevicesetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        DeviceActions body = ; // DeviceActions | Action(s) to apply to the device
    +        try {
    +            SuccessResponse result = apiInstance.devicesetDeviceActionsPost(deviceSetIndex, body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DevicesetApi#devicesetDeviceActionsPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.DevicesetApi;
    +
    +public class DevicesetApiExample {
    +
    +    public static void main(String[] args) {
    +        DevicesetApi apiInstance = new DevicesetApi();
    +        Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +        DeviceActions body = ; // DeviceActions | Action(s) to apply to the device
    +        try {
    +            SuccessResponse result = apiInstance.devicesetDeviceActionsPost(deviceSetIndex, body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DevicesetApi#devicesetDeviceActionsPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Integer *deviceSetIndex = 56; // Index of device set in the device set list
    +DeviceActions *body = ; // Action(s) to apply to the device
    +
    +DevicesetApi *apiInstance = [[DevicesetApi alloc] init];
    +
    +[apiInstance devicesetDeviceActionsPostWith:deviceSetIndex
    +    body:body
    +              completionHandler: ^(SuccessResponse output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.DevicesetApi()
    +
    +var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
    +
    +var body = ; // {DeviceActions} Action(s) to apply to the device
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.devicesetDeviceActionsPost(deviceSetIndex, body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class devicesetDeviceActionsPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new DevicesetApi();
    +            var deviceSetIndex = 56;  // Integer | Index of device set in the device set list
    +            var body = new DeviceActions(); // DeviceActions | Action(s) to apply to the device
    +
    +            try
    +            {
    +                SuccessResponse result = apiInstance.devicesetDeviceActionsPost(deviceSetIndex, body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling DevicesetApi.devicesetDeviceActionsPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\DevicesetApi();
    +$deviceSetIndex = 56; // Integer | Index of device set in the device set list
    +$body = ; // DeviceActions | Action(s) to apply to the device
    +
    +try {
    +    $result = $api_instance->devicesetDeviceActionsPost($deviceSetIndex, $body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DevicesetApi->devicesetDeviceActionsPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::DevicesetApi;
    +
    +my $api_instance = SWGSDRangel::DevicesetApi->new();
    +my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
    +my $body = SWGSDRangel::Object::DeviceActions->new(); # DeviceActions | Action(s) to apply to the device
    +
    +eval { 
    +    my $result = $api_instance->devicesetDeviceActionsPost(deviceSetIndex => $deviceSetIndex, body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DevicesetApi->devicesetDeviceActionsPost: $@\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.DevicesetApi()
    +deviceSetIndex = 56 # Integer | Index of device set in the device set list
    +body =  # DeviceActions | Action(s) to apply to the device
    +
    +try: 
    +    api_response = api_instance.deviceset_device_actions_post(deviceSetIndex, body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DevicesetApi->devicesetDeviceActionsPost: %s\n" % e)
    +
    +
    + +

    Parameters

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

    Responses

    +

    Status: 202 - Message to perform action was sent successfully

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

    Status: 400 - Invalid device set index

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

    Status: 404 - Device not found

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

    Status: 500 - Error

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

    Status: 501 - Function not implemented

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

    Instance

    @@ -32624,7 +33759,7 @@ except ApiException as e:
    - Generated 2020-03-08T20:37:07.112+01:00 + Generated 2020-03-08T23:59:21.736+01:00
    diff --git a/swagger/sdrangel/code/qt5/client/SWGChannelActions.cpp b/swagger/sdrangel/code/qt5/client/SWGChannelActions.cpp new file mode 100644 index 000000000..a72d67958 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGChannelActions.cpp @@ -0,0 +1,204 @@ +/** + * 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: 5.1.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 "SWGChannelActions.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGChannelActions::SWGChannelActions(QString* json) { + init(); + this->fromJson(*json); +} + +SWGChannelActions::SWGChannelActions() { + channel_type = nullptr; + m_channel_type_isSet = false; + direction = 0; + m_direction_isSet = false; + originator_device_set_index = 0; + m_originator_device_set_index_isSet = false; + originator_channel_index = 0; + m_originator_channel_index_isSet = false; + file_source_actions = nullptr; + m_file_source_actions_isSet = false; +} + +SWGChannelActions::~SWGChannelActions() { + this->cleanup(); +} + +void +SWGChannelActions::init() { + channel_type = new QString(""); + m_channel_type_isSet = false; + direction = 0; + m_direction_isSet = false; + originator_device_set_index = 0; + m_originator_device_set_index_isSet = false; + originator_channel_index = 0; + m_originator_channel_index_isSet = false; + file_source_actions = new SWGFileSourceActions(); + m_file_source_actions_isSet = false; +} + +void +SWGChannelActions::cleanup() { + if(channel_type != nullptr) { + delete channel_type; + } + + + + if(file_source_actions != nullptr) { + delete file_source_actions; + } +} + +SWGChannelActions* +SWGChannelActions::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGChannelActions::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&channel_type, pJson["channelType"], "QString", "QString"); + + ::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", ""); + + ::SWGSDRangel::setValue(&originator_device_set_index, pJson["originatorDeviceSetIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&originator_channel_index, pJson["originatorChannelIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&file_source_actions, pJson["FileSourceActions"], "SWGFileSourceActions", "SWGFileSourceActions"); + +} + +QString +SWGChannelActions::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGChannelActions::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(channel_type != nullptr && *channel_type != QString("")){ + toJsonValue(QString("channelType"), channel_type, obj, QString("QString")); + } + if(m_direction_isSet){ + obj->insert("direction", QJsonValue(direction)); + } + if(m_originator_device_set_index_isSet){ + obj->insert("originatorDeviceSetIndex", QJsonValue(originator_device_set_index)); + } + if(m_originator_channel_index_isSet){ + obj->insert("originatorChannelIndex", QJsonValue(originator_channel_index)); + } + if((file_source_actions != nullptr) && (file_source_actions->isSet())){ + toJsonValue(QString("FileSourceActions"), file_source_actions, obj, QString("SWGFileSourceActions")); + } + + return obj; +} + +QString* +SWGChannelActions::getChannelType() { + return channel_type; +} +void +SWGChannelActions::setChannelType(QString* channel_type) { + this->channel_type = channel_type; + this->m_channel_type_isSet = true; +} + +qint32 +SWGChannelActions::getDirection() { + return direction; +} +void +SWGChannelActions::setDirection(qint32 direction) { + this->direction = direction; + this->m_direction_isSet = true; +} + +qint32 +SWGChannelActions::getOriginatorDeviceSetIndex() { + return originator_device_set_index; +} +void +SWGChannelActions::setOriginatorDeviceSetIndex(qint32 originator_device_set_index) { + this->originator_device_set_index = originator_device_set_index; + this->m_originator_device_set_index_isSet = true; +} + +qint32 +SWGChannelActions::getOriginatorChannelIndex() { + return originator_channel_index; +} +void +SWGChannelActions::setOriginatorChannelIndex(qint32 originator_channel_index) { + this->originator_channel_index = originator_channel_index; + this->m_originator_channel_index_isSet = true; +} + +SWGFileSourceActions* +SWGChannelActions::getFileSourceActions() { + return file_source_actions; +} +void +SWGChannelActions::setFileSourceActions(SWGFileSourceActions* file_source_actions) { + this->file_source_actions = file_source_actions; + this->m_file_source_actions_isSet = true; +} + + +bool +SWGChannelActions::isSet(){ + bool isObjectUpdated = false; + do{ + if(channel_type && *channel_type != QString("")){ + isObjectUpdated = true; break; + } + if(m_direction_isSet){ + isObjectUpdated = true; break; + } + if(m_originator_device_set_index_isSet){ + isObjectUpdated = true; break; + } + if(m_originator_channel_index_isSet){ + isObjectUpdated = true; break; + } + if(file_source_actions && file_source_actions->isSet()){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGChannelActions.h b/swagger/sdrangel/code/qt5/client/SWGChannelActions.h new file mode 100644 index 000000000..0fb8698b9 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGChannelActions.h @@ -0,0 +1,84 @@ +/** + * 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: 5.1.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. + */ + +/* + * SWGChannelActions.h + * + * Base channel actions. Only the channel actions corresponding to the channel specified in the channelType field is or should be present. + */ + +#ifndef SWGChannelActions_H_ +#define SWGChannelActions_H_ + +#include + + +#include "SWGFileSourceActions.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGChannelActions: public SWGObject { +public: + SWGChannelActions(); + SWGChannelActions(QString* json); + virtual ~SWGChannelActions(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGChannelActions* fromJson(QString &jsonString) override; + + QString* getChannelType(); + void setChannelType(QString* channel_type); + + qint32 getDirection(); + void setDirection(qint32 direction); + + qint32 getOriginatorDeviceSetIndex(); + void setOriginatorDeviceSetIndex(qint32 originator_device_set_index); + + qint32 getOriginatorChannelIndex(); + void setOriginatorChannelIndex(qint32 originator_channel_index); + + SWGFileSourceActions* getFileSourceActions(); + void setFileSourceActions(SWGFileSourceActions* file_source_actions); + + + virtual bool isSet() override; + +private: + QString* channel_type; + bool m_channel_type_isSet; + + qint32 direction; + bool m_direction_isSet; + + qint32 originator_device_set_index; + bool m_originator_device_set_index_isSet; + + qint32 originator_channel_index; + bool m_originator_channel_index_isSet; + + SWGFileSourceActions* file_source_actions; + bool m_file_source_actions_isSet; + +}; + +} + +#endif /* SWGChannelActions_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceActions.cpp b/swagger/sdrangel/code/qt5/client/SWGDeviceActions.cpp new file mode 100644 index 000000000..3d56bf17f --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceActions.cpp @@ -0,0 +1,181 @@ +/** + * 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: 5.1.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 "SWGDeviceActions.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGDeviceActions::SWGDeviceActions(QString* json) { + init(); + this->fromJson(*json); +} + +SWGDeviceActions::SWGDeviceActions() { + device_hw_type = nullptr; + m_device_hw_type_isSet = false; + direction = 0; + m_direction_isSet = false; + originator_index = 0; + m_originator_index_isSet = false; + rtl_sdr_actions = nullptr; + m_rtl_sdr_actions_isSet = false; +} + +SWGDeviceActions::~SWGDeviceActions() { + this->cleanup(); +} + +void +SWGDeviceActions::init() { + device_hw_type = new QString(""); + m_device_hw_type_isSet = false; + direction = 0; + m_direction_isSet = false; + originator_index = 0; + m_originator_index_isSet = false; + rtl_sdr_actions = new SWGRtlSdrActions(); + m_rtl_sdr_actions_isSet = false; +} + +void +SWGDeviceActions::cleanup() { + if(device_hw_type != nullptr) { + delete device_hw_type; + } + + + if(rtl_sdr_actions != nullptr) { + delete rtl_sdr_actions; + } +} + +SWGDeviceActions* +SWGDeviceActions::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGDeviceActions::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&device_hw_type, pJson["deviceHwType"], "QString", "QString"); + + ::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", ""); + + ::SWGSDRangel::setValue(&originator_index, pJson["originatorIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&rtl_sdr_actions, pJson["rtlSdrActions"], "SWGRtlSdrActions", "SWGRtlSdrActions"); + +} + +QString +SWGDeviceActions::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGDeviceActions::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(device_hw_type != nullptr && *device_hw_type != QString("")){ + toJsonValue(QString("deviceHwType"), device_hw_type, obj, QString("QString")); + } + if(m_direction_isSet){ + obj->insert("direction", QJsonValue(direction)); + } + if(m_originator_index_isSet){ + obj->insert("originatorIndex", QJsonValue(originator_index)); + } + if((rtl_sdr_actions != nullptr) && (rtl_sdr_actions->isSet())){ + toJsonValue(QString("rtlSdrActions"), rtl_sdr_actions, obj, QString("SWGRtlSdrActions")); + } + + return obj; +} + +QString* +SWGDeviceActions::getDeviceHwType() { + return device_hw_type; +} +void +SWGDeviceActions::setDeviceHwType(QString* device_hw_type) { + this->device_hw_type = device_hw_type; + this->m_device_hw_type_isSet = true; +} + +qint32 +SWGDeviceActions::getDirection() { + return direction; +} +void +SWGDeviceActions::setDirection(qint32 direction) { + this->direction = direction; + this->m_direction_isSet = true; +} + +qint32 +SWGDeviceActions::getOriginatorIndex() { + return originator_index; +} +void +SWGDeviceActions::setOriginatorIndex(qint32 originator_index) { + this->originator_index = originator_index; + this->m_originator_index_isSet = true; +} + +SWGRtlSdrActions* +SWGDeviceActions::getRtlSdrActions() { + return rtl_sdr_actions; +} +void +SWGDeviceActions::setRtlSdrActions(SWGRtlSdrActions* rtl_sdr_actions) { + this->rtl_sdr_actions = rtl_sdr_actions; + this->m_rtl_sdr_actions_isSet = true; +} + + +bool +SWGDeviceActions::isSet(){ + bool isObjectUpdated = false; + do{ + if(device_hw_type && *device_hw_type != QString("")){ + isObjectUpdated = true; break; + } + if(m_direction_isSet){ + isObjectUpdated = true; break; + } + if(m_originator_index_isSet){ + isObjectUpdated = true; break; + } + if(rtl_sdr_actions && rtl_sdr_actions->isSet()){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceActions.h b/swagger/sdrangel/code/qt5/client/SWGDeviceActions.h new file mode 100644 index 000000000..e9006c696 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceActions.h @@ -0,0 +1,78 @@ +/** + * 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: 5.1.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. + */ + +/* + * SWGDeviceActions.h + * + * Base device actions. Only the device actions corresponding to the device specified in the deviceHwType field is or should be present. + */ + +#ifndef SWGDeviceActions_H_ +#define SWGDeviceActions_H_ + +#include + + +#include "SWGRtlSdrActions.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGDeviceActions: public SWGObject { +public: + SWGDeviceActions(); + SWGDeviceActions(QString* json); + virtual ~SWGDeviceActions(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGDeviceActions* fromJson(QString &jsonString) override; + + QString* getDeviceHwType(); + void setDeviceHwType(QString* device_hw_type); + + qint32 getDirection(); + void setDirection(qint32 direction); + + qint32 getOriginatorIndex(); + void setOriginatorIndex(qint32 originator_index); + + SWGRtlSdrActions* getRtlSdrActions(); + void setRtlSdrActions(SWGRtlSdrActions* rtl_sdr_actions); + + + virtual bool isSet() override; + +private: + QString* device_hw_type; + bool m_device_hw_type_isSet; + + qint32 direction; + bool m_direction_isSet; + + qint32 originator_index; + bool m_originator_index_isSet; + + SWGRtlSdrActions* rtl_sdr_actions; + bool m_rtl_sdr_actions_isSet; + +}; + +} + +#endif /* SWGDeviceActions_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGDevicesetApi.cpp b/swagger/sdrangel/code/qt5/client/SWGDevicesetApi.cpp new file mode 100644 index 000000000..7bbb69236 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDevicesetApi.cpp @@ -0,0 +1,148 @@ +/** + * 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: 5.1.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 "SWGDevicesetApi.h" +#include "SWGHelpers.h" +#include "SWGModelFactory.h" + +#include +#include + +namespace SWGSDRangel { + +SWGDevicesetApi::SWGDevicesetApi() {} + +SWGDevicesetApi::~SWGDevicesetApi() {} + +SWGDevicesetApi::SWGDevicesetApi(QString host, QString basePath) { + this->host = host; + this->basePath = basePath; +} + +void +SWGDevicesetApi::devicesetChannelActionsPost(qint32 device_set_index, qint32 channel_index, SWGChannelActions& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/actions"); + + QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}"); + fullPath.replace(device_set_indexPathParam, stringValue(device_set_index)); + QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}"); + fullPath.replace(channel_indexPathParam, stringValue(channel_index)); + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + + + + QString output = body.asJson(); + input.request_body.append(output); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGDevicesetApi::devicesetChannelActionsPostCallback); + + worker->execute(&input); +} + +void +SWGDevicesetApi::devicesetChannelActionsPostCallback(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 devicesetChannelActionsPostSignal(output); + } else { + emit devicesetChannelActionsPostSignalE(output, error_type, error_str); + emit devicesetChannelActionsPostSignalEFull(worker, error_type, error_str); + } +} + +void +SWGDevicesetApi::devicesetDeviceActionsPost(qint32 device_set_index, SWGDeviceActions& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/actions"); + + QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}"); + fullPath.replace(device_set_indexPathParam, stringValue(device_set_index)); + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + + + + QString output = body.asJson(); + input.request_body.append(output); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGDevicesetApi::devicesetDeviceActionsPostCallback); + + worker->execute(&input); +} + +void +SWGDevicesetApi::devicesetDeviceActionsPostCallback(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 devicesetDeviceActionsPostSignal(output); + } else { + emit devicesetDeviceActionsPostSignalE(output, error_type, error_str); + emit devicesetDeviceActionsPostSignalEFull(worker, error_type, error_str); + } +} + + +} diff --git a/swagger/sdrangel/code/qt5/client/SWGDevicesetApi.h b/swagger/sdrangel/code/qt5/client/SWGDevicesetApi.h new file mode 100644 index 000000000..a105ebdfb --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDevicesetApi.h @@ -0,0 +1,59 @@ +/** + * 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: 5.1.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. + */ + +#ifndef _SWG_SWGDevicesetApi_H_ +#define _SWG_SWGDevicesetApi_H_ + +#include "SWGHttpRequest.h" + +#include "SWGChannelActions.h" +#include "SWGDeviceActions.h" +#include "SWGErrorResponse.h" +#include "SWGSuccessResponse.h" + +#include + +namespace SWGSDRangel { + +class SWGDevicesetApi: public QObject { + Q_OBJECT + +public: + SWGDevicesetApi(); + SWGDevicesetApi(QString host, QString basePath); + ~SWGDevicesetApi(); + + QString host; + QString basePath; + QMap defaultHeaders; + + void devicesetChannelActionsPost(qint32 device_set_index, qint32 channel_index, SWGChannelActions& body); + void devicesetDeviceActionsPost(qint32 device_set_index, SWGDeviceActions& body); + +private: + void devicesetChannelActionsPostCallback (SWGHttpRequestWorker * worker); + void devicesetDeviceActionsPostCallback (SWGHttpRequestWorker * worker); + +signals: + void devicesetChannelActionsPostSignal(SWGSuccessResponse* summary); + void devicesetDeviceActionsPostSignal(SWGSuccessResponse* summary); + + void devicesetChannelActionsPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void devicesetDeviceActionsPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); + + void devicesetChannelActionsPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void devicesetDeviceActionsPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + +}; + +} +#endif diff --git a/swagger/sdrangel/code/qt5/client/SWGFileSourceActions.cpp b/swagger/sdrangel/code/qt5/client/SWGFileSourceActions.cpp new file mode 100644 index 000000000..7abb19621 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFileSourceActions.cpp @@ -0,0 +1,108 @@ +/** + * 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: 5.1.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 "SWGFileSourceActions.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGFileSourceActions::SWGFileSourceActions(QString* json) { + init(); + this->fromJson(*json); +} + +SWGFileSourceActions::SWGFileSourceActions() { + play = 0; + m_play_isSet = false; +} + +SWGFileSourceActions::~SWGFileSourceActions() { + this->cleanup(); +} + +void +SWGFileSourceActions::init() { + play = 0; + m_play_isSet = false; +} + +void +SWGFileSourceActions::cleanup() { + +} + +SWGFileSourceActions* +SWGFileSourceActions::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGFileSourceActions::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&play, pJson["play"], "qint32", ""); + +} + +QString +SWGFileSourceActions::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGFileSourceActions::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_play_isSet){ + obj->insert("play", QJsonValue(play)); + } + + return obj; +} + +qint32 +SWGFileSourceActions::getPlay() { + return play; +} +void +SWGFileSourceActions::setPlay(qint32 play) { + this->play = play; + this->m_play_isSet = true; +} + + +bool +SWGFileSourceActions::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_play_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGFileSourceActions.h b/swagger/sdrangel/code/qt5/client/SWGFileSourceActions.h new file mode 100644 index 000000000..6e44e15a9 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFileSourceActions.h @@ -0,0 +1,58 @@ +/** + * 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: 5.1.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. + */ + +/* + * SWGFileSourceActions.h + * + * FileSource + */ + +#ifndef SWGFileSourceActions_H_ +#define SWGFileSourceActions_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGFileSourceActions: public SWGObject { +public: + SWGFileSourceActions(); + SWGFileSourceActions(QString* json); + virtual ~SWGFileSourceActions(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGFileSourceActions* fromJson(QString &jsonString) override; + + qint32 getPlay(); + void setPlay(qint32 play); + + + virtual bool isSet() override; + +private: + qint32 play; + bool m_play_isSet; + +}; + +} + +#endif /* SWGFileSourceActions_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 38e1fc247..559a3b4e2 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -45,6 +45,7 @@ #include "SWGBladeRF2OutputSettings.h" #include "SWGCWKeyerSettings.h" #include "SWGChannel.h" +#include "SWGChannelActions.h" #include "SWGChannelAnalyzerSettings.h" #include "SWGChannelConfig.h" #include "SWGChannelListItem.h" @@ -62,6 +63,7 @@ #include "SWGDSDDemodSettings.h" #include "SWGDVSerialDevice.h" #include "SWGDVSerialDevices.h" +#include "SWGDeviceActions.h" #include "SWGDeviceConfig.h" #include "SWGDeviceListItem.h" #include "SWGDeviceReport.h" @@ -74,6 +76,7 @@ #include "SWGFCDProSettings.h" #include "SWGFileInputReport.h" #include "SWGFileInputSettings.h" +#include "SWGFileSourceActions.h" #include "SWGFileSourceReport.h" #include "SWGFileSourceSettings.h" #include "SWGFreeDVDemodReport.h" @@ -144,6 +147,7 @@ #include "SWGRemoteSinkSettings.h" #include "SWGRemoteSourceReport.h" #include "SWGRemoteSourceSettings.h" +#include "SWGRtlSdrActions.h" #include "SWGRtlSdrReport.h" #include "SWGRtlSdrSettings.h" #include "SWGSDRPlayReport.h" @@ -275,6 +279,9 @@ namespace SWGSDRangel { if(QString("SWGChannel").compare(type) == 0) { return new SWGChannel(); } + if(QString("SWGChannelActions").compare(type) == 0) { + return new SWGChannelActions(); + } if(QString("SWGChannelAnalyzerSettings").compare(type) == 0) { return new SWGChannelAnalyzerSettings(); } @@ -326,6 +333,9 @@ namespace SWGSDRangel { if(QString("SWGDVSerialDevices").compare(type) == 0) { return new SWGDVSerialDevices(); } + if(QString("SWGDeviceActions").compare(type) == 0) { + return new SWGDeviceActions(); + } if(QString("SWGDeviceConfig").compare(type) == 0) { return new SWGDeviceConfig(); } @@ -362,6 +372,9 @@ namespace SWGSDRangel { if(QString("SWGFileInputSettings").compare(type) == 0) { return new SWGFileInputSettings(); } + if(QString("SWGFileSourceActions").compare(type) == 0) { + return new SWGFileSourceActions(); + } if(QString("SWGFileSourceReport").compare(type) == 0) { return new SWGFileSourceReport(); } @@ -572,6 +585,9 @@ namespace SWGSDRangel { if(QString("SWGRemoteSourceSettings").compare(type) == 0) { return new SWGRemoteSourceSettings(); } + if(QString("SWGRtlSdrActions").compare(type) == 0) { + return new SWGRtlSdrActions(); + } if(QString("SWGRtlSdrReport").compare(type) == 0) { return new SWGRtlSdrReport(); } diff --git a/swagger/sdrangel/code/qt5/client/SWGRtlSdrActions.cpp b/swagger/sdrangel/code/qt5/client/SWGRtlSdrActions.cpp new file mode 100644 index 000000000..1385b17d9 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGRtlSdrActions.cpp @@ -0,0 +1,108 @@ +/** + * 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: 5.1.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 "SWGRtlSdrActions.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGRtlSdrActions::SWGRtlSdrActions(QString* json) { + init(); + this->fromJson(*json); +} + +SWGRtlSdrActions::SWGRtlSdrActions() { + record = 0; + m_record_isSet = false; +} + +SWGRtlSdrActions::~SWGRtlSdrActions() { + this->cleanup(); +} + +void +SWGRtlSdrActions::init() { + record = 0; + m_record_isSet = false; +} + +void +SWGRtlSdrActions::cleanup() { + +} + +SWGRtlSdrActions* +SWGRtlSdrActions::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGRtlSdrActions::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&record, pJson["record"], "qint32", ""); + +} + +QString +SWGRtlSdrActions::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGRtlSdrActions::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_record_isSet){ + obj->insert("record", QJsonValue(record)); + } + + return obj; +} + +qint32 +SWGRtlSdrActions::getRecord() { + return record; +} +void +SWGRtlSdrActions::setRecord(qint32 record) { + this->record = record; + this->m_record_isSet = true; +} + + +bool +SWGRtlSdrActions::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_record_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGRtlSdrActions.h b/swagger/sdrangel/code/qt5/client/SWGRtlSdrActions.h new file mode 100644 index 000000000..7e107ee34 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGRtlSdrActions.h @@ -0,0 +1,58 @@ +/** + * 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: 5.1.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. + */ + +/* + * SWGRtlSdrActions.h + * + * RTLSDR + */ + +#ifndef SWGRtlSdrActions_H_ +#define SWGRtlSdrActions_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGRtlSdrActions: public SWGObject { +public: + SWGRtlSdrActions(); + SWGRtlSdrActions(QString* json); + virtual ~SWGRtlSdrActions(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGRtlSdrActions* fromJson(QString &jsonString) override; + + qint32 getRecord(); + void setRecord(qint32 record); + + + virtual bool isSet() override; + +private: + qint32 record; + bool m_record_isSet; + +}; + +} + +#endif /* SWGRtlSdrActions_H_ */