Update:
		Committing patches received from AD7AI for several Icom
		models including IC-746, IC-756, and IC-7800.


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2111 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.6rc1
Nate Bargmann, N0NB 2006-07-18 22:51:43 +00:00
rodzic bed2cca690
commit c85dcd5105
13 zmienionych plików z 602 dodań i 249 usunięć

Wyświetl plik

@ -1,3 +1,33 @@
2006-07-03 KHill <fuzzballz@comcast.net>
*
2006-07-03 KHill <fuzzballz@comcast.net>
* include/hamlib/rig.h changed settings_t and rig_idx2setting from long (32 bit words)
to long long (64 bit). The RIG_SETTING_MAX is set to 64. This caused errors multiple
bits of code tried to access the upper 32 bits. Maybe RIG_SETTING_MAX should be
changed to 32?
* Icom/frame.c Changed passband mode to reflect the majority of modern rigs and all the old ones I
could find the command documentation for. Change char buffer defs so the are consistant.
2006-06-29 KHill <fuzzballz@comcast.net>
* icom/icom.c numerous fixes and updates. get_ptt, removing unused code and
structures, functions fagc, fbkin, sbkin fixed and vsc (voice squelch added).
tone set for ctcss fixed, scan fixed.
* include/hamlib/rig.h rig_func_rnf (rtty notch filter) renamed to rig_func_rf (rty filter). It is miss-named.
It is so far only implemented with Icom. It is not a notch filter it is a series of
predfined filters for rtty mode. filter mode needs more work.
* icom/ic746 updated and corrected lots of bugs added parameters and get channels
these still need lot of work. Could probably generalize the parameters for all the newer
rigs.
2003-04-28 08:34 fillods
* INSTALL, NEWS, README, README.developer: updates before release

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - low level communication routines
* Copyright (c) 2000-2006 by Stephane Fillod
*
* $Id: frame.c,v 1.28 2006-02-26 18:48:07 fillods Exp $
* $Id: frame.c,v 1.29 2006-07-18 22:51:42 n0nb 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
@ -47,11 +47,11 @@
* REM: if "data" is NULL, then "data_len" MUST be 0.
*
* NB: the frame array must be big enough to hold the frame.
* The smallest frame is 8 bytes, the biggest is at least 13 bytes.
* The smallest frame is 6 bytes, the biggest is at least 13 bytes.
*
* TODO: inline the function?
*/
int make_cmd_frame(char frame[], char re_id, char cmd, int subcmd, const char *data, int data_len)
int make_cmd_frame(char frame[], char re_id, char cmd, int subcmd, const unsigned char *data, int data_len)
{
int i = 0;
@ -63,9 +63,9 @@ int make_cmd_frame(char frame[], char re_id, char cmd, int subcmd, const char *d
frame[i++] = re_id;
frame[i++] = CTRLID;
frame[i++] = cmd;
if (subcmd != -1)
frame[i++] = subcmd & 0xff;
if (subcmd != -1)
frame[i++] = subcmd & 0xff;
if (data_len != 0) {
memcpy(frame+i, data, data_len);
i += data_len;
@ -88,7 +88,7 @@ int make_cmd_frame(char frame[], char re_id, char cmd, int subcmd, const char *d
* return RIG_OK if transaction completed,
* or a negative value otherwise indicating the error.
*/
int icom_one_transaction (RIG *rig, int cmd, int subcmd, const char *payload, int payload_len, char *data, int *data_len)
int icom_one_transaction (RIG *rig, int cmd, int subcmd, const unsigned char *payload, int payload_len, unsigned char *data, int *data_len)
{
struct icom_priv_data *priv;
struct rig_state *rs;
@ -235,7 +235,7 @@ int icom_one_transaction (RIG *rig, int cmd, int subcmd, const char *payload, in
* return RIG_OK if transaction completed,
* or a negative value otherwise indicating the error.
*/
int icom_transaction (RIG *rig, int cmd, int subcmd, const char *payload, int payload_len, char *data, int *data_len)
int icom_transaction (RIG *rig, int cmd, int subcmd, const unsigned char *payload, int payload_len, unsigned char *data, int *data_len)
{
int retval, retry;
@ -309,7 +309,7 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
medium_width = rig_passband_normal(rig, mode);
if (width == medium_width || width == RIG_PASSBAND_NORMAL)
icmode_ext = -1; /* medium, no passband data */
icmode_ext = -1; /* medium, no passband data-> rig default. Is medium always the default? */
else if (width < medium_width)
icmode_ext = PD_NARROW;
else
@ -362,26 +362,18 @@ void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode, pbwidth_t
*mode = RIG_MODE_NONE;
}
/* IC-R75 returns passband indexes 1-wide, 2-normal,3-narrow */
if ((rig->caps->rig_model == RIG_MODEL_ICR75) ||
(rig->caps->rig_model == RIG_MODEL_IC756PROII))
pd = 3-pd;
/* Most rigs return 1-wide, 2-normal,3-narrow see defs of PD_NARROW etc in the ICOM_defs file. That is what the rig2icom func uses. */
switch (pd) {
case 0x00: *width = rig_passband_narrow(rig, *mode); break;
case 0x01: *width = rig_passband_normal(rig, *mode); break;
case 0x02: *width = rig_passband_wide(rig, *mode); break;
case 0x03: *width = rig_passband_narrow(rig, *mode); break;
case 0x02: *width = rig_passband_normal(rig, *mode); break;
case 0x01: *width = rig_passband_wide(rig, *mode); break;
case -1: break; /* no passband data */
case 0x03:
if (rig->caps->rig_model == RIG_MODEL_IC751) {
*width = rig_passband_narrow(rig, *mode);
break;
}
/* else fall through */
default:
rig_debug(RIG_DEBUG_ERR,"icom: Unsupported Icom mode width %#.2x\n",
pd);
*width = RIG_PASSBAND_NORMAL;
}
}

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - low level communication header
* Copyright (c) 2000-2005 by Stephane Fillod
*
* $Id: frame.h,v 1.14 2005-04-03 12:27:15 fillods Exp $
* $Id: frame.h,v 1.15 2006-07-18 22:51:42 n0nb 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
@ -23,14 +23,14 @@
#ifndef _FRAME_H
#define _FRAME_H 1
#define MAXFRAMELEN 32
#define MAXFRAMELEN 56
/*
* helper functions
*/
int make_cmd_frame(char frame[], char re_id, char cmd, int subcmd, const char *data, int data_len);
int make_cmd_frame(char frame[], char re_id, char cmd, int subcmd, const unsigned char *data, int data_len);
int icom_transaction (RIG *rig, int cmd, int subcmd, const char *payload, int payload_len, char *data, int *data_len);
int icom_transaction (RIG *rig, int cmd, int subcmd, const unsigned char *payload, int payload_len, unsigned char *data, int *data_len);
int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[]);
int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width, unsigned char *md, char *pd);

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - description of IC-746 and variations
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: ic746.c,v 1.5 2005-04-03 19:47:19 fillods Exp $
* $Id: ic746.c,v 1.6 2006-07-18 22:51:42 n0nb 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
@ -48,7 +48,6 @@
* - set_ctcss_tone/ctcss_sql
* - set keyer?
* - read IF filter setting?
* - switch main/sub?
* - test all that stuff..
*/
@ -57,19 +56,24 @@
/*
* 100W in all modes but AM (40W)
* deleted rig_mode_tx_modes
*/
#define IC746_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
#define IC746_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
#define IC746_AM_TX_MODES (RIG_MODE_AM)
#define IC746_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RNF|RIG_FUNC_ANF|RIG_FUNC_APF)
#define IC746_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RF|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_RESUME)
#define IC746_LEVEL_ALL (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF|RIG_LEVEL_APF|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR)
#define IC746_LEVEL_ALL (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR)
#define IC746_GET_PARM (RIG_PARM_BACKLIGHT|RIG_PARM_BEEP)
#define IC746_SET_PARM (RIG_PARM_BACKLIGHT|RIG_PARM_BEEP|RIG_PARM_ANN)
#define IC746_VFO_ALL (RIG_VFO_A|RIG_VFO_B)
#define IC746_ANTS (RIG_ANT_1|RIG_ANT_2)
#define IC746_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define IC746_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM)
#define IC746_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
#define IC746_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_SLCT|RIG_SCAN_PROG|RIG_SCAN_DELTA)
#define IC746_STR_CAL { 16, \
{ \
@ -91,6 +95,69 @@
{ 146, 60 } \
} }
#define IC746PRO_MEM_CAP { \
.freq = 1, \
.mode = 1, \
.width = 1, \
.tx_freq = 1, \
.tx_mode = 1, \
.tx_width = 1, \
.split = 1, \
.rptr_shift = 1,\
.ctcss_tone = 1,\
.ctcss_sql = 1, \
.dcs_code = 1, \
.flags = 1, \
.channel_desc = 1, \
}
/* Memory channel buffer structure for IC-746 pro and ?
Note requires an ack_buff of 64 bytes and data length is 46.
*/
typedef struct {
unsigned char freq[5]; /* little endian frequency */
unsigned char mode;
unsigned char pb; /* passband or filter selection*/
unsigned char data; /* data port 0=off 1=on */
unsigned char dup; /* duplex, tone, tonesql and DTCS
Values in hex are "or"ed together
00 = Simplex
10 = -DUP
20 = +DUP
01 = ctcss tone on
02 = tone_sql on
03 = DTCS on */
unsigned char tone[3]; /* ctcss tone bigendian first byte fixed 00 */
unsigned char tone_sql[3]; /* tone squelch frequency as tone */
struct {
unsigned char pol; /* DTCS polarity by nibbles Tx pol | Rx pol; 0 = normal; 1 = rev */
unsigned char code[2]; /* DTCS code bigendian */
} dcs;
} channel_str_t;
typedef struct {
char chan_flag; /* split 0x10 = on; scan select 0x01 = on */
channel_str_t rx;
channel_str_t tx;
char name[9]; /*name 9 ascii no null terminator */
} mem_buf_t;
#define MAX_MEM_BUF_LEN sizeof(mem_buf_t)
/* IC-746 Pro has a 3 "band-stacking registers" defined for each hamband and general coverage. These are updated and rotated when band is changed from front panel. The most recent is rolled down and the oldest discarded. The structure of the register is roughly half a memory buffer.
*/
typedef channel_str_t band_stack_reg_t;
static int ic746_set_parm(RIG *rig, setting_t parm, value_t val);
static int ic746_get_parm(RIG *rig, setting_t parm, value_t *val);
static int ic746pro_get_channel(RIG *rig, channel_t *chan);
/*
* ic746 rig capabilities.
*/
@ -126,7 +193,7 @@ const struct rig_caps ic746_caps = {
.has_get_level = IC746_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(IC746_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.has_set_parm = RIG_PARM_ANN,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
@ -165,10 +232,10 @@ const struct rig_caps ic746_caps = {
RIG_FRNG_END,
},
/* most it2 rigs have 108-174 coverage*/
.rx_range_list2 = {
{kHz(30),MHz(60),IC746_ALL_RX_MODES,-1,-1,IC746_VFO_ALL,IC746_ANTS},
{MHz(144),MHz(148),IC746_ALL_RX_MODES,-1,-1,IC746_VFO_ALL,IC746_ANTS},
{MHz(108),MHz(174),IC746_ALL_RX_MODES,-1,-1,IC746_VFO_ALL,IC746_ANTS},
RIG_FRNG_END, },
.tx_range_list2 = {
FRQ_RNG_HF(2,IC746_OTHER_TX_MODES, W(5),W(100),IC746_VFO_ALL,IC746_ANTS),
@ -225,6 +292,7 @@ const struct rig_caps ic746_caps = {
.get_level = icom_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = ic746_set_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
@ -279,8 +347,8 @@ const struct rig_caps ic746pro_caps = {
.has_set_func = IC746_FUNC_ALL,
.has_get_level = IC746_LEVEL_ALL,
.has_set_level = RIG_LEVEL_SET(IC746_LEVEL_ALL),
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
.has_get_parm = IC746_GET_PARM,
.has_set_parm = IC746_SET_PARM,
.level_gran = {
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
@ -289,7 +357,7 @@ const struct rig_caps ic746pro_caps = {
.dcs_list = full_dcs_list,
.preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
.attenuator = { 20, RIG_DBLST_END, },
.max_rit = Hz(9999),
.max_rit = Hz(0),
.max_xit = Hz(0),
.max_ifshift = Hz(0),
.targetable_vfo = 0,
@ -297,12 +365,12 @@ const struct rig_caps ic746pro_caps = {
.scan_ops = IC746_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 0,
.chan_desc_sz = 0,
.chan_desc_sz = 9,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM },
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
{ 102, 102, RIG_MTYPE_CALL },
{ 1, 99, RIG_MTYPE_MEM, IC746PRO_MEM_CAP },
{ 100, 101, RIG_MTYPE_EDGE, IC746PRO_MEM_CAP }, /* two by two */
{ 102, 102, RIG_MTYPE_CALL, IC746PRO_MEM_CAP },
RIG_CHAN_END,
},
@ -320,10 +388,10 @@ const struct rig_caps ic746pro_caps = {
RIG_FRNG_END,
},
/* most it2 rigs have 108-174 coverage*/
.rx_range_list2 = {
{kHz(30),MHz(60),IC746_ALL_RX_MODES,-1,-1,IC746_VFO_ALL,IC746_ANTS},
{MHz(144),MHz(148),IC746_ALL_RX_MODES,-1,-1,IC746_VFO_ALL,IC746_ANTS},
{MHz(108),MHz(174),IC746_ALL_RX_MODES,-1,-1,IC746_VFO_ALL,IC746_ANTS},
RIG_FRNG_END, },
.tx_range_list2 = {
FRQ_RNG_HF(2,IC746_OTHER_TX_MODES, W(5),W(100),IC746_VFO_ALL,IC746_ANTS),
@ -348,13 +416,26 @@ const struct rig_caps ic746pro_caps = {
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
/* mode/filter list, remember: order matters! But duplication may speed up search. Put the most commonly used modes first! It might be better to rewrite and just put all filter widths for 1 mode together in 1 record. Remember these are defaults, with dsp rigs you can change them to anything you want (except rtty filter modes). */
.filters = {
{RIG_MODE_SSB|RIG_MODE_RTTYR|RIG_MODE_CWR|RIG_MODE_RTTY|RIG_MODE_CW, kHz(2.4)},
{RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(350)},
{RIG_MODE_CW|RIG_MODE_CWR, Hz(500)},
{RIG_MODE_SSB, kHz(2.4)},
{RIG_MODE_SSB, kHz(1.8)},
{RIG_MODE_SSB, kHz(3)},
{RIG_MODE_FM, kHz(10)},
{RIG_MODE_FM, kHz(15)},
{RIG_MODE_FM|RIG_MODE_AM, kHz(6)},
{RIG_MODE_FM, kHz(7)},
/* There are 5 rtty filters when rtty filter mode is set (default condition) { 1k, 500, 350, 300, 250 }. These are fixed. If rtty filter mode is unset there are 3 general IF filters { 2.4k, 500, 250 are the defaults }. These can be changed. There is a "twin-peak" filter mode as well. It boosts the 2125 and 2295 recieve frequency reponse. I'm not sure what the icom_defs S_FUNC_RNF (rtty notch filter) is supposed to refer to, it has no notch function, but, the commands turns the rtty filter mode on and off. Changed to S_FUNC_RF */
{RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(500)}, /* RTTY & "normal" IF Filters */
{RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(250)}, /* RTTY & "narrow" IF Filters */
{RIG_MODE_CW|RIG_MODE_CWR, kHz(2.4)}, /* "wide" IF filter */
{RIG_MODE_RTTY|RIG_MODE_RTTYR, kHz(1)}, /*RTTY mode Filter*/
{RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(350)}, /*"Default " rtty mode filter*/
{RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(300)}, /* RTTY mode Filter */
{RIG_MODE_AM, kHz(6)},
{RIG_MODE_AM, kHz(3)},
{RIG_MODE_AM, kHz(9)},
RIG_FLT_END,
},
.str_cal = IC746_STR_CAL,
@ -382,6 +463,8 @@ const struct rig_caps ic746pro_caps = {
.get_level = icom_get_level,
.set_func = icom_set_func,
.get_func = icom_get_func,
.set_parm = ic746_set_parm,
.get_parm = ic746_get_parm,
.set_mem = icom_set_mem,
.vfo_op = icom_vfo_op,
.scan = icom_scan,
@ -389,9 +472,9 @@ const struct rig_caps ic746pro_caps = {
.get_ptt = icom_get_ptt,
.get_dcd = icom_get_dcd,
.set_ts = icom_set_ts,
.get_ts = icom_get_ts,
.get_ts = NULL,
.set_rptr_shift = icom_set_rptr_shift,
.get_rptr_shift = icom_get_rptr_shift,
.get_rptr_shift = NULL,
.set_rptr_offs = icom_set_rptr_offs,
.get_rptr_offs = icom_get_rptr_offs,
.set_ctcss_tone = icom_set_ctcss_tone,
@ -403,7 +486,254 @@ const struct rig_caps ic746pro_caps = {
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.get_split_vfo = NULL,
.get_channel = ic746pro_get_channel,
};
/*
* icom_set_parm
* Assumes rig!=NULL
* These are very much rig specific and should probably be in rig files. These are for IC-746Pro.
* The 746 has no parameters.
*/
int ic746_set_parm(RIG *rig, setting_t parm, value_t val)
{
unsigned char prmbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int ack_len, prm_len;
int prm_cn, prm_sc;
int retval, icom_val;
prm_cn = C_CTL_MEM; /* Most parm are 0x05xx */
prm_sc = S_MEM_PARM;
switch (parm) {
case RIG_PARM_ANN:
if ((val.i == RIG_ANN_FREQ) || (val.i == RIG_ANN_RXMODE)) {
prm_cn = C_CTL_ANN;
prm_sc = val.i;
prm_len = 0;
}
else {
if ((val.i == RIG_ANN_ENG)||(val.i == RIG_ANN_JAP)) {
prm_cn = C_CTL_MEM;
prm_sc = S_MEM_LANG >> 8;
prmbuf[0] = S_MEM_LANG & 0xff;
prm_len = 2;
prmbuf[1] = (val.i == RIG_ANN_ENG ? 0 : 1);
}
else {
rig_debug(RIG_DEBUG_ERR,"Unsupported set_parm_ann %d\n", val.i);
return -RIG_EINVAL;
}
}
break;
case RIG_PARM_BACKLIGHT:
prmbuf[0] = S_MEM_BKLIT;
prm_len = 3;
icom_val = val.f * 255 ;
to_bcd_be(prmbuf + 1, (long long)icom_val, 4);
break;
case RIG_PARM_BEEP:
prmbuf[0] = S_MEM_BEEP;
prm_len = 2;
prmbuf[1] = val.i;
break;
default:
rig_debug(RIG_DEBUG_ERR,"Unsupported set_parm %d\n", parm);
return -RIG_EINVAL;
}
retval = icom_transaction(rig, prm_cn, prm_sc, prmbuf, prm_len,
ackbuf, &ack_len);
if (retval != RIG_OK)
return retval;
if (ack_len != 1) {
rig_debug(RIG_DEBUG_ERR,"icom_set_parm: wrong frame len=%d\n",
ack_len);
return -RIG_EPROTO;
}
return RIG_OK;
}
/*
* icom_get_parm
* Assumes rig!=NULL
*/
int ic746_get_parm(RIG *rig, setting_t parm, value_t *val)
{
unsigned char resbuf[MAXFRAMELEN], data;
int res_len, icom_val;
int prm_cn, prm_sc;
int cmdhead;
int retval;
prm_cn = C_CTL_MEM;
prm_sc = S_MEM_PARM;
switch (parm) {
case RIG_PARM_BACKLIGHT:
data = S_MEM_BKLIT;
break;
case RIG_PARM_BEEP:
data = S_MEM_BEEP;
break;
default:
rig_debug(RIG_DEBUG_ERR,"Unsupported get_parm %d", parm);
return -RIG_EINVAL;
}
retval = icom_transaction (rig, prm_cn, prm_sc, &data, 1,
resbuf, &res_len);
if (retval != RIG_OK)
return retval;
/*
* strbuf should contain Cn,Sc,Data area
*/
cmdhead = (prm_sc == -1) ? 1:3;
res_len -= cmdhead;
/* should echo cmd, subcmd and then data, if you get an ack something is wrong */
if (resbuf[0] != prm_cn) {
if (resbuf[0] == ACK) {
rig_debug(RIG_DEBUG_ERR,"%s: protocol error (%#.2x), "
"len=%d\n", __FUNCTION__,resbuf[0],res_len);
return -RIG_EPROTO;
}
else {
rig_debug(RIG_DEBUG_ERR,"%s: ack NG (%#.2x), "
"len=%d\n", __FUNCTION__,resbuf[0],res_len);
return -RIG_ERJCTED;
}
}
icom_val = from_bcd_be(resbuf+cmdhead, res_len*2); /* is this method necessary? Why not just use unsigned char directly on the buf ? */
if (RIG_PARM_IS_FLOAT(parm))
val->f = (float)icom_val/255;
else
val->i = icom_val;
rig_debug(RIG_DEBUG_TRACE,"%s: %d %d %d %f\n",
__FUNCTION__, res_len, icom_val, val->i, val->f);
return RIG_OK;
}
/*
* ic746pro_get_channel
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
*
* If memory is empty it will return RIG_OK,but every thing will be null. Where do we boundary check?
*/
int ic746pro_get_channel(RIG *rig, channel_t *chan)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char chanbuf[46], databuf[32], data;
mem_buf_t *membuf;
int chan_len, freq_len, retval, data_len, sc, band;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
to_bcd_be(chanbuf,chan->channel_num,4);
chan_len = 2;
freq_len = priv->civ_731_mode ? 4:5;
retval = icom_transaction (rig, C_CTL_MEM, S_MEM_CNTNT,
chanbuf, chan_len, chanbuf, &chan_len);
if (retval != RIG_OK)
return retval;
chan->vfo = RIG_VFO_MEM;
chan->ant = RIG_ANT_NONE;
chan->freq = 0;
chan->mode = RIG_MODE_NONE;
chan->width = RIG_PASSBAND_NORMAL;
chan->rptr_shift = RIG_RPT_SHIFT_NONE;
chan->rptr_offs = 0;
chan->tuning_step = 0;
chan->tx_freq = 0;
chan->tx_mode = RIG_MODE_NONE;
chan->tx_width = RIG_PASSBAND_NORMAL;
chan->tx_vfo = RIG_VFO_NONE;
chan->rit = 0;
chan->xit = 0;
chan->funcs = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_PREAMP)].i = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_ATT)].i = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_AF)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_RF)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_SQL)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_NR)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_PBT_IN)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_PBT_OUT)].f = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_CWPITCH)].i = 0;
chan->levels[rig_setting2idx(RIG_LEVEL_AGC)].i = RIG_AGC_OFF;
chan->ctcss_tone = 0;
chan->ctcss_sql = 0;
chan->dcs_code = 0;
chan->dcs_sql = 0;
chan->scan_group = 0;
chan->flags = RIG_CHFLAG_SKIP;
strcpy(chan->channel_desc, " ");
/*
* freqbuf should contain Cn,Sc,Data area
*/
if ((chan_len != freq_len*2+40) && (chan_len != 1)) {
rig_debug(RIG_DEBUG_ERR,"ic746pro_get_channel: wrong frame len=%d\n",
chan_len);
return -RIG_ERJCTED;
}
/* do this only if not a blank channel */
if (chan_len != 1) {
membuf = (mem_buf_t *) (chanbuf+4);
chan->flags = membuf->chan_flag && 0x01 ? RIG_CHFLAG_SKIP : RIG_CHFLAG_NONE;
/* data mode on */
if (membuf->rx.data) chan->flags |= RIG_CHFLAG_DATA;
/*
* from_bcd requires nibble len
*/
chan->freq = from_bcd(membuf->rx.freq, freq_len*2);
icom2rig_mode(rig, membuf->rx.mode, membuf->rx.pb,
&chan->mode, &chan->width);
chan->rptr_shift = (rptr_shift_t) (membuf->rx.dup >> 8);
/* offset is default for the band & is not stored in channel memory.
The following retrieves the system default for the band */
band = (int) chan->freq / 1000000; /* hf, 2m or 6 m */
sc = S_MEM_PARM;
if (band < 50 ) data = S_MEM_HF_DUP_OFST;
else if (band < 108) data = S_MEM_6M_DUP_OFST;
else data = S_MEM_2M_DUP_OFST;
retval = icom_transaction (rig, C_CTL_MEM, sc,
&data, 1, databuf, &data_len);
if (retval != RIG_OK)
return retval;
chan->rptr_offs = from_bcd(databuf + 3, 6) * 100;
chan->ctcss_tone = from_bcd_be(membuf->rx.tone, 6);
chan->ctcss_sql = from_bcd_be(membuf->rx.tone_sql, 6);
chan->dcs_code = from_bcd_be(membuf->rx.dcs.code, 4);
/* The dcs information include in the channel includes polarity information
for both tx and recieve. Both directions are enabled when in dcs mode */
chan->tx_freq = from_bcd(membuf->tx.freq, freq_len*2);
icom2rig_mode(rig, membuf->tx.mode, membuf->tx.pb,
&chan->tx_mode, &chan->tx_width);
strncpy(chan->channel_desc, membuf->name, 9);
chan->channel_desc[9] = '\0'; /* add null terminator */
}
return RIG_OK;
}

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - description of IC-756 and variations
* Copyright (c) 2000-2004 by Stephane Fillod
*
* $Id: ic756.c,v 1.12 2004-09-26 08:35:03 fillods Exp $
* $Id: ic756.c,v 1.13 2006-07-18 22:51:42 n0nb 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
@ -47,7 +47,7 @@
#define IC756_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
#define IC756_AM_TX_MODES (RIG_MODE_AM)
#define IC756PRO_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RNF)
#define IC756PRO_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RF)
#define IC756PRO_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF|RIG_LEVEL_RAWSTR)

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - description of IC-7800 and variations
* Copyright (c) 2004 by Stephane Fillod
*
* $Id: ic7800.c,v 1.2 2004-09-26 08:35:03 fillods Exp $
* $Id: ic7800.c,v 1.3 2006-07-18 22:51:42 n0nb 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
@ -45,7 +45,7 @@
#define IC7800_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM)
#define IC7800_AM_TX_MODES (RIG_MODE_AM)
#define IC7800_FUNCS (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RNF|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK)
#define IC7800_FUNCS (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RF|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK)
#define IC7800_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_APF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC)

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - main file
* Copyright (c) 2000-2005 by Stephane Fillod
*
* $Id: icom.c,v 1.95 2006-01-09 21:45:06 fillods Exp $
* $Id: icom.c,v 1.96 2006-07-18 22:51:42 n0nb 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
@ -136,7 +136,7 @@ const struct ts_sc_list ic756_ts_sc_list[] = {
};
const struct ts_sc_list ic756pro_ts_sc_list[] = {
{ 10, 0x00 },
{ 10, 0x00 }, /* 1 if step turned off */
{ 100, 0x01 },
{ kHz(1), 0x02 },
{ kHz(5), 0x03 },
@ -178,6 +178,14 @@ const struct ts_sc_list ic910_ts_sc_list[] = {
{ 0, 0 },
};
const struct rtty_fltr_list rtty_fil[] = {
{ Hz(250), 0x00 },
{ Hz(300), 0x01 },
{ Hz(350), 0x02 },
{ Hz(500), 0x03 },
{ kHz(1), 0x04 },
};
struct icom_addr {
rig_model_t model;
unsigned char re_civ_addr;
@ -301,8 +309,6 @@ int icom_init(RIG *rig)
* + override with preferences
*/
priv->re_civ_addr = 0x00;
priv->re_civ_addr = priv_caps->re_civ_addr;
priv->civ_731_mode = priv_caps->civ_731_mode;
@ -417,14 +423,9 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
int icom_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char freqbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int freq_len, ack_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
freq_len = 2;
/*
@ -529,13 +530,9 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
*/
int icom_set_vfo(RIG *rig, vfo_t vfo)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char ackbuf[MAXFRAMELEN];
int ack_len, icvfo, retval;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
if (vfo == RIG_VFO_CURR)
return RIG_OK;
@ -1044,14 +1041,9 @@ int icom_get_conf(RIG *rig, token_t token, char *val)
*/
int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char ackbuf[MAXFRAMELEN], pttbuf[1];
int ack_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
pttbuf[0] = ptt == RIG_PTT_ON ? 1 : 0;
retval = icom_transaction (rig, C_CTL_PTT, S_PTT, pttbuf, 1,
@ -1074,30 +1066,25 @@ int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
*/
int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char pttbuf[MAXFRAMELEN];
int ptt_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
retval = icom_transaction (rig, C_CTL_PTT, S_PTT, NULL, 0,
pttbuf, &ptt_len);
if (retval != RIG_OK)
return retval;
/*
* freqbuf should contain Cn,Data area
* freqbuf should contain Cn,Sc,Data area
*/
ptt_len--;
ptt_len -= 2;
if (ptt_len != 1) {
rig_debug(RIG_DEBUG_ERR,"icom_get_ptt: wrong frame len=%d\n",
ptt_len);
return -RIG_ERJCTED;
}
*ptt = pttbuf[1] == 1 ? RIG_PTT_ON : RIG_PTT_OFF;
*ptt = pttbuf[2] == 1 ? RIG_PTT_ON : RIG_PTT_OFF;
return RIG_OK;
}
@ -1108,15 +1095,10 @@ int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
*/
int icom_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char dcdbuf[MAXFRAMELEN];
int dcd_len, retval;
int icom_val;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
retval = icom_transaction (rig, C_RD_SQSM, S_SQL, NULL, 0,
dcdbuf, &dcd_len);
if (retval != RIG_OK)
@ -1152,15 +1134,10 @@ int icom_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
*/
int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char ackbuf[MAXFRAMELEN];
int ack_len, retval;
int rptr_sc;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
switch (rptr_shift) {
case RIG_RPT_SHIFT_NONE:
rptr_sc = S_DUP_OFF; /* Simplex mode */
@ -1194,18 +1171,14 @@ int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
/*
* icom_get_rptr_shift
* Assumes rig!=NULL, rig->state.priv!=NULL, rptr_shift!=NULL
* NOTE: seems not to work (tested on IC-706MkIIG), please report --SF
* will not work for IC-746 Pro
* NOTE: seems not to work (tested on IC-706MkIIG), please report --SF
*/
int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char rptrbuf[MAXFRAMELEN];
int rptr_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
retval = icom_transaction (rig, C_CTL_SPLT, -1, NULL, 0,
rptrbuf, &rptr_len);
if (retval != RIG_OK)
@ -1245,14 +1218,9 @@ int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
*/
int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char offsbuf[MAXFRAMELEN],ackbuf[MAXFRAMELEN];
int ack_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
/*
* Icoms are using a 100Hz unit (at least on 706MKIIg) -- SF
*/
@ -1279,13 +1247,9 @@ int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
*/
int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char offsbuf[MAXFRAMELEN];
int offs_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
retval = icom_transaction (rig, C_RD_OFFS, -1, NULL, 0,
offsbuf, &offs_len);
@ -1489,14 +1453,10 @@ int icom_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_wid
*/
int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char ackbuf[MAXFRAMELEN];
int ack_len, retval;
int split_sc;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
switch (split) {
case RIG_SPLIT_OFF:
@ -1530,14 +1490,9 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
*/
int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char splitbuf[MAXFRAMELEN];
int split_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
retval = icom_transaction (rig, C_CTL_SPLT, -1, NULL, 0,
splitbuf, &split_len);
if (retval != RIG_OK)
@ -1637,7 +1592,7 @@ int icom_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
/*
* icom_get_ts
* Assumes rig!=NULL, rig->caps->priv!=NULL, ts!=NULL
* NOTE: seems not to work (tested on IC-706MkIIG), please report --SF
* NOTE: seems not to work (tested on IC-706MkIIG), please report --SF Not available on 746pro
*/
int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
{
@ -1699,7 +1654,7 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
fct_sc = S_FUNC_AGC;
/* note: should it be a LEVEL only, and no func? --SF */
if (status != 0)
fctbuf[0] = 0x01; /* default to 0x01 super-fast */
fctbuf[0] = 0x03; /* default to 0x03 in IC746 pro super-fast */
else
fctbuf[0] = 0x02;
break;
@ -1723,10 +1678,21 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_TSQL;
break;
case RIG_FUNC_SBKIN: /* FIXME ? */
case RIG_FUNC_SBKIN:
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_BKIN;
if (status != 0)
fctbuf[0] = 0x01;
else
fctbuf[0] = 0x00;
break;
case RIG_FUNC_FBKIN:
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_BKIN;
if (status != 0)
fctbuf[0] = 0x02;
else
fctbuf[0] = 0x00;
break;
case RIG_FUNC_ANF:
fct_cn = C_CTL_FUNC;
@ -1748,9 +1714,13 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_MN;
break;
case RIG_FUNC_RNF:
case RIG_FUNC_RF:
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_RNF;
fct_sc = S_FUNC_RF;
break;
case RIG_FUNC_VSC:
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_VSC;
break;
case RIG_FUNC_AFC: /* IC-910H */
fct_cn = C_CTL_FUNC;
@ -1764,7 +1734,7 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
fct_cn = C_CTL_MEM;
fct_sc = S_MEM_BANDSCOPE;
break;
case RIG_FUNC_RESUME: /* IC-910H */
case RIG_FUNC_RESUME: /* IC-910H & IC-746-Pro*/
fct_cn = C_CTL_SCAN;
fct_sc = status ? S_SCAN_RSMON : S_SCAN_RSMOFF;
fct_len = 0;
@ -1805,7 +1775,7 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
switch (func) {
case RIG_FUNC_FAGC:
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_AGC; /* default to 0x01 super-fast */
fct_sc = S_FUNC_AGC; /* default to 0x01=slow 0x03=super-fast */
break;
case RIG_FUNC_NB:
fct_cn = C_CTL_FUNC;
@ -1827,7 +1797,7 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_TSQL;
break;
case RIG_FUNC_SBKIN: /* FIXME ? */
case RIG_FUNC_SBKIN: /* returns 1 for semi and 2 for full adjusted below */
case RIG_FUNC_FBKIN:
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_BKIN;
@ -1852,11 +1822,15 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_MN;
break;
case RIG_FUNC_RNF:
case RIG_FUNC_RF:
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_RNF;
fct_sc = S_FUNC_RF;
break;
case RIG_FUNC_AFC: /* IC-910H */
case RIG_FUNC_VSC:
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_VSC;
break;
case RIG_FUNC_AFC: /* IC-910H */
fct_cn = C_CTL_FUNC;
fct_sc = S_FUNC_AFC;
break;
@ -1882,9 +1856,11 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
rig_debug(RIG_DEBUG_ERR,"icom_get_func: wrong frame len=%d\n",
ack_len);
return -RIG_EPROTO;
}
*status = ackbuf[2];
}
if (func != RIG_FUNC_FBKIN)
*status = ackbuf[2];
else
*status = ackbuf[2] == 2 ? 1 : 0;
return RIG_OK;
}
@ -1892,6 +1868,7 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
/*
* icom_set_parm
* Assumes rig!=NULL
These are very much rig specific and should probably be in rig files. These are for ICR75C only.
*/
int icom_set_parm(RIG *rig, setting_t parm, value_t val)
{
@ -2070,10 +2047,11 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val)
/*
* icom_set_ctcss_tone
* Assumes rig!=NULL, rig->state.priv!=NULL
* Assumes rig!=NULL, rig->state.priv!=NULL
*
* Warning! This is untested stuff! May work at least on 756PRO and IC746.
* Please owners report to me <f4cfe@users.sourceforge.net>, thanks. --SF
Works for 746 pro and should work for 756 xx and 7800
*/
int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
{
@ -2090,10 +2068,11 @@ int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
* Most probably, it might be the index of the CTCSS subaudible
* tone, and not the tone itself, starting from zero.
*
* Something in the range of 00..51, BCD big endian
* Something in the range of 00..51, BCD big endian 4 nibbles
* Please someone let me know if it works this way. --SF
* No. sent directly as be nibbles with frequency same format as internal kh
*/
for (i = 0; caps->ctcss_list[i] != 0 && i<200; i++) {
for (i = 0; caps->ctcss_list[i] != 0 && i<52; i++) {
if (caps->ctcss_list[i] == tone)
break;
}
@ -2101,7 +2080,7 @@ int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
return -RIG_EINVAL;
tone_len = 1;
to_bcd_be(tonebuf, (long long)i, tone_len*2);
to_bcd_be(tonebuf, tone, tone_len*2);
retval = icom_transaction(rig, C_SET_TONE, S_TONE_RPTR,
tonebuf, tone_len, ackbuf, &ack_len);
@ -2125,13 +2104,13 @@ int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
{
const struct rig_caps *caps;
unsigned char tonebuf[MAXFRAMELEN];
int tone_len, tone_idx, retval;
int tone_len, retval;
int i;
caps = rig->caps;
/*
* see icom_set_ctcss for discussion on the untested status!
* see icom_set_ctcss for discussion on the status!
*/
retval = icom_transaction(rig, C_SET_TONE, S_TONE_RPTR, NULL, 0,
@ -2139,26 +2118,25 @@ int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
if (retval != RIG_OK)
return retval;
if (tone_len != 3) {
/* cn,sc,data*3 */
if (tone_len != 5) {
rig_debug(RIG_DEBUG_ERR,"icom_get_ctcss_tone: ack NG (%#.2x), "
"len=%d\n", tonebuf[0], tone_len);
return -RIG_ERJCTED;
}
tone_len -= 2;
tone_idx = from_bcd_be(tonebuf, tone_len*2);
*tone = from_bcd_be(tonebuf+2, tone_len*2);
/* check this tone exists. That's better than nothing. */
for (i = 0; i<=tone_idx; i++) {
if (caps->ctcss_list[i] == 0) {
rig_debug(RIG_DEBUG_ERR,"icom_get_ctcss_tone: CTCSS NG "
"(%#.2x)\n", tonebuf[2]);
return -RIG_EPROTO;
}
for (i = 0; caps->ctcss_list[i] != 0 && i<52; i++) {
if (caps->ctcss_list[i] == *tone)
return RIG_OK;
}
*tone = caps->ctcss_list[tone_idx];
return RIG_OK;
rig_debug(RIG_DEBUG_ERR,"icom_get_ctcss_tone: CTCSS NG "
"(%#.2x)\n", tonebuf[2]);
return -RIG_EPROTO;
}
/*
@ -2168,7 +2146,7 @@ int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
* Warning! This is untested stuff! May work at least on 756PRO and IC746.
* Please owners report to me <f4cfe@users.sourceforge.net>, thanks. --SF
*/
int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int tone)
int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
{
const struct rig_caps *caps;
unsigned char tonebuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
@ -2181,7 +2159,7 @@ int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int tone)
* see icom_set_ctcss for discussion on the untested status!
*/
for (i = 0; caps->ctcss_list[i] != 0 && i<200; i++) {
for (i = 0; caps->ctcss_list[i] != 0 && i<52; i++) {
if (caps->ctcss_list[i] == tone)
break;
}
@ -2189,7 +2167,7 @@ int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int tone)
return -RIG_EINVAL;
tone_len = 1;
to_bcd_be(tonebuf, (long long)i, tone_len*2);
to_bcd_be(tonebuf, tone, tone_len*2);
retval = icom_transaction(rig, C_SET_TONE, S_TONE_SQL,
tonebuf, tone_len, ackbuf, &ack_len);
@ -2209,11 +2187,11 @@ int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int tone)
* icom_get_ctcss_sql
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_get_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int *tone)
int icom_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
{
const struct rig_caps *caps;
unsigned char tonebuf[MAXFRAMELEN];
int tone_len, tone_idx, retval;
int tone_len, retval;
int i;
caps = rig->caps;
@ -2227,26 +2205,24 @@ int icom_get_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int *tone)
if (retval != RIG_OK)
return retval;
if (tone_len != 3) {
if (tone_len != 5) {
rig_debug(RIG_DEBUG_ERR,"icom_get_ctcss_sql: ack NG (%#.2x), "
"len=%d\n", tonebuf[0], tone_len);
return -RIG_ERJCTED;
}
tone_len -= 2;
tone_idx = from_bcd_be(tonebuf, tone_len*2);
*tone = from_bcd_be(tonebuf+2, tone_len*2);
/* check this tone exists. That's better than nothing. */
for (i = 0; i<=tone_idx; i++) {
if (caps->ctcss_list[i] == 0) {
rig_debug(RIG_DEBUG_ERR,"icom_get_ctcss_sql: CTCSS NG "
"(%#.2x)\n", tonebuf[2]);
return -RIG_EPROTO;
}
for (i = 0; caps->ctcss_list[i] != 0 && i<52; i++) {
if (caps->ctcss_list[i] == *tone)
return RIG_OK;
}
*tone = caps->ctcss_list[tone_idx];
return RIG_OK;
rig_debug(RIG_DEBUG_ERR,"icom_get_ctcss_sql: CTCSS NG "
"(%#.2x)\n", tonebuf[2]);
return -RIG_EPROTO;
}
@ -2322,16 +2298,11 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status)
*/
int icom_set_mem(RIG *rig, vfo_t vfo, int ch)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char membuf[2];
unsigned char ackbuf[MAXFRAMELEN];
int ack_len, retval;
int chan_len;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
chan_len = ch < 100 ? 1 : 2;
to_bcd_be(membuf, ch, chan_len*2);
@ -2355,15 +2326,10 @@ int icom_set_mem(RIG *rig, vfo_t vfo, int ch)
*/
int icom_set_bank(RIG *rig, vfo_t vfo, int bank)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char bankbuf[2];
unsigned char ackbuf[MAXFRAMELEN];
int ack_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
to_bcd_be(bankbuf, bank, BANK_NB_LEN*2);
retval = icom_transaction (rig, C_SET_MEM, S_BANK,
bankbuf, CHAN_NB_LEN, ackbuf, &ack_len);
@ -2385,18 +2351,13 @@ int icom_set_bank(RIG *rig, vfo_t vfo, int bank)
*/
int icom_set_ant(RIG * rig, vfo_t vfo, ant_t ant)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char antarg;
unsigned char ackbuf[MAXFRAMELEN];
int ack_len, retval, i_ant;
int ant_len;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
/*
* FIXME: IC-756*, IC-746*
* FIXME: IC-756*
*/
i_ant = ant == RIG_ANT_1 ? 0: 1;
@ -2419,6 +2380,7 @@ int icom_set_ant(RIG * rig, vfo_t vfo, ant_t ant)
/*
* icom_get_ant
* Assumes rig!=NULL, rig->state.priv!=NULL
* only meaningfull for HF
*/
int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
{
@ -2430,23 +2392,12 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
if (retval != RIG_OK)
return retval;
if (rig->caps->rig_model == RIG_MODEL_ICR75) {
if (ack_len != 2 || ackbuf[0] != C_CTL_ANT) {
rig_debug(RIG_DEBUG_ERR,"icom_get_ant: ack NG (%#.2x), "
"len=%d\n", ackbuf[0],ack_len);
return -RIG_ERJCTED;
}
}
else
if (ack_len != 1 || ackbuf[0] != ACK) {
if (ack_len != 2 || ackbuf[0] != C_CTL_ANT) {
rig_debug(RIG_DEBUG_ERR,"icom_get_ant: ack NG (%#.2x), "
"len=%d\n", ackbuf[0],ack_len);
return -RIG_ERJCTED;
}
/*
* FIXME: IC-756*, IC-746*
*/
*ant = ackbuf[1] == 0 ? RIG_ANT_1 : RIG_ANT_2;
return RIG_OK;
@ -2459,16 +2410,11 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
*/
int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char mvbuf[MAXFRAMELEN];
unsigned char ackbuf[MAXFRAMELEN];
int mv_len, ack_len, retval;
int mv_cn, mv_sc;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
mv_len = 0;
switch(op) {

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - main header
* Copyright (c) 2000-2004 by Stephane Fillod
*
* $Id: icom.h,v 1.70 2004-09-26 08:35:03 fillods Exp $
* $Id: icom.h,v 1.71 2006-07-18 22:51:42 n0nb 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
@ -79,6 +79,14 @@ struct ts_sc_list {
unsigned char sc; /* sub command */
};
/*
* rtty filter passband width; available on pro rigs
*/
struct rtty_fltr_list {
shortfreq_t bw; /* filter width */
unsigned char sel;
};
/**
* \brief Pipelined tuning state data structure.
*/
@ -119,6 +127,8 @@ extern const struct ts_sc_list ic706_ts_sc_list[];
extern const struct ts_sc_list ic910_ts_sc_list[];
extern const struct ts_sc_list ic718_ts_sc_list[];
extern const struct rtty_fltr_list rtty_fil[];
int icom_init(RIG *rig);
int icom_cleanup(RIG *rig);
int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq);

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - defines for the ICOM "CI-V" interface.
* Copyright (c) 2000-2004 by Stephane Fillod
*
* $Id: icom_defs.h,v 1.17 2004-09-07 21:54:20 fillods Exp $
* $Id: icom_defs.h,v 1.18 2006-07-18 22:51:42 n0nb 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
@ -27,7 +27,7 @@
* CI-V frame codes
*/
#define PR 0xfe /* Preamble code */
#define CTRLID 0xe0 /* Controllers's default address */
#define CTRLID 0xe0 /* Controllers's default address */
#define BCASTID 0x00 /* Broadcast address */
#define FI 0xfd /* End of message code */
#define ACK 0xfb /* OK code */
@ -49,15 +49,23 @@
/*
* Cn controller commands
*
Most radios have 2 or 3 recieve passbands available. Where only 2 are available they
are selected by 01 for wide and 02 for narrow Actual bandwidth is determined by the filters
installed. With the newer DSP rigs there are 3 presets 01 = wide 02 = middle and 03 = narrow.
Acutally you can set change any of these presets to any thing you want.
* Notes:
* 1. When wide or normal op available: add "00" for wide, "01" normal
* The following only applies to IC-706.
* 1. When wide or normal op available: add "00" for wide, "01" normal
* Normal or narrow op: add "00" for normal, "01" for narrow
* Wide, normal or narrow op: add "00" for wide, "01" normal, "02" narrow
* 2. Memory channel number 1A=0100/1b=0101, 2A=0102/2b=0103,
* 3A=0104/3b=0105, C1=0106, C2=0107
*/
#define C_SND_FREQ 0x00 /* Send frequency data */
#define C_SND_MODE 0x01 /* Send mode data, Sc */
#define C_SND_FREQ 0x00 /* Send frequency data trancieve mode does not ack*/
#define C_SND_MODE 0x01 /* Send mode data, Sc for trancieve mode does not ack */
#define C_RD_BAND 0x02 /* Read band edge frequencies */
#define C_RD_FREQ 0x03 /* Read display frequency */
#define C_RD_MODE 0x04 /* Read display mode */
@ -68,13 +76,13 @@
#define C_WR_MEM 0x09 /* Write memory */
#define C_MEM2VFO 0x0a /* Memory to VFO */
#define C_CLR_MEM 0x0b /* Memory clear */
#define C_RD_OFFS 0x0c /* Read duplex offset frequency */
#define C_RD_OFFS 0x0c /* Read duplex offset frequency; default changes with HF/6M/2M */
#define C_SET_OFFS 0x0d /* Set duplex offset frequency */
#define C_CTL_SCAN 0x0e /* Control scan, Sc */
#define C_CTL_SPLT 0x0f /* Control split, Sc */
#define C_CTL_SPLT 0x0f /* Control split, and duplex mode Sc */
#define C_SET_TS 0x10 /* Set tuning step, Sc */
#define C_CTL_ATT 0x11 /* Set attenuator, Sc */
#define C_CTL_ANT 0x12 /* Set antenna, Sc */
#define C_CTL_ATT 0x11 /* Set/get attenuator, Sc */
#define C_CTL_ANT 0x12 /* Set/get antenna, Sc */
#define C_CTL_ANN 0x13 /* Control announce (speech synth.), Sc */
#define C_CTL_LVL 0x14 /* Set AF/RF/squelch, Sc */
#define C_RD_SQSM 0x15 /* Read squelch condiction/S-meter level, Sc */
@ -133,19 +141,19 @@
/*
* Scan control (C_CTL_SCAN) subcommands
*/
#define S_SCAN_STOP 0x00 /* Stop scan/window scan */
#define S_SCAN_STOP 0x00 /* Stop scan/window scan */
#define S_SCAN_START 0x01 /* Programmed/Memory scan */
#define S_SCAN_PROG 0x02 /* Programmed scan */
#define S_SCAN_PROG 0x02 /* Programmed scan */
#define S_SCAN_DELTA 0x03 /* Delta-f scan */
#define S_SCAN_WRITE 0x04 /* auto memory-write scan */
#define S_SCAN_FPROG 0x12 /* Fine programmed scan */
#define S_SCAN_FDELTA 0x13 /* Fine delta-f scan */
#define S_SCAN_MEM2 0x22 /* Memory scan */
#define S_SCAN_MEM2 0x22 /* Memory scan */
#define S_SCAN_SLCTN 0x23 /* Selected number memory scan */
#define S_SCAN_SLCTM 0x24 /* Selected mode memory scan */
#define S_SCAN_PRIO 0x42 /* Priority / window scan */
#define S_SCAN_PRIO 0x42 /* Priority / window scan */
#define S_SCAN_NSLCT 0xB0 /* Set as non select channel */
#define S_SCAN_SLCT 0xB1 /* Set as select channel */
#define S_SCAN_SLCT 0xB1 /* Set as select channel */
#define S_SCAN_RSMOFF 0xD0 /* Set scan resume OFF */
#define S_SCAN_RSMON 0xD3 /* Set scan resume ON */
@ -162,7 +170,7 @@
/*
* Set Attenuator (C_CTL_ATT) subcommands
*/
#define S_ATT_RD 0x00 /* Without subcommand, reads out setting */
#define S_ATT_RD -1 /* Without subcommand, reads out setting */
#define S_ATT_OFF 0x00 /* Off */
#define S_ATT_6dB 0x06 /* 6 dB, IC-756Pro */
#define S_ATT_10dB 0x10 /* 10 dB */
@ -181,7 +189,7 @@
/*
* Set antenna (C_SET_ANT) subcommands
*/
#define S_ANT_RD 0x00 /* Without subcommand, reads out setting */
#define S_ANT_RD -1 /* Without subcommand, reads out setting */
#define S_ANT1 0x00 /* Antenna 1 */
#define S_ANT2 0x01 /* Antenna 2 */
@ -202,24 +210,27 @@
#define S_LVL_APF 0x05 /* APF level setting */
#define S_LVL_NR 0x06 /* NR level setting */
#define S_LVL_PBTIN 0x07 /* Twin PBT setting (inside) */
#define S_LVL_PBTOUT 0x08 /* Twin PBT setting (outside) */
#define S_LVL_CWPITCH 0x09 /* CW pitch setting */
#define S_LVL_RFPOWER 0x0a /* RF power setting */
#define S_LVL_MICGAIN 0x0b /* MIC gain setting */
#define S_LVL_KEYSPD 0x0c /* Key Speed setting */
#define S_LVL_NOTCHF 0x0d /* Notch freq. setting */
#define S_LVL_PBTOUT 0x08 /* Twin PBT setting (outside) */
#define S_LVL_CWPITCH 0x09 /* CW pitch setting */
#define S_LVL_RFPOWER 0x0a /* RF power setting */
#define S_LVL_MICGAIN 0x0b /* MIC gain setting */
#define S_LVL_KEYSPD 0x0c /* Key Speed setting */
#define S_LVL_NOTCHF 0x0d /* Notch freq. setting */
#define S_LVL_COMP 0x0e /* Compressor level setting */
#define S_LVL_BKINDL 0x0f /* BKin delay setting */
#define S_LVL_BALANCE 0x10 /* Balance setting (Dual watch) */
#define S_LVL_BKINDL 0x0f /* BKin delay setting */
#define S_LVL_BALANCE 0x10 /* Balance setting (Dual watch) */
/*
* Read squelch condition/S-meter level (C_RD_SQSM) subcommands
* Read squelch condition/S-meter level/other meter levels (C_RD_SQSM) subcommands
*/
#define S_SQL 0x01 /* Read squelch condition */
#define S_SML 0x02 /* Read S-meter level */
#define S_RFML 0x11 /* Read RF-meter level */
#define S_SWR 0x12 /* Read SWR-meter level */
#define S_ALC 0x13 /* Read ALC-meter level */
/*
* Function settings (C_CTL_FUNC) subcommands
* Function settings (C_CTL_FUNC) subcommands Set and Read
*/
#define S_FUNC_PAMP 0x02 /* Preamp setting */
#define S_FUNC_AGCOFF 0x10 /* IC-R8500 only */
@ -240,13 +251,10 @@
#define S_FUNC_VOX 0x46 /* VOX setting */
#define S_FUNC_BKIN 0x47 /* BK-IN setting */
#define S_FUNC_MN 0x48 /* Manual notch setting */
#define S_FUNC_RNF 0x49 /* RTTY Filter Notch setting */
#define S_FUNC_AFC 0x4A /* Auto Frequency Control (AFC) setting */
/*
* Transceiver ID (C_RD_TRXID) subcommands
*/
#define S_TRXID 0x00 /* Read transceiver ID code */
#define S_FUNC_RF 0x49 /* RTTY Filter setting */
#define S_FUNC_AFC 0x4A /* Auto Frequency Control (AFC) setting */
#define S_FUNC_DTCS 0x4B /*DTCS tone code squelch setting*/
#define S_FUNC_VSC 0x4C /* voice squelch control useful for scanning*/
/*
* Set Power On/Off (C_SET_PWR) subcommands
@ -257,14 +265,23 @@
/*
* Transmit control (C_CTL_PTT) subcommands
*/
#define S_PTT 0x00
#define S_PTT 0x00
#define S_ANT_TUN 0x01 /* Auto tuner 0=OFF, 1 = ON, 2=Start Tuning */
/*
* Memory contents (C_CTL_MEM) subcommands
* Misc contents (C_CTL_MEM) subcommands
*/
#define S_MEM_CNTNT 0x00
#define S_MEM_CNTNT 0x00 /* Memory content 2 bigendian */
#define S_MEM_BAND_REG 0x01 /* band stacking register */
#define S_MEM_FILT_WDTH 0x03 /* current passband filter width */
#define S_MEM_PARM 0x05 /* rig parameters; extended parm # + param value */
#define S_MEM_DATA_MODE 0x06 /* data mode */
#define S_MEM_TX_PB 0x07 /* SSB tx passband */
#define S_MEM_FLTR_SHAPE 0x08 /* filter shape 0=sharp 1=soft */
/* Icr75c */
#define S_MEM_CNTNT_SLCT 0x01
#define S_MEM_FILT_SLCT 0x01
#define S_MEM_FLT_SLCT 0x01
#define S_MEM_MODE_SLCT 0x02
/* For IC-910H rig. */
#define S_MEM_RDWR_MEM 0x00 /* Read/write memory channel */
@ -277,14 +294,37 @@
#define S_MEM_SATMODE 0x07 /* Satellite mode (on/off) */
#define S_MEM_BANDSCOPE 0x08 /* Simple bandscope (on/off) */
/*IC-746Pro Rig parameters Sc=S_MEM_PARM */
#define S_MEM_LCD_CONT 0x01 /* LCD Contrast 0-256/0-100% */
#define S_MEM_BKLIT 0x02 /* Backlight 0-256/0-100% */
#define S_MEM_BEEP 0x06 /* Button confirmation */
/* values -9.999 MHz to + 9.999 Mhz */
#define S_MEM_SPLT_OFST 0x12 /* default split offset 4 bytes little endian last byte sign*/
/* values 0.000 MHz to + 9.999 Mhz */
#define S_MEM_HF_DUP_OFST 0x14 /* default HF band duplex offset 3 byte little endian */
#define S_MEM_6M_DUP_OFST 0x15 /* default 50 mHz duplex offset 3 byte little endian */
#define S_MEM_2M_DUP_OFST 0x16 /* default 144 MHz duplex offset 3 byte little endian */
#define S_MEM_LANG 0x23 /* 0=English 1=Japanese */
#define S_MEM_RTTY_FLTR_PB 0x62 /* 0=250 Hz, 1=300' 2 = 350, 3 = 500, 4 = 1 KHz */
#define S_MEM_RTTY_TWNPEAK 0x63 /* rtty twin peak filter off/on */
#define S_MEM_SCN_SPD 0x70 /* 0 = low; 1 = high */
#define S_MEM_NB_LVL 0x72 /* NB level 0-255 */
#define S_MEM_VOX_GN_LVL 0x73
#define S_MEM_AVOX_GN_LVL 0x74 /* anti-vox gain */
#define S_MEM_VOX_DEL_LVL 0x75 /* vox delay 0=0 - 20=2.0 sec */
/*
* Tone control (C_SET_TONE) subcommands
*/
#define S_TONE_RPTR 0x00 /* Tone frequency setting for repeater user */
#define S_TONE_RPTR 0x00 /* Tone frequency setting for repeater receive */
#define S_TONE_SQL 0x01 /* Tone frequency setting for squelch */
#define S_TONE_DTCS 0x02 /* DTCS code and polarity for squelch */
/*
* C_RD_TRXID
* Transceiver ID (C_RD_TRXID) subcommands
*/
#define S_RD_TRXID 0x00

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Interface - API header
* Copyright (c) 2000-2005 by Stephane Fillod and Frank Singleton
*
* $Id: rig.h,v 1.111 2006-03-18 07:41:13 y32kn Exp $
* $Id: rig.h,v 1.112 2006-07-18 22:51:42 n0nb 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
@ -627,7 +627,7 @@ enum rig_parm_e {
#define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST)
#define RIG_PARM_SET(l) ((l)&~RIG_PARM_READONLY_LIST)
#define RIG_SETTING_MAX 32
#define RIG_SETTING_MAX 64
/**
* \brief Setting
*
@ -664,7 +664,7 @@ enum rig_func_e {
RIG_FUNC_APF = (1<<11),/*!< Auto Passband Filter */
RIG_FUNC_MON = (1<<12),/*!< Monitor transmitted signal */
RIG_FUNC_MN = (1<<13),/*!< Manual Notch */
RIG_FUNC_RNF = (1<<14),/*!< RTTY Filter Notch */
RIG_FUNC_RF = (1<<14),/*!< RTTY Filter */
RIG_FUNC_ARO = (1<<15),/*!< Auto Repeater Offset */
RIG_FUNC_LOCK = (1<<16),/*!< Lock */
RIG_FUNC_MUTE = (1<<17),/*!< Mute */
@ -818,6 +818,8 @@ struct filter_list {
*/
#define RIG_CHFLAG_NONE 0
#define RIG_CHFLAG_SKIP (1<<0)
/* DATA port mode flag */
#define RIG_CHFLAG_DATA (1<<1)
/**
* \brief Extension attribute definition

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Interface - toolbox
* Copyright (c) 2000-2005 by Stephane Fillod
*
* $Id: misc.c,v 1.38 2005-04-09 09:49:12 fillods Exp $
* $Id: misc.c,v 1.39 2006-07-18 22:51:43 n0nb 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
@ -314,7 +314,7 @@ static struct {
{ RIG_FUNC_AIP, "AIP" },
{ RIG_FUNC_MON, "MON" },
{ RIG_FUNC_MN, "MN" },
{ RIG_FUNC_RNF, "RNF" },
{ RIG_FUNC_RF, "RF" },
{ RIG_FUNC_ARO, "ARO" },
{ RIG_FUNC_LOCK, "LOCK" },
{ RIG_FUNC_MUTE, "MUTE" },

Wyświetl plik

@ -3,7 +3,7 @@
* This programs dumps the mmeory contents of a rig.
*
*
* $Id: dumpmem.c,v 1.8 2002-07-10 21:34:53 fillods Exp $
* $Id: dumpmem.c,v 1.9 2006-07-18 22:51:43 n0nb Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -184,7 +184,7 @@ int dump_chan(RIG *rig, int chan_num)
if (chan.funcs&RIG_FUNC_APF) printf("APF ");
if (chan.funcs&RIG_FUNC_MON) printf("MON ");
if (chan.funcs&RIG_FUNC_MN) printf("MN ");
if (chan.funcs&RIG_FUNC_RNF) printf("RNF ");
if (chan.funcs&RIG_FUNC_RF) printf("RF ");
printf("\n");
} else
printf("none\n");

Wyświetl plik

@ -5,7 +5,7 @@
* It takes commands in interactive mode as well as
* from command line options.
*
* $Id: rigctl.c,v 1.58 2005-04-20 13:29:43 fillods Exp $
* $Id: rigctl.c,v 1.59 2006-07-18 22:51:43 n0nb Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -1788,7 +1788,7 @@ declare_proto_rig(send_cmd)
{
int retval;
struct rig_state *rs;
int backend_num;
int backend_num, cmd_len;
#define BUFSZ 128
char bufcmd[BUFSZ];
char buf[BUFSZ];
@ -1806,10 +1806,13 @@ declare_proto_rig(send_cmd)
pp = p+1;
bufcmd[i] = strtol(p+1, &p, 0);
}
bufcmd[i] = '\0';
cmd_len = i-1;
/* must save length to allow 0x00 to be sent as part of a command
*/
} else {
strncpy(bufcmd,arg1,BUFSZ);
bufcmd[BUFSZ-1] = '\0';
cmd_len = strlen(bufcmd);
/*
* assumes CR is end of line char
* for all ascii protocols
@ -1821,7 +1824,7 @@ declare_proto_rig(send_cmd)
serial_flush(&rs->rigport);
retval = write_block(&rs->rigport, bufcmd, strlen(bufcmd));
retval = write_block(&rs->rigport, bufcmd, cmd_len);
if (retval != RIG_OK)
return retval;