diff options
Diffstat (limited to 'libarmep/service.c')
-rw-r--r-- | libarmep/service.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libarmep/service.c b/libarmep/service.c index b5b736b..798e256 100644 --- a/libarmep/service.c +++ b/libarmep/service.c @@ -78,6 +78,7 @@ static void init_aep(struct aep_context *aep_context, struct aep *aep, const cha ch->voffset[1] = 0; ch->vnoise[1] = 0; ch->rshunt = 0; + ch->flag_was_configured = 0; sprintf(ch->channel_name, "%s-%d", device_filepath, n); ch->pretrig_ring = NULL; ch->ring_samples = 0; @@ -277,6 +278,9 @@ int service_aeps(struct aep_context *aep_context, int fd_with_rx) for (n = 0; n < CHANNELS_PER_PROBE; n++) { struct aep_channel *ch = &aep_context->aeps[aep_context->scan].ch[n]; + if (!ch->flag_was_configured) + continue; + select_map(ch); if (aep_context->original_count_channel_names) { @@ -340,7 +344,8 @@ bail: for (m = 0; m <= aep_context->highest; m++) if (aep_context->aeps[m].fd > 0 && aep_context->aeps[m].done_config == 3) { for (i = 0; i < CHANNELS_PER_PROBE; i++) - if (aep_context->aeps[m].ch[i].requested) + if (aep_context->aeps[m].ch[i].requested && + aep_context->aeps[m].ch[i].flag_was_configured) c++; } @@ -370,7 +375,7 @@ bail: for (i = 0; i < CHANNELS_PER_PROBE; i++) { ch = &aep_context->aeps[m].ch[i]; - if (!ch->requested) + if (!ch->requested || !ch->flag_was_configured) continue; copy_public_ch_info_to_shared(aep_context->aepd_interface, chan, ch); @@ -623,10 +628,12 @@ int aep_init_and_fork(struct aep_context *aep_context, char *argv[]) for (i = 0; i < CHANNELS_PER_PROBE; i++) { ch = &aep_context->aeps[n].ch[i]; ; - if (configure(aep_context, &aep_context->aeps[n], + if (ch->flag_was_configured) { + if (configure(aep_context, &aep_context->aeps[n], aep_context->aeps[n].dev_filepath, aep_context->config_filepath, ch) < 0) fprintf(stderr, "failed to update config\n"); + } } probe_close(&aep_context->aeps[n]); |