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.

TCP API TX filter bandwidth syntax

David
David Member ✭✭
edited February 2020 in SmartSDR API
I have looked through the documentation for TCP API but cannot find the syntax for setting the TX filter bandwidth.

Answers

  • bobby
    bobby Member ✭✭
    edited February 2020
    Here ya go ...

    '-----------------------------------------------
        'Sets Tx BW Lo = 200 Hi = 3000
        "transmit set filter_low=200 filter_high=3000"
     '-----------------------------------------------
        'Sets Tx BW Lo = 200 Hi = 2300
        "transmit set filter_low=200 filter_high=2300"
     '------------------------------------------------



  • David
    David Member ✭✭
    edited February 2020
    That is what I was looking for but was not finding it in the TCP API documentation. I would expect to be list on the transmit options. Here is the syntax used to test with a raw telnet session to the radio on port 4992.
    c99|transmit s filter_low=200 
    c99|transmit s filter_high=2600
    http://wiki.flexradio.com/index.php?title=TCP/IP_transmit

    Thank you for the information.
  • bobby
    bobby Member ✭✭
    edited February 2020
    I run a custom built program which searches all the api files and for each api file creates a text file listing any finds that start with send command. Then I can just open the created files with a text editor to view all the available commands the wiki is so outdated and non existant since flex changed the api now. Im still on 2.4.9.
  • bobby
    bobby Member ✭✭
    edited February 2020
    same command you just used the s for set so it should have worked I would think.
  • David
    David Member ✭✭
    edited February 2020
    Yes, I was providing an example of what I used to test it successfully for anyone else that might have the question.
  • David
    David Member ✭✭
    edited February 2020
    Are you willing to share your script? What did you write the script in?
  • bobby
    bobby Member ✭✭
    edited February 2020
    It is actually part of my vb flex control project. Here are pics API files put as extracted into the API directory (dirstr picture) the generated text files for each api file are in the APIReports directory with an .api extension but are text files with the results. (dapirpt picture) I have included the subroutine code that does that. Im sure it could be done externally with just Gwbasic or any language that will open, read, and write files. Its just all strings and the instring find function them formatting the results in a readable format and writing it to another file in text format.

    I just did it within so all I have to do is press a button to do it or again to do it over.

    Below are the pics and code.


    Code follows:

    '===============================
    'PURPOSE
    '===============================
    'Searches all API Files in the
    'API Directory for the SEND COMMAND
    'string and then writes all the
    'SEND COMMANDS to a related API
    'named file for development use.
    '===============================
        'Local Variables
        '------------------------
        Dim N As Integer:                        ' Number
        Dim TFNS As Single:                      ' Tgtfilename start string
        Dim TFNE As Single:                      ' Tgtfilename end string
        Dim APISL As Integer:                    ' Start Location
        Dim CC As Single:                        ' Command Instance Count
        Dim LNData As String:                    ' Line Data
        Dim RLC As Single:                       ' Line Count
        Dim ReportFileName As String:            ' Report File Name
        Dim RFN As String:                       ' API Filename less extension
        Dim APILimiter(10) As Long:              'Location of end of Filename
        Dim CmdCount As Long:
        Dim EN As String
        Dim OFilename As String
        '------------------------
        'Initializations
        '------------------------
        'Anything preceeded by
        'Main. is a reference to
        'a definition or object
        'in the Main program form.
        '------------------------
        Main.RDisplay.Text = ""
        Main.FDisplay.Text = ""
        Main.NDisplay.Text = ""
        Main.FDisplay.Visible = False
        '------------------------
        'Gets the Target File for Report
        'from the user
        '------------------------
        Main.ReportDialog1.Flags = &H800& Or &H2& Or &H8&
        Main.ReportDialog1.Filename = BaseDrive & BaseDirectory & APIDirectory & "*.cs"
        Main.ReportDialog1.ShowOpen
        If Main.ReportDialog1.Filename = "" Then Exit Sub
        TargetFile = Main.ReportDialog1.Filename
        Open Main.ReportDialog1.Filename For Input As #1
        '------------------------
        'Prepare the oupput ReportFile
        '------------------------
                'Adjust for short date
                '-------------------------------
                DSM = Mid(Date, 1, 1)
                DSD = Mid(Date, 3, 2)
                If Left(DSD, 1) = "/" Then DSD = Mid(Date, 4, 2)
                If Val(DSD) < 10 Then
                        DSD = "0" & Left(DSD, 1)
                End If
                '-------------------------------
                'ReportsPath is the APIReports directoy to store the result files
                'The orignal API files are in the API directory
                '------------------------------
                OFilename = ReportsPath & "CollectAPI" & DSM & DSD & ".txt"
                '-------------------------------
        'Extract API Filename
        'without extension
        '------------------------
        'Identify start string location
        '------------------------
        APISL = 1
        For N = 1 To 10
            APILimiter(N) = InStr(APISL, TargetFile, """)
            APISL = APILimiter(N) + 1
            If (APISL - 1) = 0 Then Exit For
        Next
        For N = 1 To 10
            If APILimiter(N) = 0 Then
                TFNS = APILimiter(N - 1)
                Exit For
            End If
        Next
        '------------------------
        'Identify end string location
        '------------------------
         APISL = 1
        For N = 1 To 10
            APILimiter(N) = InStr(APISL, TargetFile, ".")
            APISL = APILimiter(N) + 1
            If (APISL - 1) = 0 Then Exit For
        Next
        For N = 1 To 10
            If APILimiter(N) = 0 Then
                TFNE = APILimiter(N - 1)
                Exit For
            End If
        Next
        '--------------------------
        'Create Report Name
        '--------------------------
        RFN = Mid(TargetFile, TFNS, (TFNE - TFNS))
        ReportFileName = RFN & ".api"
        '--------------------------
        'Initialize the Report File
        '--------------------------
        ReportFile = BaseDrive & BaseDirectory & APIReportsDirectory & ReportFileName
        Open ReportFile For Output As #2
        Open OFilename For Output As #5
        '--------------------------
        'Collection file header
        '--------------------------
        Print #5, " ********************************** "
        Print #5, ReportFileName
        Print #5, " "
        '---------------------------------------------------------
        'Create and Format the Report File
        '---------------------------------------------------------
          CC = 0: RLC = 0
         Do While Not EOF(1)
            Line Input #1, LNData
            RLC = RLC + 1
            CmdCount = InStr(LNData, "SendCommand")
            If CmdCount > 0 Then
                CC = CC + 1
                Print #2, "Line: " & RLC & " - " & LNData
                Print #5, "Line: " & RLC & " - " & LNData
            End If
          Loop
          Print #2, " "
          '---------------------------------
          'Collection File Footer
          '---------------------------------
          Print #5, " "
          Print #5, " ********************************** "
          Print #5, " "
          '---------------------------------
          Print #2, "There were " & CC & " occurances of Send Command in this file."
          Print #5, "There were " & CC & " occurances of Send Command in this file."
        '----------------------------------------------------------
        'File Read and Created close all files used
        '----------------------------------------------------------
        Close #1
        Close #2
        Close #5
        '----------------------------------------------------------------
        'Show created report in viewer automatically
        '----------------------------------------------------------------
        Dim IL1 As String
        Open ReportFile For Input As #1
        '---------------------------------------------------------
        'Handle Report Text File this way
        '---------------------------------------------------------
            Do Until EOF(1)
                Line Input #1, IL1
                Main.RDisplay.Text = Main.RDisplay.Text & vbCrLf & IL1
            Loop
            Main.RDisplay.Visible = True
            Main.RDisplay.Refresh
            Close #1
            GoTo Done
       '==========================================================================================
    E:
        EN = MsgBox("Error Number: " & Err.Number & " Occured", vbCritical)
        '-------------------
    Done:
        On Error GoTo 0
        Unload Me
        Do While Not WFC
            DoEvents
        Loop
       '-------------------

  • bobby
    bobby Member ✭✭
    edited February 2020
    Now that you brought it up I could not find it in the API files either, however I have so much API stuff and wasnt able to find it, I'm sure I obtained it another way by using a network monitor or something monitoring the commands sent/recvd across the TCP/IP connection either to the radio or smartsdr during operations. In fact that is how I find much of the undocumented stuff I am using.
  • bobby
    bobby Member ✭✭
    edited February 2020
    Found them late last night in the Radio.cs api file.
  • bobby
    bobby Member ✭✭
    edited February 2020
    David, see my latest post with the ListApi program includes a link to the project folder with source files, compiled program and info. Written after you ask here in PowerBasic Command Compiler 6.04 52k in size includes everything no bloatware!
  • David
    David Member ✭✭
    edited February 2020
    Is SendCommand the only string you are searching for in the files?

    As an alternative the following is what I did on my linux host at the root of the FlexLib_API unzipped directory.
    Without filenames
    grep -ri --no-filename SendCommand * | awk '{ sub(/^[ ]+/, ""); print }'|grep -v '^//'|sed 's/_radio.//'|grep '^SendCommand'| sort -u|less

    With filenames
    grep -ri SendCommand * | awk '{ sub(/[ ]+/, " "); print }'|grep -v '^//'|sed 's/_radio.//'| sort -u|less
    Other option to the |less at the end

    Browse results
    |less

    Line count
    |wc -l

    write to file
    > allAPI.txt

    Thank you for sharing.

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.