Thread: [Hamlib-developer] branch_ts2k
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Dale E. E. <de...@w-...> - 2003-03-01 22:37:51
|
Stephane,
1) If you have some time in the near future could you check-out and
look at branch_ts2k? Especially the include/hamlib/rig.h and how
I added #define's with hooks into rig_newvfo.h. This would allow
minimal changes to rig.h and prevents the ts2k stuff from interfering.
2) Also, I'm working on a command-line. You can glance at it and see
if you think its going the right direction. I'd eventually like to have
it
be called during startup to process .hamlibrc or some such. It should
also be callable by user routines. I haven't tried the 'pure-parser'
for re-entrant routines yet. Also, the flex scanner is set as 'always-
interactive' for use as a command-line parser. This conflicts with
its use as start-up command processor. The files live in tests/rc.
I don't know if you can use scanner.l (flex) for rigctl. If you look at
the code (very bleeding edge, with lots of sharp edges!) you can tell
me things that you'll need or would like to have. I'll be working on
it as soon as I get my ts2k.c re-write finished.
3) Last but not least, I've written ts2k_cmds.[ch] which implement
all of the commands available for the TS-2000 except the 'ex;'
command for setting menu options. These are very nice to use
so that you only worry about parameters (p1, p2,...) and not about
the exact implementation and quirks. When a bug is fixed it fixes
all code and saves alot of duplication. I presume others backends
can use them. The only thing they know about hamlib is:
a) ts2k_transaction() which can easily be replaced.
b) RIG * required for the ts2k_transaction.
They simply read/write rig commands and place them in a
parameter struct. Any ideas or comments will be welcome.
73's
Dale, KD7ENI
|
|
From: Stephane F. <f8...@fr...> - 2003-03-03 22:53:15
|
On Sat, Mar 01, 2003, Dale E. Edmons wrote:
> 1) If you have some time in the near future could you check-out and
> look at branch_ts2k? Especially the include/hamlib/rig.h and how
> I added #define's with hooks into rig_newvfo.h. This would allow
> minimal changes to rig.h and prevents the ts2k stuff from interfering.
The rig_newvfo.h has stricly no chance to be merged with the HEAD.
It's ugly, it's horrible. I want good quality.
Everything that belongs to rig.h should be in rig.h.
I want patches, not a rewrite of the API.
Also keep in mind that it has to be source level compatible,
if not binary level compatible.
About your style: fix your code
* Make it gcc-3.x friendly. Compilation should report NO warning.
. Especially printf(__FUNCTION__ " has been called\n"); is not accepted.
write instead printf("%s has been called\n", __FUNCTION__ );
. Use C99 intializer
instead of struct { int a; char *b } = { a: 5, b: "bad" };
write struct { int a; char *b } = { .a = 5, .b = "good" };
* Use doxygen style comments /*<! */
About rig.h changes:
* anything that has ts2k in a struct name in rig.h has no chance
to be merged. (eg. ts2k_menu_t, ts2k_pm_t, etc.)
* talking about RIG_RPT_SHIFT_1750, read my past posts
* ts2k menu's are ext_parms, please convert your code to ext_parms interface
* RIG_FUNC_TSQL and rig_set_ctcss_sql are NOT duplicate! read pas posts
* I dislike the "next" field in you struct channel, but I may agree on
some "void *priv" generic purpose field.
* don't rename defines to your liking, you're breaking compatibility.
I admit some names were not choosen correctly, but stick with it.
Example are: RIG_MODE_WIDE, RIG_MODE_NARROW, tone, dcs, etc.
* You're messing too much with RIG_VFO's.
I'll give you an example: RIG_VFO_AB, it's not gonna work.
The gnuradio backend can have many VFO, and real ones, ie. not just
"glorified" memories. So how would you define RIG_VFO_BF for
VFO_B/VFO_F? This is broken design.
What I would propose instead is something like this:
#define RIG_VFO_n(x) (1<<(x))
#define RIG_VFO_A RIG_VFO_n(0)
#define RIG_VFO_B RIG_VFO_n(1)
#define RIG_VFO_C RIG_VFO_n(2)
/* the following defines as just aliases */
#define RIG_VFO_NONE 0
#define RIG_VFO_CURR -6
#define RIG_VFO_MEM -2
#define RIG_VFO_VFO -3
#define RIG_VFO_TX -4 /* applies to RIG_VFO_CURR */
#define RIG_VFO_RX -5 /* applies to RIG_VFO_CURR */
#define RIG_CTRL_MAIN -7
#define RIG_CTRL_SUB -8
My goal is to kill the band field in vfo_t. To do this, a new field
in rig_caps will be created to describe each VFO#, and if it is
exclusive with another VFO.
Anything else would be done using other API calls (split, weird
channel setup), maybe creating new ones.
* Anything that's not a VFO is something else, most probably a kind of
memory channel. Memory channel numbers can be forged, using negative
value for instance.
Please, everyone, comment heavily on this vfo_t design. I'll try to come
up with a real patch this week. The vfo_t redesign is the only thing
holding me to release hamlib-1.1.4.
Note about CVS repository:
* please, no autogenerated file (eg Makefile.in, ..) in the CVS base.
* also, if you're not modifying a HEAD file, do NOT duplicate and
check it in your branch! Otherwise, you drift from HEAD, and don't
get updated in case of new changes (which was the case).
> 2) Also, I'm working on a command-line. You can glance at it and see
> if you think its going the right direction. I'd eventually like to have
[..]
Sorry, I haven't had time to look at it. Fix the 1) first, you have a
lot to do.
Stephane
|
|
From: Nate B. <n0...@ne...> - 2003-03-04 23:11:04
|
Hmmm.
I've been using the RIG_VFO_x macros, but I'm still dense on the
intention. I wonder if my confusion is with the documentation in rig.h
where a diagram of a byte is shown, but the text uses the term byte
where I suspect bit was meant.
* Stephane Fillod <f8...@fr...> [2003 Mar 03 17:08 -0600]:
> My goal is to kill the band field in vfo_t. To do this, a new field
> in rig_caps will be created to describe each VFO#, and if it is
> exclusive with another VFO.
> Anything else would be done using other API calls (split, weird
> channel setup), maybe creating new ones.
I'm not opposed to this. I don't understand the current system, so I'll
try to make sense of any new effort.
> * Anything that's not a VFO is something else, most probably a kind of
> memory channel. Memory channel numbers can be forged, using negative
> value for instance.
At the moment the FT-920 has both VFO-A/B. Unfortunately, it's not a
true dual VFO radio even though it has a sub display similar to other
dual display rigs. Thus I added some support for RIG_VFO_MAIN/SUB where
it made sense to me.
So it would be handy to return a set of flags that indicate VFO/MEM/MEM
TUNE and SUB/MAIN (by simple definition VFO A = MAIN and VFO B = SUB) to
rig_get_vfo. Perhaps an unsigned int with the MSB (0x03) could be the
flags byte and the lower three bytes could be used by the backend to
number the available VFOs.
On the other hand, Dale's idea of making it into a structure may be more
versatile in the long run. New capability could be added to the struct
as the need arises and this might not break old backends too badly.
> Please, everyone, comment heavily on this vfo_t design. I'll try to come
> up with a real patch this week. The vfo_t redesign is the only thing
> holding me to release hamlib-1.1.4.
Well, there's my short comment.
73, de Nate >>
--
Wireless | Amateur Radio Station N0NB | "We have awakened a
Internet | n0...@ne... | sleeping giant and
Location | Bremen, Kansas USA EM19ov | have instilled in him
Amateur radio exams; ham radio; Linux info @ | a terrible resolve".
http://www.qsl.net/n0nb/ | - Admiral Yamamoto
|