pull/224/head
Michael Black 2020-03-15 15:33:06 -05:00
commit e297470901
9 zmienionych plików z 71 dodań i 49 usunięć

Wyświetl plik

@ -1020,10 +1020,12 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
priv = (struct icom_priv_data *) rs->priv; priv = (struct icom_priv_data *) rs->priv;
#if 0 // disabled to test if IC9700 satmode/gpredict still works OK #if 0 // disabled to test if IC9700 satmode/gpredict still works OK
if (priv->curr_vfo == RIG_VFO_NONE) if (priv->curr_vfo == RIG_VFO_NONE)
{ {
icom_set_default_vfo(rig); icom_set_default_vfo(rig);
} }
#endif #endif
cmd = C_RD_FREQ; cmd = C_RD_FREQ;

Wyświetl plik

@ -637,7 +637,9 @@ int kenwood_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
err = kenwood_get_id(rig, id); err = kenwood_get_id(rig, id);
if (err == -RIG_ETIMEOUT) {
if (err == -RIG_ETIMEOUT)
{
// Ensure rig is on // Ensure rig is on
rig_set_powerstat(rig, 1); rig_set_powerstat(rig, 1);
} }

Wyświetl plik

@ -200,11 +200,13 @@ int HAMLIB_API rig_register(const struct rig_caps *caps)
} }
hval = HASH_FUNC(caps->rig_model); hval = HASH_FUNC(caps->rig_model);
if (rig_hash_table[hval]) if (rig_hash_table[hval])
{ {
printf("Hash collision!!! Fatal error!!\n"); printf("Hash collision!!! Fatal error!!\n");
exit(1); exit(1);
} }
p->caps = caps; p->caps = caps;
// p->handle = NULL; // p->handle = NULL;
p->next = rig_hash_table[hval]; p->next = rig_hash_table[hval];

Wyświetl plik

@ -45,6 +45,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <ctype.h>
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h> # include <sys/ioctl.h>
@ -199,6 +200,7 @@ int HAMLIB_API serial_open(hamlib_port_t *rp)
rig_debug(RIG_DEBUG_TRACE, "%s: OPEN before\n", __func__); rig_debug(RIG_DEBUG_TRACE, "%s: OPEN before\n", __func__);
fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY | O_NDELAY); fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
rig_debug(RIG_DEBUG_TRACE, "%s: OPEN after\n", __func__); rig_debug(RIG_DEBUG_TRACE, "%s: OPEN after\n", __func__);
if (fd == -1) if (fd == -1)
{ {
/* Could not open the port. */ /* Could not open the port. */
@ -519,6 +521,7 @@ rig_debug(RIG_DEBUG_TRACE,"%s: cfsetospeed\n", __func__);
#if defined(HAVE_TERMIOS_H) #if defined(HAVE_TERMIOS_H)
rig_debug(RIG_DEBUG_TRACE, "%s: tcsetattr TCSANOW\n", __func__); rig_debug(RIG_DEBUG_TRACE, "%s: tcsetattr TCSANOW\n", __func__);
if (tcsetattr(fd, TCSANOW, &options) == -1) if (tcsetattr(fd, TCSANOW, &options) == -1)
{ {
rig_debug(RIG_DEBUG_ERR, rig_debug(RIG_DEBUG_ERR,
@ -533,6 +536,7 @@ rig_debug(RIG_DEBUG_TRACE,"%s: tcsetattr TCSANOW\n", __func__);
#elif defined(HAVE_TERMIO_H) #elif defined(HAVE_TERMIO_H)
rig_debug(RIG_DEBUG_TRACE, "%s: IOCTL TCSETA\n", __func__); rig_debug(RIG_DEBUG_TRACE, "%s: IOCTL TCSETA\n", __func__);
if (IOCTL(fd, TCSETA, &options) == -1) if (IOCTL(fd, TCSETA, &options) == -1)
{ {
rig_debug(RIG_DEBUG_ERR, rig_debug(RIG_DEBUG_ERR,
@ -547,6 +551,7 @@ rig_debug(RIG_DEBUG_TRACE,"%s: IOCTL TCSETA\n", __func__);
#else #else
rig_debug(RIG_DEBUG_TRACE, "%s: IOCTL TIOCSETP\n", __func__); rig_debug(RIG_DEBUG_TRACE, "%s: IOCTL TIOCSETP\n", __func__);
/* sgtty */ /* sgtty */
if (IOCTL(fd, TIOCSETP, &sg) == -1) if (IOCTL(fd, TIOCSETP, &sg) == -1)
{ {
@ -585,11 +590,11 @@ rig_debug(RIG_DEBUG_TRACE,"%s: IOCTL TIOCSETP\n", __func__);
*/ */
int HAMLIB_API serial_flush(hamlib_port_t *p) int HAMLIB_API serial_flush(hamlib_port_t *p)
{ {
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s MDB called\n", __func__);
if (p->fd == uh_ptt_fd || p->fd == uh_radio_fd) // if (p->fd == uh_ptt_fd || p->fd == uh_radio_fd)
{ // {
char buf[32]; unsigned char buf[32];
/* /*
* Catch microHam case: * Catch microHam case:
* if fd corresponds to a microHam device drain the line * if fd corresponds to a microHam device drain the line
@ -597,14 +602,21 @@ int HAMLIB_API serial_flush(hamlib_port_t *p)
*/ */
int n; int n;
rig_debug(RIG_DEBUG_TRACE, "%s: flushing: ", __func__);
while ((n = read(p->fd, buf, 32)) > 0) while ((n = read(p->fd, buf, 32)) > 0)
{ {
rig_debug(RIG_DEBUG_VERBOSE, "%s: flushed %d bytes\n", __func__, n); int i;
for (i = 0; i < n; ++i) { printf("0x%02x(%c) ", buf[i], isprint(buf[i]) ? buf[i] : '~'); }
/* do nothing */ /* do nothing */
} }
printf("DONE\n");
return RIG_OK; return RIG_OK;
} // }
rig_debug(RIG_DEBUG_VERBOSE, "%s: tcflush\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s: tcflush\n", __func__);
tcflush(p->fd, TCIFLUSH); tcflush(p->fd, TCIFLUSH);

Wyświetl plik

@ -416,7 +416,8 @@ int main(int argc, char *argv[])
rig_set_debug(verbose); rig_set_debug(verbose);
rig_debug(RIG_DEBUG_VERBOSE, "rigctl, %s %s\n", hamlib_version, __DATE__ " " __TIME__); rig_debug(RIG_DEBUG_VERBOSE, "rigctl, %s %s\n", hamlib_version,
__DATE__ " " __TIME__);
rig_debug(RIG_DEBUG_VERBOSE, "%s", rig_debug(RIG_DEBUG_VERBOSE, "%s",
"Report bugs to <hamlib-developer@lists.sourceforge.net>\n\n"); "Report bugs to <hamlib-developer@lists.sourceforge.net>\n\n");

Wyświetl plik

@ -640,6 +640,7 @@ int main(int argc, char *argv[])
my_rig->caps->rig_model, my_rig->caps->rig_model,
my_rig->caps->model_name); my_rig->caps->model_name);
} }
#endif #endif
#ifdef __MINGW32__ #ifdef __MINGW32__
@ -980,6 +981,7 @@ void *handle_socket(void *arg)
sync_callback(1); sync_callback(1);
#if 0 #if 0
if (!client_count++) if (!client_count++)
{ {
retcode = rig_open(my_rig); retcode = rig_open(my_rig);
@ -991,6 +993,7 @@ void *handle_socket(void *arg)
my_rig->caps->model_name); my_rig->caps->model_name);
} }
} }
#endif #endif
sync_callback(0); sync_callback(0);