Added:
		doc/README.rotorez -- backend to API document
	Updated:
		Added rot_set_conf support to rotorez.c
		Added interactive support for rot_set_conf in rotctl.c
		Updated rotctl.1 for changes.


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1397 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.4
Nate Bargmann, N0NB 2003-02-27 03:47:47 +00:00
rodzic 6b8c137e6d
commit 8d53121692
4 zmienionych plików z 121 dodań i 15 usunięć

45
doc/README.rotorez 100644
Wyświetl plik

@ -0,0 +1,45 @@
Quirks, known bugs, and other notes.
====================================
$Id: README.rotorez,v 1.1 2003-02-27 03:47:47 n0nb Exp $
In this document I'll try to describe the behavior of the Idiom Press
Rotor-EZ and RotorCard interfaces as well as the HyGain DCU-1/DCU-1X control
units with Hamlib. For background information see rotorez/rotorez.txt.
The Idiom Press interfaces are the most capable of the units supported by
this backend and all available commands are supported by these units at this
time. The HyGain control units only support a subset of the command set
involving rotor positioning.
This document is organized by Hamlib function calls and documents observed
behavior with each call.
rot_set_position
* Fractional values passed for azimuth are dropped. i.e. 180.6 becomes
180 while a value greater than 359.4999 is converted to 0 for DCU1/
DCU-1X compatibility.
* Allowed range for azimuth is 0 to 360.
* Values passed for elevation are ignored. The protocol only supports
azimuthal positioning
rot_set_position
* Position reading is returned in whole degrees from 0 to 359.
* Not supported by DCU-1/DCU-1X.
rotorez_rot_stop
* Causes immediate cessation of rotor positioning.
* Not supported by DCU-1/DCU-1X.
rot_set_conf
* Accepts one of E, e, J, j, O, o, S, and s (see rotorez/rotorez.txt)
in *val.
* The value in token is not used by the backend and may be safely
set to TOK_BACKEND_NONE.
* Not supported by DCU-1/DCU-1X.
BUGS
Please report all bugs to <hamlib-developer@users.sourceforge.net>
Nate Bargmann n0nb at arrl.net

Wyświetl plik

@ -12,7 +12,7 @@
* Hy-Gain is a trademark of MFJ Enterprises
*
*
* $Id: rotorez.c,v 1.4 2003-02-13 03:07:59 n0nb Exp $
* $Id: rotorez.c,v 1.5 2003-02-27 03:47:47 n0nb Exp $
*
*
* This library is free software; you can redistribute it and/or
@ -80,7 +80,7 @@ const struct rot_caps rotorez_rot_caps = {
.rot_model = ROT_MODEL_ROTOREZ,
.model_name = "Rotor-EZ",
.mfg_name = "Idiom Press",
.version = "0.1.0",
.version = "0.1.2",
.copyright = "LGPL",
.status = RIG_STATUS_NEW,
.rot_type = ROT_TYPE_OTHER,
@ -108,6 +108,7 @@ const struct rot_caps rotorez_rot_caps = {
.set_position = rotorez_rot_set_position,
.get_position = rotorez_rot_get_position,
.stop = rotorez_rot_stop,
.set_conf = rotorez_rot_set_conf,
};
@ -120,7 +121,7 @@ const struct rot_caps rotorcard_rot_caps = {
.rot_model = ROT_MODEL_ROTORCARD,
.model_name = "RotorCard",
.mfg_name = "Idiom Press",
.version = "0.1.0",
.version = "0.1.2",
.copyright = "LGPL",
.status = RIG_STATUS_NEW,
.rot_type = ROT_TYPE_OTHER,
@ -148,6 +149,7 @@ const struct rot_caps rotorcard_rot_caps = {
.set_position = rotorez_rot_set_position,
.get_position = rotorez_rot_get_position,
.stop = rotorez_rot_stop,
.set_conf = rotorez_rot_set_conf,
};
@ -160,7 +162,7 @@ const struct rot_caps dcu_rot_caps = {
.rot_model = ROT_MODEL_DCU,
.model_name = "DCU-1/DCU-1X",
.mfg_name = "Hy-Gain",
.version = "0.1.0",
.version = "0.1.2",
.copyright = "LGPL",
.status = RIG_STATUS_NEW,
.rot_type = ROT_TYPE_OTHER,
@ -288,6 +290,7 @@ static int rotorez_rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *e
struct rot_state *rs;
unsigned char cmdstr[5] = "AI1;";
unsigned char az[5]; /* read azimuth string */
char *p;
azimuth_t tmp = 0;
int err;
@ -310,10 +313,11 @@ static int rotorez_rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *e
* by three octets containing the rotor's position in degrees. The
* semi-colon is ignored when passing the string to atof().
*/
az[4] = NULL; /* NULL terminated string */
tmp = (azimuth_t)atof((az + 1));
az[4] = 0x00; /* NULL terminated string */
p = az + 1; /* advance past leading ';' */
tmp = (azimuth_t)atof(p);
rig_debug(RIG_DEBUG_TRACE, "%s: \"%s\" after conversion = %.1f\n",
__func__, (az + 1), tmp);
__func__, p, tmp);
if (tmp < 0 || tmp > 359)
return -RIG_EINVAL;
@ -349,6 +353,42 @@ static int rotorez_rot_stop(ROT *rot) {
}
/*
* Send configuration character
*
* token is ignored
* Rotor-EZ interface will act on these commands immediately --
* no other command or command terminator is needed
*/
static int rotorez_rot_set_conf(ROT *rot, token_t token, const char *val) {
int err;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (!rot)
return -RIG_EINVAL;
switch(*val) {
case 'E': /* Enable endpoint option */
case 'e': /* Disable endpoint option */
case 'J': /* Enable jam protection */
case 'j': /* Disable jam protection -- not recommended */
case 'O': /* Enable overshoot option */
case 'o': /* Disable overshoot option */
case 'S': /* Enable unstick option */
case 's': /* Disable unstick option */
err = rotorez_send_priv_cmd(rot, val);
if (err != RIG_OK)
return err;
return RIG_OK;
default:
return -RIG_EINVAL;
}
}
/*
* Send command string to rotor
*/

Wyświetl plik

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH ROTCTL "1" "September 22, 2002" "Hamlib"
.TH ROTCTL "1" "February 26, 2003" "Hamlib"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -30,10 +30,10 @@ interactive mode if none provided in command line.
.\" respectively.
Keep in mind that \fBHamlib\fP is still ALPHA level software.
A lof of stuff hasn't been tested thoroughly, and the API may change
without publicised notice. Please report bugs and feedback at
without publicized notice. Please report bugs and feedback at
the e-mail address given in the REPORTING BUGS section.
.SH OPTIONS
This program follow the usual GNU command line syntax, with long
This program follows the usual GNU command line syntax, with long
options starting with two dashes (`-').
A summary of options is included below.
.TP
@ -41,10 +41,12 @@ A summary of options is included below.
Select rotator model number. See model list.
.TP
.B \-r, --rot-file=device
Use \fBdevice\fP as the file name of the rotator to operate.
Use \fBdevice\fP as the file name of the rotator to operate. Default is
\fB/dev/rotator\fP (may be a symbolic link to the actual device).
.TP
.B \-s, --serial-speed=baud
Set serial speed to \fBbaud\fP rate. Uses maximal rotator speed as default.
Set serial speed to \fBbaud\fP rate. Uses maximum serial speed from rotator
backend capabilites as default.
.TP
.B \-L, \-\-show-conf
List all config parameters.
@ -63,7 +65,10 @@ Show summary of options and exit.
.TP
.B \-V, \-\-version
Show version of program and exit.
.PP
\fBNOTE!\fP Some options may not be implemented by a given backend and will
return an error. This is most likely to occur with the \fI\-\-set-conf\fP
and \fI\-\-show-conf\fP options.
.SH COMMANDS
Commands can be entered either as a single char, or as a long command name.
Basically, the commands do not take a dash in front of them, as
@ -97,6 +102,10 @@ Reset the rotator.
.B M, move
Move the rotator in a spesific direction.
.TP
.B C, set_conf
Set a configuration parameter. It is safe to give "Token" a value of '0'
(zero). "Value" may be a string up to 20 characters.
.TP
.B _, get_info
Get misc information on the rotator.
@ -115,7 +124,7 @@ Report bugs to <hamlib-developer@users.sourceforge.net>.
.br
I'm already aware of the bug in the previous section :-)
.SH COPYRIGHT
Copyright \(co 2000-2002 Stephane Fillod.
Copyright \(co 2000-2003 Stephane Fillod.
.br
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY

Wyświetl plik

@ -5,7 +5,7 @@
* It takes commands in interactive mode as well as
* from command line options.
*
* $Id: rotctl.c,v 1.5 2002-09-24 21:45:37 fillods Exp $
* $Id: rotctl.c,v 1.6 2003-02-27 03:47:47 n0nb Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -99,6 +99,7 @@ declare_proto_rot(park);
declare_proto_rot(reset);
declare_proto_rot(move);
declare_proto_rot(get_info);
declare_proto_rot(inter_set_conf); /* interactive mode set_conf */
/*
@ -113,6 +114,7 @@ struct test_table test_list[] = {
{ 'S', "stop", stop, ARG_NONE, },
{ 'R', "reset", reset, ARG_IN, "Reset" },
{ 'M', "move", move, ARG_IN, "Direction", "Speed" },
{ 'C', "set_conf", inter_set_conf, ARG_IN, "Token", "Value" },
{ '_', "get_info", get_info, ARG_OUT, "Info" },
{ 0x00, "", NULL },
@ -607,3 +609,13 @@ declare_proto_rot(move)
return rot_move(rot, direction, speed);
}
declare_proto_rot(inter_set_conf)
{
token_t token;
char val[21] = ""; /* 20 chars enough? */
sscanf(arg1, "%ld", &token);
sscanf(arg2, "%s", val);
return rot_set_conf(rot, token, val);
}