1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-17 13:51:47 -05:00

REST API server updates and fixes

This commit is contained in:
f4exb 2019-05-07 15:25:20 +02:00
parent 54e46837dd
commit 6771c6de5b
11 changed files with 201 additions and 178 deletions

View File

@ -2107,13 +2107,13 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" "description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)"
}, },
"nbStreams" : { "deviceNbStreams" : {
"type" : "integer", "type" : "integer",
"description" : "Number of channels or streams in the device" "description" : "Number of channels or streams in the device"
}, },
"streamIndex" : { "deviceStreamIndex" : {
"type" : "integer", "type" : "integer",
"description" : "Index of the channel in the device" "description" : "Index of the channel in the device. Applies to single stream directions (Rx or Tx)"
}, },
"deviceSetIndex" : { "deviceSetIndex" : {
"type" : "integer", "type" : "integer",
@ -4779,7 +4779,7 @@ margin-bottom: 20px;
"description" : "A sample rate expressed in samples per second (S/s)" "description" : "A sample rate expressed in samples per second (S/s)"
}; };
defs.SamplingDevice = { defs.SamplingDevice = {
"required" : [ "bandwidth", "centerFrequency", "hwType", "index", "sequence", "serial", "state", "streamIndex" ], "required" : [ "bandwidth", "centerFrequency", "hwType", "index", "sequence", "serial", "state" ],
"properties" : { "properties" : {
"index" : { "index" : {
"type" : "integer", "type" : "integer",
@ -4793,13 +4793,13 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" "description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)"
}, },
"nbStreams" : { "deviceNbStreams" : {
"type" : "integer", "type" : "integer",
"description" : "Number of channels or streams in the device" "description" : "Number of channels or streams in the device"
}, },
"streamIndex" : { "deviceStreamIndex" : {
"type" : "integer", "type" : "integer",
"description" : "Index of the channel in the device" "description" : "Index of the channel in the device. Applies to single stream directions (Rx or Tx)"
}, },
"sequence" : { "sequence" : {
"type" : "integer", "type" : "integer",
@ -9567,7 +9567,7 @@ public class DeviceSetApiExample {
DeviceSetApi apiInstance = new DeviceSetApi(); DeviceSetApi apiInstance = new DeviceSetApi();
Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
DeviceListItem body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. DeviceListItem body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try { try {
DeviceListItem result = apiInstance.devicesetDevicePut(deviceSetIndex, body); DeviceListItem result = apiInstance.devicesetDevicePut(deviceSetIndex, body);
System.out.println(result); System.out.println(result);
@ -9587,7 +9587,7 @@ public class DeviceSetApiExample {
public static void main(String[] args) { public static void main(String[] args) {
DeviceSetApi apiInstance = new DeviceSetApi(); DeviceSetApi apiInstance = new DeviceSetApi();
Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
DeviceListItem body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. DeviceListItem body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try { try {
DeviceListItem result = apiInstance.devicesetDevicePut(deviceSetIndex, body); DeviceListItem result = apiInstance.devicesetDevicePut(deviceSetIndex, body);
System.out.println(result); System.out.println(result);
@ -9604,7 +9604,7 @@ public class DeviceSetApiExample {
</div> --> </div> -->
<div class="tab-pane" id="examples-DeviceSet-devicesetDevicePut-0-objc"> <div class="tab-pane" id="examples-DeviceSet-devicesetDevicePut-0-objc">
<pre class="prettyprint"><code class="language-cpp">Integer *deviceSetIndex = 56; // Index of device set in the device set list <pre class="prettyprint"><code class="language-cpp">Integer *deviceSetIndex = 56; // Index of device set in the device set list
DeviceListItem *body = ; // Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. DeviceListItem *body = ; // Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init]; DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init];
@ -9628,7 +9628,7 @@ var api = new SdRangel.DeviceSetApi()
var deviceSetIndex = 56; // {Integer} Index of device set in the device set list var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
var body = ; // {DeviceListItem} Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. var body = ; // {DeviceListItem} Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
var callback = function(error, data, response) { var callback = function(error, data, response) {
@ -9661,7 +9661,7 @@ namespace Example
var apiInstance = new DeviceSetApi(); var apiInstance = new DeviceSetApi();
var deviceSetIndex = 56; // Integer | Index of device set in the device set list var deviceSetIndex = 56; // Integer | Index of device set in the device set list
var body = new DeviceListItem(); // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. var body = new DeviceListItem(); // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try try
{ {
@ -9684,7 +9684,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\DeviceSetApi(); $api_instance = new Swagger\Client\Api\DeviceSetApi();
$deviceSetIndex = 56; // Integer | Index of device set in the device set list $deviceSetIndex = 56; // Integer | Index of device set in the device set list
$body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. $body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try { try {
$result = $api_instance->devicesetDevicePut($deviceSetIndex, $body); $result = $api_instance->devicesetDevicePut($deviceSetIndex, $body);
@ -9702,7 +9702,7 @@ use SWGSDRangel::DeviceSetApi;
my $api_instance = SWGSDRangel::DeviceSetApi->new(); my $api_instance = SWGSDRangel::DeviceSetApi->new();
my $deviceSetIndex = 56; # Integer | Index of device set in the device set list my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
my $body = SWGSDRangel::Object::DeviceListItem->new(); # DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. my $body = SWGSDRangel::Object::DeviceListItem->new(); # DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
eval { eval {
my $result = $api_instance->devicesetDevicePut(deviceSetIndex => $deviceSetIndex, body => $body); my $result = $api_instance->devicesetDevicePut(deviceSetIndex => $deviceSetIndex, body => $body);
@ -9723,7 +9723,7 @@ from pprint import pprint
# create an instance of the API class # create an instance of the API class
api_instance = swagger_sdrangel.DeviceSetApi() api_instance = swagger_sdrangel.DeviceSetApi()
deviceSetIndex = 56 # Integer | Index of device set in the device set list deviceSetIndex = 56 # Integer | Index of device set in the device set list
body = # DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. body = # DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try: try:
api_response = api_instance.deviceset_device_put(deviceSetIndex, body) api_response = api_instance.deviceset_device_put(deviceSetIndex, body)
@ -9782,7 +9782,7 @@ $(document).ready(function() {
var schemaWrapper = { var schemaWrapper = {
"in" : "body", "in" : "body",
"name" : "body", "name" : "body",
"description" : "Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified.", "description" : "Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.",
"required" : true, "required" : true,
"schema" : { "schema" : {
"$ref" : "#/definitions/DeviceListItem" "$ref" : "#/definitions/DeviceListItem"
@ -24924,7 +24924,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2019-05-07T11:40:05.130+02:00 Generated 2019-05-07T14:58:09.366+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -754,7 +754,7 @@ paths:
description: Index of device set in the device set list description: Index of device set in the device set list
- name: body - name: body
in: body in: body
description: Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. description: Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
required: true required: true
schema: schema:
$ref: "#/definitions/DeviceListItem" $ref: "#/definitions/DeviceListItem"
@ -1371,11 +1371,11 @@ definitions:
direction: direction:
description: "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" description: "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)"
type: integer type: integer
nbStreams: deviceNbStreams:
description: "Number of channels or streams in the device" description: "Number of channels or streams in the device"
type: integer type: integer
streamIndex: deviceStreamIndex:
description: "Index of the channel in the device" description: "Index of the channel in the device. Applies to single stream directions (Rx or Tx)"
type: integer type: integer
deviceSetIndex: deviceSetIndex:
description: "Index of the device set that claimed this device (-1 if not claimed)" description: "Index of the device set that claimed this device (-1 if not claimed)"
@ -1470,11 +1470,11 @@ definitions:
direction: direction:
description: "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" description: "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)"
type: integer type: integer
nbStreams: deviceNbStreams:
description: "Number of channels or streams in the device" description: "Number of channels or streams in the device"
type: integer type: integer
streamIndex: deviceStreamIndex:
description: "Index of the channel in the device" description: "Index of the channel in the device. Applies to single stream directions (Rx or Tx)"
type: integer type: integer
sequence: sequence:
description: "Sequence in the enumeration of same device types" description: "Sequence in the enumeration of same device types"

View File

@ -1731,10 +1731,10 @@ bool WebAPIRequestMapper::validateDeviceListItem(SWGSDRangel::SWGDeviceListItem&
deviceListItem.setSequence(-1); deviceListItem.setSequence(-1);
} }
if (jsonObject.contains("streamIndex")) { if (jsonObject.contains("deviceStreamIndex")) {
deviceListItem.setStreamIndex(jsonObject["streamIndex"].toInt(-1)); deviceListItem.setDeviceStreamIndex(jsonObject["deviceStreamIndex"].toInt(-1));
} else { } else {
deviceListItem.setStreamIndex(-1); deviceListItem.setDeviceStreamIndex(-1);
} }
return identified; return identified;

View File

@ -133,8 +133,8 @@ int WebAPIAdapterGUI::instanceDevices(
*devices->back()->getHwType() = samplingDevice.hardwareId; *devices->back()->getHwType() = samplingDevice.hardwareId;
*devices->back()->getSerial() = samplingDevice.serial; *devices->back()->getSerial() = samplingDevice.serial;
devices->back()->setSequence(samplingDevice.sequence); devices->back()->setSequence(samplingDevice.sequence);
devices->back()->setDirection(!samplingDevice.rxElseTx ? 0 : 1); devices->back()->setDirection(samplingDevice.rxElseTx ? 0 : 1);
devices->back()->setNbStreams(samplingDevice.deviceNbItems); devices->back()->setDeviceNbStreams(samplingDevice.deviceNbItems);
devices->back()->setDeviceSetIndex(samplingDevice.claimed); devices->back()->setDeviceSetIndex(samplingDevice.claimed);
devices->back()->setIndex(i); devices->back()->setIndex(i);
} }
@ -946,14 +946,14 @@ int WebAPIAdapterGUI::devicesetDevicePut(
if ((query.getDirection() != 1) && (deviceSet->m_deviceSinkEngine)) if ((query.getDirection() != 1) && (deviceSet->m_deviceSinkEngine))
{ {
error.init(); error.init();
*error.getMessage() = QString("Device type (Rx) and device set type (Tx) mismatch"); *error.getMessage() = QString("Device type and device set type (Tx) mismatch");
return 404; return 404;
} }
if ((query.getDirection() != 0) && (deviceSet->m_deviceSourceEngine)) if ((query.getDirection() != 0) && (deviceSet->m_deviceSourceEngine))
{ {
error.init(); error.init();
*error.getMessage() = QString("Device type (Tx) and device set type (Rx) mismatch"); *error.getMessage() = QString("Device type and device set type (Rx) mismatch");
return 404; return 404;
} }
@ -998,7 +998,7 @@ int WebAPIAdapterGUI::devicesetDevicePut(
continue; continue;
} }
if ((query.getStreamIndex() >= 0) && (query.getStreamIndex() != samplingDevice.deviceItemIndex)) { if ((query.getDeviceStreamIndex() >= 0) && (query.getDeviceStreamIndex() != samplingDevice.deviceItemIndex)) {
continue; continue;
} }
@ -1011,8 +1011,8 @@ int WebAPIAdapterGUI::devicesetDevicePut(
*response.getSerial() = samplingDevice.serial; *response.getSerial() = samplingDevice.serial;
response.setSequence(samplingDevice.sequence); response.setSequence(samplingDevice.sequence);
response.setDirection(tx); response.setDirection(tx);
response.setNbStreams(samplingDevice.deviceNbItems); response.setDeviceNbStreams(samplingDevice.deviceNbItems);
response.setStreamIndex(samplingDevice.deviceItemIndex); response.setDeviceStreamIndex(samplingDevice.deviceItemIndex);
response.setDeviceSetIndex(deviceSetIndex); response.setDeviceSetIndex(deviceSetIndex);
response.setIndex(i); response.setIndex(i);
@ -1102,7 +1102,7 @@ int WebAPIAdapterGUI::devicesetDeviceSettingsPutPatch(
} }
else if (deviceSet->m_deviceSinkEngine) // Single Tx else if (deviceSet->m_deviceSinkEngine) // Single Tx
{ {
if (response.getDirection() != 0) if (response.getDirection() != 1)
{ {
*error.getMessage() = QString("Single Tx device found but other type of device requested"); *error.getMessage() = QString("Single Tx device found but other type of device requested");
return 400; return 400;
@ -1387,7 +1387,6 @@ int WebAPIAdapterGUI::devicesetChannelPost(
*error.getMessage() = QString("This type of device is not implemented yet"); *error.getMessage() = QString("This type of device is not implemented yet");
return 400; return 400;
} }
} }
else else
{ {
@ -1700,8 +1699,8 @@ void WebAPIAdapterGUI::getDeviceSet(SWGSDRangel::SWGDeviceSet *deviceSet, const
*samplingDevice->getHwType() = deviceUISet->m_deviceSinkAPI->getHardwareId(); *samplingDevice->getHwType() = deviceUISet->m_deviceSinkAPI->getHardwareId();
*samplingDevice->getSerial() = deviceUISet->m_deviceSinkAPI->getSampleSinkSerial(); *samplingDevice->getSerial() = deviceUISet->m_deviceSinkAPI->getSampleSinkSerial();
samplingDevice->setSequence(deviceUISet->m_deviceSinkAPI->getSampleSinkSequence()); samplingDevice->setSequence(deviceUISet->m_deviceSinkAPI->getSampleSinkSequence());
samplingDevice->setNbStreams(deviceUISet->m_deviceSinkAPI->getNbItems()); samplingDevice->setDeviceNbStreams(deviceUISet->m_deviceSinkAPI->getNbItems());
samplingDevice->setStreamIndex(deviceUISet->m_deviceSinkAPI->getItemIndex()); samplingDevice->setDeviceStreamIndex(deviceUISet->m_deviceSinkAPI->getItemIndex());
deviceUISet->m_deviceSinkAPI->getDeviceEngineStateStr(*samplingDevice->getState()); deviceUISet->m_deviceSinkAPI->getDeviceEngineStateStr(*samplingDevice->getState());
DeviceSampleSink *sampleSink = deviceUISet->m_deviceSinkEngine->getSink(); DeviceSampleSink *sampleSink = deviceUISet->m_deviceSinkEngine->getSink();
@ -1732,8 +1731,8 @@ void WebAPIAdapterGUI::getDeviceSet(SWGSDRangel::SWGDeviceSet *deviceSet, const
*samplingDevice->getHwType() = deviceUISet->m_deviceSourceAPI->getHardwareId(); *samplingDevice->getHwType() = deviceUISet->m_deviceSourceAPI->getHardwareId();
*samplingDevice->getSerial() = deviceUISet->m_deviceSourceAPI->getSampleSourceSerial(); *samplingDevice->getSerial() = deviceUISet->m_deviceSourceAPI->getSampleSourceSerial();
samplingDevice->setSequence(deviceUISet->m_deviceSourceAPI->getSampleSourceSequence()); samplingDevice->setSequence(deviceUISet->m_deviceSourceAPI->getSampleSourceSequence());
samplingDevice->setNbStreams(deviceUISet->m_deviceSourceAPI->getNbItems()); samplingDevice->setDeviceNbStreams(deviceUISet->m_deviceSourceAPI->getNbItems());
samplingDevice->setStreamIndex(deviceUISet->m_deviceSourceAPI->getItemIndex()); samplingDevice->setDeviceStreamIndex(deviceUISet->m_deviceSourceAPI->getItemIndex());
deviceUISet->m_deviceSourceAPI->getDeviceEngineStateStr(*samplingDevice->getState()); deviceUISet->m_deviceSourceAPI->getDeviceEngineStateStr(*samplingDevice->getState());
DeviceSampleSource *sampleSource = deviceUISet->m_deviceSourceEngine->getSource(); DeviceSampleSource *sampleSource = deviceUISet->m_deviceSourceEngine->getSource();

View File

@ -133,8 +133,8 @@ int WebAPIAdapterSrv::instanceDevices(
*devices->back()->getHwType() = samplingDevice.hardwareId; *devices->back()->getHwType() = samplingDevice.hardwareId;
*devices->back()->getSerial() = samplingDevice.serial; *devices->back()->getSerial() = samplingDevice.serial;
devices->back()->setSequence(samplingDevice.sequence); devices->back()->setSequence(samplingDevice.sequence);
devices->back()->setTx(!samplingDevice.rxElseTx); devices->back()->setDirection(samplingDevice.rxElseTx ? 0 : 1);
devices->back()->setNbStreams(samplingDevice.deviceNbItems); devices->back()->setDeviceNbStreams(samplingDevice.deviceNbItems);
devices->back()->setDeviceSetIndex(samplingDevice.claimed); devices->back()->setDeviceSetIndex(samplingDevice.claimed);
devices->back()->setIndex(i); devices->back()->setIndex(i);
} }
@ -161,7 +161,7 @@ int WebAPIAdapterSrv::instanceChannels(
const PluginDescriptor& pluginDescriptor = channelInterface->getPluginDescriptor(); const PluginDescriptor& pluginDescriptor = channelInterface->getPluginDescriptor();
*channels->back()->getVersion() = pluginDescriptor.version; *channels->back()->getVersion() = pluginDescriptor.version;
*channels->back()->getName() = pluginDescriptor.displayedName; *channels->back()->getName() = pluginDescriptor.displayedName;
channels->back()->setTx(tx); channels->back()->setDirection(tx ? 1 : 0);
*channels->back()->getIdUri() = channelRegistrations->at(i).m_channelIdURI; *channels->back()->getIdUri() = channelRegistrations->at(i).m_channelIdURI;
*channels->back()->getId() = channelRegistrations->at(i).m_channelId; *channels->back()->getId() = channelRegistrations->at(i).m_channelId;
channels->back()->setIndex(i); channels->back()->setIndex(i);
@ -1028,26 +1028,43 @@ int WebAPIAdapterSrv::devicesetDevicePut(
{ {
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
if ((query.getTx() == 0) && (deviceSet->m_deviceSinkEngine)) if ((query.getDirection() != 1) && (deviceSet->m_deviceSinkEngine))
{ {
error.init(); error.init();
*error.getMessage() = QString("Device type (Rx) and device set type (Tx) mismatch"); *error.getMessage() = QString("Device type and device set type (Tx) mismatch");
return 404; return 404;
} }
if ((query.getTx() != 0) && (deviceSet->m_deviceSourceEngine)) if ((query.getDirection() != 0) && (deviceSet->m_deviceSourceEngine))
{ {
error.init(); error.init();
*error.getMessage() = QString("Device type (Tx) and device set type (Rx) mismatch"); *error.getMessage() = QString("Device type and device set type (Rx) mismatch");
return 404; return 404;
} }
int nbSamplingDevices = query.getTx() != 0 ? DeviceEnumerator::instance()->getNbTxSamplingDevices() : DeviceEnumerator::instance()->getNbRxSamplingDevices(); int nbSamplingDevices;
int tx = query.getTx();
if (query.getDirection() == 0) {
nbSamplingDevices = DeviceEnumerator::instance()->getNbRxSamplingDevices();
} else if (query.getDirection() == 1) {
nbSamplingDevices = DeviceEnumerator::instance()->getNbTxSamplingDevices();
} else {
nbSamplingDevices = 0; // TODO: not implemented yet
}
for (int i = 0; i < nbSamplingDevices; i++) for (int i = 0; i < nbSamplingDevices; i++)
{ {
PluginInterface::SamplingDevice samplingDevice = query.getTx() ? DeviceEnumerator::instance()->getTxSamplingDevice(i) : DeviceEnumerator::instance()->getRxSamplingDevice(i); int tx;
if (query.getDirection() == 0) {
tx = 0;
} else if (query.getDirection() == 1) {
tx = 1;
} else {
continue; // TODO: any device (2) not supported yet
}
PluginInterface::SamplingDevice samplingDevice = query.getDirection() == 0 ? DeviceEnumerator::instance()->getRxSamplingDevice(i) : DeviceEnumerator::instance()->getTxSamplingDevice(i);
if (query.getDisplayedName() && (*query.getDisplayedName() != samplingDevice.displayedName)) { if (query.getDisplayedName() && (*query.getDisplayedName() != samplingDevice.displayedName)) {
continue; continue;
@ -1065,11 +1082,11 @@ int WebAPIAdapterSrv::devicesetDevicePut(
continue; continue;
} }
if ((query.getStreamIndex() >= 0) && (query.getStreamIndex() != samplingDevice.deviceItemIndex)) { if ((query.getDeviceStreamIndex() >= 0) && (query.getDeviceStreamIndex() != samplingDevice.deviceItemIndex)) {
continue; continue;
} }
MainCore::MsgSetDevice *msg = MainCore::MsgSetDevice::create(deviceSetIndex, i, query.getTx() != 0); MainCore::MsgSetDevice *msg = MainCore::MsgSetDevice::create(deviceSetIndex, i, query.getDirection() == 1);
m_mainCore.m_inputMessageQueue.push(msg); m_mainCore.m_inputMessageQueue.push(msg);
response.init(); response.init();
@ -1077,9 +1094,9 @@ int WebAPIAdapterSrv::devicesetDevicePut(
*response.getHwType() = samplingDevice.hardwareId; *response.getHwType() = samplingDevice.hardwareId;
*response.getSerial() = samplingDevice.serial; *response.getSerial() = samplingDevice.serial;
response.setSequence(samplingDevice.sequence); response.setSequence(samplingDevice.sequence);
response.setTx(tx); response.setDirection(tx);
response.setNbStreams(samplingDevice.deviceNbItems); response.setDeviceNbStreams(samplingDevice.deviceNbItems);
response.setStreamIndex(samplingDevice.deviceItemIndex); response.setDeviceStreamIndex(samplingDevice.deviceItemIndex);
response.setDeviceSetIndex(deviceSetIndex); response.setDeviceSetIndex(deviceSetIndex);
response.setIndex(i); response.setIndex(i);
@ -1110,17 +1127,17 @@ int WebAPIAdapterSrv::devicesetDeviceSettingsGet(
{ {
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
if (deviceSet->m_deviceSourceEngine) // Rx if (deviceSet->m_deviceSourceEngine) // Single Rx
{ {
response.setDeviceHwType(new QString(deviceSet->m_deviceSourceAPI->getHardwareId())); response.setDeviceHwType(new QString(deviceSet->m_deviceSourceAPI->getHardwareId()));
response.setTx(0); response.setDirection(0);
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource(); DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
return source->webapiSettingsGet(response, *error.getMessage()); return source->webapiSettingsGet(response, *error.getMessage());
} }
else if (deviceSet->m_deviceSinkEngine) // Tx else if (deviceSet->m_deviceSinkEngine) // Single Tx
{ {
response.setDeviceHwType(new QString(deviceSet->m_deviceSinkAPI->getHardwareId())); response.setDeviceHwType(new QString(deviceSet->m_deviceSinkAPI->getHardwareId()));
response.setTx(1); response.setDirection(1);
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink(); DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
return sink->webapiSettingsGet(response, *error.getMessage()); return sink->webapiSettingsGet(response, *error.getMessage());
} }
@ -1150,11 +1167,11 @@ int WebAPIAdapterSrv::devicesetDeviceSettingsPutPatch(
{ {
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
if (deviceSet->m_deviceSourceEngine) // Rx if (deviceSet->m_deviceSourceEngine) // Single Rx
{ {
if (response.getTx() != 0) if (response.getDirection() != 0)
{ {
*error.getMessage() = QString("Rx device found but Tx device requested"); *error.getMessage() = QString("Single Rx device found but other type of device requested");
return 400; return 400;
} }
if (deviceSet->m_deviceSourceAPI->getHardwareId() != *response.getDeviceHwType()) if (deviceSet->m_deviceSourceAPI->getHardwareId() != *response.getDeviceHwType())
@ -1168,11 +1185,11 @@ int WebAPIAdapterSrv::devicesetDeviceSettingsPutPatch(
return source->webapiSettingsPutPatch(force, deviceSettingsKeys, response, *error.getMessage()); return source->webapiSettingsPutPatch(force, deviceSettingsKeys, response, *error.getMessage());
} }
} }
else if (deviceSet->m_deviceSinkEngine) // Tx else if (deviceSet->m_deviceSinkEngine) // Single Tx
{ {
if (response.getTx() == 0) if (response.getDirection() != 1)
{ {
*error.getMessage() = QString("Tx device found but Rx device requested"); *error.getMessage() = QString("Single Tx device found but other type of device requested");
return 400; return 400;
} }
else if (deviceSet->m_deviceSinkAPI->getHardwareId() != *response.getDeviceHwType()) else if (deviceSet->m_deviceSinkAPI->getHardwareId() != *response.getDeviceHwType())
@ -1318,17 +1335,17 @@ int WebAPIAdapterSrv::devicesetDeviceReportGet(
{ {
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
if (deviceSet->m_deviceSourceEngine) // Rx if (deviceSet->m_deviceSourceEngine) // Single Rx
{ {
response.setDeviceHwType(new QString(deviceSet->m_deviceSourceAPI->getHardwareId())); response.setDeviceHwType(new QString(deviceSet->m_deviceSourceAPI->getHardwareId()));
response.setTx(0); response.setDirection(0);
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource(); DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
return source->webapiReportGet(response, *error.getMessage()); return source->webapiReportGet(response, *error.getMessage());
} }
else if (deviceSet->m_deviceSinkEngine) // Tx else if (deviceSet->m_deviceSinkEngine) // Single Tx
{ {
response.setDeviceHwType(new QString(deviceSet->m_deviceSinkAPI->getHardwareId())); response.setDeviceHwType(new QString(deviceSet->m_deviceSinkAPI->getHardwareId()));
response.setTx(1); response.setDirection(1);
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink(); DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
return sink->webapiReportGet(response, *error.getMessage()); return sink->webapiReportGet(response, *error.getMessage());
} }
@ -1376,7 +1393,7 @@ int WebAPIAdapterSrv::devicesetChannelPost(
{ {
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
if (query.getTx() == 0) // Rx if (query.getDirection() == 0) // Single Rx
{ {
if (deviceSet->m_deviceSourceEngine == 0) if (deviceSet->m_deviceSourceEngine == 0)
{ {
@ -1412,7 +1429,7 @@ int WebAPIAdapterSrv::devicesetChannelPost(
return 404; return 404;
} }
} }
else // Tx else if (query.getDirection() == 1) // single Tx
{ {
if (deviceSet->m_deviceSinkEngine == 0) if (deviceSet->m_deviceSinkEngine == 0)
{ {
@ -1448,6 +1465,12 @@ int WebAPIAdapterSrv::devicesetChannelPost(
return 404; return 404;
} }
} }
else
{
error.init();
*error.getMessage() = QString("This type of device is not implemented yet");
return 400;
}
} }
else else
{ {
@ -1536,7 +1559,7 @@ int WebAPIAdapterSrv::devicesetChannelSettingsGet(
{ {
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
if (deviceSet->m_deviceSourceEngine) // Rx if (deviceSet->m_deviceSourceEngine) // Single Rx
{ {
ChannelSinkAPI *channelAPI = deviceSet->m_deviceSourceAPI->getChanelAPIAt(channelIndex); ChannelSinkAPI *channelAPI = deviceSet->m_deviceSourceAPI->getChanelAPIAt(channelIndex);
@ -1549,11 +1572,11 @@ int WebAPIAdapterSrv::devicesetChannelSettingsGet(
{ {
response.setChannelType(new QString()); response.setChannelType(new QString());
channelAPI->getIdentifier(*response.getChannelType()); channelAPI->getIdentifier(*response.getChannelType());
response.setTx(0); response.setDirection(0);
return channelAPI->webapiSettingsGet(response, *error.getMessage()); return channelAPI->webapiSettingsGet(response, *error.getMessage());
} }
} }
else if (deviceSet->m_deviceSinkEngine) // Tx else if (deviceSet->m_deviceSinkEngine) // Single Tx
{ {
ChannelSourceAPI *channelAPI = deviceSet->m_deviceSinkAPI->getChanelAPIAt(channelIndex); ChannelSourceAPI *channelAPI = deviceSet->m_deviceSinkAPI->getChanelAPIAt(channelIndex);
@ -1566,7 +1589,7 @@ int WebAPIAdapterSrv::devicesetChannelSettingsGet(
{ {
response.setChannelType(new QString()); response.setChannelType(new QString());
channelAPI->getIdentifier(*response.getChannelType()); channelAPI->getIdentifier(*response.getChannelType());
response.setTx(1); response.setDirection(1);
return channelAPI->webapiSettingsGet(response, *error.getMessage()); return channelAPI->webapiSettingsGet(response, *error.getMessage());
} }
} }
@ -1595,7 +1618,7 @@ int WebAPIAdapterSrv::devicesetChannelReportGet(
{ {
DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex]; DeviceSet *deviceSet = m_mainCore.m_deviceSets[deviceSetIndex];
if (deviceSet->m_deviceSourceEngine) // Rx if (deviceSet->m_deviceSourceEngine) // Single Rx
{ {
ChannelSinkAPI *channelAPI = deviceSet->m_deviceSourceAPI->getChanelAPIAt(channelIndex); ChannelSinkAPI *channelAPI = deviceSet->m_deviceSourceAPI->getChanelAPIAt(channelIndex);
@ -1608,11 +1631,11 @@ int WebAPIAdapterSrv::devicesetChannelReportGet(
{ {
response.setChannelType(new QString()); response.setChannelType(new QString());
channelAPI->getIdentifier(*response.getChannelType()); channelAPI->getIdentifier(*response.getChannelType());
response.setTx(0); response.setDirection(0);
return channelAPI->webapiReportGet(response, *error.getMessage()); return channelAPI->webapiReportGet(response, *error.getMessage());
} }
} }
else if (deviceSet->m_deviceSinkEngine) // Tx else if (deviceSet->m_deviceSinkEngine) // Single Tx
{ {
ChannelSourceAPI *channelAPI = deviceSet->m_deviceSinkAPI->getChanelAPIAt(channelIndex); ChannelSourceAPI *channelAPI = deviceSet->m_deviceSinkAPI->getChanelAPIAt(channelIndex);
@ -1625,7 +1648,7 @@ int WebAPIAdapterSrv::devicesetChannelReportGet(
{ {
response.setChannelType(new QString()); response.setChannelType(new QString());
channelAPI->getIdentifier(*response.getChannelType()); channelAPI->getIdentifier(*response.getChannelType());
response.setTx(1); response.setDirection(1);
return channelAPI->webapiReportGet(response, *error.getMessage()); return channelAPI->webapiReportGet(response, *error.getMessage());
} }
} }
@ -1747,15 +1770,15 @@ void WebAPIAdapterSrv::getDeviceSet(SWGSDRangel::SWGDeviceSet *swgDeviceSet, con
SWGSDRangel::SWGSamplingDevice *samplingDevice = swgDeviceSet->getSamplingDevice(); SWGSDRangel::SWGSamplingDevice *samplingDevice = swgDeviceSet->getSamplingDevice();
samplingDevice->init(); samplingDevice->init();
samplingDevice->setIndex(deviceUISetIndex); samplingDevice->setIndex(deviceUISetIndex);
samplingDevice->setTx(deviceSet->m_deviceSinkEngine != 0);
if (deviceSet->m_deviceSinkEngine) // Tx data if (deviceSet->m_deviceSinkEngine) // Single Tx data
{ {
samplingDevice->setDirection(1);
*samplingDevice->getHwType() = deviceSet->m_deviceSinkAPI->getHardwareId(); *samplingDevice->getHwType() = deviceSet->m_deviceSinkAPI->getHardwareId();
*samplingDevice->getSerial() = deviceSet->m_deviceSinkAPI->getSampleSinkSerial(); *samplingDevice->getSerial() = deviceSet->m_deviceSinkAPI->getSampleSinkSerial();
samplingDevice->setSequence(deviceSet->m_deviceSinkAPI->getSampleSinkSequence()); samplingDevice->setSequence(deviceSet->m_deviceSinkAPI->getSampleSinkSequence());
samplingDevice->setNbStreams(deviceSet->m_deviceSinkAPI->getNbItems()); samplingDevice->setDeviceNbStreams(deviceSet->m_deviceSinkAPI->getNbItems());
samplingDevice->setStreamIndex(deviceSet->m_deviceSinkAPI->getItemIndex()); samplingDevice->setDeviceStreamIndex(deviceSet->m_deviceSinkAPI->getItemIndex());
deviceSet->m_deviceSinkAPI->getDeviceEngineStateStr(*samplingDevice->getState()); deviceSet->m_deviceSinkAPI->getDeviceEngineStateStr(*samplingDevice->getState());
DeviceSampleSink *sampleSink = deviceSet->m_deviceSinkEngine->getSink(); DeviceSampleSink *sampleSink = deviceSet->m_deviceSinkEngine->getSink();
@ -1780,13 +1803,14 @@ void WebAPIAdapterSrv::getDeviceSet(SWGSDRangel::SWGDeviceSet *swgDeviceSet, con
} }
} }
if (deviceSet->m_deviceSourceEngine) // Rx data if (deviceSet->m_deviceSourceEngine) // Single Rx data
{ {
samplingDevice->setDirection(1);
*samplingDevice->getHwType() = deviceSet->m_deviceSourceAPI->getHardwareId(); *samplingDevice->getHwType() = deviceSet->m_deviceSourceAPI->getHardwareId();
*samplingDevice->getSerial() = deviceSet->m_deviceSourceAPI->getSampleSourceSerial(); *samplingDevice->getSerial() = deviceSet->m_deviceSourceAPI->getSampleSourceSerial();
samplingDevice->setSequence(deviceSet->m_deviceSourceAPI->getSampleSourceSequence()); samplingDevice->setSequence(deviceSet->m_deviceSourceAPI->getSampleSourceSequence());
samplingDevice->setNbStreams(deviceSet->m_deviceSourceAPI->getNbItems()); samplingDevice->setDeviceNbStreams(deviceSet->m_deviceSourceAPI->getNbItems());
samplingDevice->setStreamIndex(deviceSet->m_deviceSourceAPI->getItemIndex()); samplingDevice->setDeviceStreamIndex(deviceSet->m_deviceSourceAPI->getItemIndex());
deviceSet->m_deviceSourceAPI->getDeviceEngineStateStr(*samplingDevice->getState()); deviceSet->m_deviceSourceAPI->getDeviceEngineStateStr(*samplingDevice->getState());
DeviceSampleSource *sampleSource = deviceSet->m_deviceSourceEngine->getSource(); DeviceSampleSource *sampleSource = deviceSet->m_deviceSourceEngine->getSource();

View File

@ -754,7 +754,7 @@ paths:
description: Index of device set in the device set list description: Index of device set in the device set list
- name: body - name: body
in: body in: body
description: Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. description: Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
required: true required: true
schema: schema:
$ref: "#/definitions/DeviceListItem" $ref: "#/definitions/DeviceListItem"
@ -1371,11 +1371,11 @@ definitions:
direction: direction:
description: "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" description: "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)"
type: integer type: integer
nbStreams: deviceNbStreams:
description: "Number of channels or streams in the device" description: "Number of channels or streams in the device"
type: integer type: integer
streamIndex: deviceStreamIndex:
description: "Index of the channel in the device" description: "Index of the channel in the device. Applies to single stream directions (Rx or Tx)"
type: integer type: integer
deviceSetIndex: deviceSetIndex:
description: "Index of the device set that claimed this device (-1 if not claimed)" description: "Index of the device set that claimed this device (-1 if not claimed)"
@ -1470,11 +1470,11 @@ definitions:
direction: direction:
description: "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" description: "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)"
type: integer type: integer
nbStreams: deviceNbStreams:
description: "Number of channels or streams in the device" description: "Number of channels or streams in the device"
type: integer type: integer
streamIndex: deviceStreamIndex:
description: "Index of the channel in the device" description: "Index of the channel in the device. Applies to single stream directions (Rx or Tx)"
type: integer type: integer
sequence: sequence:
description: "Sequence in the enumeration of same device types" description: "Sequence in the enumeration of same device types"

View File

@ -2107,13 +2107,13 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" "description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)"
}, },
"nbStreams" : { "deviceNbStreams" : {
"type" : "integer", "type" : "integer",
"description" : "Number of channels or streams in the device" "description" : "Number of channels or streams in the device"
}, },
"streamIndex" : { "deviceStreamIndex" : {
"type" : "integer", "type" : "integer",
"description" : "Index of the channel in the device" "description" : "Index of the channel in the device. Applies to single stream directions (Rx or Tx)"
}, },
"deviceSetIndex" : { "deviceSetIndex" : {
"type" : "integer", "type" : "integer",
@ -4779,7 +4779,7 @@ margin-bottom: 20px;
"description" : "A sample rate expressed in samples per second (S/s)" "description" : "A sample rate expressed in samples per second (S/s)"
}; };
defs.SamplingDevice = { defs.SamplingDevice = {
"required" : [ "bandwidth", "centerFrequency", "hwType", "index", "sequence", "serial", "state", "streamIndex" ], "required" : [ "bandwidth", "centerFrequency", "hwType", "index", "sequence", "serial", "state" ],
"properties" : { "properties" : {
"index" : { "index" : {
"type" : "integer", "type" : "integer",
@ -4793,13 +4793,13 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)" "description" : "0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)"
}, },
"nbStreams" : { "deviceNbStreams" : {
"type" : "integer", "type" : "integer",
"description" : "Number of channels or streams in the device" "description" : "Number of channels or streams in the device"
}, },
"streamIndex" : { "deviceStreamIndex" : {
"type" : "integer", "type" : "integer",
"description" : "Index of the channel in the device" "description" : "Index of the channel in the device. Applies to single stream directions (Rx or Tx)"
}, },
"sequence" : { "sequence" : {
"type" : "integer", "type" : "integer",
@ -9567,7 +9567,7 @@ public class DeviceSetApiExample {
DeviceSetApi apiInstance = new DeviceSetApi(); DeviceSetApi apiInstance = new DeviceSetApi();
Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
DeviceListItem body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. DeviceListItem body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try { try {
DeviceListItem result = apiInstance.devicesetDevicePut(deviceSetIndex, body); DeviceListItem result = apiInstance.devicesetDevicePut(deviceSetIndex, body);
System.out.println(result); System.out.println(result);
@ -9587,7 +9587,7 @@ public class DeviceSetApiExample {
public static void main(String[] args) { public static void main(String[] args) {
DeviceSetApi apiInstance = new DeviceSetApi(); DeviceSetApi apiInstance = new DeviceSetApi();
Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
DeviceListItem body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. DeviceListItem body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try { try {
DeviceListItem result = apiInstance.devicesetDevicePut(deviceSetIndex, body); DeviceListItem result = apiInstance.devicesetDevicePut(deviceSetIndex, body);
System.out.println(result); System.out.println(result);
@ -9604,7 +9604,7 @@ public class DeviceSetApiExample {
</div> --> </div> -->
<div class="tab-pane" id="examples-DeviceSet-devicesetDevicePut-0-objc"> <div class="tab-pane" id="examples-DeviceSet-devicesetDevicePut-0-objc">
<pre class="prettyprint"><code class="language-cpp">Integer *deviceSetIndex = 56; // Index of device set in the device set list <pre class="prettyprint"><code class="language-cpp">Integer *deviceSetIndex = 56; // Index of device set in the device set list
DeviceListItem *body = ; // Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. DeviceListItem *body = ; // Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init]; DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init];
@ -9628,7 +9628,7 @@ var api = new SdRangel.DeviceSetApi()
var deviceSetIndex = 56; // {Integer} Index of device set in the device set list var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
var body = ; // {DeviceListItem} Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. var body = ; // {DeviceListItem} Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
var callback = function(error, data, response) { var callback = function(error, data, response) {
@ -9661,7 +9661,7 @@ namespace Example
var apiInstance = new DeviceSetApi(); var apiInstance = new DeviceSetApi();
var deviceSetIndex = 56; // Integer | Index of device set in the device set list var deviceSetIndex = 56; // Integer | Index of device set in the device set list
var body = new DeviceListItem(); // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. var body = new DeviceListItem(); // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try try
{ {
@ -9684,7 +9684,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\DeviceSetApi(); $api_instance = new Swagger\Client\Api\DeviceSetApi();
$deviceSetIndex = 56; // Integer | Index of device set in the device set list $deviceSetIndex = 56; // Integer | Index of device set in the device set list
$body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. $body = ; // DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try { try {
$result = $api_instance->devicesetDevicePut($deviceSetIndex, $body); $result = $api_instance->devicesetDevicePut($deviceSetIndex, $body);
@ -9702,7 +9702,7 @@ use SWGSDRangel::DeviceSetApi;
my $api_instance = SWGSDRangel::DeviceSetApi->new(); my $api_instance = SWGSDRangel::DeviceSetApi->new();
my $deviceSetIndex = 56; # Integer | Index of device set in the device set list my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
my $body = SWGSDRangel::Object::DeviceListItem->new(); # DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. my $body = SWGSDRangel::Object::DeviceListItem->new(); # DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
eval { eval {
my $result = $api_instance->devicesetDevicePut(deviceSetIndex => $deviceSetIndex, body => $body); my $result = $api_instance->devicesetDevicePut(deviceSetIndex => $deviceSetIndex, body => $body);
@ -9723,7 +9723,7 @@ from pprint import pprint
# create an instance of the API class # create an instance of the API class
api_instance = swagger_sdrangel.DeviceSetApi() api_instance = swagger_sdrangel.DeviceSetApi()
deviceSetIndex = 56 # Integer | Index of device set in the device set list deviceSetIndex = 56 # Integer | Index of device set in the device set list
body = # DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified. body = # DeviceListItem | Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.
try: try:
api_response = api_instance.deviceset_device_put(deviceSetIndex, body) api_response = api_instance.deviceset_device_put(deviceSetIndex, body)
@ -9782,7 +9782,7 @@ $(document).ready(function() {
var schemaWrapper = { var schemaWrapper = {
"in" : "body", "in" : "body",
"name" : "body", "name" : "body",
"description" : "Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and nbStreams are ignored. Rx is assumed if Tx is not specified.", "description" : "Device item to look for. Specify only the fields you want to search for. You must at least specify one among displayedName, hwType or serial. index and deviceŃbStreams are ignored. Rx is assumed by default.",
"required" : true, "required" : true,
"schema" : { "schema" : {
"$ref" : "#/definitions/DeviceListItem" "$ref" : "#/definitions/DeviceListItem"
@ -24924,7 +24924,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2019-05-07T11:40:05.130+02:00 Generated 2019-05-07T14:58:09.366+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -38,10 +38,10 @@ SWGDeviceListItem::SWGDeviceListItem() {
m_sequence_isSet = false; m_sequence_isSet = false;
direction = 0; direction = 0;
m_direction_isSet = false; m_direction_isSet = false;
nb_streams = 0; device_nb_streams = 0;
m_nb_streams_isSet = false; m_device_nb_streams_isSet = false;
stream_index = 0; device_stream_index = 0;
m_stream_index_isSet = false; m_device_stream_index_isSet = false;
device_set_index = 0; device_set_index = 0;
m_device_set_index_isSet = false; m_device_set_index_isSet = false;
index = 0; index = 0;
@ -64,10 +64,10 @@ SWGDeviceListItem::init() {
m_sequence_isSet = false; m_sequence_isSet = false;
direction = 0; direction = 0;
m_direction_isSet = false; m_direction_isSet = false;
nb_streams = 0; device_nb_streams = 0;
m_nb_streams_isSet = false; m_device_nb_streams_isSet = false;
stream_index = 0; device_stream_index = 0;
m_stream_index_isSet = false; m_device_stream_index_isSet = false;
device_set_index = 0; device_set_index = 0;
m_device_set_index_isSet = false; m_device_set_index_isSet = false;
index = 0; index = 0;
@ -114,9 +114,9 @@ SWGDeviceListItem::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", ""); ::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", "");
::SWGSDRangel::setValue(&nb_streams, pJson["nbStreams"], "qint32", ""); ::SWGSDRangel::setValue(&device_nb_streams, pJson["deviceNbStreams"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", ""); ::SWGSDRangel::setValue(&device_stream_index, pJson["deviceStreamIndex"], "qint32", "");
::SWGSDRangel::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", ""); ::SWGSDRangel::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", "");
@ -153,11 +153,11 @@ SWGDeviceListItem::asJsonObject() {
if(m_direction_isSet){ if(m_direction_isSet){
obj->insert("direction", QJsonValue(direction)); obj->insert("direction", QJsonValue(direction));
} }
if(m_nb_streams_isSet){ if(m_device_nb_streams_isSet){
obj->insert("nbStreams", QJsonValue(nb_streams)); obj->insert("deviceNbStreams", QJsonValue(device_nb_streams));
} }
if(m_stream_index_isSet){ if(m_device_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index)); obj->insert("deviceStreamIndex", QJsonValue(device_stream_index));
} }
if(m_device_set_index_isSet){ if(m_device_set_index_isSet){
obj->insert("deviceSetIndex", QJsonValue(device_set_index)); obj->insert("deviceSetIndex", QJsonValue(device_set_index));
@ -220,23 +220,23 @@ SWGDeviceListItem::setDirection(qint32 direction) {
} }
qint32 qint32
SWGDeviceListItem::getNbStreams() { SWGDeviceListItem::getDeviceNbStreams() {
return nb_streams; return device_nb_streams;
} }
void void
SWGDeviceListItem::setNbStreams(qint32 nb_streams) { SWGDeviceListItem::setDeviceNbStreams(qint32 device_nb_streams) {
this->nb_streams = nb_streams; this->device_nb_streams = device_nb_streams;
this->m_nb_streams_isSet = true; this->m_device_nb_streams_isSet = true;
} }
qint32 qint32
SWGDeviceListItem::getStreamIndex() { SWGDeviceListItem::getDeviceStreamIndex() {
return stream_index; return device_stream_index;
} }
void void
SWGDeviceListItem::setStreamIndex(qint32 stream_index) { SWGDeviceListItem::setDeviceStreamIndex(qint32 device_stream_index) {
this->stream_index = stream_index; this->device_stream_index = device_stream_index;
this->m_stream_index_isSet = true; this->m_device_stream_index_isSet = true;
} }
qint32 qint32
@ -269,8 +269,8 @@ SWGDeviceListItem::isSet(){
if(serial != nullptr && *serial != QString("")){ isObjectUpdated = true; break;} if(serial != nullptr && *serial != QString("")){ isObjectUpdated = true; break;}
if(m_sequence_isSet){ isObjectUpdated = true; break;} if(m_sequence_isSet){ isObjectUpdated = true; break;}
if(m_direction_isSet){ isObjectUpdated = true; break;} if(m_direction_isSet){ isObjectUpdated = true; break;}
if(m_nb_streams_isSet){ isObjectUpdated = true; break;} if(m_device_nb_streams_isSet){ isObjectUpdated = true; break;}
if(m_stream_index_isSet){ isObjectUpdated = true; break;} if(m_device_stream_index_isSet){ isObjectUpdated = true; break;}
if(m_device_set_index_isSet){ isObjectUpdated = true; break;} if(m_device_set_index_isSet){ isObjectUpdated = true; break;}
if(m_index_isSet){ isObjectUpdated = true; break;} if(m_index_isSet){ isObjectUpdated = true; break;}
}while(false); }while(false);

View File

@ -57,11 +57,11 @@ public:
qint32 getDirection(); qint32 getDirection();
void setDirection(qint32 direction); void setDirection(qint32 direction);
qint32 getNbStreams(); qint32 getDeviceNbStreams();
void setNbStreams(qint32 nb_streams); void setDeviceNbStreams(qint32 device_nb_streams);
qint32 getStreamIndex(); qint32 getDeviceStreamIndex();
void setStreamIndex(qint32 stream_index); void setDeviceStreamIndex(qint32 device_stream_index);
qint32 getDeviceSetIndex(); qint32 getDeviceSetIndex();
void setDeviceSetIndex(qint32 device_set_index); void setDeviceSetIndex(qint32 device_set_index);
@ -88,11 +88,11 @@ private:
qint32 direction; qint32 direction;
bool m_direction_isSet; bool m_direction_isSet;
qint32 nb_streams; qint32 device_nb_streams;
bool m_nb_streams_isSet; bool m_device_nb_streams_isSet;
qint32 stream_index; qint32 device_stream_index;
bool m_stream_index_isSet; bool m_device_stream_index_isSet;
qint32 device_set_index; qint32 device_set_index;
bool m_device_set_index_isSet; bool m_device_set_index_isSet;

View File

@ -34,10 +34,10 @@ SWGSamplingDevice::SWGSamplingDevice() {
m_hw_type_isSet = false; m_hw_type_isSet = false;
direction = 0; direction = 0;
m_direction_isSet = false; m_direction_isSet = false;
nb_streams = 0; device_nb_streams = 0;
m_nb_streams_isSet = false; m_device_nb_streams_isSet = false;
stream_index = 0; device_stream_index = 0;
m_stream_index_isSet = false; m_device_stream_index_isSet = false;
sequence = 0; sequence = 0;
m_sequence_isSet = false; m_sequence_isSet = false;
serial = nullptr; serial = nullptr;
@ -62,10 +62,10 @@ SWGSamplingDevice::init() {
m_hw_type_isSet = false; m_hw_type_isSet = false;
direction = 0; direction = 0;
m_direction_isSet = false; m_direction_isSet = false;
nb_streams = 0; device_nb_streams = 0;
m_nb_streams_isSet = false; m_device_nb_streams_isSet = false;
stream_index = 0; device_stream_index = 0;
m_stream_index_isSet = false; m_device_stream_index_isSet = false;
sequence = 0; sequence = 0;
m_sequence_isSet = false; m_sequence_isSet = false;
serial = new QString(""); serial = new QString("");
@ -115,9 +115,9 @@ SWGSamplingDevice::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", ""); ::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", "");
::SWGSDRangel::setValue(&nb_streams, pJson["nbStreams"], "qint32", ""); ::SWGSDRangel::setValue(&device_nb_streams, pJson["deviceNbStreams"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", ""); ::SWGSDRangel::setValue(&device_stream_index, pJson["deviceStreamIndex"], "qint32", "");
::SWGSDRangel::setValue(&sequence, pJson["sequence"], "qint32", ""); ::SWGSDRangel::setValue(&sequence, pJson["sequence"], "qint32", "");
@ -154,11 +154,11 @@ SWGSamplingDevice::asJsonObject() {
if(m_direction_isSet){ if(m_direction_isSet){
obj->insert("direction", QJsonValue(direction)); obj->insert("direction", QJsonValue(direction));
} }
if(m_nb_streams_isSet){ if(m_device_nb_streams_isSet){
obj->insert("nbStreams", QJsonValue(nb_streams)); obj->insert("deviceNbStreams", QJsonValue(device_nb_streams));
} }
if(m_stream_index_isSet){ if(m_device_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index)); obj->insert("deviceStreamIndex", QJsonValue(device_stream_index));
} }
if(m_sequence_isSet){ if(m_sequence_isSet){
obj->insert("sequence", QJsonValue(sequence)); obj->insert("sequence", QJsonValue(sequence));
@ -210,23 +210,23 @@ SWGSamplingDevice::setDirection(qint32 direction) {
} }
qint32 qint32
SWGSamplingDevice::getNbStreams() { SWGSamplingDevice::getDeviceNbStreams() {
return nb_streams; return device_nb_streams;
} }
void void
SWGSamplingDevice::setNbStreams(qint32 nb_streams) { SWGSamplingDevice::setDeviceNbStreams(qint32 device_nb_streams) {
this->nb_streams = nb_streams; this->device_nb_streams = device_nb_streams;
this->m_nb_streams_isSet = true; this->m_device_nb_streams_isSet = true;
} }
qint32 qint32
SWGSamplingDevice::getStreamIndex() { SWGSamplingDevice::getDeviceStreamIndex() {
return stream_index; return device_stream_index;
} }
void void
SWGSamplingDevice::setStreamIndex(qint32 stream_index) { SWGSamplingDevice::setDeviceStreamIndex(qint32 device_stream_index) {
this->stream_index = stream_index; this->device_stream_index = device_stream_index;
this->m_stream_index_isSet = true; this->m_device_stream_index_isSet = true;
} }
qint32 qint32
@ -287,8 +287,8 @@ SWGSamplingDevice::isSet(){
if(m_index_isSet){ isObjectUpdated = true; break;} if(m_index_isSet){ isObjectUpdated = true; break;}
if(hw_type != nullptr && *hw_type != QString("")){ isObjectUpdated = true; break;} if(hw_type != nullptr && *hw_type != QString("")){ isObjectUpdated = true; break;}
if(m_direction_isSet){ isObjectUpdated = true; break;} if(m_direction_isSet){ isObjectUpdated = true; break;}
if(m_nb_streams_isSet){ isObjectUpdated = true; break;} if(m_device_nb_streams_isSet){ isObjectUpdated = true; break;}
if(m_stream_index_isSet){ isObjectUpdated = true; break;} if(m_device_stream_index_isSet){ isObjectUpdated = true; break;}
if(m_sequence_isSet){ isObjectUpdated = true; break;} if(m_sequence_isSet){ isObjectUpdated = true; break;}
if(serial != nullptr && *serial != QString("")){ isObjectUpdated = true; break;} if(serial != nullptr && *serial != QString("")){ isObjectUpdated = true; break;}
if(m_center_frequency_isSet){ isObjectUpdated = true; break;} if(m_center_frequency_isSet){ isObjectUpdated = true; break;}

View File

@ -51,11 +51,11 @@ public:
qint32 getDirection(); qint32 getDirection();
void setDirection(qint32 direction); void setDirection(qint32 direction);
qint32 getNbStreams(); qint32 getDeviceNbStreams();
void setNbStreams(qint32 nb_streams); void setDeviceNbStreams(qint32 device_nb_streams);
qint32 getStreamIndex(); qint32 getDeviceStreamIndex();
void setStreamIndex(qint32 stream_index); void setDeviceStreamIndex(qint32 device_stream_index);
qint32 getSequence(); qint32 getSequence();
void setSequence(qint32 sequence); void setSequence(qint32 sequence);
@ -85,11 +85,11 @@ private:
qint32 direction; qint32 direction;
bool m_direction_isSet; bool m_direction_isSet;
qint32 nb_streams; qint32 device_nb_streams;
bool m_nb_streams_isSet; bool m_device_nb_streams_isSet;
qint32 stream_index; qint32 device_stream_index;
bool m_stream_index_isSet; bool m_device_stream_index_isSet;
qint32 sequence; qint32 sequence;
bool m_sequence_isSet; bool m_sequence_isSet;