Skip to content

Commit

Permalink
Problem: index has to be counted for any device not just for daisychain
Browse files Browse the repository at this point in the history
Solution: counted for both

Signed-off-by: Barbora Stepankova <[email protected]>
  • Loading branch information
bstepankova committed Feb 20, 2018
1 parent 9008d31 commit 84c10a8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions drivers/snmp-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -2225,21 +2225,23 @@ bool_t daisychain_init()
}
}

/* Finally, compute and store the base OID index and NUT offset */
su_info_p = su_find_info("device.model");
if (su_info_p != NULL)
{
device_template_index_base = base_snmp_template_index(su_info_p);
upsdebugx(1, "%s: device_template_index_base = %i", __func__, device_template_index_base);
device_template_offset = device_template_index_base - 1;
upsdebugx(1, "%s: device_template_offset = %i", __func__, device_template_offset);
}
}
else {
daisychain_enabled = FALSE;
upsdebugx(1, "No device.count entry found, daisychain support not needed");
}

/* Finally, compute and store the base OID index and NUT offset */
su_info_p = su_find_info("device.model");
if (su_info_p != NULL) {
device_template_index_base = base_snmp_template_index(su_info_p);
upsdebugx(1, "%s: device_template_index_base = %i", __func__, device_template_index_base);
device_template_offset = device_template_index_base - 1;
upsdebugx(1, "%s: device_template_offset = %i", __func__, device_template_offset);
}



return daisychain_enabled;
}

Expand Down

0 comments on commit 84c10a8

Please sign in to comment.