Hello Rei,
Thank you for the link provided. Going to be more open - it’s a right way to keep your community growing.
Let’s look what I have for current moment.
I’ve analyzed captured packets and extracted command codes and payload size from each packet:
Code: Alles auswählen
************************************************************************
FishX1 packets
STX, Header, CRC and ETX was removed.
Designations:
Request from RP to TX-C - REQ
Reply from TX-C to RP - RPL
Fish.X1 command code - CMD
Payload size (bytes) - PL
************************************************************************
REQ, CMD=0x01, PL=0
RPL, CMD=0x65, PL=0
RPL, CMD=0x6A, PL=64
52 4F 42 4F 20 54 58 2D 33 37 37 00 00 00 00 00
00 30 30 3A 31 33 3A 37 42 3A 35 34 3A 37 45 3A
31 39 00 00 04 02 00 20 00 00 70 30 00 00 0D 00
43 00 00 00 00 01 01 1E 01 01 01 08 01 01 01 04
REQ, CMD=0x07, PL=0
RPL, CMD=0x6B, PL=24
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
REQ, CMD=?
0D 67 65 74 5F 73 65 72 5F 6E 75 6D 0D
RPL, CMD=?
0D 0A 52 4F 42 4F 20 54 58 2D 33 37 37 2F 55 53
42 3E 67 65 74 5F 73 65 72 5F 6E 75 6D 0D 0A 30
30 30 32 31 33 31 30 34 38 0D 0A 52 4F 42 4F 20
54 58 2D 33 37 37 2F 55 53 42 3E
REQ, CMD=0x05, PL=48
00 01 01 01 81 81 81 81 81 81 81 81 01 01 01 01
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
RPL, CMD=0x69, PL=0
REQ, CMD=0x02, PL=44
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
RPL, CMD=0x66, PL=48
00 00 00 00 59 00 6D 00 C9 0B C9 0B 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
REQ, CMD=0x02, PL=44
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
RPL, CMD=0x66, PL=48
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
REQ, CMD=0x02, PL=44
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
RPL, CMD=0x66, PL=48
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
In captured data we have 9 different commands:
001(0x01)
101(0x65)
106(0x6A)
007(0x07)
107(0x6B)
005(0x05)
105(0x69)
002(0x02)
102(0x66)
Now we can compare payload size of captured packets with structures from ROBO_TX_FW.H and find out which structure was used in packets:
106(0x6A) TA_INFO
107(0x6B) ?
005(0x05) TA_CONFIG ?
002(0x02) TA_OUTPUT
102(0x66) TA_INPUT?
? – mean that I can’t identify structure for this command code. Packets without payload not listed.
The most interesting persons in the list above - commands with codes 002 and 102.
Request with CMD=002 used to send new data for TX-C’s outputs. Respective reply with CMD=102 returns states of all TX-C’s inputs.
I have some problems to identify structure for CMD=102 because payload size from captured data did not match TA_INPUT structure size from ROBO_TX_FW.H. To find the packet structure for CMD=102 I've manually connected inputs to 9V or GND and monitored for changes in the data packet. Right structure for CMD=102 payload is following:
Code: Alles auswählen
#define N_CNT 4 // Number of counters
#define N_UNI 8 // Number of universal inputs
// Input structure, 48 bytes
typedef struct
{
unsigned short uni[N_UNI]; // Current values of the universal inputs
unsigned char cnt_in[N_CNT]; // Current levels (0 or 1) on the counter inputs according
// to their configuration (normal or inverse)
unsigned short counter[N_CNT]; // Current values of the counter inputs
unsigned short display_button_left; // Number of milliseconds during which the left display button
// is being kept pressed
unsigned short display_button_right; // Number of milliseconds during which the right display button
// is being kept pressed
// (distance from output structure) is reached
char reserved[16];
} TA_INPUT;
Now I have almost all information to write
parser for the FishX1
protocol. Stay tuned!
![Verrückter Teufel :twisted:](./images/smilies/icon_twisted.gif)