2010-05-19 21:56:00 +00:00
|
|
|
/*
|
|
|
|
* Hamlib Rotator backend - M2 RC2800
|
|
|
|
*
|
|
|
|
*
|
2011-08-21 02:54:40 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
2010-05-19 21:56:00 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2011-08-21 02:54:40 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2010-05-19 21:56:00 +00:00
|
|
|
*
|
2011-08-21 02:54:40 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2010-05-19 21:56:00 +00:00
|
|
|
* License along with this library; if not, write to the Free Software
|
2011-08-21 02:54:40 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2010-05-19 21:56:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
|
|
#include "hamlib/rotator.h"
|
|
|
|
#include "serial.h"
|
|
|
|
#include "misc.h"
|
|
|
|
#include "register.h"
|
2010-05-28 14:36:52 +00:00
|
|
|
#include "num_stdio.h"
|
2010-05-19 21:56:00 +00:00
|
|
|
|
|
|
|
#include "rc2800.h"
|
|
|
|
|
|
|
|
#define CR "\r"
|
2010-05-28 14:36:52 +00:00
|
|
|
#define LF "\x0a"
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2010-05-26 07:50:47 +00:00
|
|
|
#define BUFSZ 128
|
2010-05-19 21:56:00 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
The continuous output of some of the RC2800
|
|
|
|
models can be a nuisance. Even if we flush
|
|
|
|
the input stream before sending the command,
|
|
|
|
there may be partial sentence in the stream
|
|
|
|
ahead of the data we want.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2020-11-30 20:53:55 +00:00
|
|
|
rc2800_parse
|
2010-05-19 21:56:00 +00:00
|
|
|
|
|
|
|
Parse output from the rotator controller
|
|
|
|
|
|
|
|
We want to recognize the following sentences:
|
|
|
|
A ERR=<n><cr>
|
|
|
|
E ERR=<n><cr>
|
|
|
|
A P=<ff.f> S=<n> <s><cr>
|
|
|
|
E P=<ff.f> S=<n> <s><cr>
|
|
|
|
A=<ff.f> S=<n> <s><cr>
|
|
|
|
E=<ff.f> S=<n> <s><cr>
|
|
|
|
*/
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
static int rc2800_parse(char *s, char *device, float *value)
|
2010-05-19 21:56:00 +00:00
|
|
|
{
|
2019-12-08 16:10:10 +00:00
|
|
|
int msgtype = 0, errcode = 0;
|
2019-12-09 23:12:13 +00:00
|
|
|
int len;
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s: device return->%s", __func__, s);
|
2011-08-21 02:54:40 +00:00
|
|
|
|
2019-12-09 23:12:13 +00:00
|
|
|
len = strlen(s);
|
2020-02-23 17:26:09 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
if (len == 0)
|
2010-05-19 21:56:00 +00:00
|
|
|
{
|
2019-11-30 16:19:08 +00:00
|
|
|
return -RIG_EPROTO;
|
2010-05-19 21:56:00 +00:00
|
|
|
}
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
if (len > 7)
|
|
|
|
{
|
|
|
|
if (*s == 'A' || *s == 'E')
|
|
|
|
{
|
2019-12-08 16:10:10 +00:00
|
|
|
int i;
|
2019-11-30 16:19:08 +00:00
|
|
|
*device = *s;
|
|
|
|
|
|
|
|
if (!strncmp(s + 2, "ERR=", 4))
|
|
|
|
{
|
|
|
|
msgtype = 1;
|
|
|
|
i = sscanf(s + 6, "%d", &errcode);
|
|
|
|
|
|
|
|
if (i == EOF)
|
|
|
|
{
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!strncmp(s + 2, "P=", 2))
|
|
|
|
{
|
|
|
|
msgtype = 2;
|
|
|
|
i = num_sscanf(s + 5, "%f", value);
|
|
|
|
|
|
|
|
if (i == EOF)
|
|
|
|
{
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (s[1] == '=')
|
|
|
|
{
|
|
|
|
msgtype = 2;
|
|
|
|
i = num_sscanf(s + 2, "%f", value);
|
|
|
|
|
|
|
|
if (i == EOF)
|
|
|
|
{
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-08-21 02:54:40 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
if (msgtype == 2)
|
|
|
|
{
|
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s: device=%c value=%3.1f\n", __func__, *device,
|
|
|
|
*value);
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
else if (msgtype == 1)
|
|
|
|
{
|
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s: driver error code %d\n", __func__, errcode);
|
|
|
|
*device = ' ';
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -RIG_EPROTO;
|
2010-05-19 21:56:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
2019-11-30 16:19:08 +00:00
|
|
|
int testmain()
|
2010-05-19 21:56:00 +00:00
|
|
|
{
|
2019-11-30 16:19:08 +00:00
|
|
|
rc2800_parse("A P= 98.1 S=9 MV");
|
|
|
|
rc2800_parse("A P= 100.0 S=9 MV");
|
|
|
|
rc2800_parse("E=43.7 S=9 M");
|
|
|
|
rc2800_parse("E=42.8 S=9 S");
|
|
|
|
rc2800_parse("E ERR=05");
|
|
|
|
return 0;
|
2010-05-19 21:56:00 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* rc2800_transaction
|
|
|
|
*
|
|
|
|
* cmdstr - Command to be sent to the rig.
|
|
|
|
* data - Buffer for reply string. Can be NULL, indicating that no reply is
|
|
|
|
* is needed, but answer will still be read.
|
|
|
|
* data_len - in: Size of buffer. It is the caller's responsibily to provide
|
|
|
|
* a large enough buffer for all possible replies for a command.
|
|
|
|
*
|
|
|
|
* returns:
|
Fix spelling errors
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
2020-07-24 07:02:12 +00:00
|
|
|
* RIG_OK - if no error occurred.
|
|
|
|
* RIG_EIO - if an I/O error occurred while sending/receiving data.
|
2010-05-19 21:56:00 +00:00
|
|
|
* RIG_ETIMEOUT - if timeout expires without any characters received.
|
|
|
|
*/
|
|
|
|
static int
|
2019-11-30 16:19:08 +00:00
|
|
|
rc2800_transaction(ROT *rot, const char *cmdstr,
|
|
|
|
char *data, size_t data_len)
|
2010-05-19 21:56:00 +00:00
|
|
|
{
|
|
|
|
struct rot_state *rs;
|
|
|
|
int retval;
|
|
|
|
int retry_read = 0;
|
|
|
|
char replybuf[BUFSZ];
|
|
|
|
|
|
|
|
rs = &rot->state;
|
|
|
|
|
|
|
|
transaction_write:
|
|
|
|
|
2020-06-23 13:44:27 +00:00
|
|
|
rig_flush(&rs->rotport);
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
if (cmdstr)
|
|
|
|
{
|
2010-05-19 21:56:00 +00:00
|
|
|
retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr));
|
2019-11-30 16:19:08 +00:00
|
|
|
|
2010-05-19 21:56:00 +00:00
|
|
|
if (retval != RIG_OK)
|
2019-11-30 16:19:08 +00:00
|
|
|
{
|
2010-05-19 21:56:00 +00:00
|
|
|
goto transaction_quit;
|
2019-11-30 16:19:08 +00:00
|
|
|
}
|
2010-05-19 21:56:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Always read the reply to know whether the cmd went OK */
|
|
|
|
if (!data)
|
2019-11-30 16:19:08 +00:00
|
|
|
{
|
2010-05-19 21:56:00 +00:00
|
|
|
data = replybuf;
|
2019-11-30 16:19:08 +00:00
|
|
|
}
|
|
|
|
|
2010-05-19 21:56:00 +00:00
|
|
|
if (!data_len)
|
2019-11-30 16:19:08 +00:00
|
|
|
{
|
2010-05-19 21:56:00 +00:00
|
|
|
data_len = BUFSZ;
|
2019-11-30 16:19:08 +00:00
|
|
|
}
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2021-01-29 14:20:56 +00:00
|
|
|
/* then comes the answer */
|
2019-11-30 16:19:08 +00:00
|
|
|
memset(data, 0, data_len);
|
2020-11-27 19:21:46 +00:00
|
|
|
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
|
2019-11-30 16:19:08 +00:00
|
|
|
|
2021-01-29 14:20:56 +00:00
|
|
|
// some models seem to echo -- so we'll check and read again if echoed
|
2021-02-28 18:33:07 +00:00
|
|
|
if (cmdstr && strcmp(data, cmdstr) == 0)
|
2019-11-30 16:19:08 +00:00
|
|
|
{
|
2021-01-29 14:20:56 +00:00
|
|
|
memset(data, 0, data_len);
|
|
|
|
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
|
2010-05-26 07:50:47 +00:00
|
|
|
}
|
2020-11-28 22:59:55 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
if (retval < 0)
|
|
|
|
{
|
2010-05-19 21:56:00 +00:00
|
|
|
if (retry_read++ < rot->state.rotport.retry)
|
2019-11-30 16:19:08 +00:00
|
|
|
{
|
2010-05-19 21:56:00 +00:00
|
|
|
goto transaction_write;
|
2019-11-30 16:19:08 +00:00
|
|
|
}
|
|
|
|
|
2010-05-19 21:56:00 +00:00
|
|
|
goto transaction_quit;
|
|
|
|
}
|
|
|
|
|
|
|
|
retval = RIG_OK;
|
|
|
|
transaction_quit:
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
|
|
|
|
{
|
2019-11-30 16:19:08 +00:00
|
|
|
char cmdstr[64];
|
2020-11-28 22:59:55 +00:00
|
|
|
int retval1, retval2 = RIG_OK;
|
2019-11-30 16:19:08 +00:00
|
|
|
|
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s called: %f %f\n", __func__, az, el);
|
2011-08-21 02:54:40 +00:00
|
|
|
|
2020-11-30 17:22:33 +00:00
|
|
|
if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZ)
|
|
|
|
{
|
2020-11-30 20:53:55 +00:00
|
|
|
// we only do azimuth and this is the old protocol
|
|
|
|
// we have to switch modes and then send azimuth
|
|
|
|
// an extra CR gives us a response to expect
|
|
|
|
num_sprintf(cmdstr, "A\r%.0f\r\r", az);
|
2020-11-30 17:22:33 +00:00
|
|
|
}
|
2020-11-30 20:53:55 +00:00
|
|
|
else
|
2020-11-30 17:22:33 +00:00
|
|
|
{
|
|
|
|
// does the new protocol use decimal points?
|
2020-11-30 20:53:55 +00:00
|
|
|
// we'll assume no for now
|
|
|
|
num_sprintf(cmdstr, "A%0f"CR, az);
|
2020-11-30 17:22:33 +00:00
|
|
|
}
|
2020-11-30 20:53:55 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
retval1 = rc2800_transaction(rot, cmdstr, NULL, 0);
|
2011-08-21 02:54:40 +00:00
|
|
|
|
2020-11-30 17:22:33 +00:00
|
|
|
if (rot->caps->rot_type == ROT_TYPE_AZIMUTH)
|
2020-11-28 22:59:55 +00:00
|
|
|
{
|
2020-11-30 17:22:33 +00:00
|
|
|
return retval1;
|
|
|
|
}
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2020-11-30 17:22:33 +00:00
|
|
|
/* do not overwhelm the MCU? */
|
|
|
|
hl_usleep(200 * 1000);
|
2010-05-29 22:20:50 +00:00
|
|
|
|
2020-11-30 17:22:33 +00:00
|
|
|
if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZEL)
|
|
|
|
{
|
2020-11-30 20:53:55 +00:00
|
|
|
// this is the old protocol
|
|
|
|
// we have to switch modes and then send azimuth
|
|
|
|
// an extra CR gives us a response to expect
|
|
|
|
num_sprintf(cmdstr, "E\r%.0f\r\r", el);
|
2020-11-30 17:22:33 +00:00
|
|
|
}
|
2020-11-30 20:53:55 +00:00
|
|
|
else
|
2020-11-30 17:22:33 +00:00
|
|
|
{
|
|
|
|
num_sprintf(cmdstr, "E%.0f"CR, el);
|
|
|
|
}
|
2020-11-30 20:53:55 +00:00
|
|
|
|
2020-11-30 17:22:33 +00:00
|
|
|
retval2 = rc2800_transaction(rot, cmdstr, NULL, 0);
|
|
|
|
|
|
|
|
if (retval1 == retval2)
|
|
|
|
{
|
|
|
|
return retval1;
|
2019-11-30 16:19:08 +00:00
|
|
|
}
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
return (retval1 != RIG_OK ? retval1 : retval2);
|
2010-05-19 21:56:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
rc2800_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
|
|
|
|
{
|
2019-11-30 16:19:08 +00:00
|
|
|
char posbuf[32];
|
|
|
|
int retval;
|
|
|
|
char device;
|
|
|
|
float value;
|
|
|
|
|
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
|
|
|
|
|
2020-11-30 17:22:33 +00:00
|
|
|
*el = 0;
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
retval = rc2800_transaction(rot, "A" CR, posbuf, sizeof(posbuf));
|
|
|
|
|
|
|
|
if (retval != RIG_OK || strlen(posbuf) < 5)
|
|
|
|
{
|
|
|
|
return retval < 0 ? retval : -RIG_EPROTO;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rc2800_parse(posbuf, &device, &value) == RIG_OK)
|
|
|
|
{
|
|
|
|
if (device == 'A')
|
|
|
|
{
|
|
|
|
*az = (azimuth_t) value;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-28 22:59:55 +00:00
|
|
|
if (rot->caps->rot_model == ROT_MODEL_RC2800)
|
2019-11-30 16:19:08 +00:00
|
|
|
{
|
2020-11-28 22:59:55 +00:00
|
|
|
retval = rc2800_transaction(rot, "E" CR, posbuf, sizeof(posbuf));
|
2019-11-30 16:19:08 +00:00
|
|
|
|
2020-11-28 22:59:55 +00:00
|
|
|
if (retval != RIG_OK || strlen(posbuf) < 5)
|
2019-11-30 16:19:08 +00:00
|
|
|
{
|
2020-11-28 22:59:55 +00:00
|
|
|
return retval < 0 ? retval : -RIG_EPROTO;
|
2019-11-30 16:19:08 +00:00
|
|
|
}
|
2020-11-28 22:59:55 +00:00
|
|
|
|
|
|
|
if (rc2800_parse(posbuf, &device, &value) == RIG_OK)
|
2019-11-30 16:19:08 +00:00
|
|
|
{
|
2020-11-28 22:59:55 +00:00
|
|
|
if (device == 'E')
|
|
|
|
{
|
|
|
|
*el = (elevation_t) value;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
2019-11-30 16:19:08 +00:00
|
|
|
}
|
2020-11-28 22:59:55 +00:00
|
|
|
|
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s: (az, el) = (%.1f, %.1f)\n",
|
|
|
|
__func__, *az, *el);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s: (az) = (%.1f)\n",
|
|
|
|
__func__, *az);
|
2019-11-30 16:19:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return RIG_OK;
|
2010-05-19 21:56:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
rc2800_rot_stop(ROT *rot)
|
|
|
|
{
|
2019-11-30 16:19:08 +00:00
|
|
|
int retval;
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
/* TODO: check each return value (do we care?) */
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
/* Stop AZ*/
|
|
|
|
retval = rc2800_transaction(rot, "A" CR, NULL, 0); /* select AZ */
|
2019-12-08 16:10:10 +00:00
|
|
|
|
|
|
|
if (retval != RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "%s: A command failed?\n", __func__); }
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
retval = rc2800_transaction(rot, "S" CR, NULL, 0); /* STOP */
|
2011-08-21 02:54:40 +00:00
|
|
|
|
2019-12-08 16:10:10 +00:00
|
|
|
if (retval != RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "%s: az S command failed?\n", __func__); }
|
|
|
|
|
2020-11-30 17:22:33 +00:00
|
|
|
if (rot->caps->rot_type == ROT_TYPE_AZIMUTH)
|
|
|
|
{
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
/* do not overwhelm the MCU? */
|
2020-01-08 05:18:56 +00:00
|
|
|
hl_usleep(200 * 1000);
|
2010-05-29 22:20:50 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
/* Stop EL*/
|
|
|
|
retval = rc2800_transaction(rot, "E" CR, NULL, 0); /* select EL */
|
2019-12-08 16:10:10 +00:00
|
|
|
|
|
|
|
if (retval != RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "%s: E command failed?\n", __func__); }
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
retval = rc2800_transaction(rot, "S" CR, NULL, 0); /* STOP */
|
2011-08-21 02:54:40 +00:00
|
|
|
|
2019-12-08 16:10:10 +00:00
|
|
|
if (retval != RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "%s: el S command failed?\n", __func__); }
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
return retval;
|
2010-05-19 21:56:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ************************************************************************* */
|
|
|
|
/*
|
|
|
|
* M2 RC2800 rotator capabilities.
|
2010-05-26 07:50:47 +00:00
|
|
|
*
|
|
|
|
* Protocol documentation: http://www.confluentdesigns.com/files/PdfFiles/devguide_24.pdf
|
2010-05-19 21:56:00 +00:00
|
|
|
*/
|
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
const struct rot_caps rc2800_rot_caps =
|
|
|
|
{
|
2020-03-06 05:48:14 +00:00
|
|
|
ROT_MODEL(ROT_MODEL_RC2800),
|
2019-11-30 16:19:08 +00:00
|
|
|
.model_name = "RC2800",
|
|
|
|
.mfg_name = "M2",
|
2021-01-29 14:20:56 +00:00
|
|
|
.version = "20210129",
|
2019-11-30 16:19:08 +00:00
|
|
|
.copyright = "LGPL",
|
2021-01-29 14:20:56 +00:00
|
|
|
.status = RIG_STATUS_STABLE,
|
2019-11-30 16:19:08 +00:00
|
|
|
.rot_type = ROT_TYPE_AZEL,
|
|
|
|
.port_type = RIG_PORT_SERIAL,
|
|
|
|
.serial_rate_min = 9600,
|
|
|
|
.serial_rate_max = 9600,
|
|
|
|
.serial_data_bits = 8,
|
|
|
|
.serial_stop_bits = 1,
|
|
|
|
.serial_parity = RIG_PARITY_NONE,
|
|
|
|
.serial_handshake = RIG_HANDSHAKE_NONE,
|
|
|
|
.write_delay = 0,
|
|
|
|
.post_write_delay = 0,
|
|
|
|
.timeout = 1000,
|
|
|
|
.retry = 3,
|
|
|
|
|
|
|
|
.min_az = 0.0,
|
|
|
|
.max_az = 360.0,
|
|
|
|
.min_el = 0.0,
|
|
|
|
.max_el = 180.0,
|
|
|
|
|
|
|
|
.get_position = rc2800_rot_get_position,
|
|
|
|
.set_position = rc2800_rot_set_position,
|
|
|
|
.stop = rc2800_rot_stop,
|
2010-05-19 21:56:00 +00:00
|
|
|
};
|
|
|
|
|
2020-11-30 17:22:33 +00:00
|
|
|
// below tested on RC2800P-A
|
2020-11-28 22:59:55 +00:00
|
|
|
const struct rot_caps rc2800az_rot_caps =
|
|
|
|
{
|
2020-11-30 17:22:33 +00:00
|
|
|
ROT_MODEL(ROT_MODEL_RC2800_EARLY_AZ),
|
|
|
|
.model_name = "RC2800_EARLY_AZ",
|
2020-11-28 22:59:55 +00:00
|
|
|
.mfg_name = "M2",
|
2020-11-30 04:46:04 +00:00
|
|
|
.version = "20201130",
|
2020-11-28 22:59:55 +00:00
|
|
|
.copyright = "LGPL",
|
|
|
|
.status = RIG_STATUS_STABLE,
|
|
|
|
.rot_type = ROT_TYPE_AZIMUTH,
|
|
|
|
.port_type = RIG_PORT_SERIAL,
|
|
|
|
.serial_rate_min = 9600,
|
|
|
|
.serial_rate_max = 9600,
|
|
|
|
.serial_data_bits = 8,
|
|
|
|
.serial_stop_bits = 1,
|
|
|
|
.serial_parity = RIG_PARITY_NONE,
|
|
|
|
.serial_handshake = RIG_HANDSHAKE_NONE,
|
|
|
|
.write_delay = 0,
|
|
|
|
.post_write_delay = 0,
|
|
|
|
.timeout = 1000,
|
|
|
|
.retry = 3,
|
|
|
|
|
|
|
|
.min_az = 0.0,
|
|
|
|
.max_az = 360.0,
|
|
|
|
.min_el = 0.0,
|
|
|
|
.max_el = 180.0,
|
|
|
|
|
|
|
|
.get_position = rc2800_rot_get_position,
|
|
|
|
.set_position = rc2800_rot_set_position,
|
|
|
|
.stop = rc2800_rot_stop,
|
|
|
|
};
|
|
|
|
|
2020-11-30 17:22:33 +00:00
|
|
|
const struct rot_caps rc2800azel_rot_caps =
|
|
|
|
{
|
|
|
|
ROT_MODEL(ROT_MODEL_RC2800_EARLY_AZEL),
|
|
|
|
.model_name = "RC2800_EARLY_AZEL",
|
|
|
|
.mfg_name = "M2",
|
|
|
|
.version = "20201130",
|
|
|
|
.copyright = "LGPL",
|
|
|
|
.status = RIG_STATUS_STABLE,
|
|
|
|
.rot_type = ROT_TYPE_AZEL,
|
|
|
|
.port_type = RIG_PORT_SERIAL,
|
|
|
|
.serial_rate_min = 9600,
|
|
|
|
.serial_rate_max = 9600,
|
|
|
|
.serial_data_bits = 8,
|
|
|
|
.serial_stop_bits = 1,
|
|
|
|
.serial_parity = RIG_PARITY_NONE,
|
|
|
|
.serial_handshake = RIG_HANDSHAKE_NONE,
|
|
|
|
.write_delay = 0,
|
|
|
|
.post_write_delay = 0,
|
|
|
|
.timeout = 1000,
|
|
|
|
.retry = 3,
|
|
|
|
|
|
|
|
.min_az = 0.0,
|
|
|
|
.max_az = 360.0,
|
|
|
|
.min_el = 0.0,
|
|
|
|
.max_el = 180.0,
|
|
|
|
|
|
|
|
.get_position = rc2800_rot_get_position,
|
|
|
|
.set_position = rc2800_rot_set_position,
|
|
|
|
.stop = rc2800_rot_stop,
|
|
|
|
};
|
|
|
|
|
2010-05-19 21:56:00 +00:00
|
|
|
/* ************************************************************************* */
|
|
|
|
|
|
|
|
DECLARE_INITROT_BACKEND(m2)
|
|
|
|
{
|
2019-11-30 16:19:08 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
rot_register(&rc2800_rot_caps);
|
2020-11-28 23:03:28 +00:00
|
|
|
rot_register(&rc2800az_rot_caps);
|
2020-11-30 17:22:33 +00:00
|
|
|
rot_register(&rc2800azel_rot_caps);
|
2010-05-19 21:56:00 +00:00
|
|
|
|
2019-11-30 16:19:08 +00:00
|
|
|
return RIG_OK;
|
2010-05-19 21:56:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************************************************************* */
|
|
|
|
/* end of file */
|
|
|
|
|