kopia lustrzana https://github.com/Hamlib/Hamlib
Adjust retry & timeout values to help in case of no response from rig, i.e.,
if rig power happens to be off. Prettify some code indents. git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2250 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.7
rodzic
b2def3a225
commit
ef94c9c21e
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib TenTenc backend - TT-565 description
|
* Hamlib TenTenc backend - TT-565 description
|
||||||
* Copyright (c) 2004-2007 by Stephane Fillod & Martin Ewing
|
* Copyright (c) 2004-2007 by Stephane Fillod & Martin Ewing
|
||||||
*
|
*
|
||||||
* $Id: orion.c,v 1.22 2007-11-15 04:10:31 aa6e Exp $
|
* $Id: orion.c,v 1.23 2007-11-23 04:54:12 aa6e Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -128,12 +128,12 @@ int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *d
|
||||||
if (!data || !data_len)
|
if (!data || !data_len)
|
||||||
return 0; /* normal exit if no read */
|
return 0; /* normal exit if no read */
|
||||||
#ifdef TT565_TIME
|
#ifdef TT565_TIME
|
||||||
ft1 = tt565_timenow();
|
ft1 = tt565_timenow();
|
||||||
#endif
|
#endif
|
||||||
*data_len = data_len_init; /* restore orig. buffer length */
|
*data_len = data_len_init; /* restore orig. buffer length */
|
||||||
*data_len = read_string(&rs->rigport, data, *data_len,
|
*data_len = read_string(&rs->rigport, data, *data_len,
|
||||||
EOM, strlen(EOM));
|
EOM, strlen(EOM));
|
||||||
if (*data_len > 0) return RIG_OK; /* normal exit if reading */
|
if (*data_len > 0) return RIG_OK; /* normal exit if reading */
|
||||||
#ifdef TT565_TIME
|
#ifdef TT565_TIME
|
||||||
ft2 = tt565_timenow();
|
ft2 = tt565_timenow();
|
||||||
if (*data_len == -RIG_ETIMEOUT)
|
if (*data_len == -RIG_ETIMEOUT)
|
||||||
|
@ -141,8 +141,8 @@ int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *d
|
||||||
itry, ft2-ft1);
|
itry, ft2-ft1);
|
||||||
else
|
else
|
||||||
rig_debug(RIG_DEBUG_ERR,
|
rig_debug(RIG_DEBUG_ERR,
|
||||||
"Other Error #%d, itry=%d: Elapsed = %f secs.\n",
|
"Other Error #%d, itry=%d: Elapsed = %f secs.\n",
|
||||||
*data_len, itry, ft2-ft1);
|
*data_len, itry, ft2-ft1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return -RIG_ETIMEOUT;
|
return -RIG_ETIMEOUT;
|
||||||
|
@ -839,14 +839,14 @@ const char *tt565_get_info(RIG *rig)
|
||||||
if (retval != RIG_OK || firmware_len < 8) {
|
if (retval != RIG_OK || firmware_len < 8) {
|
||||||
rig_debug(RIG_DEBUG_ERR,"%s: ack NG, len=%d\n",
|
rig_debug(RIG_DEBUG_ERR,"%s: ack NG, len=%d\n",
|
||||||
__FUNCTION__, firmware_len);
|
__FUNCTION__, firmware_len);
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
buf[firmware_len] = '\0';
|
buf[firmware_len] = '\0';
|
||||||
|
|
||||||
/* filter out any non-graphic characters */
|
/* filter out any non-graphic characters */
|
||||||
for (i=0; i < strlen(buf); i++)
|
for (i=0; i < strlen(buf); i++)
|
||||||
if (!isgraph(buf[i])) buf[i] = ' '; // bad chars -> spaces
|
if (!isgraph(buf[i])) buf[i] = ' '; // bad chars -> spaces
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,8 +205,8 @@ const struct rig_caps tt565_caps = {
|
||||||
.serial_handshake = RIG_HANDSHAKE_HARDWARE,
|
.serial_handshake = RIG_HANDSHAKE_HARDWARE,
|
||||||
.write_delay = 0,
|
.write_delay = 0,
|
||||||
.post_write_delay = 10, /* Needed for CW send + ?? */
|
.post_write_delay = 10, /* Needed for CW send + ?? */
|
||||||
.timeout = 400,
|
.timeout = 200, /* was 400 */
|
||||||
.retry = 3,
|
.retry = 2, /* was 3 */
|
||||||
|
|
||||||
.has_get_func = TT565_FUNCS,
|
.has_get_func = TT565_FUNCS,
|
||||||
.has_set_func = TT565_FUNCS,
|
.has_set_func = TT565_FUNCS,
|
||||||
|
|
Ładowanie…
Reference in New Issue