[Hamlib-developer] Re: Kenwood TH-D7A(G) patch
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Francois R. <fgr...@su...> - 2002-01-04 18:29:02
|
Hello Stephane, > Great! I love patches! And yours is now commited to cvs. > You're right, the TH-D7 is using a protocol similar to the Kenwood table > top rigs, but with some changes. It turns out I own a TH-F7E, and even > though I don't have the protocol specs, it looks like the commands are the > same as the TH-D7, hence the kenwood/th.c file. Here is some more. ;-) Should I add the commands to the th.c or thd7.c file? Do you know how similar the TH-F7E/TH-D7 are? > > It seems that some duplication can be avoided if the > > kenwood_transaction is responsible for adding the terminating > > character (either, ';' for older radios and <CR> for TH) > > based on the radio being used. > > sure! Actualy, I don't like at all kenwood_transaction(). > So feel free to crush it and rewrite it correctly, in the light of the > different Kenwood protocol variants. If not sure how to do it, we can > discuss about it. That'd be neat if kenwood_transaction could handle > rigs error codes without having to pass an ack_buf. Thus when no response > is expected, ack_buf = NULL would be better than ack_len = 0. I agree. I have an idea or two. I will start looking into a better transaction routine. I aspect that still bother me is how async messages should be handled. How does the callback infrastructure of hamlib work? I don't quite follow the Icom implementation. > > Also, it seems that the *data_len parameter is not returning > > any value. I always get zero length, but the buffer contain > > the correct string. > > okay, time to take a closer look. Almost all the Kenwood command are string based. Thus we can work with strings instead of buffer/length. See the read_string function I added with the Easycomm patch. It is basically a replacement for the port_transaction function. btw. Why the difference between read_block and fread_block? Cheers Francois Retief -- --------------------------------------------------------------------- Electronic Systems Laboratory (ESL) University of Stellenbosch South Africa Tel. +27-21-808-4472 ** Developers of the SUNSAT micro-satellite ** http://sunsat.ee.sun.ac.za |