From 5e0d373d2a75f1834b1a5ac5ece5ce981d95aa17 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 10 Mar 2020 08:32:54 +0100 Subject: [PATCH] REST API device and channel actions: generated code --- sdrbase/resources/webapi/doc/html2/index.html | 1137 ++++++++++++++++- .../doc/swagger/include/FileSource.yaml | 10 + .../webapi/doc/swagger/include/RtlSdr.yaml | 14 +- .../resources/webapi/doc/swagger/swagger.yaml | 78 ++ swagger/sdrangel/code/html2/index.html | 1137 ++++++++++++++++- .../code/qt5/client/SWGModelFactory.h | 16 + 6 files changed, 2388 insertions(+), 4 deletions(-) diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index e229f3310..6386fbc7d 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -2004,6 +2004,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" : { @@ -2602,6 +2628,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" : { @@ -3127,6 +3175,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" : { @@ -5534,6 +5591,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" : { @@ -7201,6 +7267,13 @@ margin-bottom: 20px;
  • instanceDeviceSetPost
  • + +
  • + devicesetChannelActionsPost +
  • +
  • + devicesetDeviceActionsPost +
  • instanceAMBEDevicesDelete @@ -17931,6 +18004,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

    @@ -32053,7 +33188,7 @@ except ApiException as e:
    - Generated 2020-03-10T05:29:42.607+01:00 + Generated 2020-03-10T08:19:16.942+01:00
    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 47b5d9fe5..7f1dd0ad9 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 e229f3310..6386fbc7d 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -2004,6 +2004,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" : { @@ -2602,6 +2628,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" : { @@ -3127,6 +3175,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" : { @@ -5534,6 +5591,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" : { @@ -7201,6 +7267,13 @@ margin-bottom: 20px;
  • instanceDeviceSetPost
  • + +
  • + devicesetChannelActionsPost +
  • +
  • + devicesetDeviceActionsPost +
  • instanceAMBEDevicesDelete @@ -17931,6 +18004,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

    @@ -32053,7 +33188,7 @@ except ApiException as e:
    - Generated 2020-03-10T05:29:42.607+01:00 + Generated 2020-03-10T08:19:16.942+01:00
    diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 21dfc6645..064c31ea5 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -44,6 +44,7 @@ #include "SWGBladeRF2OutputSettings.h" #include "SWGCWKeyerSettings.h" #include "SWGChannel.h" +#include "SWGChannelActions.h" #include "SWGChannelAnalyzerSettings.h" #include "SWGChannelConfig.h" #include "SWGChannelListItem.h" @@ -57,6 +58,7 @@ #include "SWGDSDDemodSettings.h" #include "SWGDVSerialDevice.h" #include "SWGDVSerialDevices.h" +#include "SWGDeviceActions.h" #include "SWGDeviceConfig.h" #include "SWGDeviceListItem.h" #include "SWGDeviceReport.h" @@ -69,6 +71,7 @@ #include "SWGFCDProSettings.h" #include "SWGFileInputReport.h" #include "SWGFileInputSettings.h" +#include "SWGFileSourceActions.h" #include "SWGFileSourceReport.h" #include "SWGFileSourceSettings.h" #include "SWGFreeDVDemodReport.h" @@ -138,6 +141,7 @@ #include "SWGRemoteSinkSettings.h" #include "SWGRemoteSourceReport.h" #include "SWGRemoteSourceSettings.h" +#include "SWGRtlSdrActions.h" #include "SWGRtlSdrReport.h" #include "SWGRtlSdrSettings.h" #include "SWGSDRPlayReport.h" @@ -263,6 +267,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(); } @@ -302,6 +309,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(); } @@ -338,6 +348,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(); } @@ -545,6 +558,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(); }