* aor_transaction: handle rigs configured to return extra LF

* fix RIG_LEVEL_RAWSTR for AR8600, and possibly AR8000
* S-meter caliration data for AR8600 from Mark P. Grimes, WAØTOP
* S-meter caliration data for AR8200 from AR8200 Bulletin


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2951 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.12
Stéphane Fillod, F8CFE 2010-08-20 08:18:23 +00:00
rodzic 5ea0ff6cb6
commit 8411d9d1d7
4 zmienionych plików z 53 dodań i 18 usunięć

Wyświetl plik

@ -97,6 +97,12 @@ static int aor_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, i
if (retval < 0)
return retval;
/* chop LF head when present */
if (retval >= 1 && data[0] == '\x0a') {
retval--;
memmove(data, data+1, retval);
}
*data_len = retval;
if (*data_len < BUFSZ)
@ -104,7 +110,7 @@ static int aor_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, i
else
data[BUFSZ-1] = '\0';
if (data[0] == '?') {
if (retval >= 1 && data[0] == '?') {
/* command failed? resync with radio */
write_block(&rs->rigport, EOM, 1);
@ -575,7 +581,15 @@ int aor_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
case RIG_LEVEL_RAWSTR:
if (ack_len < 4 || ackbuf[0] != 'L' || ackbuf[1] != 'M')
return -RIG_EPROTO;
sscanf(ackbuf+(ackbuf[2]=='%'?3:2), "%x", &val->i);
if (rig->caps->rig_model == RIG_MODEL_AR8000) {
sscanf(ackbuf+2, "%x", &val->i);
val->i &= ~0x80; /* mask squelch status */
} else if (rig->caps->rig_model == RIG_MODEL_AR8200 ||
rig->caps->rig_model == RIG_MODEL_AR8600)
sscanf(ackbuf+3, "%d", &val->i);
else
sscanf(ackbuf+3, "%x", &val->i);
break;
case RIG_LEVEL_ATT:

Wyświetl plik

@ -1,8 +1,7 @@
/*
* Hamlib AOR backend - main header
* Copyright (c) 2000-2008 by Stephane Fillod
* Copyright (c) 2000-2010 by Stephane Fillod
*
* $Id: aor.h,v 1.24 2008-04-11 17:10:45 fillods 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
@ -25,7 +24,7 @@
#include <hamlib/rig.h>
#define BACKEND_VER "0.5"
#define BACKEND_VER "0.6"
int format8k_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width);

Wyświetl plik

@ -1,8 +1,7 @@
/*
* Hamlib AOR backend - AR8200 description
* Copyright (c) 2000-2008 by Stephane Fillod
* Copyright (c) 2000-2010 by Stephane Fillod
*
* $Id: ar8200.c,v 1.22 2008-04-11 17:10:45 fillods 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
@ -44,10 +43,21 @@
#define AR8200_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
/* TODO: measure and report real values */
#define AR8200_STR_CAL { 2, \
/* series-2 (black cabinet), from AR8200 Bulletin page */
#define AR8200_STR_CAL { 12, \
{ \
{ 0x00, -60 }, \
{ 0xff, 60 } \
{ 0,-54 }, \
{ 27,-32 }, \
{ 42,-27 }, \
{ 55,-22 }, \
{ 68,-17 }, \
{ 86, -7 }, \
{ 97, 3 }, \
{ 103, 13 }, \
{ 106, 23 }, \
{ 109, 33 }, \
{ 112, 43 }, \
{ 139, 53 }, \
} }
#define AR8200_MEM_CAP { \
@ -81,7 +91,7 @@ const struct rig_caps ar8200_caps = {
.rig_model = RIG_MODEL_AR8200,
.model_name = "AR8200",
.mfg_name = "AOR",
.version = BACKEND_VER,
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_SCANNER,

Wyświetl plik

@ -1,8 +1,7 @@
/*
* Hamlib AOR backend - AR8600 description
* Copyright (c) 2000-2008 by Stephane Fillod
* Copyright (c) 2000-2010 by Stephane Fillod
*
* $Id: ar8600.c,v 1.3 2008-04-11 17:10:45 fillods 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
@ -43,11 +42,24 @@
#define AR8600_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
/* TODO: measure and report real values */
#define AR8600_STR_CAL { 2, \
/* Measurement by Mark, WAØTOP,
* using a HP8640B signal generator on an AR8600 Mark 2 (sn. 551454).
* The mode was AM. The ATT was off.
*/
#define AR8600_STR_CAL { 12, \
{ \
{ 0x00, -60 }, \
{ 0xff, 60 } \
{ 0, -54 }, /* 1st point is extrapolated */ \
{ 13, -27 }, /* S-pixels: none */ \
{ 29, -17 }, \
{ 41, - 7 }, \
{ 49, 3 }, /* S-pixels: 21 */ \
{ 54, 13 }, \
{ 59, 23 }, \
{ 62, 33 }, /* S-pixels: 30 */ \
{ 64, 43 }, \
{ 65, 53 }, \
{ 68, 63 }, \
{ 69, 73 } /* S-pixels: 36 */ \
} }
#define AR8600_MEM_CAP { \
@ -81,7 +93,7 @@ const struct rig_caps ar8600_caps = {
.rig_model = RIG_MODEL_AR8600,
.model_name = "AR8600",
.mfg_name = "AOR",
.version = BACKEND_VER,
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_SCANNER,