(Captured using flrig.)
The response from IC-7410 depends on the command you send. The command “0x03” is to read operating frequency. The first response is the echo back, and the second is the frequency data, 7123.456kHz in this case.
The command “0x06” is to send operating mode. For this type of command, you will receive the echo back, and a “FB” message.
So my program goes something like this:
gboolean send_command(unsigned char* command){
int n_command;
int n_echoback;
unsigned char echoback[256];
n_command = mystrlen(command);
write(fd, command, n_command); /* send command */
n_echoback = read(fd, echoback, 255); /* get echo back */
if ( (n_echoback != n_command) || (mystrcmp(command, echoback) != 0) ) {
g_print("*** error *** echoback does not much. \n");
return FALSE;
}
return TRUE;
}
This is for all the commands, and for the commands that expect a “FB” mesasge:
send_command(command_that_expects_FB);
receive_fb();
Not very smart, but it works.