[Hamlib-developer] RIG_TRN
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Dale E. E. <de...@w-...> - 2002-06-24 12:27:49
|
Hi all.
I'm getting to the point I'm starting to try and figure out how to code
the exception. I'm real weak in this area, and I'd appreciate any
comments.
About all I've figured out is where to enter the function name. That
is trivial, since it has an entry name like other functions for the
back-
end. (Stephane, please *don't* write this routine. I'd appreciate
the chance to take a stab at it. You can always replace it later it
I botch it. :) ) I've glanced at a couple of backends that have one,
but don't quite understand.
Here's how it looks to me:
1) somebody enables exception handling and the backend
sends the autoinformation on via myrig_set_trn(). (Is the
trn parameter like FILE, or RIG?)
2) somewhere (I forget where) in rig.c signal exception
handling is enabled and the myrig_decode() is installed
as the handler. (Is myrig_decode() supposed to read
and decode/parse all incoming commands from the
rig? What is done with the information?)
3) An exception occurs and myrig_decode() is called, which
calls myrig_transaction() to read the command. (?) Now we
have the actual command that came from the rig and caused
an exception, we decode it to find out what command it it.
Now what do we do with it???
4) myrig_decode() returns and the code in rig.c handles all
of the messy cleanup etc.
The big question is in 3). Taking the most common example from
the ts2k "sm...;" which gives us the current meter value. This
command comes it, we determine it is a particular "op code"
"sm", it has two parmaters, Sub/Main, and Value. These are
easily parsed. Where do we send the data or what do we do with
it? Is a previous myrig_transaction() on the stack waiting for
any response from the rig, which we provide? I don't know of
a place in RIG where current values are kept (except vfo_curr).
Or, have I not got a clue what's going on here? (That's how I
feel at the moment!) (Oh yea, is the hamlib mechanism pretty
much in place? I know for a fact that enabling RIG_TRN does
enable the exceptions, but that's all I know.)
I've only spent a couple of hours looking into this. I'm going to be
busy
this week and would like some pointers if anybody has them.
Thank you and 73's.
Dale
kd7eni
|