kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/mdblack98/Hamlib
commit
343835c94c
|
@ -409,14 +409,15 @@ static int read_transaction(RIG *rig, char *xml, int xml_len)
|
||||||
char tmp_buf[MAXXMLLEN]; // plenty big for expected flrig responses hopefully
|
char tmp_buf[MAXXMLLEN]; // plenty big for expected flrig responses hopefully
|
||||||
int len = read_string(&rs->rigport, tmp_buf, sizeof(tmp_buf), delims,
|
int len = read_string(&rs->rigport, tmp_buf, sizeof(tmp_buf), delims,
|
||||||
strlen(delims));
|
strlen(delims));
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: string='%s'", __func__, tmp_buf);
|
rig_debug(RIG_DEBUG_TRACE, "%s: string='%s'\n", __func__, tmp_buf);
|
||||||
|
|
||||||
if (len > 0) { retry = 3; }
|
if (len > 0) { retry = 3; }
|
||||||
|
|
||||||
if (len <= 0)
|
if (len <= 0)
|
||||||
{
|
{
|
||||||
rig_debug(RIG_DEBUG_ERR, "%s: read_string error=%d\n", __func__, len);
|
rig_debug(RIG_DEBUG_ERR, "%s: read_string error=%d\n", __func__, len);
|
||||||
return -(100 + RIG_EPROTO);
|
//return -(100 + RIG_EPROTO);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(xml) + strlen(tmp_buf) < xml_len - 1)
|
if (strlen(xml) + strlen(tmp_buf) < xml_len - 1)
|
||||||
|
@ -436,6 +437,7 @@ static int read_transaction(RIG *rig, char *xml, int xml_len)
|
||||||
if (retry == 0)
|
if (retry == 0)
|
||||||
{
|
{
|
||||||
rig_debug(RIG_DEBUG_WARN, "%s: retry timeout\n", __func__);
|
rig_debug(RIG_DEBUG_WARN, "%s: retry timeout\n", __func__);
|
||||||
|
return -RIG_ETIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strstr(xml, terminator))
|
if (strstr(xml, terminator))
|
||||||
|
@ -1464,7 +1466,9 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
read_transaction(rig, xml, sizeof(xml));
|
retval = read_transaction(rig, xml, sizeof(xml));
|
||||||
|
if (retval < 0) {
|
||||||
|
}
|
||||||
xml_parse(xml, value, sizeof(value));
|
xml_parse(xml, value, sizeof(value));
|
||||||
retval = modeMapGetHamlib(value);
|
retval = modeMapGetHamlib(value);
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BACKEND_VER "20200319"
|
#define BACKEND_VER "20200421"
|
||||||
|
|
||||||
#define EOM "\r"
|
#define EOM "\r"
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
|
|
|
@ -1023,14 +1023,20 @@ void *handle_socket(void *arg)
|
||||||
sync_callback,
|
sync_callback,
|
||||||
1, 0, handle_data_arg->vfo_mode, send_cmd_term, &ext_resp, &resp_sep);
|
1, 0, handle_data_arg->vfo_mode, send_cmd_term, &ext_resp, &resp_sep);
|
||||||
|
|
||||||
|
if (retcode != 0) rig_debug(RIG_DEBUG_ERR, "%s: rigctl_parse retcode=%d\n", __func__, retcode);
|
||||||
|
|
||||||
if (ferror(fsockin) || ferror(fsockout))
|
if (ferror(fsockin) || ferror(fsockout))
|
||||||
{
|
{
|
||||||
|
rig_debug(RIG_DEBUG_ERR,"%s: %d, %d\n", __func__, ferror(fsockin), ferror(fsockout));
|
||||||
retcode = 1;
|
retcode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retcode == 1)
|
if (retcode == 1)
|
||||||
{
|
{
|
||||||
|
retcode = rig_close(my_rig);
|
||||||
|
rig_debug(RIG_DEBUG_ERR,"%s: rig_close retcode=%d\n", __func__, retcode);
|
||||||
retcode = rig_open(my_rig);
|
retcode = rig_open(my_rig);
|
||||||
|
rig_debug(RIG_DEBUG_ERR,"%s: rig_open retcode=%d\n", __func__, retcode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (retcode == 0 || retcode == 2 || retcode == -RIG_ENAVAIL);
|
while (retcode == 0 || retcode == 2 || retcode == -RIG_ENAVAIL);
|
||||||
|
|
Ładowanie…
Reference in New Issue