Added rot_move function

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@869 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.3
Francois Retief 2002-01-16 17:08:31 +00:00
rodzic 814d86f7d1
commit e4bb8bfa09
3 zmienionych plików z 41 dodań i 18 usunięć

Wyświetl plik

@ -11,7 +11,7 @@
* Hamlib Interface - main file
* Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton
*
* $Id: rotator.c,v 1.3 2002-01-07 17:28:36 fgretief Exp $
* $Id: rotator.c,v 1.4 2002-01-16 17:06:59 fgretief Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -457,8 +457,8 @@ int rot_get_conf(ROT *rot, token_t token, char *val)
*
* Sets the azimuth and elevation of the rotator.
*
* \return RIG_OK if the operation has been sucessful, otherwise
* a negative value if an error occured (in which case, cause is
* \return RIG_OK if the operation has been sucessful, otherwise
* a negative value if an error occured (in which case, cause is
* set appropriately).
*
* \sa rot_get_position()
@ -597,6 +597,29 @@ int rot_reset (ROT *rot, rot_reset_t reset)
return caps->reset(rot, reset);
}
/**
* \brief move the rotator in the spesified direction
* \param rot The rot handle
* \param direction Direction of movement
* \param speed Speed of movement
*
* Move the rotator in the spesified direction. The speed is a value
* between 1 and 100.
*/
int rot_move (ROT *rot, int direction, int speed)
{
const struct rot_caps *caps;
if (!rot || !rot->caps)
return -RIG_EINVAL;
caps = rot->caps;
if (caps->move == NULL)
return -RIG_ENAVAIL;
return caps->move(rot, direction, speed);
}
/**
* \brief get general information from the rotator

Wyświetl plik

@ -43,20 +43,6 @@ Select rotator model number. See model list.
.B \-r, --rot-file=device
Use \fBdevice\fP as the file name of the rotator to operate.
.TP
.B \-p, --ptt-file=device
Use \fBdevice\fP as the file name of the Push-To-Talk device to operate on.
.TP
.B \-d, --dcd-file=device
Use \fBdevice\fP as the file name of the Data Carrier Detect device
to operate on.
.TP
.B \-p, --ptt-type=type
Use \fBtype\fP device as the kind of the Push-To-Talk device to operate on.
.TP
.B \-d, --dcd-type=type
Use \fBtype\fP device as the kind of the Data Carrier Detect device
to operate on.
.TP
.B \-s, --serial-speed=baud
Set serial speed to \fBbaud\fP rate. Uses maximal rotator speed as default.
.TP
@ -108,6 +94,9 @@ Stop the rotator.
.B R, reset
Reset the rotator.
.TP
.B M, move
Move the rotator in a spesific direction.
.TP
.B _, get_info
Get misc information on the rotator.

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.2 2002-01-14 07:00:55 fillods Exp $
* $Id: rotctl.c,v 1.3 2002-01-16 17:08:31 fgretief Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -96,6 +96,7 @@ declare_proto_rot(get_position);
declare_proto_rot(stop);
declare_proto_rot(park);
declare_proto_rot(reset);
declare_proto_rot(move);
declare_proto_rot(get_info);
@ -110,6 +111,7 @@ struct test_table test_list[] = {
{ 'K', "park", park, ARG_NONE, },
{ 'S', "stop", stop, ARG_NONE, },
{ 'R', "reset", reset, ARG_IN, "Reset" },
{ 'M', "move", move, ARG_IN, "Direction", "Speed" },
{ '_', "get_info", get_info, ARG_OUT, "Info" },
{ 0x00, "", NULL },
@ -580,4 +582,13 @@ declare_proto_rot(get_info)
return RIG_OK;
}
declare_proto_rot(move)
{
int direction;
int speed;
sscanf(arg1, "%d", &direction);
sscanf(arg2, "%d", &speed);
return rot_move(rot, direction, speed);
}