diff --git a/NEWS b/NEWS index fd41a5320..1cd13356e 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * Added --set-conf=filter_usb, filter_usbd, and filter_cw to allow Icom rigs set mode to set filter number too * Added macros for applications to obtain pointers to Hamlib structures(issues #1445, #1420, #487). Internal conversion is still a WIP, but use of these macros will make the final cutover transparent to applications. * Added Guohe Q900 entry diff --git a/bindings/perltest.pl b/bindings/perltest.pl index 509560ad6..6e2ec0ee1 100755 --- a/bindings/perltest.pl +++ b/bindings/perltest.pl @@ -4,7 +4,7 @@ use Hamlib; print "Perl $] test, version: $Hamlib::hamlib_version\n\n"; -#Hamlib::rig_set_debug($Hamlib::RIG_DEBUG_TRACE); +Hamlib::rig_set_debug($Hamlib::RIG_DEBUG_TRACE); Hamlib::rig_set_debug($Hamlib::RIG_DEBUG_NONE); $rig = new Hamlib::Rig($Hamlib::RIG_MODEL_DUMMY); @@ -99,3 +99,16 @@ printf("Longitude:\t%9.4f, %4d° %2d' %2d\" %1s\trecoded: %9.4f\n", printf("Latitude:\t%9.4f, %4d° %2d' %2d\" %1s\trecoded: %9.4f\n", $lat1, $deg2, $min2, $sec2, $sw2 ? 'S' : 'N', $lat3); +$reply_len = 20; +$cmd => "FA;"; +$term => ";"; +$cmd_uc => pack("C*", unpack("C*", $cmd)); +$term_uc => pack("C*", unpack("C*", $term)); +$reply_len = 64; +$reply = "\0" x $reply_len; +$reply_uc => pack("C*", unpack("C*", $reply)); +printf("reply, len=%d, start=%s\n", length($reply), $reply); +$bytes = $rig->send_raw($cmd, length($cmd), $reply, $reply_len, $term_uc); +#$newstring = unpack("A*", $reply_uc); +#printf("send_raw bytes=%d newstring=%s\n", $bytes, $newstring); +printf("send_raw bytes=%d reply=%s\n", $bytes, $reply); diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 9536beb35..3ec65890e 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -49,6 +49,11 @@ int ic9700_get_clock(RIG *rig, int *year, int *month, int *day, int ic9700_set_vfo(RIG *rig, vfo_t vfo); +int ic9700_set_freq(RIG *rig, vfo_t vfo, freq_t freq); +int ic9700_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +int ic9700_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); +int ic9700_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); + #define IC7300_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM) #define IC7300_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM) @@ -1243,10 +1248,10 @@ struct rig_caps ic9700_caps = .rig_open = icom_rig_open, .rig_close = icom_rig_close, - .set_freq = icom_set_freq, - .get_freq = icom_get_freq, - .set_mode = icom_set_mode, - .get_mode = icom_get_mode, + .set_freq = ic9700_set_freq, + .get_freq = ic9700_get_freq, + .set_mode = ic9700_set_mode, + .get_mode = ic9700_get_mode, // IC-9700 can indicate Main/Sub band selection, but not VFO A/B, so leave get_vfo not implemented // .get_vfo = icom_get_vfo, .set_vfo = ic9700_set_vfo, @@ -1780,8 +1785,7 @@ struct rig_caps ic905_caps = .set_conf = icom_set_conf, .get_conf = icom_get_conf, - .priv = (void *)& IC905_priv_caps, - .rig_init = icom_init, + .priv = (void *)& IC905_priv_caps, .rig_init = icom_init, .rig_cleanup = icom_cleanup, .rig_open = icom_rig_open, .rig_close = icom_rig_close, @@ -2226,7 +2230,7 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo) if (rig->state.cache.satmode && !vfo_is_main_or_sub) { // Translate VFO A/B to Main/Sub in satellite mode - if (vfo == RIG_VFO_A) + if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN_A) { vfo = RIG_VFO_MAIN; } @@ -2322,3 +2326,28 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo) RETURNFUNC(retval); } + +int ic9700_set_freq(RIG *rig, vfo_t vfo, freq_t freq) +{ + int retval = -RIG_EINTERNAL; + ENTERFUNC; + return retval; +} +int ic9700_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +{ + int retval = -RIG_EINTERNAL; + ENTERFUNC; + return retval; +} +int ic9700_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) +{ + int retval = -RIG_EINTERNAL; + ENTERFUNC; + return retval; +} +int ic9700_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) +{ + int retval = -RIG_EINTERNAL; + ENTERFUNC; + return retval; +} diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 16753eaa0..118a8600f 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 +check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simic910 simxiegux6100 simelecraft_SOURCES = simelecraft.c simkenwood_SOURCES = simkenwood.c diff --git a/src/rig.c b/src/rig.c index a88fd6be9..9e3a417d8 100644 --- a/src/rig.c +++ b/src/rig.c @@ -8647,7 +8647,9 @@ HAMLIB_EXPORT(int) rig_send_raw(RIG *rig, const unsigned char *send, { rig_debug(RIG_DEBUG_VERBOSE, "%s: simulating response for model %s\n", __func__, rig->caps->model_name); + memcpy(reply, send, send_len); retval = send_len; + return retval; } else {