TCP Server

From DDUtilV3
Jump to: navigation, search

General

The TCP/IP Server allows third party Ethernet clients to remotely control DDUtil_V.. functionality. The Server is not intended to replicate or replace the functionality of DDUtil, but is intended to allow users to operate the radio remotely the use of some critical functions. Some of these remote functions include:

  • Turning Rotor to desired heading.
  • Toggling Auto Drive PTT (Oper/Stby).
  • Turning Amplifier power on/off for selected amplifiers.
  • Toggling Amplifier Mode (Oper/Stby).
  • Setting SteppIR yagi to Forward/Reverse mode.
  • Executing Macros.


See the sample DDClient application for a demonstration of the TCP Server.

Setup

Connections are restricted to the Local Area Network (LAN) that DDUtil is connected to.

  • Use the IP address of the host PC DDUtil is open on; i.e. 192.168.1.xxx.
  • Use port 5678

Commands

The following commands are available for remote DDUtil control.
Notes:

  • Commands must be input EXACTLY as shown below.
  • All commands must be terminated with a CRLF (\r\n).
  • ACK returns only guarantee the commands were sent, not that they actually worked.
  • Rotor feedback is provided anytime the rotor moves whether initiated from this app, manually or some other manner.
  • Separator characters can be any recognizable character. A colon (:) is suggested.


   A95PWR - A9500 Power On						
    Form:   A95PWR \r\n			
    Uses:   A95PWR\r\n	
    Rtrn:   A95PWR:ACK
   A95AUX - A9500 Aux Power On / Power Off						
    Form:   A95AUX \r\n			
    Uses:   A95AUX\r\n	
    Rtrn:   A95AUX:ACK
  A95AUTO - A9500 Auto Memory Mode On/Off (toggle)						
    Form:   A95AUTO \r\n			
    Uses:   A95AUTO\r\n	
    Rtrn:   A95AUTO:ACK
   A95ANT - A9500 Antenna Select (steps 1-4)						
    Form:   A95ANT \r\n			
    Uses:   A95ANT\r\n	
    Rtrn:   A95ANT:ACK
  A95MODE - A9500 Oper/Stby (toggle)						
    Form:   A95MODE \r\n			
    Uses:   A95MODE\r\n	
    Rtrn:   A95MODE:ACK
  AUTOPTT - Auto Drive Oper/Stby mode (toggle)						
    Form:   AUTOPTT \r\n			
    Uses:   AUTOPTT\r\n	
    Rtrn:   AUTOPTT:{Oper|Stby}
 DATASYNC - Synchronizes the Client to the Radio						  
    Form:   DATASYNC \r\n			
    Uses:   DATASYNC\r\n	
    Rtrn:   DATASYNC:ACK
    F-KEY - Execute Macro Function Key (F-Key)
    Form:   F-KEY P1 \r\n			
    Parm:   P1 =  2 digit (01-48) macro/F-Key to execute 
    Uses:   F-KEY12\r\n	(executes macro associated with the PF12 key)
    Note:   See usage notes at the bottom of this page.
 GETROTOR - Gets Rotor position						  
    Form:   GETROTOR \r\n			
    Uses:   GETROTOR\r\n	
    Rtrn:   Head:045
 GETSLICE - Gets frequency of radio slice n (n = 0-7)						  
    Form:   GETSLICE P1 \r\n			
    Parm:   P1 = Slice number 0-7
    Uses:   GETSLICE2\r\n	
    Rtrn:   Slice2:00014123456
   KPAPWR - KPA500 Power On/Off						
    Form:   KPAPWR \r\n			
    Uses:   KPAPWR\r\n	
    Rtrn:   KPA:{On|Off}
  KPAMODE - KPA500 Oper/Stby (toggle)						
    Form:   KPAMODE \r\n			
    Uses:   KPAMODE\r\n	
    Rtrn:   KPA:{Oper|Stby}
    MACRO - Execute a Macro
    Form:   MACRO P1 P2 \r\n			
    Parm:   P1 = Separator (:)
    Parm:   P2 = Macro command
    Uses:   MACRO:DDPT\r\n	
 SETROTOR - Sets Rotor position						  
    Form:   SETROTOR P1 \r\n			
    Parm:   P1 = a 3 digit heading to turn the rotor to.
    Uses:   SETROTOR045\r\n	
    Rtrn:   Head:045 (when finished turning)
 SETSLICE - Sets frequency of radio slice n (n = 0-7)						  
    Form:   SETSLICE P1 P2 P3 \r\n			
    Parm:   P1 = Slice number 0-7
    Parm:   P2 = Separator (:)
    Parm:   P3 = 11 digit frequency to set slice
    Uses:   SETSLICE2:00014123456\r\n	
    Rtrn:   SETSLICE:ACK
  STEPFWD - Set SteppIR Yagi to Forward mode
    Form:   STEPFWD \r\n			
    Uses:   STEPFWD\r\n	
    Rtrn:   STEPFWD:ACK
  STEPREV - Set SteppIR Yagi to Reverse mode
    Form:   STEPREV \r\n			
    Uses:   STEPREV\r\n	
    Rtrn:   STEPREV:ACK
STOPROTOR - Stops Rotor movement						  
    Form:   STOPROTOR \r\n			
    Parm:   P1 = a 3 digit heading to turn the rotor to.
    Uses:   STOPROTOR\r\n	
    Rtrn:   NotifyIcon message

Notes:

  • F-KEY is intended to allow execution of 1 of 48 macros associated with the main program PF Keys. Normal use would be to use the Key-Down event of the Client app form to capture the Key pressed and then forward to the server as follows:
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
   if (e.KeyCode == Keys.F12) { SendFKey(12); }
   void SendFKey(int key)
   { client.Send("F-KEY" + key.ToString().PadLeft(2, '0') + "\r\n"); }
}