Skip to content

Commit

Permalink
function to up for definition
Browse files Browse the repository at this point in the history
Signed-off-by: DaRK AnGeL <[email protected]>
  • Loading branch information
masterwishx committed Oct 11, 2024
1 parent cb6c601 commit 3669d38
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions drivers/mge-hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,20 +703,6 @@ static info_lkp_t eaton_input_mode_info[] = {
{ 0, NULL, NULL, NULL }
};

/* Automatic Bypass mode On */
static info_lkp_t eaton_input_bypass_mode_on_info[] = {
{ 0, "not used", NULL, NULL },
{ 1, "bypassOn", eaton_input_bypass_check_range, NULL },
{ 0, NULL, NULL, NULL }
};

/* Automatic Bypass mode Off */
static info_lkp_t eaton_input_bypass_mode_off_info[] = {
{ 0, "not used", NULL, NULL },
{ 1, "bypassOff", NULL, NULL },
{ 0, NULL, NULL, NULL }
};

// Function to check if the current bypass voltage is within the configured limits
static const char *eaton_input_bypass_check_range(double value)
{
Expand All @@ -725,6 +711,7 @@ static const char *eaton_input_bypass_check_range(double value)
const char* bypass_low_str = dstate_getinfo("input.transfer.bypass.low");
const char* bypass_high_str = dstate_getinfo("input.transfer.bypass.high");
const char* out_nominal_str = dstate_getinfo("output.voltage.nominal");
NUT_UNUSED_VARIABLE(value);

if (bypass_voltage_str == NULL || bypass_low_str == NULL || bypass_high_str == NULL || out_nominal_str == NULL) {
upsdebugx(1, "Failed to get values", __func__);
Expand Down Expand Up @@ -757,6 +744,20 @@ static const char *eaton_input_bypass_check_range(double value)
}
}

/* Automatic Bypass mode On */
static info_lkp_t eaton_input_bypass_mode_on_info[] = {
{ 0, "not used", NULL, NULL },
{ 1, "bypassOn", eaton_input_bypass_check_range, NULL },
{ 0, NULL, NULL, NULL }
};

/* Automatic Bypass mode Off */
static info_lkp_t eaton_input_bypass_mode_off_info[] = {
{ 0, "not used", NULL, NULL },
{ 1, "bypassOff", NULL, NULL },
{ 0, NULL, NULL, NULL }
};

/* Determine country using UPS.PowerSummary.Country.
* If not present:
* if PowerConverter.Output.Voltage >= 200 => "Europe"
Expand Down

0 comments on commit 3669d38

Please sign in to comment.