mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-21 10:27:18 +00:00
Update astyle for 4.5 release
This commit is contained in:
parent
9ffd0a4ba5
commit
67b933ddb5
@ -1854,7 +1854,7 @@ int filtericom[] = { 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 600, 700,
|
||||
pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode)
|
||||
{
|
||||
|
||||
int retval, res_len=0, rfstatus;
|
||||
int retval, res_len = 0, rfstatus;
|
||||
unsigned char resbuf[MAXFRAMELEN];
|
||||
value_t rfwidth;
|
||||
unsigned char fw_sub_cmd = RIG_MODEL_IC7200 == rig->caps->rig_model ? 0x02 :
|
||||
@ -8851,11 +8851,14 @@ int icom_process_async_frame(RIG *rig, size_t frame_length,
|
||||
// TODO: rig_set_cache_timeout_ms(rig, HAMLIB_CACHE_FREQ, HAMLIB_CACHE_ALWAYS);
|
||||
freq_t freq = (freq_t) from_bcd(frame + 5, (priv->civ_731_mode ? 4 : 5) * 2);
|
||||
rig_fire_freq_event(rig, RIG_VFO_CURR, freq);
|
||||
|
||||
if (rs->use_cached_freq != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): use_cached_freq turning on\n", __func__, __LINE__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): use_cached_freq turning on\n", __func__,
|
||||
__LINE__);
|
||||
rs->use_cached_freq = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -8864,11 +8867,14 @@ int icom_process_async_frame(RIG *rig, size_t frame_length,
|
||||
// TODO: rig_set_cache_timeout_ms(rig, HAMLIB_CACHE_MODE, HAMLIB_CACHE_ALWAYS);
|
||||
icom2rig_mode(rig, frame[5], frame[6], &mode, &width);
|
||||
rig_fire_mode_event(rig, RIG_VFO_CURR, mode, width);
|
||||
|
||||
if (rs->use_cached_mode != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): use_cached_mode turning on\n", __func__, __LINE__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): use_cached_mode turning on\n", __func__,
|
||||
__LINE__);
|
||||
rs->use_cached_mode = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case C_CTL_SCP:
|
||||
|
@ -754,11 +754,12 @@ int kenwood_init(RIG *rig)
|
||||
priv->curr_mode = 0;
|
||||
priv->micgain_min = -1;
|
||||
priv->micgain_max = -1;
|
||||
priv->has_ps = 1; // until proven otherwise
|
||||
priv->has_ps = 1; // until proven otherwise
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS450S
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS50
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS140S
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS440)
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS50
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS140S
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS440)
|
||||
{
|
||||
priv->has_ps = 0;
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "FA", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"FA%f", &freqA);
|
||||
sscanf(buf, "FA%f", &freqA);
|
||||
}
|
||||
else if (strcmp(buf, "FB;") == 0)
|
||||
{
|
||||
@ -222,11 +222,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "FB", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"FB%f", &freqB);
|
||||
sscanf(buf, "FB%f", &freqB);
|
||||
}
|
||||
else if (strcmp(buf, "VS;") == 0)
|
||||
{
|
||||
SNPRINTF(buf, sizeof(buf), "VS%c;", vfo == 0? '0':'1');
|
||||
SNPRINTF(buf, sizeof(buf), "VS%c;", vfo == 0 ? '0' : '1');
|
||||
n = write(fd, buf, strlen(buf));
|
||||
}
|
||||
else if (strcmp(buf, "FT;") == 0)
|
||||
@ -246,7 +246,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "VS", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"VS%d", &vs);
|
||||
sscanf(buf, "VS%d", &vs);
|
||||
}
|
||||
else if (strcmp(buf, "TX;") == 0)
|
||||
{
|
||||
@ -255,7 +255,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "TX", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"TX%d", &tx);
|
||||
sscanf(buf, "TX%d", &tx);
|
||||
}
|
||||
else if (strcmp(buf, "AI;") == 0)
|
||||
{
|
||||
@ -264,7 +264,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "AI", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"AI%d", &ai);
|
||||
sscanf(buf, "AI%d", &ai);
|
||||
}
|
||||
else if (strcmp(buf, "SH0;") == 0)
|
||||
{
|
||||
@ -273,7 +273,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "SH0", 3) == 0)
|
||||
{
|
||||
sscanf(buf,"SH0%d", &sh);
|
||||
sscanf(buf, "SH0%d", &sh);
|
||||
}
|
||||
else if (strcmp(buf, "NA0;") == 0)
|
||||
{
|
||||
@ -282,7 +282,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "NA0", 3) == 0)
|
||||
{
|
||||
sscanf(buf,"NA0%d", &na);
|
||||
sscanf(buf, "NA0%d", &na);
|
||||
}
|
||||
else if (strcmp(buf, "EX039;") == 0)
|
||||
{
|
||||
@ -291,7 +291,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "EX039", 3) == 0)
|
||||
{
|
||||
sscanf(buf,"EX039%d", &ex039);
|
||||
sscanf(buf, "EX039%d", &ex039);
|
||||
}
|
||||
else if (strlen(buf) > 0)
|
||||
{
|
||||
|
@ -214,7 +214,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "FA", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"FA%f", &freqA);
|
||||
sscanf(buf, "FA%f", &freqA);
|
||||
}
|
||||
else if (strcmp(buf, "FB;") == 0)
|
||||
{
|
||||
@ -223,11 +223,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "FB", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"FB%f", &freqB);
|
||||
sscanf(buf, "FB%f", &freqB);
|
||||
}
|
||||
else if (strcmp(buf, "VS;") == 0)
|
||||
{
|
||||
SNPRINTF(buf, sizeof(buf), "VS%c;", vfo == 0? '0':'1');
|
||||
SNPRINTF(buf, sizeof(buf), "VS%c;", vfo == 0 ? '0' : '1');
|
||||
n = write(fd, buf, strlen(buf));
|
||||
}
|
||||
else if (strcmp(buf, "FT;") == 0)
|
||||
@ -238,10 +238,11 @@ int main(int argc, char *argv[])
|
||||
else if (strncmp(buf, "FT", 2) == 0)
|
||||
{
|
||||
int tmp;
|
||||
sscanf(buf,"FT%d", &tmp);
|
||||
if (tmp == 2) ft=0;
|
||||
else if (tmp == 3) ft=1;
|
||||
else printf("%s expected FT2; or FT3;\n", buf);
|
||||
sscanf(buf, "FT%d", &tmp);
|
||||
|
||||
if (tmp == 2) { ft = 0; }
|
||||
else if (tmp == 3) { ft = 1; }
|
||||
else { printf("%s expected FT2; or FT3;\n", buf); }
|
||||
}
|
||||
else if (strcmp(buf, "MD0;") == 0)
|
||||
{
|
||||
@ -250,7 +251,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "MD0", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"MD0%d", &md0);
|
||||
sscanf(buf, "MD0%d", &md0);
|
||||
}
|
||||
else if (strcmp(buf, "MD1;") == 0)
|
||||
{
|
||||
@ -259,7 +260,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "MD1", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"MD1%d", &md1);
|
||||
sscanf(buf, "MD1%d", &md1);
|
||||
}
|
||||
else if (strcmp(buf, "VS;") == 0)
|
||||
{
|
||||
@ -268,7 +269,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "VS", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"VS%d", &vs);
|
||||
sscanf(buf, "VS%d", &vs);
|
||||
}
|
||||
else if (strcmp(buf, "TX;") == 0)
|
||||
{
|
||||
@ -277,7 +278,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "TX", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"TX%d", &tx);
|
||||
sscanf(buf, "TX%d", &tx);
|
||||
}
|
||||
else if (strcmp(buf, "AI;") == 0)
|
||||
{
|
||||
@ -286,7 +287,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "AI", 2) == 0)
|
||||
{
|
||||
sscanf(buf,"AI%d", &ai);
|
||||
sscanf(buf, "AI%d", &ai);
|
||||
}
|
||||
else if (strcmp(buf, "SH0;") == 0)
|
||||
{
|
||||
@ -295,7 +296,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "SH0", 3) == 0)
|
||||
{
|
||||
sscanf(buf,"SH0%d", &sh);
|
||||
sscanf(buf, "SH0%d", &sh);
|
||||
}
|
||||
else if (strcmp(buf, "NA0;") == 0)
|
||||
{
|
||||
@ -304,7 +305,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "NA0", 3) == 0)
|
||||
{
|
||||
sscanf(buf,"NA0%d", &na);
|
||||
sscanf(buf, "NA0%d", &na);
|
||||
}
|
||||
else if (strcmp(buf, "EX039;") == 0)
|
||||
{
|
||||
@ -313,7 +314,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strncmp(buf, "EX039", 3) == 0)
|
||||
{
|
||||
sscanf(buf,"EX039%d", &ex039);
|
||||
sscanf(buf, "EX039%d", &ex039);
|
||||
}
|
||||
else if (strlen(buf) > 0)
|
||||
{
|
||||
|
17
src/cache.c
17
src/cache.c
@ -99,7 +99,8 @@ int rig_set_cache_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_WARN, "%s(%d): unknown vfo=%s\n", __func__, __LINE__, rig_strvfo(vfo));
|
||||
rig_debug(RIG_DEBUG_WARN, "%s(%d): unknown vfo=%s\n", __func__, __LINE__,
|
||||
rig_strvfo(vfo));
|
||||
RETURNFUNC(-RIG_EINTERNAL);
|
||||
}
|
||||
|
||||
@ -116,7 +117,8 @@ int rig_set_cache_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
rig_cache_show(rig, __func__, __LINE__);
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s(%d): vfo=%s, current_vfo=%s\n", __func__, __LINE__,
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s(%d): vfo=%s, current_vfo=%s\n", __func__,
|
||||
__LINE__,
|
||||
rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo));
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
@ -135,7 +137,8 @@ int rig_set_cache_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
|
||||
if (rig_need_debug(RIG_DEBUG_CACHE))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s(%d): set vfo=%s to freq=%.0f\n", __func__, __LINE__,
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s(%d): set vfo=%s to freq=%.0f\n", __func__,
|
||||
__LINE__,
|
||||
rig_strvfo(vfo), freq);
|
||||
}
|
||||
|
||||
@ -251,7 +254,8 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq,
|
||||
ENTERFUNC2;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s(%d): vfo=%s, current_vfo=%s\n", __func__, __LINE__,
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s(%d): vfo=%s, current_vfo=%s\n", __func__,
|
||||
__LINE__,
|
||||
rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo));
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
@ -295,7 +299,8 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq,
|
||||
break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): unknown vfo=%s\n", __func__, __LINE__, rig_strvfo(vfo));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): unknown vfo=%s\n", __func__, __LINE__,
|
||||
rig_strvfo(vfo));
|
||||
}
|
||||
}
|
||||
|
||||
@ -425,7 +430,7 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq,
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s(%d): vfo=%s, freq=%.0f, mode=%s, width=%d\n",
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s(%d): vfo=%s, freq=%.0f, mode=%s, width=%d\n",
|
||||
__func__, __LINE__, rig_strvfo(vfo),
|
||||
(double)*freq, rig_strrmode(*mode), (int)*width);
|
||||
|
||||
|
22
src/rig.c
22
src/rig.c
@ -891,7 +891,9 @@ int HAMLIB_API rig_open(RIG *rig)
|
||||
free(cwd);
|
||||
|
||||
// Enable async data only if it's enabled through conf settings *and* supported by the backend
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: async_data_enable=%d, async_data_supported=%d\n", __func__, rs->async_data_enabled, caps->async_data_supported);
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: async_data_enable=%d, async_data_supported=%d\n", __func__,
|
||||
rs->async_data_enabled, caps->async_data_supported);
|
||||
rs->async_data_enabled = rs->async_data_enabled && caps->async_data_supported;
|
||||
rs->rigport.asyncio = rs->async_data_enabled;
|
||||
|
||||
@ -1340,7 +1342,8 @@ int HAMLIB_API rig_open(RIG *rig)
|
||||
rmode_t mode;
|
||||
pbwidth_t width;
|
||||
rig_get_mode(rig, RIG_VFO_A, &mode, &width);
|
||||
if (split)
|
||||
|
||||
if (split)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split);
|
||||
HAMLIB_TRACE;
|
||||
@ -2021,7 +2024,8 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
|| (rig->state.cache.timeout_ms == HAMLIB_CACHE_ALWAYS
|
||||
|| rig->state.use_cached_freq)))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: %s cache hit age=%dms, freq=%.0f, use_cached_freq=%d\n", __func__,
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: %s cache hit age=%dms, freq=%.0f, use_cached_freq=%d\n", __func__,
|
||||
rig_strvfo(vfo), cache_ms_freq, *freq, rig->state.use_cached_freq);
|
||||
ELAPSED2;
|
||||
return (RIG_OK);
|
||||
@ -2029,7 +2033,8 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: cache miss age=%dms, cached_vfo=%s, asked_vfo=%s, use_cached_freq=%d\n", __func__,
|
||||
"%s: cache miss age=%dms, cached_vfo=%s, asked_vfo=%s, use_cached_freq=%d\n",
|
||||
__func__,
|
||||
cache_ms_freq,
|
||||
rig_strvfo(vfo), rig_strvfo(vfo), rig->state.use_cached_freq);
|
||||
}
|
||||
@ -2344,7 +2349,7 @@ int HAMLIB_API rig_get_mode(RIG *rig,
|
||||
|
||||
if (!mode || !width)
|
||||
{
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
caps = rig->caps;
|
||||
@ -2753,7 +2758,8 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
|
||||
|
||||
if (vfo != rig->state.current_vfo && rig_get_vfo(rig, &tmp_vfo) == -RIG_ENAVAIL)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Expiring all cache due to VFO change and no get_vfo\n", __func__);
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: Expiring all cache due to VFO change and no get_vfo\n", __func__);
|
||||
// expire all cached items when we switch VFOs and get_vfo does not work
|
||||
rig_set_cache_freq(rig, RIG_VFO_ALL, 0);
|
||||
}
|
||||
@ -7196,7 +7202,9 @@ static int async_data_handler_start(RIG *rig)
|
||||
|
||||
if (!rs->async_data_enabled)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: async data support disabled since asynd_data_enabled=%d\n", __func__, rs->async_data_enabled);
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: async data support disabled since asynd_data_enabled=%d\n", __func__,
|
||||
rs->async_data_enabled);
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
@ -1738,7 +1738,8 @@ readline_repeat:
|
||||
}
|
||||
|
||||
// Allow only certain commands when the rig is powered off
|
||||
if (retcode == RIG_OK && (rig_powerstat == RIG_POWER_OFF || rig_powerstat == RIG_POWER_STANDBY)
|
||||
if (retcode == RIG_OK && (rig_powerstat == RIG_POWER_OFF
|
||||
|| rig_powerstat == RIG_POWER_STANDBY)
|
||||
&& cmd_entry->cmd != '1' // dump_caps
|
||||
&& cmd_entry->cmd != '3' // dump_conf
|
||||
&& cmd_entry->cmd != 0x8f // dump_state
|
||||
@ -1746,7 +1747,8 @@ readline_repeat:
|
||||
&& cmd_entry->cmd != 0x87) // set_powerstat
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN,
|
||||
"%s: command %s not allowed when rig is powered off\n", __func__, cmd_entry->name);
|
||||
"%s: command %s not allowed when rig is powered off\n", __func__,
|
||||
cmd_entry->name);
|
||||
retcode = -RIG_EPOWER;
|
||||
}
|
||||
else
|
||||
|
@ -262,7 +262,8 @@ int main(int argc, char *argv[])
|
||||
int twiddle_timeout = 0;
|
||||
int twiddle_rit = 0;
|
||||
int uplink = 0;
|
||||
int rigctld_idle = 0; // if true then rig will close when no clients are connected
|
||||
int rigctld_idle =
|
||||
0; // if true then rig will close when no clients are connected
|
||||
char host[NI_MAXHOST];
|
||||
char serv[NI_MAXSERV];
|
||||
char rigstartup[1024];
|
||||
@ -778,8 +779,8 @@ int main(int argc, char *argv[])
|
||||
if (verbose > RIG_DEBUG_ERR)
|
||||
{
|
||||
printf("Closed rig model %d, '%s - will reopen for clients'\n",
|
||||
my_rig->caps->rig_model,
|
||||
my_rig->caps->model_name);
|
||||
my_rig->caps->rig_model,
|
||||
my_rig->caps->model_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user