kopia lustrzana https://github.com/Hamlib/Hamlib
astyle rig.c
rodzic
ca6692c022
commit
d2f7957e8b
22
src/rig.c
22
src/rig.c
|
@ -1103,9 +1103,11 @@ int HAMLIB_API rig_close(RIG *rig)
|
|||
multicast_server_run = 0;
|
||||
extern pthread_t multicast_server_threadId;
|
||||
int err = pthread_join(multicast_server_threadId, NULL);
|
||||
|
||||
if (err)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): pthread_join error %s\n", __FILE__, __LINE__, strerror(errno));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): pthread_join error %s\n", __FILE__, __LINE__,
|
||||
strerror(errno));
|
||||
// just ignore it
|
||||
}
|
||||
|
||||
|
@ -1444,6 +1446,7 @@ static int set_cache_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
ENTERFUNC;
|
||||
cache_show(rig, __func__, __LINE__);
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s: vfo=%s, current_vfo=%s\n", __func__,
|
||||
rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo));
|
||||
|
||||
|
@ -1539,6 +1542,7 @@ static int set_cache_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
cache_show(rig, __func__, __LINE__);
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -1549,6 +1553,7 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq,
|
|||
{
|
||||
ENTERFUNC;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s: vfo=%s, current_vfo=%s\n", __func__,
|
||||
rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo));
|
||||
|
||||
|
@ -1657,10 +1662,12 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq,
|
|||
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s: vfo=%s, freq=%.0f\n", __func__, rig_strvfo(vfo),
|
||||
(double)*freq);
|
||||
|
||||
if (rig_need_debug(RIG_DEBUG_CACHE))
|
||||
{
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -6374,9 +6381,11 @@ int HAMLIB_API rig_get_rig_info(RIG *rig, char *response, int max_response_len)
|
|||
|
||||
if (strlen(response) >= max_response_len - 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): response len exceeded max %d chars\n", __FILE__, __LINE__, max_response_len);
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): response len exceeded max %d chars\n",
|
||||
__FILE__, __LINE__, max_response_len);
|
||||
RETURNFUNC(RIG_EINTERNAL);
|
||||
}
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
@ -6525,7 +6534,8 @@ int HAMLIB_API rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie,
|
|||
// this should also prevent problems with DLLs & shared libraies
|
||||
// the debug_msg is another non-thread-safe which this will help fix
|
||||
// 27 char cookie will last until the year 10000
|
||||
static char cookie_save[HAMLIB_COOKIE_SIZE]; // only one client can have the 26-char cookie
|
||||
static char
|
||||
cookie_save[HAMLIB_COOKIE_SIZE]; // only one client can have the 26-char cookie
|
||||
static double time_last_used;
|
||||
double time_curr;
|
||||
struct timespec tp;
|
||||
|
@ -6547,7 +6557,8 @@ int HAMLIB_API rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie,
|
|||
return -RIG_EINVAL; // nothing to do
|
||||
}
|
||||
|
||||
if (cookie_save[0] != 0 && strcmp(cookie, cookie_save) == 0) // matching cookie so we'll clear it
|
||||
if (cookie_save[0] != 0
|
||||
&& strcmp(cookie, cookie_save) == 0) // matching cookie so we'll clear it
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %s coookie released\n",
|
||||
__FILE__, __LINE__, cookie_save);
|
||||
|
@ -6568,7 +6579,8 @@ int HAMLIB_API rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie,
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %s comparing renew request to %s==%d\n",
|
||||
__FILE__, __LINE__, cookie, cookie_save, strcmp(cookie, cookie_save));
|
||||
|
||||
if (cookie_save[0] != 0 && strcmp(cookie, cookie_save) == 0) // matching cookie so we'll renew it
|
||||
if (cookie_save[0] != 0
|
||||
&& strcmp(cookie, cookie_save) == 0) // matching cookie so we'll renew it
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d) %s renew request granted\n", __FILE__,
|
||||
__LINE__, cookie);
|
||||
|
|
Ładowanie…
Reference in New Issue