* pbwidth_t is now the passband type in Hz, RIG_PASSBAND_NARROW and RIG_PASSBAND_WIDE are dead now. Backend maintenairs, please adapt your code\!

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@449 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.1
Stéphane Fillod, F8CFE 2001-04-22 13:57:39 +00:00
rodzic f84c0b9a58
commit cca6e2acab
6 zmienionych plików z 77 dodań i 18 usunięć

Wyświetl plik

@ -6,7 +6,7 @@
* via serial interface to an AOR scanner.
*
*
* $Id: aor.c,v 1.5 2001-03-02 18:29:31 f4cfe Exp $
* $Id: aor.c,v 1.6 2001-04-22 13:57:39 f4cfe Exp $
*
*
*
@ -168,8 +168,12 @@ int aor_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_AM:
switch(width) {
case RIG_PASSBAND_NORMAL: aormode = MD_AM; break;
#ifdef RIG_PASSBAND_OLDTIME
case RIG_PASSBAND_WIDE: aormode = MD_WAM; break;
case RIG_PASSBAND_NARROW: aormode = MD_NAM; break;
#else
/* TODO */
#endif
default:
rig_debug(RIG_DEBUG_ERR,
"aor_set_mode: unsupported passband %d %d\n",
@ -183,8 +187,12 @@ int aor_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_FM:
switch(width) {
case RIG_PASSBAND_NORMAL: aormode = MD_NFM; break;
#ifdef RIG_PASSBAND_OLDTIME
case RIG_PASSBAND_WIDE: aormode = MD_WFM; break;
case RIG_PASSBAND_NARROW: aormode = MD_SFM; break;
#else
/* TODO */
#endif
default:
rig_debug(RIG_DEBUG_ERR,
"aor_set_mode: unsupported passband %d %d\n",
@ -192,6 +200,7 @@ int aor_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
return -RIG_EINVAL;
}
break;
case RIG_MODE_WFM: aormode = MD_WFM; break;
case RIG_MODE_RTTY:
default:
rig_debug(RIG_DEBUG_ERR,"aor_set_mode: unsupported mode %d\n",
@ -234,11 +243,19 @@ int aor_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
case MD_AM: *mode = RIG_MODE_AM; break;
case MD_NAM:
*mode = RIG_MODE_AM;
#ifdef RIG_PASSBAND_OLDTIME
*width = RIG_PASSBAND_NARROW;
#else
/* FIXME! */
#endif
break;
case MD_WAM:
*mode = RIG_MODE_AM;
#ifdef RIG_PASSBAND_OLDTIME
*width = RIG_PASSBAND_WIDE;
#else
/* FIXME! */
#endif
break;
case MD_CW: *mode = RIG_MODE_CW; break;
case MD_USB: *mode = RIG_MODE_USB; break;
@ -246,10 +263,13 @@ int aor_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
case MD_NFM: *mode = RIG_MODE_FM; break;
case MD_SFM:
*mode = RIG_MODE_FM;
#ifdef RIG_PASSBAND_OLDTIME
*width = RIG_PASSBAND_NARROW;
#else
/* FIXME! */
#endif
break;
case MD_WFM: *mode = RIG_MODE_FM;
*width = RIG_PASSBAND_WIDE;
case MD_WFM: *mode = RIG_MODE_WFM;
break;
default:
rig_debug(RIG_DEBUG_ERR,"aor_get_mode: unsupported mode %d\n",

Wyświetl plik

@ -6,7 +6,7 @@
* CI-V interface, used in serial communication to ICOM radios.
*
*
* $Id: frame.c,v 1.8 2001-02-27 23:05:51 f4cfe Exp $
* $Id: frame.c,v 1.9 2001-04-22 13:57:39 f4cfe Exp $
*
*
*
@ -210,9 +210,16 @@ unsigned short hamlib2icom_mode(rmode_t mode, pbwidth_t width)
case RIG_MODE_LSB: icmode = S_LSB; break;
case RIG_MODE_RTTY: icmode = S_RTTY; break;
case RIG_MODE_FM:
#ifdef RIG_PASSBAND_OLDTIME
icmode = width==RIG_PASSBAND_WIDE?S_WFM:S_FM;
icmode_ext = width==RIG_PASSBAND_NARROW?0x02:0x00;
#else
icmode = S_FM;
/* FIXME: */
icmode_ext = width!=RIG_PASSBAND_NORMAL?0x00:0x02;
#endif
break;
case RIG_MODE_WFM: icmode = S_WFM; break;
default:
rig_debug(RIG_DEBUG_ERR,"icom: Unsupported Hamlib mode %d\n",mode);
icmode = 0xff;
@ -229,8 +236,7 @@ void icom2hamlib_mode(unsigned short icmode, rmode_t *mode, pbwidth_t *width)
case S_CW: *mode = RIG_MODE_CW; break;
case S_FM: *mode = RIG_MODE_FM; break;
case S_WFM:
*mode = RIG_MODE_FM;
*width = RIG_PASSBAND_WIDE;
*mode = RIG_MODE_WFM;
break;
case S_USB: *mode = RIG_MODE_USB; break;
case S_LSB: *mode = RIG_MODE_LSB; break;

Wyświetl plik

@ -6,7 +6,7 @@
* via serial interface to an Icom PCR-1xxx radio.
*
*
* $Id: pcr.c,v 1.1 2001-03-02 18:26:18 f4cfe Exp $
* $Id: pcr.c,v 1.2 2001-04-22 13:57:39 f4cfe Exp $
*
*
*
@ -227,15 +227,20 @@ int pcr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_USB: pcrmode = MD_USB; pcrfilter = FLT_2_8kHz; break;
case RIG_MODE_LSB: pcrmode = MD_LSB; pcrfilter = FLT_2_8kHz; break;
case RIG_MODE_AM: pcrmode = MD_AM; pcrfilter = FLT_15kHz; break;
case RIG_MODE_WFM: pcrmode = MD_WFM; pcrfilter = FLT_230kHz; break;
case RIG_MODE_FM:
pcrmode = MD_FM;
switch (width) {
case RIG_PASSBAND_NORMAL: pcrfilter = FLT_6kHz; break;
case RIG_PASSBAND_NARROW: pcrfilter = FLT_15kHz; break;
case RIG_PASSBAND_NORMAL: pcrfilter = FLT_15kHz; break;
#ifdef RIG_PASSBAND_OLDTIME
case RIG_PASSBAND_NARROW: pcrfilter = FLT_6kHz; break;
case RIG_PASSBAND_WIDE:
pcrmode = MD_WFM;
pcrfilter = FLT_50kHz;
break;
#else
/* TODO */
#endif
default:
rig_debug(RIG_DEBUG_ERR,"pcr_set_mode: unsupported "
"width %d\n", width);
@ -282,17 +287,27 @@ int pcr_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
case MD_LSB: *mode = RIG_MODE_LSB; break;
case MD_AM: *mode = RIG_MODE_AM; break;
case MD_WFM:
*mode = RIG_MODE_FM;
*width = RIG_PASSBAND_WIDE;
*mode = RIG_MODE_WFM;
break;
case MD_FM:
*mode = RIG_MODE_FM;
switch(priv->last_filter) {
#ifdef RIG_PASSBAND_OLDTIME
case FLT_2_8kHz:
case FLT_6kHz: *width = RIG_PASSBAND_NARROW; break;
#else
case FLT_2_8kHz: *width = kHz(2.8); break;
case FLT_6kHz: *width = kHz(6); break;
#endif
/* TODO: return Hz(0) or 15kHz? */
case FLT_15kHz: *width = RIG_PASSBAND_NORMAL; break;
#ifdef RIG_PASSBAND_OLDTIME
case FLT_50kHz:
case FLT_230kHz: *width = RIG_PASSBAND_WIDE; break;
#else
case FLT_50kHz: *width = kHz(50); break;
case FLT_230kHz: *width = kHz(230); break;
#endif
default:
rig_debug(RIG_DEBUG_ERR,"pcr_get_mode: unsupported "
"width %d\n", priv->last_filter);

Wyświetl plik

@ -8,7 +8,7 @@
* /dev/winradio API.
*
*
* $Id: winradio.c,v 1.6 2001-03-02 18:37:17 f4cfe Exp $
* $Id: winradio.c,v 1.7 2001-04-22 13:57:39 f4cfe Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -74,11 +74,18 @@ int wr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) {
case RIG_MODE_CW: m = RMD_CW; break;
case RIG_MODE_LSB: m = RMD_LSB; break;
case RIG_MODE_USB: m = RMD_USB; break;
case RIG_MODE_WFM: m = RMD_FMW; break;
case RIG_MODE_FM:
switch ( width ) {
#ifdef RIG_PASSBAND_OLDTIME
case RIG_PASSBAND_NARROW: m = RMD_FM6; break;
#else
/* TODO */
#endif
case RIG_PASSBAND_NORMAL: m = RMD_FMN; break;
#ifdef RIG_PASSBAND_OLDTIME
case RIG_PASSBAND_WIDE: m = RMD_FMW; break;
#endif
default: return -RIG_EINVAL;
}
default: return -RIG_EINVAL;
@ -93,12 +100,15 @@ int wr_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) {
switch ( m ) {
case RMD_CW: *mode = RIG_MODE_CW; *width = RIG_PASSBAND_NORMAL; break;
case RMD_AM: *mode = RIG_MODE_AM; *width = RIG_PASSBAND_NORMAL; break;
#ifdef RIG_PASSBAND_OLDTIME
case RMD_FMN: *mode = RIG_MODE_FM; *width = RIG_PASSBAND_NARROW; break;
case RMD_FMW: *mode = RIG_MODE_FM; *width = RIG_PASSBAND_WIDE; break;
case RMD_FM6: *mode = RIG_MODE_FM; *width = RIG_PASSBAND_NARROW; break;
#else
/* TODO */
#endif
case RMD_FMW: *mode = RIG_MODE_WFM; *width = RIG_PASSBAND_NORMAL; break;
case RMD_LSB: *mode = RIG_MODE_LSB; *width = RIG_PASSBAND_NORMAL; break;
case RMD_USB: *mode = RIG_MODE_USB; *width = RIG_PASSBAND_NORMAL; break;
case RMD_FMM: *mode = RIG_MODE_FM; *width = RIG_PASSBAND_NARROW; break;
case RMD_FM6: *mode = RIG_MODE_FM; *width = RIG_PASSBAND_NARROW; break;
default: return -RIG_EINVAL;
}
return RIG_OK;

Wyświetl plik

@ -7,7 +7,7 @@
* box (FIF-232C) or similar
*
*
* $Id: ft747.c,v 1.9 2001-03-02 18:35:18 f4cfe Exp $
* $Id: ft747.c,v 1.10 2001-04-22 13:57:39 f4cfe Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -444,6 +444,7 @@ int ft747_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
case RIG_PASSBAND_NORMAL: /* easy case , no change to native sequence */
break;
#ifdef RIG_PASSBAND_OLDTIME
case RIG_PASSBAND_WIDE:
return -RIG_EINVAL; /* sorry, WIDE WIDTH is not supported */
@ -462,11 +463,14 @@ int ft747_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
return -RIG_EINVAL; /* sorry, wrong MODE/WIDTH combo */
}
break;
#else
/* TODO! */
#endif
default:
return -RIG_EINVAL; /* sorry, wrong WIDTH requested */
}
/*
* phew! now send cmd to rig
*/

Wyświetl plik

@ -6,7 +6,7 @@
* via serial interface to an FT-847 using the "CAT" interface.
*
*
* $Id: ft847.c,v 1.9 2001-03-02 18:35:18 f4cfe Exp $
* $Id: ft847.c,v 1.10 2001-04-22 13:57:39 f4cfe Exp $
*
*
*
@ -520,6 +520,7 @@ int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) {
ft847_send_priv_cmd(rig,cmd_index); /* TODO -- check return codes */
return RIG_OK; /* I am out of here .. */
#ifdef RIG_PASSBAND_OLDTIME
case RIG_PASSBAND_WIDE:
return -RIG_EINVAL; /* sorry, WIDE WIDTH is not supported */
@ -538,6 +539,9 @@ int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) {
return -RIG_EINVAL; /* sorry, wrong MODE/WIDTH combo */
}
break;
#else
/* TODO ! */
#endif
default:
return -RIG_EINVAL; /* sorry, wrong WIDTH requested */