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.

Getting started question

IW7DMH, Enzo
IW7DMH, Enzo Member ✭✭
edited January 2017 in FLEX-6000 Signature Series
Hello,
 
while I am waiting for my new Flex 6300, I am taking a look at the latest FlexRadio API archive (FlexLib_v1.3.9). 
I am finding it a bit hard bearing among lots objects in the various projects and therefore I would ask if it is possible to have some help for this simple use case:
 
- Acquiring radio control (I suppose it is like getting a radio instance) 
- Reading the VFO frequency 
- Set the volume level

I don't want to use the cat approach but the powerful api access instead. I can't find the documentation for all these classes, nor a class diagram that can help me. I would be glad also for a code snippet.

Thank you very much 
73' Enzo
iw7dmh

Answers

  • Steve N4LQ
    Steve N4LQ Member ✭✭
    edited September 2015
    Enzo. Your translator is broken. I have no idea what you just asked.
  • IW7DMH, Enzo
    IW7DMH, Enzo Member ✭✭
    edited January 2017
    I am talking about writing a simple Windows application that can interact with a Flex Signature radio.
    Surely my translation is not perfect, but most of the terms I used, are well known to software developers.
    Best regards
     
  • KY6LA_Howard
    KY6LA_Howard La Jolla, CA. Paris and Sablet FranceMember ✭✭✭
    edited January 2017
    I thought his request was perfectly understandable both times

    He just wants better documentation of the API so he can find the classes that contain control for the radio's volume and frequency as well as a copy of some sample code so that he can see how to write the application to bypass using CAT in order to address the radio directly..


  • Steve N4LQ
    Steve N4LQ Member ✭✭
    edited September 2015
    Well of course! Why am I not surprised?
  • IW7DMH, Enzo
    IW7DMH, Enzo Member ✭✭
    edited January 2017
    Yes, that was what I meant. 
    In the meantime I found this interesting post https://community.flexradio.com/flexradio/topics/first_steps_with_flexlib 
    with an answer by Eric:) 
    I'll start from here. 

    Thank you very much 
    73 '
    iw7dmh
  • IW7DMH, Enzo
    IW7DMH, Enzo Member ✭✭
    edited January 2017
    Hello,

    I am back after doing some tests, but with no great results.
    I followed the directions of Eric and tried to write a simple program.
    When my program starts I get the error listed below, and any radio is found.

    ...
    A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
    A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
    A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
    A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
    ...

    The socket error happens when SmartSDRCat is already running, otherwise no errors but again any radio is found.
    Also SmartSdrCAT, compiled from FlexLib 1.3.9 source, can't find any radio, while the version getted from the installation package (luckly) works fine.

    I really do not understand where I'm wrong.
    Here is my simple source code and I would be glad for any help.

    73' Enzo
    iw7dmh

    ===========================================
    ...

    using Flex.Smoothlake.FlexLib;
    using AsyncSocketsV2;
    using log4net;

    namespace FlexTest
    {
        public partial class Form1 : Form
        {

            Radio this_radio;

            public Form1()
            {
                InitializeComponent();
                //
                API.RadioAdded += new API.RadioAddedEventHandler(API_RadioAdded);
                API.RadioRemoved += new API.RadioRemovedEventHandler(API_RadioRemoved);
                API.ProgramName = "FlexTEST";
                API.Init();
               
            }

            /*
             * API_RadioAdded
             */
            void API_RadioAdded(Radio radio)
            {
                Console.WriteLine("API_RadioAdded Fired: " + radio.ToString());
                this_radio = radio;
            }

            /*
             * API_RadioRemoved
             */
            void API_RadioRemoved(Radio radio)
            {
                Console.WriteLine("API_RadioRemovfed Fired: " + radio.ToString());
                this_radio = null;
            }


            private void button1_Click(object sender, EventArgs e)
            {
                Close();
            }


        }
    }
    ===========================================


  • IW7DMH, Enzo
    IW7DMH, Enzo Member ✭✭
    edited January 2017
    Well, it was really hard, but in the end I solved the mystery.

    The code in the previous post, even if so simple, is correct and works well.
    The problem is related to the Windows firewall settings !!!
    When you run the program for the first time, Windows firewall prompt you to allow your application connections. Even if you agree, it actually doesn't happen. YOU HAVE TO CHECK ALSO "Public Network".

    image

    If you forgot it, as you can see from the image below, you wil have two connections still blocked (they have the red icon).

    image

    These are just the TCP and UDP rules used by Flex Library to communicate with your radio.
    You only need to change (allow connection) these two rules and the program magically works.

    image

    image

    image

    Hope this can help other beginners like me.

    73' Enzo
    iw7dmh

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.