SmartSDR v3.8.19 and the SmartSDR v3.8.19 Release Notes | SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
SmartSDR v1.12.1 and the SmartSDR v1.12.1 Release Notes
Power Genius XL Utility v3.8.8 and the Power Genius XL Release Notes v3.8.8
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
Mute Status When Using The API
I now have the "Mute" API command working, including multiplex.
Next, I want to use the "audio_mute" Flex Message, from the slice subscription, to show the current "Mute" status.
Here is the question.
When I change the mute status, on a slice, from a "GUI client", I received the "audio_mute" status on the "Non GUI Client's, slice subscription......good
When I command a mute status change, on a slice, from a "Non GUI Client, using the API command, I do not receive the "audio_mute" message, on that same "Non GUI Client's slice subscription......not good.
Interesting, when I command a mute status change, on a slice, from a different "Non GUI Client, and look for the "audio_mute" message on a different "Non GUI Client's slice message, I do get the response......good.
To eliminate any errors in the Non-GUI clients, I reversed the device issuing the command and the device listening for the slice subscription response, and got the same response / "non-response" pattern.
Has anyone seen this before? Are there other ways to get "mute" status? Is this a bug?
Alan. WA9WUD
Best Answers
-
Alan,
Subscriptions allow you to receive a notification when attributes on objects, like a slice, are changed by other clients so you can track the state. Since you own the client making the change, it is assumed you will update your local state to reflect the change(s) you made, provided, of course, you receive a SUCCESS result from your command.
If your code is asynchronous (I suspect it is), you will need to track what you send and match the response. The good news is that the decimal number immediately after the command prefix's C (or CD) is returned in the response (R) prefix.
73,
Dan
0 -
Thanks, Dan
I was looking for a response to confirm the mute status change. Understand I should look at the command, "success", response rather than the slice subscription attribute change, and build my own local state.
Good explanation.
Alan
0
Answers
-
Alan, can you please supply the set of API commands you use to create the Non-Gui client? Please include any subscription commands as well.
73,
Dan
0 -
Hi Dan. Thanks for taking a look. Sure.
For subscribing to the slice messages I use, "sub slice all"
I command the mute with , "slice set <number> audio_mute=<1or 0>"
To bind the non-GUI client to the GUI Client, I use, "client bind client_id=<big number>"
Alan. WA9WUD
0 -
Hi Alan,
This is one shortcoming of Stephen’s new nodes. He filters out the success/failure response and you do not know the sequential number to look for.
Dave wo2x
0 -
Dave,
Just saw this. The success or failure codes are there on the flexradio-request node along with any response message. It just gets complicated when you send multiple commands into the same request node. You will need to determine which one goes with which.
…perhaps some form of tagging mechanism, e.g. pass along a topic or other message attribute from input (request) to output (response). Right now I do pass along the formatted request to the output, but I can see where an extra tag might be helpful.
Stephen
0 -
I solved this problem.
Stephen includes the "sent" command, in the Flex response (msg.request), along with the associated "success/failure" code (msg.status_code) response from the Flex Radio Server.
My solution was to match up the command I sent, with Flex Request Node's Response JSON object, with the same "msg.request". If the same JSON object has a "msg.status_code" == 0 (success), I update that variables value in the Non-GUI variable's context, with whatever the Non-GUI client commanded the GUI-Client.
Really, same as matching the "C" with the "R", if they were both available.
Alan. WA9WUD
0
Leave a Comment
Categories
- All Categories
- 289 Community Topics
- 2.1K New Ideas
- 534 The Flea Market
- 7.5K Software
- 6K SmartSDR for Windows
- 146 SmartSDR for Maestro and M models
- 360 SmartSDR for Mac
- 249 SmartSDR for iOS
- 230 SmartSDR CAT
- 172 DAX
- 352 SmartSDR API
- 8.8K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 26 FLEX-8000 Signature Series
- 850 Maestro
- 44 FlexControl
- 847 FLEX Series (Legacy) Radios
- 796 Genius Products
- 416 Power Genius XL Amplifier
- 277 Tuner Genius XL
- 103 Antenna Genius
- 243 Shack Infrastructure
- 166 Networking
- 404 Remote Operation (SmartLink)
- 130 Contesting
- 631 Peripherals & Station Integration
- 125 Amateur Radio Interests
- 870 Third-Party Software