Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Need info on programatically implementing Remote operation in c# ...

Gary L. Robinson
Gary L. Robinson Member ✭✭
edited November 2019 in SmartSDR API
I have written a "dumb" client (C# with FlexLib .NET API) for my Flex 6300.  It is set to be the main client - not a helper app. I call it a dumb client because it does NOT have panadapter - because I want to make it so that it has much less LAN or WLAN traffic. And my client takes up very little screen space.

My client uses the Flexlib .NET API.

It works real well if it is connected by lan cable to the same network as my Flex 6300.  But I need to implement a "Remote" button to get it to work as well - when it is on my laptop over wi-fi.

SmartSDR on the my laptop works perfectly over wii when I use the REMOTE button it has.  My client works real well also over wi-fi - except for having the audio ON the laptop - I still hear it on the desktop computer.

I need to implement a "remote" button in my client but can't figure out exactly what I need to do in the button code (and/or elsewhere) to add this functionality for remote operation.  I think I need to implement an OpusStream but not sure what exactly to do with it or what else it needs.

If anyone could give me a "road map" on what steps I need to take to effect this, sudo code, or real code - I would really appreciate it.   Any help would be appreciated.

---Gary

Answers

  • Eric-KE5DTO
    Eric-KE5DTO Administrator, FlexRadio Employee admin
    edited February 2017
    Gary,

    First, congrats on getting the client this far.  In general, there are a couple of things you can do to try to figure out how things work in the client.  You can wireshark it, search the wiki docs (wiki.flexradio.com), and ask here on the community.

    If you're not familiar with wireshark (www.wireshark.org), it is an awesome tool for debugging and understanding what is going on with network traffic.  At some point we will have to put out a tutorial on how this works as it is hard to live without once you have used it.  With wireshark running, activate the option in SmartSDR that you want to understand the commands for and then explore the commands that were sent in the TCP stream to the radio.

    If you are using FlexLib (.NET API), you can then go search for the command keywords you find.  In this case, it would be "remote_audio rx_on 1".  This is indeed found in the RemoteRxOn property in the OpusStream class in FlexLib.

    Once you have this running, the OpusStream will provide you with audio samples at a regular interval.  It will be up to you to get those into an audio stream of some sort.  Buffering is a good idea to keep the audio from sputtering, but be careful as buffering comes at a cost of latency.  I would recommend looking at Portaudio (or PortaudioSharp -- https://github.com/atsushieno/portaudio-sharp) as the sound card library interface.  Feel free to ask additional questions on how that works as you get further down that road.

    Good luck and have fun!
  • Kevin
    Kevin Member
    edited November 2019
    Gary... now that an answer is posted, I wonder if you'd consider posting your code or snippets? I'm just learning C# on Visual Studio 2015 and would love to see code samples or even something I could run and experiment with (shoulders of giants kinda thing).

    73,
    Kev K4VD
  • Tim - W4TME
    Tim - W4TME Administrator, FlexRadio Employee admin
    edited December 2016
    I recommend putting it in a GIT repository (or something similar)
  • Ria
    Ria Member ✭✭✭
    edited November 2016
    Put it on GitHub, that is if you even want to make your code open source. 
  • Gary L. Robinson
    Gary L. Robinson Member ✭✭
    edited November 2016
    Thanks Eric, will check out wireshark and start playing with it.  I have a feeling it will take me a while to get where I want to go BUT that is part of the fun.  And what I lack in knowledge and skill I often make up for by persistence hihi  I don't give up easily.
  • Gary L. Robinson
    Gary L. Robinson Member ✭✭
    edited November 2016
    I am not a professional in the same way as Eric and all the great coders at Flex.  My code is addressing only the 6300 with 2 slices since all I have is a 6300.  And I have no plans at all in ever releasing it as a product so I have just made it for myself and another local friend who also has a 6300.  I am sure my code will raise a few eyebrows and can be improved on  :-)
    Having said that, I will post the code I have on my web site sometime after the Thanksgiving holiday and if someone wants to download and post it elsewhere or anywhere - that is fine with me.  I have no experience with GitHub and collaborating hihi  I will post an announcement on this forum when I put it on my website at http://www.oliviamode.com/wb8rol_xtra.htm
  • Kevin
    Kevin Member
    edited December 2016
    Very big thanks! I know it will help me out a lot.

    Kev

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.