Announcement

Collapse
No announcement yet.

Rig Control API Documentation

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rig Control API Documentation

    Good day.

    Figured I would provide some more detail on what I have deduced about the Rig Control API.

    NOTE: The HRD provided documentation is very inaccurate. You cannot open a connection to HRD with putty and send it strings and have it work

    You will need to open a socket connection to the API and send arrays of Bytes.

    To get it to work, you will need to send specific arrays of bytes to HRD IP Server.


    The text portion of those bytes (the payload if you will) needs to be UTF16 characters, which really means, in this case, each ASCII character is followed by a null.

    If the server doesn't understand what you sent it simply doesn't send anything back.

    The payload portion IS case sensitive, but they are not consistent with their use of capital letters.

    For example to get the current frequency, you call the "Get Frequency" command. To set the current frequency, you call "set frequency-hz".

    The protocol for the API looks like this:

    4 Bytes - Contains the length of the entire message (see below on how that is computed). Least Significant Byte First.
    8 Bytes - Signature [cd ab 34 12 34 12 cd ab] - This is always the same.
    4 Bytes - Always 0 [0 0 0 0]
    Payload Data (UTF16/Unicode): Your message or the servers response
    6 Bytes - Always 0 [0 0 0 0 0 0]

    Length = 4 (length) + 8 (signature) + 4 + payload length + 6


    Some commands require a context (you get it by sending a Get Context command, which usually returns a string of digits, in my examples that was a 3 digit string, (others have reported single and double digit strings), and stays valid as long as you are connected to the IP Server).

    If a command requires a context (like set frequency), it appears in the payload portion of the command. So if your context string is "117" it would appear in square brackets, followed by a single space, and then the command:

    payload = "[117] get radio"

    Note: The string, when encoded into the byte array will need to be UTF-16 (two bytes per character, with the second byte being a 0.

    Note: the "get radio" command works with and without a context being specified.

    My breakdown of the commands (I haven't mapped all of them, yet) are shown below, these are what the entire message looks like for each request/response.

    73s
    Terry, K4FXD

    -----------------------------------------------------------------------------------------------------------------

    Get Radio
    0000 28 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 (.....4.4.......
    0010 47 00 65 00 74 00 20 00 52 00 61 00 64 00 69 00 G.e.t. .R.a.d.i.
    0020 6f 00 00 00 00 00 00 00 o.......

    Get Radio Response
    0000 22 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 ".....4.4.......
    0010 46 00 54 00 2d 00 39 00 39 00 31 00 00 00 00 00 F.T.-.9.9.1.....
    0020 00 00 ..

    Get Radio with Context
    0000 34 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 4.....4.4.......
    0010 5b 00 31 00 31 00 37 00 5d 00 20 00 67 00 65 00 [.1.1.7.]. .g.e.
    0020 74 00 20 00 72 00 61 00 64 00 69 00 6f 00 00 00 t. .r.a.d.i.o...
    0030 00 00 00 00

    Get Radio with Context Response
    0000 22 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 ".....4.4.......
    0010 46 00 54 00 2d 00 39 00 39 00 31 00 00 00 00 00 F.T.-.9.9.1.....
    0020 00 00 ..

    Get Context
    0000 2c 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 ,.....4.4.......
    0010 47 00 65 00 74 00 20 00 43 00 6f 00 6e 00 74 00 G.e.t. .C.o.n.t.
    0020 65 00 78 00 74 00 00 00 00 00 00 00 e.x.t.......

    Get Context Response
    0000 1c 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 ......4.4.......
    0010 31 00 31 00 37 00 00 00 00 00 00 00 1.1.7.......

    Get Version
    0000 2c 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 ,.....4.4.......
    0010 47 00 65 00 74 00 20 00 56 00 65 00 72 00 73 00 G.e.t. .V.e.r.s.
    0020 69 00 6f 00 6e 00 00 00 00 00 00 00 i.o.n.......

    Get Version Response
    0000 34 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 4.....4.4.......
    0010 76 00 36 00 2e 00 33 00 2e 00 30 00 2e 00 36 00 v.6...3...0...6.
    0020 31 00 33 00 20 00 62 00 36 00 31 00 33 00 00 00 1.3. .b.6.1.3...
    0030 00 00 00 00 ....

    Get Frequency
    0000 3c 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 <.....4.4.......
    0010 5b 00 31 00 31 00 37 00 5d 00 20 00 47 00 65 00 [.1.1.7.]. .G.e.
    0020 74 00 20 00 46 00 72 00 65 00 71 00 75 00 65 00 t. .F.r.e.q.u.e.
    0030 6e 00 63 00 79 00 00 00 00 00 00 00 n.c.y.......

    0000 3A 00 00 00 CD AB 34 12 34 12 CD AB 00 00 00 00 :贩吠񤚸吠贩
    0010 5B 00 31 00 32 00 33 00 5D 00 47 00 65 00 74 00 [򈚒3穄稧積穞
    0020 20 00 46 00 72 00 65 00 71 00 75 00 65 00 6E 00 稦穜積穛穟積穘
    0030 63 00 79 00 00 00 00 00 00 00 c穣贩贩贩

    Get Frequency Response
    0000 34 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 4.....4.4.......
    0010 37 00 30 00 33 00 36 00 30 00 30 00 30 00 2d 00 7.0.3.6.0.0.0.-.
    0020 36 00 39 00 39 00 39 00 30 00 30 00 30 00 00 00 6.9.9.9.0.0.0...
    0030 00 00 00 00 ....

    Set Frequency
    0000 52 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 R.....4.4.......
    0010 5b 00 31 00 31 00 37 00 5d 00 20 00 73 00 65 00 [.1.1.7.]. .s.e.
    0020 74 00 20 00 66 00 72 00 65 00 71 00 75 00 65 00 t. .f.r.e.q.u.e.
    0030 6e 00 63 00 79 00 2d 00 68 00 7a 00 20 00 37 00 n.c.y.-.h.z. .7.
    0040 30 00 33 00 36 00 35 00 30 00 30 00 00 00 00 00 0.3.6.5.0.0.....
    0050 00 00 ..

    Set Frequency Response
    0000 1a 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 ......4.4.......
    0010 4f 00 4b 00 00 00 00 00 00 00 O.K.......

    Get ID
    0000 22 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 ".....4.4.......
    0010 47 00 65 00 74 00 20 00 49 00 44 00 00 00 00 00 G.e.t. .I.D.....
    0020 00 00 ..

    Get ID Response
    0000 36 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 6.....4.4.......
    0010 48 00 61 00 6d 00 20 00 52 00 61 00 64 00 69 00 H.a.m. .R.a.d.i.
    0020 6f 00 20 00 44 00 65 00 6c 00 75 00 78 00 65 00 o. .D.e.l.u.x.e.
    0030 00 00 00 00 00 00 ......

    Set Block
    0000 34 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 4.....4.4.......
    0010 5b 00 31 00 31 00 37 00 5d 00 20 00 73 00 65 00 [.1.1.7.]. .s.e.
    0020 74 00 20 00 62 00 6c 00 6f 00 63 00 6b 00 00 00 t. .b.l.o.c.k...
    0030 00 00 00 00 ....

    Set Block Response
    0000 1a 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 ......4.4.......
    0010 4f 00 4b 00 00 00 00 00 00 00 O.K.......

    Get Frequencies
    0000 40 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 @.....4.4.......
    0010 5b 00 31 00 31 00 37 00 5d 00 20 00 67 00 65 00 [.1.1.7.]. .g.e.
    0020 74 00 20 00 66 00 72 00 65 00 71 00 75 00 65 00 t. .f.r.e.q.u.e.
    0030 6e 00 63 00 69 00 65 00 73 00 00 00 00 00 00 00 n.c.i.e.s.......

    Get Frequencies Response
    0000 34 00 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 4.....4.4.......
    0010 37 00 30 00 33 00 36 00 35 00 30 00 30 00 2d 00 7.0.3.6.5.0.0.-.
    0020 36 00 39 00 39 00 39 00 30 00 30 00 30 00 00 00 6.9.9.9.0.0.0...
    0030 00 00 00 00 ....

    Get Dropdown-text

    0000 6e 01 00 00 cd ab 34 12 34 12 cd ab 00 00 00 00 n.....4.4.......
    0010 5b 00 31 00 31 00 37 00 5d 00 20 00 67 00 65 00 [.1.1.7.]. .g.e.
    0020 74 00 20 00 64 00 72 00 6f 00 70 00 64 00 6f 00 t. .d.r.o.p.d.o.
    0030 77 00 6e 00 2d 00 74 00 65 00 78 00 74 00 20 00 w.n.-.t.e.x.t. .
    0040 7b 00 4d 00 6f 00 64 00 65 00 7d 00 09 00 5b 00 {.M.o.d.e.}...[.
    0050 31 00 31 00 37 00 5d 00 20 00 67 00 65 00 74 00 1.1.7.]. .g.e.t.
    0060 20 00 64 00 72 00 6f 00 70 00 64 00 6f 00 77 00 .d.r.o.p.d.o.w.
    0070 6e 00 2d 00 74 00 65 00 78 00 74 00 20 00 7b 00 n.-.t.e.x.t. .{.
    0080 41 00 47 00 43 00 7d 00 09 00 5b 00 31 00 31 00 A.G.C.}...[.1.1.
    0090 37 00 5d 00 20 00 67 00 65 00 74 00 20 00 64 00 7.]. .g.e.t. .d.
    00a0 72 00 6f 00 70 00 64 00 6f 00 77 00 6e 00 2d 00 r.o.p.d.o.w.n.-.
    00b0 74 00 65 00 78 00 74 00 20 00 7b 00 43 00 57 00 t.e.x.t. .{.C.W.
    00c0 7e 00 4b 00 65 00 79 00 69 00 6e 00 67 00 7d 00 ~.K.e.y.i.n.g.}.
    00d0 09 00 5b 00 31 00 31 00 37 00 5d 00 20 00 67 00 ..[.1.1.7.]. .g.
    00e0 65 00 74 00 20 00 64 00 72 00 6f 00 70 00 64 00 e.t. .d.r.o.p.d.
    00f0 6f 00 77 00 6e 00 2d 00 74 00 65 00 78 00 74 00 o.w.n.-.t.e.x.t.
    0100 20 00 7b 00 43 00 57 00 7e 00 50 00 69 00 74 00 .{.C.W.~.P.i.t.
    0110 63 00 68 00 7d 00 09 00 5b 00 31 00 31 00 37 00 c.h.}...[.1.1.7.
    0120 5d 00 20 00 67 00 65 00 74 00 20 00 64 00 72 00 ]. .g.e.t. .d.r.
    0130 6f 00 70 00 64 00 6f 00 77 00 6e 00 2d 00 74 00 o.p.d.o.w.n.-.t.
    0140 65 00 78 00 74 00 20 00 7b 00 52 00 6f 00 6f 00 e.x.t. .{.R.o.o.
    0150 66 00 69 00 6e 00 67 00 7e 00 46 00 69 00 6c 00 f.i.n.g.~.F.i.l.
    0160 74 00 65 00 72 00 7d 00 00 00 00 00 00 00 t.e.r.}.......


Working...
X