Skip to content

Commit

Permalink
Move setup_switch() call to axe_wakup instead of axe_get_signal
Browse files Browse the repository at this point in the history
  • Loading branch information
Jalle19 committed Jun 25, 2024
1 parent 207c0c5 commit 6d3a2fe
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/axe.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,15 @@ int axe_wakeup(adapter *_ad, int fe_fd, int voltage) {
if (ad == NULL || is_adapter_disabled(i))
continue;
LOG("axe_wakeup: waking adapter %d, fd %d", i, ad->fe2);
if (ioctl(ad->fe2, FE_SET_VOLTAGE, voltage) == -1)
LOG("axe_wakeup: FE_SET_VOLTAGE failed fd %d: %s", ad->fe2,
strerror(errno));

if (ad->tp.diseqc_param.switch_type == SWITCH_JESS ||
ad->tp.diseqc_param.switch_type == SWITCH_UNICABLE) {
axe_setup_switch(ad);
} else {
if (ioctl(ad->fe2, FE_SET_VOLTAGE, voltage) == -1)
LOG("axe_wakeup: FE_SET_VOLTAGE failed fd %d: %s", ad->fe2,
strerror(errno));
}
}
return 0;
}
Expand Down Expand Up @@ -722,13 +728,6 @@ int axe_get_signal(adapter *ad) {
ad->strength = strength;
ad->status = status;
ad->ber = ber;

if (ad->status == 0 &&
((ad->tp.diseqc_param.switch_type == SWITCH_JESS) ||
(ad->tp.diseqc_param.switch_type == SWITCH_UNICABLE))) {
axe_setup_switch(ad);
}

adapter_unlock(ad->id);
return 0;
}
Expand Down

0 comments on commit 6d3a2fe

Please sign in to comment.