Lines 84-90
static int pollfreq = DEFAULT_POLLFREQ;
Link Here
|
84 |
static int ups_status = 0; |
84 |
static int ups_status = 0; |
85 |
static bool_t data_has_changed = FALSE; /* for SEMI_STATIC data polling */ |
85 |
static bool_t data_has_changed = FALSE; /* for SEMI_STATIC data polling */ |
86 |
static time_t lastpoll; /* Timestamp the last polling */ |
86 |
static time_t lastpoll; /* Timestamp the last polling */ |
87 |
hid_dev_handle_t udev; |
87 |
hid_dev_handle_t udev = NULL; |
88 |
|
88 |
|
89 |
/* support functions */ |
89 |
/* support functions */ |
90 |
static hid_info_t *find_nut_info(const char *varname); |
90 |
static hid_info_t *find_nut_info(const char *varname); |
Lines 1360-1366
static int reconnect_ups(void)
Link Here
|
1360 |
upsdebugx(4, "=================================================="); |
1360 |
upsdebugx(4, "=================================================="); |
1361 |
upsdebugx(4, "= device has been disconnected, try to reconnect ="); |
1361 |
upsdebugx(4, "= device has been disconnected, try to reconnect ="); |
1362 |
upsdebugx(4, "=================================================="); |
1362 |
upsdebugx(4, "=================================================="); |
1363 |
|
1363 |
if (udev) |
|
|
1364 |
comm_driver->close(udev); |
1365 |
|
1364 |
ret = comm_driver->open(&udev, &curDevice, subdriver_matcher, |
1366 |
ret = comm_driver->open(&udev, &curDevice, subdriver_matcher, |
1365 |
#ifdef SHUT_MODE |
1367 |
#ifdef SHUT_MODE |
1366 |
NULL); |
1368 |
NULL); |