Patches for pipelined tuning and OS535 from Michael Smith

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1533 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.0
Stéphane Fillod, F8CFE 2003-09-07 18:30:28 +00:00
rodzic aba3325e7f
commit dadc34efef
4 zmienionych plików z 60 dodań i 37 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - OptoScan extensions * Hamlib CI-V backend - OptoScan extensions
* Copyright (c) 2000-2003 by Stephane Fillod * Copyright (c) 2000-2003 by Stephane Fillod
* *
* $Id: optoscan.c,v 1.7 2003-08-17 22:39:07 fillods Exp $ * $Id: optoscan.c,v 1.8 2003-09-07 18:30:28 fillods Exp $
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as * it under the terms of the GNU Library General Public License as
@ -558,9 +558,6 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
pltune_cb_t cb; pltune_cb_t cb;
int rc, pin_state; int rc, pin_state;
struct rig_state *rs; struct rig_state *rs;
int status;
unsigned char y;
port_t *p;
if(scan != RIG_SCAN_PLT) if(scan != RIG_SCAN_PLT)
return -RIG_ENAVAIL; return -RIG_ENAVAIL;
@ -615,6 +612,9 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
} }
} }
/* exiting pipeline loop - force state init on next call */
state->freq=0;
return RIG_OK; return RIG_OK;
} }
@ -623,7 +623,7 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
*/ */
static int optoscan_get_status_block(RIG *rig, struct optostat *status_block) static int optoscan_get_status_block(RIG *rig, struct optostat *status_block)
{ {
int retval, ack_len; int retval, ack_len, expected_len;
unsigned char ackbuf[MAXFRAMELEN]; unsigned char ackbuf[MAXFRAMELEN];
memset(status_block,0,sizeof(struct optostat)); memset(status_block,0,sizeof(struct optostat));
@ -634,7 +634,21 @@ static int optoscan_get_status_block(RIG *rig, struct optostat *status_block)
if (retval != RIG_OK) if (retval != RIG_OK)
return retval; return retval;
if (ack_len != 4 ) { switch( rig->caps->rig_model )
{
case RIG_MODEL_OS456:
expected_len=4;
break;
case RIG_MODEL_OS535:
expected_len=5;
break;
default:
rig_debug(RIG_DEBUG_ERR,"optoscan_get_status_block: unknown rig model");
return -RIG_ERJCTED;
break;
}
if (ack_len != expected_len ) {
rig_debug(RIG_DEBUG_ERR,"optoscan_get_status_block: ack NG (%#.2x), " rig_debug(RIG_DEBUG_ERR,"optoscan_get_status_block: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len); "len=%d\n", ackbuf[0], ack_len);
return -RIG_ERJCTED; return -RIG_ERJCTED;
@ -673,7 +687,7 @@ static int optoscan_send_freq(RIG *rig,pltstate_t *state)
struct icom_priv_data *priv; struct icom_priv_data *priv;
struct rig_state *rs; struct rig_state *rs;
const port_t *port; const port_t *port;
int fd,i; int fd;
char md,pd; char md,pd;
freq_t freq; freq_t freq;
rmode_t mode; rmode_t mode;
@ -707,9 +721,6 @@ static int optoscan_RTS_toggle(RIG *rig)
{ {
struct rig_state *rs; struct rig_state *rs;
int state=0; int state=0;
port_t *p;
int status;
unsigned char y;
rs=&rig->state; rs=&rig->state;
ser_get_rts(&rs->rigport,&state); ser_get_rts(&rs->rigport,&state);
@ -748,12 +759,3 @@ static int optoscan_wait_timer(RIG *rig, pltstate_t *state)
return RIG_OK; return RIG_OK;
} }
void static dump_state(char *str, pltstate_t *state)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s:\n",str);
rig_debug(RIG_DEBUG_VERBOSE,"freq: %d\n",state->freq);
rig_debug(RIG_DEBUG_VERBOSE,"mode: %d\n",state->mode);
rig_debug(RIG_DEBUG_VERBOSE,"next freq: %d\n",state->next_freq);
rig_debug(RIG_DEBUG_VERBOSE,"next mode: %d\n",state->next_mode);
rig_debug(RIG_DEBUG_VERBOSE,"usleep time:%d\n",state->usleep_time);
}

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - description of the OptoScan456 * Hamlib CI-V backend - description of the OptoScan456
* Copyright (c) 2000-2003 by Stephane Fillod and Michael Smith * Copyright (c) 2000-2003 by Stephane Fillod and Michael Smith
* *
* $Id: os456.c,v 1.6 2003-08-17 22:39:07 fillods Exp $ * $Id: os456.c,v 1.7 2003-09-07 18:30:28 fillods Exp $
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as * it under the terms of the GNU Library General Public License as
@ -20,6 +20,11 @@
* *
*/ */
/*
* This backend is currently being maintained by Michael Smith, KE4RJQ.
* Email: james (dot) m (dot) smith (at) earthlink (dot) net
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -69,7 +74,7 @@ const struct rig_caps os456_caps = {
.rig_model = RIG_MODEL_OS456, .rig_model = RIG_MODEL_OS456,
.model_name = "OptoScan456", .model_name = "OptoScan456",
.mfg_name = "Optoelectronics", .mfg_name = "Optoelectronics",
.version = "0.2", .version = "0.3",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_SCANNER, .rig_type = RIG_TYPE_SCANNER,

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - description of the OptoScan535 * Hamlib CI-V backend - description of the OptoScan535
* Copyright (c) 2000-2002 by Stephane Fillod * Copyright (c) 2000-2002 by Stephane Fillod
* *
* $Id: os535.c,v 1.5 2003-05-19 06:57:44 fillods Exp $ * $Id: os535.c,v 1.6 2003-09-07 18:30:28 fillods Exp $
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as * it under the terms of the GNU Library General Public License as
@ -20,6 +20,11 @@
* *
*/ */
/*
* This backend is currently being maintained by Michael Smith, KE4RJQ.
* Email: james (dot) m (dot) smith (at) earthlink (dot) net
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -33,11 +38,12 @@ extern struct confparams opto_ext_parms[];
#define OS535_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM) #define OS535_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
#define OS535_VFO_ALL (RIG_VFO_A) #define OS535_VFO_ALL (RIG_VFO_A)
#define OS535_LEVELS (RIG_LEVEL_STRENGTH) #define OS535_LEVELS (RIG_LEVEL_SQLSTAT|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF)
#define OS535_SCAN_OPS (RIG_SCAN_PLT)
#define OS535_STR_CAL { 2, { \ #define OS535_STR_CAL { 2, { \
{ 137, -60 }, \
{ 20, 60 }, \ { 20, 60 }, \
{ 137, -60 }, \
} } /* TBC */ } } /* TBC */
/* /*
@ -52,19 +58,20 @@ static const struct icom_priv_caps os535_priv_caps = {
0x80, /* default address */ 0x80, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
NULL, NULL,
OS535_STR_CAL OS535_STR_CAL,
.settle_time = 12,
}; };
const struct rig_caps os535_caps = { const struct rig_caps os535_caps = {
.rig_model = RIG_MODEL_OS535, .rig_model = RIG_MODEL_OS535,
.model_name = "OptoScan535", .model_name = "OptoScan535",
.mfg_name = "Optoelectronics", .mfg_name = "Optoelectronics",
.version = "0.2", .version = "0.3",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_ALPHA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_SCANNER, .rig_type = RIG_TYPE_SCANNER,
.ptt_type = RIG_PTT_NONE, .ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE, .dcd_type = RIG_DCD_SERIAL_CAR,
.port_type = RIG_PORT_SERIAL, .port_type = RIG_PORT_SERIAL,
.serial_rate_min = 300, .serial_rate_min = 300,
.serial_rate_max = 38400, .serial_rate_max = 38400,
@ -78,8 +85,8 @@ const struct rig_caps os535_caps = {
.retry = 3, .retry = 3,
.has_get_func = RIG_FUNC_NONE, .has_get_func = RIG_FUNC_NONE,
.has_set_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_NONE,
.has_get_level = RIG_LEVEL_NONE, .has_get_level = OS535_LEVELS,
.has_set_level = RIG_LEVEL_NONE, .has_set_level = RIG_LEVEL_AF,
.has_get_parm = RIG_PARM_NONE, .has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE,
.level_gran = {}, .level_gran = {},
@ -93,7 +100,7 @@ const struct rig_caps os535_caps = {
.max_ifshift = Hz(0), .max_ifshift = Hz(0),
.targetable_vfo = 0, .targetable_vfo = 0,
.vfo_ops = RIG_OP_NONE, .vfo_ops = RIG_OP_NONE,
.scan_ops = RIG_SCAN_NONE, .scan_ops = OS535_SCAN_OPS,
.transceive = RIG_TRN_RIG, .transceive = RIG_TRN_RIG,
.bank_qty = 0, .bank_qty = 0,
.chan_desc_sz = 0, .chan_desc_sz = 0,
@ -102,9 +109,7 @@ const struct rig_caps os535_caps = {
.rx_range_list1 = { .rx_range_list1 = {
{ MHz(25),MHz(520),OS535_MODES,-1,-1,OS535_VFO_ALL}, { MHz(25),MHz(520),OS535_MODES,-1,-1,OS535_VFO_ALL},
{ MHz(760),MHz(823.995),OS535_MODES,-1,-1,OS535_VFO_ALL}, { MHz(760),MHz(1300),OS535_MODES,-1,-1,OS535_VFO_ALL},
{ MHz(849),MHz(868.995),OS535_MODES,-1,-1,OS535_VFO_ALL},
{ MHz(894),MHz(1300),OS535_MODES,-1,-1,OS535_VFO_ALL},
RIG_FRNG_END, }, RIG_FRNG_END, },
.tx_range_list1 = { RIG_FRNG_END, }, /* this is a scanner */ .tx_range_list1 = { RIG_FRNG_END, }, /* this is a scanner */
@ -151,5 +156,18 @@ const struct rig_caps os535_caps = {
.get_info = optoscan_get_info, .get_info = optoscan_get_info,
.get_ctcss_tone = optoscan_get_ctcss_tone,
.get_dcs_code = optoscan_get_dcs_code,
.recv_dtmf = optoscan_recv_dtmf,
.extparms = opto_ext_parms,
.set_ext_parm = optoscan_set_ext_parm,
.get_ext_parm = optoscan_get_ext_parm,
.set_level = optoscan_set_level,
.get_level = optoscan_get_level,
.scan = optoscan_scan,
}; };

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Interface - event handling * Hamlib Interface - event handling
* Copyright (c) 2000-2003 by Stephane Fillod and Frank Singleton * Copyright (c) 2000-2003 by Stephane Fillod and Frank Singleton
* *
* $Id: event.c,v 1.21 2003-08-20 07:22:40 fillods Exp $ * $Id: event.c,v 1.22 2003-09-07 18:30:28 fillods Exp $
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as * it under the terms of the GNU Library General Public License as
@ -510,8 +510,6 @@ int rig_set_pltune_callback(RIG *rig, pltune_cb_t cb, rig_ptr_t arg)
{ {
if (CHECK_RIG_ARG(rig)) if (CHECK_RIG_ARG(rig))
return -RIG_EINVAL; return -RIG_EINVAL;
if(arg==NULL)
return -RIG_EINVAL;
rig->callbacks.pltune = cb; rig->callbacks.pltune = cb;
rig->callbacks.pltune_arg = arg; rig->callbacks.pltune_arg = arg;