Skip to content

Commit

Permalink
Fix set_powerstat on/off/on for Icom rigs using rigctld power_on=0
Browse files Browse the repository at this point in the history
  • Loading branch information
mdblack98 committed Jan 10, 2023
1 parent 00dce99 commit dc131cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Version 4.6
Version 4.5.5
* Really fix CM108 ptt_bitnum usage
* Fix Elecraft power2mW precision/accuracy
* Fix power on/off/on for Icom rigs with rigctld power_on=0

Version 4.5.4
* 2023-XX-XX
Expand Down
11 changes: 6 additions & 5 deletions rigs/icom/icom.c
Original file line number Diff line number Diff line change
Expand Up @@ -7977,11 +7977,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
memset(fe_buf, 0xfe, fe_max);
// sending more than enough 0xfe's to wake up the rs232
write_block(&rs->rigport, fe_buf, fe_max);
// close and re-open the rig
// on linux the USB gets reset during power on
rig_close(rig);
sleep(1); // let serial bus idle for a while
rig_open(rig);

// we'll try 0x18 0x01 now -- should work on STBY rigs too
pwr_sc = S_PWR_ON;
Expand Down Expand Up @@ -8043,6 +8038,12 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
{
rig_debug(RIG_DEBUG_TRACE, "%s: Wait failed for get_powerstat\n",
__func__);
// close and re-open the rig
// on linux the USB gets reset during power on
rig_close(rig);
sleep(1);
rig_open(rig);

retval = -RIG_ETIMEOUT;
}

Expand Down
2 changes: 1 addition & 1 deletion rigs/icom/icom.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <sys/time.h>
#endif

#define BACKEND_VER "20230109"
#define BACKEND_VER "20230110"

#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
Expand Down

0 comments on commit dc131cb

Please sign in to comment.