n4af / TR4W

TRLOG 4 Windows free amateur radio logging application
GNU General Public License v3.0
19 stars 6 forks source link

Implement TCP and UDP protocol to talk to Flex radios #448

Open ny4i opened 3 years ago

ny4i commented 3 years ago

Instead of using the CAT connection, connect to the Flex radio via the TCP and UDP interfaces.

This allows finer control of the radio plus the ability to put spots and bandpass entries on the PamAdapter in SmartSDR.

ny4i commented 3 years ago

This requires a bit of retooling to the way the radio is interfaced. Right now, the radio control and radio polling are a series of case statements with all the code for all radios in two units. This should be changed so the main program calls an object such as

radio1 := new TRadio(rtIcom705, ctNetwork, connInfo); // connInfo is the IP address and port of the radio via Ethernet/WiFi
radio2 := new TRadio(rtFlex, ctNetwork, connInfo); // connInfo is IP address. if blank, tells object to search for a Flex
radio2 := new TRadio(rtElecraft, ctNetwork, null); // Since conInfo is blank, search the network for an Elecraft radio - K4 only to date.

OR

radio2 := new TRadio(rtK3,ctSerial,connInfo); // connInfo is the COM port, speed, etc of the serial connection.

Then to implement a new radio, we use a base TRadio object with a subclass of the specific radio type. So TIcom705 is an object of type TRadioIcom which is in turn an object of type TRadio.

Then to set the frequency on radio1, we just call radio1.SetFreq(14200000);

And the polling of the radio is done in a thread (as it is now) but that radio object is simply populated with the info we receive.

Note the Icom protocol network (UDP) protocol is implemented in two projects: https://gitlab.com/eliggett/wfview and https://github.com/nonoo/kappanhang

ny4i commented 2 years ago

Now that a NetRadio object exists, this can be added. Note that TNetRadio is just that (for a networked radio). TNetRadio is derived from TObject (as opposed to a generic TRadio object). The code seems to be going that way so we can then have separate instances of TRadio with the type. But this is a longer term project.

ny4i commented 2 years ago

Flex API Info: http://wiki.flexradio.com/index.php?title=SmartSDR_TCP/IP_API#Command_Format

Reference I found in Delphi specifically: http://flexradio.g3wgv.com/

ny4i commented 2 years ago

Here is a WireShark capture of DXCommander connecting to a radio with a slice already active.

V1.4.0.0
H398CC471
M10000001|Client connected from IP 192.168.1.243
C1|client udpport 4995
C2|sub pan all
C3|sub slice all
C4|sub spot all
C5|info
C6|meter list
C7|sub tx all
C8|keepalive disable
S398CC471|radio slices=3 panadapters=3 lineout_gain=100 lineout_mute=0 headphone_gain=100 headphone_mute=0 remote_on_enabled=0 pll_done=0 freq_error_ppb=-1 cal_freq=15.000000 tnf_enabled=1 snap_tune_enabled=1 nickname= callsign=NY4I binaural_rx=0 full_duplex_enabled=0 band_persistence_enabled=1 rtty_mark_default=2125 enforce_private_ip_connections=1 backlight=50 mute_local_audio_when_remote=1 daxiq_capacity=16 daxiq_available=16
S398CC471|radio filter_sharpness VOICE level=2 auto_level=1
S398CC471|radio filter_sharpness CW level=2 auto_level=1
S398CC471|radio filter_sharpness DIGITAL level=2 auto_level=1
S398CC471|radio static_net_params ip= gateway= netmask=
S398CC471|radio oscillator state=tcxo setting=auto locked=1 ext_present=0 gpsdo_present=0 tcxo_present=1
S398CC471|interlock acc_txreq_enable=0 rca_txreq_enable=0 acc_tx_enabled=1 tx1_enabled=1 tx2_enabled=1 tx3_enabled=1 tx_delay=0 acc_tx_delay=0 tx1_delay=0 tx2_delay=0 tx3_delay=0 acc_txreq_polarity=0 rca_txreq_polarity=0 timeout=0
S398CC471|eq rx mode=1 63Hz=10 125Hz=10 250Hz=10 500Hz=10 1000Hz=10 2000Hz=10 4000Hz=10 8000Hz=10
S398CC471|eq rxsc mode=1 63Hz=0 125Hz=0 250Hz=0 500Hz=0 1000Hz=0 2000Hz=0 4000Hz=0 8000Hz=0
R1|0|
C9|client udpport 4995
R2|0|
S398CC471|slice 0 in_use=1 sample_rate=24000 RF_frequency=10.000000 client_handle=0x4EAD1E55 index_letter=A rit_on=0 rit_freq=0 xit_on=0 xit_freq=0 rxant=ANT1 mode=USB wide=0 filter_lo=100 filter_hi=2800 step=100 step_list=1,10,50,100,500,1000,2000,3000 agc_mode=med agc_threshold=65 agc_off_level=10 pan=0x00000000 txant=ANT1 loopa=0 loopb=0 qsk=0 dax=1 dax_clients=0 lock=0 tx=1 active=1 audio_level=50 audio_pan=50 audio_mute=0 record=0 play=disabled record_time=0.0 anf=0 anf_level=0 nr=0 nr_level=0 nb=0 nb_level=50 wnb=0 wnb_level=0 apf=0 apf_level=0 squelch=1 squelch_level=20 diversity=0 diversity_parent=0 diversity_child=0 diversity_index=1342177293 ant_list=ANT1,ANT2,RX_A,RX_B,XVTA,XVTB mode_list=LSB,USB,AM,CW,DIGL,DIGU,SAM,FM,NFM,DFM,RTTY fm_tone_mode=OFF fm_tone_value=67.0 fm_repeater_offset_freq=0.000000 tx_offset_freq=0.000000 repeater_offset_dir=SIMPLEX fm_tone_burst=0 fm_deviation=5000 dfm_pre_de_emphasis=0 post_demod_low=300 post_demod_high=3300 rtty_mark=2125 rtty_shift=170 digl_offset=2210 digu_offset=1500 post_demod_bypass=0 rfgain=0 tx_ant_list=ANT1,ANT2,XVTA,XVTB
C10|sub pan all
S398CC471|waveform installed_list=
R3|0|
C11|sub slice all
R4|0|
C12|sub spot all
R5|0|model="FLEX-6600",chassis_serial="2720-5861-6600-3385",name="",callsign="NY4I",gps="Not Present",atu_present=1,num_scu=2,num_slice=4,num_tx=1,software_ver=3.2.39.3374,mac=00:1C:2D:05:18:9C,ip=192.168.1.150,netmask=255.255.255.0,gateway=192.168.1.1,location="",region="USA",screensaver=model,options="None"
R6|0|meter 1.src=COD-#1.num=1#1.nam=MICPEAK#1.low=-150.0#1.hi=20.0#1.desc=Signal strength of MIC output in CODEC#1.unit=dBFS#1.fps=40#2.src=COD-#2.num=2#2.nam=MIC#2.low=-150.0#2.hi=20.0#2.desc=Average Signal strength of MIC ouput in CODEC#2.unit=dBFS#2.fps=20#3.src=TX-#3.num=8#3.nam=CODEC#3.low=-150.0#3.hi=20.0#3.desc=Signal strength of CODEC output#3.unit=dBFS#3.fps=10#4.src=TX-#4.num=8#4.nam=SC_MIC#4.low=-150.0#4.hi=20.0#4.desc=Signal strength of MIC output#4.unit=dBFS#4.fps=10#5.src=TX-#5.num=8#5.nam=COMPPEAK#5.low=-150.0#5.hi=20.0#5.desc=Signal strength of signals after the CLIPPER (Compression)#5.unit=dBFS#5.fps=20#6.src=TX-#6.num=8#6.nam=SC_FILT_1#6.low=-150.0#6.hi=20.0#6.desc=Signal strength after Filter 1#6.unit=dBFS#6.fps=10#7.src=TX-#7.num=8#7.nam=ALC#7.low=-150.0#7.hi=20.0#7.desc=Signal strength of signals after SW ALC (SSB Peak)#7.unit=dBFS#7.fps=10#8.src=TX-#8.num=8#8.nam=PRE_WAVE_AGC#8.low=-150.0#8.hi=20.0#8.desc=Signal strength before Waveform AGC#8.unit=dBFS#8.fps=10#9.src=TX-#9.num=8#9.nam=PRE_WAVE#9.low=-150.0#9.hi=20.0#9.desc=Signal strength before Waveform Shim#9.unit=dBFS#9.fps=10#10.src=TX-#10.num=8#10.nam=SC_FILT_2#10.low=-150.0#10.hi=20.0#10.desc=Signal strength after Filter 2#10.unit=dBFS#10.fps=10#11.src=TX-#11.num=8#11.nam=B4RAMP#11.low=-150.0#11.hi=20.0#11.desc=Signal strength of signals before the ramp#11.unit=dBFS#11.fps=10#12.src=TX-#12.num=8#12.nam=AFRAMP#12.low=-150.0#12.hi=20.0#12.desc=Signal strength of signals after the ramp#12.unit=dBFS#12.fps=10#13.src=TX-#13.num=8#13.nam=POST_P#13.low=-150.0#13.hi=0.0#13.desc=Signal strength after all processing is done but before attenuation for power control#13.unit=dBFS#13.fps=10#14.src=TX-#14.num=8#14.nam=GAIN#14.low=-150.0#14.hi=0.0#14.desc=Signal strength after Gain#14.unit=dBFS#14.fps=10#15.src=TX-#15.num=5#15.nam=HWALC#15.low=-150.0#15.hi=20.0#15.desc=Voltage present at the Hardware ALC RCA Plug#15.unit=dBFS#15.fps=20#16.src=RAD#16.num=334#16.nam=+13.8A#16.low=10.5#16.hi=15.0#16.desc=Main radio input voltage at PA#16.unit=Volts#16.fps=0#17.src=RAD#17.num=0#17.nam=+13.8B#17.low=10.5#17.hi=15.0#17.desc=Main radio input voltage at CPU (continuous)#17.unit=Volts#17.fps=0#18.src=RAD#18.num=3#18.nam=MAINFAN#18.low=0.0#18.hi=8192.0#18.desc=Main radio fan RPM#18.unit=RPM#18.fps=0#19.src=TX-#19.num=1#19.nam=FWDPWR#19.low=0.0#19.hi=53.0#19.desc=RF Power Forward#19.unit=dBm#19.fps=20#20.src=TX-#20.num=2#20.nam=REFPWR#20.low=0.0#20.hi=53.0#20.desc=RF Power Reflected#20.unit=dBm#20.fps=20#21.src=TX-#21.num=3#21.nam=SWR#21.low=1.0#21.hi=999.0#21.desc=RF SWR#21.unit=SWR#21.fps=20#22.src=TX-#22.num=4#22.nam=PATEMP#22.low=0.0#22.hi=100.0#22.desc=PA Temperature#22.unit=degC#22.fps=0#23.src=AMP#23.num=0x70671ED0#23.nam=FWD#23.low=0.0#23.hi=63.0#23.desc=External Meter#23.unit=dBm#23.fps=0#24.src=AMP#24.num=0x70671ED0#24.nam=RL#24.low=0.0#24.hi=20.0#24.desc=External Meter#24.unit=dB#24.fps=0#25.src=AMP#25.num=0x70671ED0#25.nam=ID#25.low=0.0#25.hi=70.0#25.desc=External Meter#25.unit=Amps#25.fps=0#26.src=AMP#26.num=0x70671ED0#26.nam=Eff#26.low=0.0#26.hi=100.0#26.desc=External Meter#26.unit=Percent#26.fps=0#27.src=AMP#27.num=0x70671ED0#27.nam=TEMP#27.low=0.0#27.hi=100.0#27.desc=External Meter#27.unit=degC#27.fps=0#28.src=SLC#28.num=0#28.nam=24kHz#28.low=-140.0#28.hi=20.0#28.desc=24kHz broadband slice receiver signal level#28.unit=dBFS#28.fps=10#29.src=SLC#29.num=0#29.nam=OSC#29.low=-140.0#29.hi=20.0#29.desc=Signal Strength after OSC#29.unit=dBFS#29.fps=10#30.src=SLC#30.num=0#30.nam=LEVEL#30.low=-150.0#30.hi=20.0#30.desc=Signal strength of signals in the filter passband#30.unit=dBm#30.fps=10#31.src=SLC#31.num=0#31.nam=NR/ANF#31.low=-150.0#31.hi=20.0#31.desc=Signal strength after NR/ANF#31.unit=dBm#31.fps=10#32.src=SLC#32.num=0#32.nam=AGC+#32.low=-150.0#32.hi=0.0#32.desc=Signal strength after AGC#32.unit=dBFS#32.fps=10#
S398CC471|transmit tx_rf_power_changes_allowed=1 tune=0 show_tx_in_waterfall=1 mon_available=1 max_power_level=100
S398CC471|transmit freq=10.000000 rfpower=0 tunepower=0 tx_slice_mode=USB hwalc_enabled=0 inhibit=0 dax=0 sb_monitor=0 mon_gain_sb=80 mon_pan_sb=50 met_in_rx=0 am_carrier_level=100 mic_selection=MIC mic_level=40 mic_boost=1 mic_bias=1 mic_acc=0 compander=1 compander_level=70 vox_enable=0 vox_level=50 vox_delay=0 speech_processor_enable=0 speech_processor_level=0 lo=100 hi=3100 tx_filter_changes_allowed=1 tx_antenna=ANT1 pitch=600 speed=30 iambic=1 iambic_mode=1 swap_paddles=0 break_in=1 break_in_delay=5 cwl_enabled=0 sidetone=1 mon_gain_cw=80 mon_pan_cw=50 synccwx=1
S398CC471|eq tx mode=1 63Hz=10 125Hz=6 250Hz=6 500Hz=11 1000Hz=14 2000Hz=16 4000Hz=15 8000Hz=12
S398CC471|eq txsc mode=1 63Hz=0 125Hz=-4 250Hz=-4 500Hz=1 1000Hz=4 2000Hz=6 4000Hz=5 8000Hz=2
S398CC471|interlock acc_txreq_enable=0 rca_txreq_enable=0 acc_tx_enabled=1 tx1_enabled=1 tx2_enabled=1 tx3_enabled=1 tx_delay=0 acc_tx_delay=0 tx1_delay=0 tx2_delay=0 tx3_delay=0 acc_txreq_polarity=0 rca_txreq_polarity=0 timeout=0
R7|0|
R8|0|
C13|info
R9|0|
R10|0|
C14|meter list
C15|sub tx all
C16|keepalive disable
C17|slice s 0 dax=1
C18|meter list
S398CC471|slice 0 in_use=1 sample_rate=24000 RF_frequency=10.000000 client_handle=0x4EAD1E55 index_letter=A rit_on=0 rit_freq=0 xit_on=0 xit_freq=0 rxant=ANT1 mode=USB wide=0 filter_lo=100 filter_hi=2800 step=100 step_list=1,10,50,100,500,1000,2000,3000 agc_mode=med agc_threshold=65 agc_off_level=10 pan=0x00000000 txant=ANT1 loopa=0 loopb=0 qsk=0 dax=1 dax_clients=0 lock=0 tx=1 active=1 audio_level=50 audio_pan=50 audio_mute=0 record=0 play=disabled record_time=0.0 anf=0 anf_level=0 nr=0 nr_level=0 nb=0 nb_level=50 wnb=0 wnb_level=0 apf=0 apf_level=0 squelch=1 squelch_level=20 diversity=0 diversity_parent=0 diversity_child=0 diversity_index=1342177293 ant_list=ANT1,ANT2,RX_A,RX_B,XVTA,XVTB mode_list=LSB,USB,AM,CW,DIGL,DIGU,SAM,FM,NFM,DFM,RTTY fm_tone_mode=OFF fm_tone_value=67.0 fm_repeater_offset_freq=0.000000 tx_offset_freq=0.000000 repeater_offset_dir=SIMPLEX fm_tone_burst=0 fm_deviation=5000 dfm_pre_de_emphasis=0 post_demod_low=300 post_demod_high=3300 rtty_mark=2125 rtty_shift=170 digl_offset=2210 digu_offset=1500 post_demod_bypass=0 rfgain=0 tx_ant_list=ANT1,ANT2,XVTA,XVTB
S398CC471|waveform installed_list=
R11|0|
R12|0|
R13|0|model="FLEX-6600",chassis_serial="2720-5861-6600-3385",name="",callsign="NY4I",gps="Not Present",atu_present=1,num_scu=2,num_slice=4,num_tx=1,software_ver=3.2.39.3374,mac=00:1C:2D:05:18:9C,ip=192.168.1.150,netmask=255.255.255.0,gateway=192.168.1.1,location="",region="USA",screensaver=model,options="None"
C19|sub client all
C20|spot clear
C21|sub meter 30
S0|interlock tx_client_handle=0x00000000 state=NOT_READY reason=CLIENT_TX_INHIBIT source= tx_allowed=0 amplifier=
R14|0|meter 1.src=COD-#1.num=1#1.nam=MICPEAK#1.low=-150.0#1.hi=20.0#1.desc=Signal strength of MIC output in CODEC#1.unit=dBFS#1.fps=40#2.src=COD-#2.num=2#2.nam=MIC#2.low=-150.0#2.hi=20.0#2.desc=Average Signal strength of MIC ouput in CODEC#2.unit=dBFS#2.fps=20#3.src=TX-#3.num=8#3.nam=CODEC#3.low=-150.0#3.hi=20.0#3.desc=Signal strength of CODEC output#3.unit=dBFS#3.fps=10#4.src=TX-#4.num=8#4.nam=SC_MIC#4.low=-150.0#4.hi=20.0#4.desc=Signal strength of MIC output#4.unit=dBFS#4.fps=10#5.src=TX-#5.num=8#5.nam=COMPPEAK#5.low=-150.0#5.hi=20.0#5.desc=Signal strength of signals after the CLIPPER (Compression)#5.unit=dBFS#5.fps=20#6.src=TX-#6.num=8#6.nam=SC_FILT_1#6.low=-150.0#6.hi=20.0#6.desc=Signal strength after Filter 1#6.unit=dBFS#6.fps=10#7.src=TX-#7.num=8#7.nam=ALC#7.low=-150.0#7.hi=20.0#7.desc=Signal strength of signals after SW ALC (SSB Peak)#7.unit=dBFS#7.fps=10#8.src=TX-#8.num=8#8.nam=PRE_WAVE_AGC#8.low=-150.0#8.hi=20.0#8.desc=Signal strength before Waveform AGC#8.unit=dBFS#8.fps=10#9.src=TX-#9.num=8#9.nam=PRE_WAVE#9.low=-150.0#9.hi=20.0#9.desc=Signal strength before Waveform Shim#9.unit=dBFS#9.fps=10#10.src=TX-#10.num=8#10.nam=SC_FILT_2#10.low=-150.0#10.hi=20.0#10.desc=Signal strength after Filter 2#10.unit=dBFS#10.fps=10#11.src=TX-#11.num=8#11.nam=B4RAMP#11.low=-150.0#11.hi=20.0#11.desc=Signal strength of signals before the ramp#11.unit=dBFS#11.fps=10#12.src=TX-#12.num=8#12.nam=AFRAMP#12.low=-150.0#12.hi=20.0#12.desc=Signal strength of signals after the ramp#12.unit=dBFS#12.fps=10#13.src=TX-#13.num=8#13.nam=POST_P#13.low=-150.0#13.hi=0.0#13.desc=Signal strength after all processing is done but before attenuation for power control#13.unit=dBFS#13.fps=10#14.src=TX-#14.num=8#14.nam=GAIN#14.low=-150.0#14.hi=0.0#14.desc=Signal strength after Gain#14.unit=dBFS#14.fps=10#15.src=TX-#15.num=5#15.nam=HWALC#15.low=-150.0#15.hi=20.0#15.desc=Voltage present at the Hardware ALC RCA Plug#15.unit=dBFS#15.fps=20#16.src=RAD#16.num=334#16.nam=+13.8A#16.low=10.5#16.hi=15.0#16.desc=Main radio input voltage at PA#16.unit=Volts#16.fps=0#17.src=RAD#17.num=0#17.nam=+13.8B#17.low=10.5#17.hi=15.0#17.desc=Main radio input voltage at CPU (continuous)#17.unit=Volts#17.fps=0#18.src=RAD#18.num=3#18.nam=MAINFAN#18.low=0.0#18.hi=8192.0#18.desc=Main radio fan RPM#18.unit=RPM#18.fps=0#19.src=TX-#19.num=1#19.nam=FWDPWR#19.low=0.0#19.hi=53.0#19.desc=RF Power Forward#19.unit=dBm#19.fps=20#20.src=TX-#20.num=2#20.nam=REFPWR#20.low=0.0#20.hi=53.0#20.desc=RF Power Reflected#20.unit=dBm#20.fps=20#21.src=TX-#21.num=3#21.nam=SWR#21.low=1.0#21.hi=999.0#21.desc=RF SWR#21.unit=SWR#21.fps=20#22.src=TX-#22.num=4#22.nam=PATEMP#22.low=0.0#22.hi=100.0#22.desc=PA Temperature#22.unit=degC#22.fps=0#23.src=AMP#23.num=0x70671ED0#23.nam=FWD#23.low=0.0#23.hi=63.0#23.desc=External Meter#23.unit=dBm#23.fps=0#24.src=AMP#24.num=0x70671ED0#24.nam=RL#24.low=0.0#24.hi=20.0#24.desc=External Meter#24.unit=dB#24.fps=0#25.src=AMP#25.num=0x70671ED0#25.nam=ID#25.low=0.0#25.hi=70.0#25.desc=External Meter#25.unit=Amps#25.fps=0#26.src=AMP#26.num=0x70671ED0#26.nam=Eff#26.low=0.0#26.hi=100.0#26.desc=External Meter#26.unit=Percent#26.fps=0#27.src=AMP#27.num=0x70671ED0#27.nam=TEMP#27.low=0.0#27.hi=100.0#27.desc=External Meter#27.unit=degC#27.fps=0#28.src=SLC#28.num=0#28.nam=24kHz#28.low=-140.0#28.hi=20.0#28.desc=24kHz broadband slice receiver signal level#28.unit=dBFS#28.fps=10#29.src=SLC#29.num=0#29.nam=OSC#29.low=-140.0#29.hi=20.0#29.desc=Signal Strength after OSC#29.unit=dBFS#29.fps=10#30.src=SLC#30.num=0#30.nam=LEVEL#30.low=-150.0#30.hi=20.0#30.desc=Signal strength of signals in the filter passband#30.unit=dBm#30.fps=10#31.src=SLC#31.num=0#31.nam=NR/ANF#31.low=-150.0#31.hi=20.0#31.desc=Signal strength after NR/ANF#31.unit=dBm#31.fps=10#32.src=SLC#32.num=0#32.nam=AGC+#32.low=-150.0#32.hi=0.0#32.desc=Signal strength after AGC#32.unit=dBFS#32.fps=10#
S398CC471|transmit tx_rf_power_changes_allowed=1 tune=0 show_tx_in_waterfall=1 mon_available=1 max_power_level=100
S398CC471|transmit freq=10.000000 rfpower=0 tunepower=0 tx_slice_mode=USB hwalc_enabled=0 inhibit=0 dax=0 sb_monitor=0 mon_gain_sb=80 mon_pan_sb=50 met_in_rx=0 am_carrier_level=100 mic_selection=MIC mic_level=40 mic_boost=1 mic_bias=1 mic_acc=0 compander=1 compander_level=70 vox_enable=0 vox_level=50 vox_delay=0 speech_processor_enable=0 speech_processor_level=0 lo=100 hi=3100 tx_filter_changes_allowed=1 tx_antenna=ANT1 pitch=600 speed=30 iambic=1 iambic_mode=1 swap_paddles=0 break_in=1 break_in_delay=5 cwl_enabled=0 sidetone=1 mon_gain_cw=80 mon_pan_cw=50 synccwx=1
S398CC471|eq tx mode=1 63Hz=10 125Hz=6 250Hz=6 500Hz=11 1000Hz=14 2000Hz=16 4000Hz=15 8000Hz=12
S398CC471|eq txsc mode=1 63Hz=0 125Hz=-4 250Hz=-4 500Hz=1 1000Hz=4 2000Hz=6 4000Hz=5 8000Hz=2
S398CC471|interlock acc_txreq_enable=0 rca_txreq_enable=0 acc_tx_enabled=1 tx1_enabled=1 tx2_enabled=1 tx3_enabled=1 tx_delay=0 acc_tx_delay=0 tx1_delay=0 tx2_delay=0 tx3_delay=0 acc_txreq_polarity=0 rca_txreq_polarity=0 timeout=0
R15|0|
R16|0|
S398CC471|slice 0 dax=0 dax_clients=0 
S398CC471|slice 0 dax=1 dax_clients=0 
R17|0|
R18|0|meter 1.src=COD-#1.num=1#1.nam=MICPEAK#1.low=-150.0#1.hi=20.0#1.desc=Signal strength of MIC output in CODEC#1.unit=dBFS#1.fps=40#2.src=COD-#2.num=2#2.nam=MIC#2.low=-150.0#2.hi=20.0#2.desc=Average Signal strength of MIC ouput in CODEC#2.unit=dBFS#2.fps=20#3.src=TX-#3.num=8#3.nam=CODEC#3.low=-150.0#3.hi=20.0#3.desc=Signal strength of CODEC output#3.unit=dBFS#3.fps=10#4.src=TX-#4.num=8#4.nam=SC_MIC#4.low=-150.0#4.hi=20.0#4.desc=Signal strength of MIC output#4.unit=dBFS#4.fps=10#5.src=TX-#5.num=8#5.nam=COMPPEAK#5.low=-150.0#5.hi=20.0#5.desc=Signal strength of signals after the CLIPPER (Compression)#5.unit=dBFS#5.fps=20#6.src=TX-#6.num=8#6.nam=SC_FILT_1#6.low=-150.0#6.hi=20.0#6.desc=Signal strength after Filter 1#6.unit=dBFS#6.fps=10#7.src=TX-#7.num=8#7.nam=ALC#7.low=-150.0#7.hi=20.0#7.desc=Signal strength of signals after SW ALC (SSB Peak)#7.unit=dBFS#7.fps=10#8.src=TX-#8.num=8#8.nam=PRE_WAVE_AGC#8.low=-150.0#8.hi=20.0#8.desc=Signal strength before Waveform AGC#8.unit=dBFS#8.fps=10#9.src=TX-#9.num=8#9.nam=PRE_WAVE#9.low=-150.0#9.hi=20.0#9.desc=Signal strength before Waveform Shim#9.unit=dBFS#9.fps=10#10.src=TX-#10.num=8#10.nam=SC_FILT_2#10.low=-150.0#10.hi=20.0#10.desc=Signal strength after Filter 2#10.unit=dBFS#10.fps=10#11.src=TX-#11.num=8#11.nam=B4RAMP#11.low=-150.0#11.hi=20.0#11.desc=Signal strength of signals before the ramp#11.unit=dBFS#11.fps=10#12.src=TX-#12.num=8#12.nam=AFRAMP#12.low=-150.0#12.hi=20.0#12.desc=Signal strength of signals after the ramp#12.unit=dBFS#12.fps=10#13.src=TX-#13.num=8#13.nam=POST_P#13.low=-150.0#13.hi=0.0#13.desc=Signal strength after all processing is done but before attenuation for power control#13.unit=dBFS#13.fps=10#14.src=TX-#14.num=8#14.nam=GAIN#14.low=-150.0#14.hi=0.0#14.desc=Signal strength after Gain#14.unit=dBFS#14.fps=10#15.src=TX-#15.num=5#15.nam=HWALC#15.low=-150.0#15.hi=20.0#15.desc=Voltage present at the Hardware ALC RCA Plug#15.unit=dBFS#15.fps=20#16.src=RAD#16.num=334#16.nam=+13.8A#16.low=10.5#16.hi=15.0#16.desc=Main radio input voltage at PA#16.unit=Volts#16.fps=0#17.src=RAD#17.num=0#17.nam=+13.8B#17.low=10.5#17.hi=15.0#17.desc=Main radio input voltage at CPU (continuous)#17.unit=Volts#17.fps=0#18.src=RAD#18.num=3#18.nam=MAINFAN#18.low=0.0#18.hi=8192.0#18.desc=Main radio fan RPM#18.unit=RPM#18.fps=0#19.src=TX-#19.num=1#19.nam=FWDPWR#19.low=0.0#19.hi=53.0#19.desc=RF Power Forward#19.unit=dBm#19.fps=20#20.src=TX-#20.num=2#20.nam=REFPWR#20.low=0.0#20.hi=53.0#20.desc=RF Power Reflected#20.unit=dBm#20.fps=20#21.src=TX-#21.num=3#21.nam=SWR#21.low=1.0#21.hi=999.0#21.desc=RF SWR#21.unit=SWR#21.fps=20#22.src=TX-#22.num=4#22.nam=PATEMP#22.low=0.0#22.hi=100.0#22.desc=PA Temperature#22.unit=degC#22.fps=0#23.src=AMP#23.num=0x70671ED0#23.nam=FWD#23.low=0.0#23.hi=63.0#23.desc=External Meter#23.unit=dBm#23.fps=0#24.src=AMP#24.num=0x70671ED0#24.nam=RL#24.low=0.0#24.hi=20.0#24.desc=External Meter#24.unit=dB#24.fps=0#25.src=AMP#25.num=0x70671ED0#25.nam=ID#25.low=0.0#25.hi=70.0#25.desc=External Meter#25.unit=Amps#25.fps=0#26.src=AMP#26.num=0x70671ED0#26.nam=Eff#26.low=0.0#26.hi=100.0#26.desc=External Meter#26.unit=Percent#26.fps=0#27.src=AMP#27.num=0x70671ED0#27.nam=TEMP#27.low=0.0#27.hi=100.0#27.desc=External Meter#27.unit=degC#27.fps=0#28.src=SLC#28.num=0#28.nam=24kHz#28.low=-140.0#28.hi=20.0#28.desc=24kHz broadband slice receiver signal level#28.unit=dBFS#28.fps=10#29.src=SLC#29.num=0#29.nam=OSC#29.low=-140.0#29.hi=20.0#29.desc=Signal Strength after OSC#29.unit=dBFS#29.fps=10#30.src=SLC#30.num=0#30.nam=LEVEL#30.low=-150.0#30.hi=20.0#30.desc=Signal strength of signals in the filter passband#30.unit=dBm#30.fps=10#31.src=SLC#31.num=0#31.nam=NR/ANF#31.low=-150.0#31.hi=20.0#31.desc=Signal strength after NR/ANF#31.unit=dBm#31.fps=10#32.src=SLC#32.num=0#32.nam=AGC+#32.low=-150.0#32.hi=0.0#32.desc=Signal strength after AGC#32.unit=dBFS#32.fps=10#
R19|0|
R20|0|
S398CC471|meter 30.src=SLC#30.num=0#30.nam=LEVEL#30.low=-150.0#30.hi=20.0#30.desc=Signal strength of signals in the filter passband#30.unit=dBm#30.fps=10#
R21|0|
C22|xmit 0
R22|0|
S30BC49FA|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S30BC49FA|transmit rfpower=0 tunepower=0 am_carrier_level=100
S30BC49FA|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S30BC49FA|transmit rfpower=0 tunepower=0 am_carrier_level=100
S30BC49FA|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S30BC49FA|transmit rfpower=0 tunepower=0 am_carrier_level=100
S30BC49FA|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S30BC49FA|transmit rfpower=0 tunepower=0 am_carrier_level=100
ny4i commented 2 years ago

The sub commands are subscriptions so we subscribe to all messages about the slice and the TX.

ny4i commented 2 years ago

When going from TX to RX, these two unsolicited commands are sent by the radio:

S0|interlock tx_client_handle=0x7BFF670D state=UNKEY_REQUESTED reason= source= tx_allowed=1 amplifier=0x30BC49FA
S0|interlock tx_client_handle=0x00000000 state=READY reason=AMP:TG source= tx_allowed=1 amplifier=

The last one of STATE=READY is what I would use to indicate the radio is receiving.

When going into TX, this is sent by the radio (assuming sub to tx and slice all):

S302F1510|transmit freq=14.156400 lo=100 hi=3100 tx_filter_changes_allowed=1 
S302F1510|slice 0 pan=0x40000000 mode=USB qsk=0 tx=1
S302F1510|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S302F1510|transmit rfpower=12 tunepower=24 am_carrier_level=100
S302F1510|transmit freq=14.156400 rfpower=12 tunepower=24 tx_slice_mode=USB hwalc_enabled=0 inhibit=0 dax=1 sb_monitor=0 mon_gain_sb=80 mon_pan_sb=50 met_in_rx=0 am_carrier_level=100 mic_selection=MIC mic_level=40 mic_boost=1 mic_bias=1 mic_acc=0 compander=1 compander_level=70 vox_enable=0 vox_level=50 vox_delay=13 speech_processor_enable=0 speech_processor_level=0 lo=100 hi=3100 tx_filter_changes_allowed=1 tx_antenna=ANT1 pitch=600 speed=30 iambic=1 iambic_mode=1 swap_paddles=0 break_in=1 break_in_delay=5 cwl_enabled=0 sidetone=1 mon_gain_cw=80 mon_pan_cw=50 synccwx=1
S302F1510|interlock acc_txreq_enable=0 rca_txreq_enable=0 acc_tx_enabled=0 tx1_enabled=1 tx2_enabled=0 tx3_enabled=0 tx_delay=0 acc_tx_delay=0 tx1_delay=0 tx2_delay=0 tx3_delay=0 acc_txreq_polarity=0 rca_txreq_polarity=0 timeout=0
S0|interlock tx_client_handle=0x7BFF670D state=PTT_REQUESTED reason=AMP:TG source=SW tx_allowed=1 amplifier=
S0|interlock tx_client_handle=0x7BFF670D state=TRANSMITTING reason= source=SW tx_allowed=1 amplifier=0x30BC49FA

The last one of STATE=TRANSMITTING is what I would use to change the radio state.

ny4i commented 2 years ago

For mode changes, this is what the radio sends back when the mode is changed to CW:

S302F1510|slice 0 agc_mode=med agc_threshold=65 agc_off_level=10
S302F1510|slice 0 agc_mode=med agc_threshold=65 agc_off_level=10
S302F1510|slice 0 agc_mode=med agc_threshold=55 agc_off_level=10
S302F1510|slice 0 mode=CW filter_lo=-200 filter_hi=200 agc_mode=med agc_threshold=55 agc_off_level=10 qsk=0 step=100 step_list=1,5,10,50,100,200,400 anf=0 anf_level=0 nr=0 nr_level=0 nb=0 nb_level=50 wnb=0 wnb_level=0 apf=0 apf_level=30 squelch=1 squelch_level=20
S302F1510|slice 0 filter_lo=-200 filter_hi=200 post_demod_low=300 post_demod_high=3300
S302F1510|slice 0 fm_tone_mode=OFF fm_tone_value=67.0 fm_repeater_offset_freq=0.000000 tx_offset_freq=0.000000 repeater_offset_dir=SIMPLEX fm_tone_burst=0 fm_deviation=5000 dfm_pre_de_emphasis=0 post_demod_low=300 post_demod_high=3300 post_demod_bypass=0
S302F1510|transmit tx_slice_mode=USB
S302F1510|transmit show_tx_in_waterfall=1 mon_available=1
S302F1510|transmit dax=1 sb_monitor=0 mon_gain_sb=80 mon_pan_sb=50 met_in_rx=0 mic_selection=MIC mic_level=6 mic_boost=1 mic_bias=1 mic_acc=0 compander=1 compander_level=70 sidetone=1 mon_gain_cw=80 mon_pan_cw=50
S302F1510|eq tx mode=0 63Hz=10 125Hz=6 250Hz=6 500Hz=11 1000Hz=14 2000Hz=16 4000Hz=15 8000Hz=12
S302F1510|eq txsc mode=0 63Hz=0 125Hz=-4 250Hz=-4 500Hz=1 1000Hz=4 2000Hz=6 4000Hz=5 8000Hz=2
S302F1510|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S302F1510|transmit rfpower=12 tunepower=24 am_carrier_level=100
S302F1510|transmit vox_enable=0 vox_level=50 vox_delay=13 
S302F1510|transmit speech_processor_enable=1 speech_processor_level=0 
S302F1510|transmit freq=14.156400 lo=100 hi=3100 tx_filter_changes_allowed=1 
S302F1510|transmit tx_rf_power_changes_allowed=1 tune=0 show_tx_in_waterfall=1 mon_available=1 max_power_level=100
S302F1510|transmit freq=14.156400 rfpower=12 tunepower=24 tx_slice_mode=USB hwalc_enabled=0 inhibit=0 dax=1 sb_monitor=0 mon_gain_sb=80 mon_pan_sb=50 met_in_rx=0 am_carrier_level=100 mic_selection=MIC mic_level=6 mic_boost=1 mic_bias=1 mic_acc=0 compander=1 compander_level=70 vox_enable=0 vox_level=50 vox_delay=13 speech_processor_enable=1 speech_processor_level=0 lo=100 hi=3100 tx_filter_changes_allowed=1 tx_antenna=ANT1 pitch=600 speed=30 iambic=1 iambic_mode=1 swap_paddles=0 break_in=1 break_in_delay=5 cwl_enabled=0 sidetone=1 mon_gain_cw=80 mon_pan_cw=50 synccwx=1
S302F1510|profile mic list=Default^Default FHM-1^Default FHM-1 DX^Default FHM-2^Default FHM-2 DX^Default FHM-2 ESSB^Default FHM-3^Default FHM-3 DX^Default FHM-3 ESSB^Default HM-Pro^Default PR781^Default PR781 ESSB 3_2k^Default ProSet HC6^Inrad M629^Inrad M650^iOS_default_Profile^macOS_default_Profile^RadioSport DX M207^RadioSport DX M208^RadioSport DX M350-ADJ^RadioSport DX M360/EM56^RadioSport WIDE M207^RadioSport WIDE M208^RadioSport WIDE M350-ADJ^RadioSport WIDE M360/EM56^RTTYDefault^
S302F1510|transmit sb_monitor=0 mon_gain_sb=80 mon_pan_sb=50 pitch=600 speed=30 iambic=1 iambic_mode=1 swap_paddles=0 break_in=1 break_in_delay=5 cwl_enabled=0 sidetone=1 mon_gain_cw=80 mon_pan_cw=50 synccwx=1
S302F1510|slice 0 qsk=1
S302F1510|transmit freq=14.156400 lo=100 hi=3100 tx_filter_changes_allowed=1 
S302F1510|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S302F1510|transmit rfpower=12 tunepower=24 am_carrier_level=100
S302F1510|transmit raw_iq_enable=0
S302F1510|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S302F1510|transmit rfpower=12 tunepower=24 am_carrier_level=100
S302F1510|slice 0 filter_lo=-100 filter_hi=100 post_demod_low=300 post_demod_high=3300

S302F1510|slice 0 mode=CW seems usable for reading the mode.

ny4i commented 2 years ago

This was sent when a client set SPLIT mode:

S302F1510|slice 0 RF_frequency=14.158400 wide=0 lock=0
S302F1510|transmit freq=14.158400 lo=100 hi=3100 tx_filter_changes_allowed=1 
S302F1510|transmit freq=14.158400 lo=100 hi=3100 tx_filter_changes_allowed=1 
S302F1510|slice 0 agc_mode=med agc_threshold=65 agc_off_level=10
S302F1510|slice 0 agc_mode=med agc_threshold=65 agc_off_level=10
S302F1510|slice 0 agc_mode=med agc_threshold=55 agc_off_level=10
S302F1510|slice 0 mode=USB filter_lo=100 filter_hi=2800 agc_mode=med agc_threshold=55 agc_off_level=10 qsk=1 step=100 step_list=1,10,50,100,500,1000,2000,3000 anf=0 anf_level=0 nr=0 nr_level=0 nb=0 nb_level=50 wnb=0 wnb_level=0 apf=0 apf_level=0 squelch=1 squelch_level=20
S302F1510|slice 0 filter_lo=100 filter_hi=2800 post_demod_low=300 post_demod_high=3300
S302F1510|slice 0 fm_tone_mode=OFF fm_tone_value=67.0 fm_repeater_offset_freq=0.000000 tx_offset_freq=0.000000 repeater_offset_dir=SIMPLEX fm_tone_burst=0 fm_deviation=5000 dfm_pre_de_emphasis=0 post_demod_low=300 post_demod_high=3300 post_demod_bypass=0
S302F1510|transmit tx_slice_mode=CW
S302F1510|transmit show_tx_in_waterfall=1 mon_available=1
S302F1510|transmit dax=1 sb_monitor=0 mon_gain_sb=80 mon_pan_sb=50 met_in_rx=0 mic_selection=MIC mic_level=40 mic_boost=1 mic_bias=1 mic_acc=0 compander=1 compander_level=70 sidetone=1 mon_gain_cw=80 mon_pan_cw=50
S302F1510|eq tx mode=1 63Hz=10 125Hz=6 250Hz=6 500Hz=11 1000Hz=14 2000Hz=16 4000Hz=15 8000Hz=12
S302F1510|eq txsc mode=1 63Hz=0 125Hz=-4 250Hz=-4 500Hz=1 1000Hz=4 2000Hz=6 4000Hz=5 8000Hz=2
S302F1510|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S302F1510|transmit rfpower=12 tunepower=24 am_carrier_level=100
S302F1510|transmit vox_enable=0 vox_level=50 vox_delay=13 
S302F1510|transmit speech_processor_enable=0 speech_processor_level=0 
S302F1510|transmit freq=14.158400 lo=100 hi=3100 tx_filter_changes_allowed=1 
S302F1510|transmit tx_rf_power_changes_allowed=1 tune=0 show_tx_in_waterfall=1 mon_available=1 max_power_level=100
S302F1510|transmit freq=14.158400 rfpower=12 tunepower=24 tx_slice_mode=CW hwalc_enabled=0 inhibit=0 dax=1 sb_monitor=0 mon_gain_sb=80 mon_pan_sb=50 met_in_rx=0 am_carrier_level=100 mic_selection=MIC mic_level=40 mic_boost=1 mic_bias=1 mic_acc=0 compander=1 compander_level=70 vox_enable=0 vox_level=50 vox_delay=13 speech_processor_enable=0 speech_processor_level=0 lo=100 hi=3100 tx_filter_changes_allowed=1 tx_antenna=ANT1 pitch=600 speed=30 iambic=1 iambic_mode=1 swap_paddles=0 break_in=1 break_in_delay=5 cwl_enabled=0 sidetone=1 mon_gain_cw=80 mon_pan_cw=50 synccwx=1
S302F1510|profile mic list=Default^Default FHM-1^Default FHM-1 DX^Default FHM-2^Default FHM-2 DX^Default FHM-2 ESSB^Default FHM-3^Default FHM-3 DX^Default FHM-3 ESSB^Default HM-Pro^Default PR781^Default PR781 ESSB 3_2k^Default ProSet HC6^Inrad M629^Inrad M650^iOS_default_Profile^macOS_default_Profile^RadioSport DX M207^RadioSport DX M208^RadioSport DX M350-ADJ^RadioSport DX M360/EM56^RadioSport WIDE M207^RadioSport WIDE M208^RadioSport WIDE M350-ADJ^RadioSport WIDE M360/EM56^RTTYDefault^
S302F1510|transmit sb_monitor=0 mon_gain_sb=80 mon_pan_sb=50 pitch=600 speed=30 iambic=1 iambic_mode=1 swap_paddles=0 break_in=1 break_in_delay=5 cwl_enabled=0 sidetone=1 mon_gain_cw=80 mon_pan_cw=50 synccwx=1
S302F1510|slice 0 qsk=0
S302F1510|transmit freq=14.158400 lo=100 hi=3100 tx_filter_changes_allowed=1 
S302F1510|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S302F1510|transmit rfpower=12 tunepower=24 am_carrier_level=100
S302F1510|transmit raw_iq_enable=0
S302F1510|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S302F1510|transmit rfpower=12 tunepower=24 am_carrier_level=100
S302F1510|slice 0 pan=0x40000000 mode=USB qsk=0 tx=0
S302F1510|transmit raw_iq_enable=0
S302F1510|transmit tune=0 tx_rf_power_changes_allowed=1 max_power_level=100
S302F1510|transmit rfpower=12 tunepower=24 am_carrier_level=100
S302F1510|interlock acc_txreq_enable=0 rca_txreq_enable=0 acc_tx_enabled=0 tx1_enabled=1 tx2_enabled=0 tx3_enabled=0 tx_delay=0 acc_tx_delay=0 tx1_delay=0 tx2_delay=0 tx3_delay=0 acc_txreq_polarity=0 rca_txreq_polarity=0 timeout=0
S302F1510|transmit freq=14.156400 lo=100 hi=3100 tx_filter_changes_allowed=1 
S302F1510|transmit freq=14.156400 lo=100 hi=3100 tx_filter_changes_allowed=1 
S302F1510|slice 1 pan=0x40000000 mode=USB qsk=0 tx=1
S302F1510|slice 1 active=0
S302F1510|slice 0 active=1
S302F1510|slice 0 audio_level=84 audio_pan=50 audio_mute=0
S302F1510|slice 1 audio_level=84 audio_pan=50 audio_mute=0
ny4i commented 2 years ago

To be able to change bands, when the sub slice all commands is entered, one of the messages generates is as follows:

slice 0 in_use=1 sample_rate=24000 RF_frequency=28.530000 client_handle=0x2542FA71 index_letter=A rit_on=0 rit_freq=0 xit_on=0 xit_freq=0 rxant=ANT1 mode=USB wide=0 filter_lo=100 filter_hi=2800 step=100 step_list=1,10,50,100,500,1000,2000,3000 agc_mode=med agc_threshold=70 agc_off_level=10 pan=0x40000000 txant=ANT1 loopa=0 loopb=0 qsk=0 dax=0 dax_clients=0 lock=0 tx=1 active=1 audio_level=50 audio_pan=50 audio_mute=0 record=0 play=disabled record_time=0.0 anf=0 anf_level=0 nr=0 nr_level=0 nb=0 nb_level=50 wnb=0 wnb_level=0 apf=0 apf_level=0 squelch=1 squelch_level=20 diversity=0 diversity_parent=0 diversity_child=0 diversity_index=1342177293 ant_list=ANT1,ANT2,RX_A,RX_B,XVTA,XVTB mode_list=LSB,USB,AM,CW,DIGL,DIGU,SAM,FM,NFM,DFM,RTTY fm_tone_mode=OFF fm_tone_value=67.0 fm_repeater_offset_freq=0.000000 tx_offset_freq=0.000000 repeater_offset_dir=SIMPLEX fm_tone_burst=0 fm_deviation=5000 dfm_pre_de_emphasis=0 post_demod_low=300 post_demod_high=3300 rtty_mark=2125 rtty_shift=170 digl_offset=2210 digu_offset=1500 post_demod_bypass=0 rfgain=0 tx_ant_list=ANT1,ANT2,XVTA,XVTB

In that message, is the pan=0x40000000 parameter. 0x400000000 is the pan adapter handle. That handle can then be used to change the band with the following command:

display pan s 0x40000000 band=15 

Thanks to Alan WA9WUD on the Flex Community SmartSDR API message board for that insight.

ny4i commented 2 years ago

I had to so some experimenting to get the class structure just right to implement radios generically. I made a small project to demonstrate. It is called RadioClassFactory and it is available here.

It would be good for any TR4W developers to take a look and play with the demo to understand how these radios classes work (limited to the network radios but nothing says it could not also be done for the serial port radios too).