diff --git a/swagger/sdrangel/api/swagger/include/ChannelActions.yaml b/swagger/sdrangel/api/swagger/include/ChannelActions.yaml new file mode 100644 index 000000000..a6fd9ef05 --- /dev/null +++ b/swagger/sdrangel/api/swagger/include/ChannelActions.yaml @@ -0,0 +1,21 @@ +ChannelActions: + description: Base channel actions. Only the channel actions corresponding to the channel specified in the channelType field is or should be present. + discriminator: channelType + required: + - channelType + - direction + properties: + channelType: + description: Channel type code + type: string + direction: + description: 0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0) + type: integer + originatorDeviceSetIndex: + description: Optional for reverse API. This is the device set index from where the message comes from. + type: integer + originatorChannelIndex: + description: Optional for reverse API. This is the channel index from where the message comes from. + type: integer + FileSourceActions: + $ref: "http://localhost:8081/api/swagger/include/FileSource.yaml#/FileSourceActions" diff --git a/swagger/sdrangel/api/swagger/include/DeviceActions.yaml b/swagger/sdrangel/api/swagger/include/DeviceActions.yaml new file mode 100644 index 000000000..5f77e3a3b --- /dev/null +++ b/swagger/sdrangel/api/swagger/include/DeviceActions.yaml @@ -0,0 +1,18 @@ +DeviceActions: + description: Base device actions. Only the device actions corresponding to the device specified in the deviceHwType field is or should be present. + discriminator: deviceHwType + required: + - deviceHwType + - direction + properties: + deviceHwType: + description: Device hardware type code + type: string + direction: + description: 0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0) + type: integer + originatorIndex: + description: Optional for reverse API. This is the device set index from where the message comes from. + type: integer + rtlSdrActions: + $ref: "http://localhost:8081/api/swagger/include/RtlSdr.yaml#/RtlSdrActions" diff --git a/swagger/sdrangel/api/swagger/include/FileSource.yaml b/swagger/sdrangel/api/swagger/include/FileSource.yaml index 06654d4b1..ea78881de 100644 --- a/swagger/sdrangel/api/swagger/include/FileSource.yaml +++ b/swagger/sdrangel/api/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/swagger/sdrangel/api/swagger/include/RtlSdr.yaml b/swagger/sdrangel/api/swagger/include/RtlSdr.yaml index e2089605d..823993df0 100644 --- a/swagger/sdrangel/api/swagger/include/RtlSdr.yaml +++ b/swagger/sdrangel/api/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: "http://localhost:8081/api/swagger/include/Structs.yaml#/Gain" \ No newline at end of file + $ref: "http://localhost:8081/api/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/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index e39d0f8c9..3d7425dc7 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/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: "http://localhost:8081/api/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: "http://localhost:8081/api/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