Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/adelsystem_cbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <timehead.h>

#define DRIVER_NAME "NUT ADELSYSTEM DC-UPS CB/CBI driver"
#define DRIVER_VERSION "0.01"
#define DRIVER_VERSION "0.02"

/* variables */
static modbus_t *mbctx = NULL; /* modbus memory context */
Expand Down
2 changes: 1 addition & 1 deletion drivers/al175.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef uint8_t byte_t;


#define DRIVER_NAME "Eltek AL175/COMLI driver"
#define DRIVER_VERSION "0.13"
#define DRIVER_VERSION "0.14"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/apcsmart-old.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "nut_stdint.h"

#define DRIVER_NAME "APC Smart protocol driver"
#define DRIVER_VERSION "2.2"
#define DRIVER_VERSION "2.30"

static upsdrv_info_t table_info = {
"APC command table",
Expand Down
3 changes: 3 additions & 0 deletions drivers/apcsmart.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#include "apcsmart.h"
#include "apcsmart_tabs.h"

#define DRIVER_NAME "APC Smart protocol driver"
#define DRIVER_VERSION "3.30"

#ifdef WIN32
# ifndef ECANCELED
# define ECANCELED ERROR_CANCELLED
Expand Down
3 changes: 0 additions & 3 deletions drivers/apcsmart.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#ifndef NUT_APCSMART_H_SEEN
#define NUT_APCSMART_H_SEEN 1

#define DRIVER_NAME "APC Smart protocol driver"
#define DRIVER_VERSION "3.2"

#define ALT_CABLE_1 "940-0095B"

/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/apcupsd-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef unsigned long int nfds_t;
#include "nut_stdint.h"

#define DRIVER_NAME "apcupsd network client UPS driver"
#define DRIVER_VERSION "0.6"
#define DRIVER_VERSION "0.70"

#define POLL_INTERVAL_MIN 10

Expand Down
2 changes: 1 addition & 1 deletion drivers/asem.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#endif

#define DRIVER_NAME "ASEM"
#define DRIVER_VERSION "0.11"
#define DRIVER_VERSION "0.12"

/* Valid on ASEM PB1300 UPS */
#define BQ2060_ADDRESS 0x0B
Expand Down
2 changes: 1 addition & 1 deletion drivers/bcmxcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ TODO List:
#include "bcmxcp.h"

#define DRIVER_NAME "BCMXCP UPS driver"
#define DRIVER_VERSION "0.32"
#define DRIVER_VERSION "0.33"

#define MAX_NUT_NAME_LENGTH 128
#define NUT_OUTLET_POSITION 7
Expand Down
2 changes: 1 addition & 1 deletion drivers/bcmxcp_ser.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "nut_stdint.h"

#define SUBDRIVER_NAME "RS-232 communication subdriver"
#define SUBDRIVER_VERSION "0.21"
#define SUBDRIVER_VERSION "0.22"

/* communication driver description structure */
upsdrv_info_t comm_upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/belkin.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "nut_stdint.h"

#define DRIVER_NAME "Belkin Smart protocol driver"
#define DRIVER_VERSION "0.25"
#define DRIVER_VERSION "0.26"

static ssize_t init_communication(void);
static ssize_t get_belkin_reply(char *buf);
Expand Down
2 changes: 1 addition & 1 deletion drivers/belkinunv.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
#include "serial.h"

#define DRIVER_NAME "Belkin 'Universal UPS' driver"
#define DRIVER_VERSION "0.08"
#define DRIVER_VERSION "0.09"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/bestfcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include "serial.h"

#define DRIVER_NAME "Best Ferrups/Fortress driver"
#define DRIVER_VERSION "0.13"
#define DRIVER_VERSION "0.14"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/bestfortress.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#endif

#define DRIVER_NAME "Best Fortress UPS driver"
#define DRIVER_VERSION "0.07"
#define DRIVER_VERSION "0.08"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/bestuferrups.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "serial.h"

#define DRIVER_NAME "Best Ferrups Series ME/RE/MD driver"
#define DRIVER_VERSION "0.04"
#define DRIVER_VERSION "0.05"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/bestups.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "nut_stdint.h"

#define DRIVER_NAME "Best UPS driver"
#define DRIVER_VERSION "1.07"
#define DRIVER_VERSION "1.08"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/blazer_ser.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "blazer.h"

#define DRIVER_NAME "Megatec/Q1 protocol serial driver"
#define DRIVER_VERSION "1.58"
#define DRIVER_VERSION "1.59"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/blazer_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#endif

#define DRIVER_NAME "Megatec/Q1 protocol USB driver"
#define DRIVER_VERSION "0.14"
#define DRIVER_VERSION "0.15"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/clone-outlet.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#endif

#define DRIVER_NAME "clone outlet UPS Driver"
#define DRIVER_VERSION "0.02"
#define DRIVER_VERSION "0.03"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#endif

#define DRIVER_NAME "Clone UPS driver"
#define DRIVER_VERSION "0.03"
#define DRIVER_VERSION "0.04"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/dummy-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include "dummy-ups.h"

#define DRIVER_NAME "Device simulation and repeater driver"
#define DRIVER_VERSION "0.15"
#define DRIVER_VERSION "0.16"

/* driver description structure */
upsdrv_info_t upsdrv_info =
Expand Down
2 changes: 1 addition & 1 deletion drivers/etapro.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#include "nut_stdint.h"

#define DRIVER_NAME "ETA PRO driver"
#define DRIVER_VERSION "0.05"
#define DRIVER_VERSION "0.06"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/everups.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "serial.h"

#define DRIVER_NAME "Ever UPS driver (serial)"
#define DRIVER_VERSION "0.04"
#define DRIVER_VERSION "0.05"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/gamatronic.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "nut_stdint.h"

#define DRIVER_NAME "Gamatronic UPS driver"
#define DRIVER_VERSION "0.03"
#define DRIVER_VERSION "0.04"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
61 changes: 31 additions & 30 deletions drivers/generic_gpio_common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#ifndef GENERIC_GPIO_COMMON_H
#define GENERIC_GPIO_COMMON_H
/* generic_gpio_common.h - common NUT driver definitions for GPIO attached UPS devices
*
* Copyright (C)
Expand All @@ -22,47 +20,50 @@
*
*/

#ifndef GENERIC_GPIO_COMMON_H_SEEN
#define GENERIC_GPIO_COMMON_H_SEEN

#include <stdlib.h>
#include <regex.h>
#include <ctype.h>

/* rules commands definition */
#define RULES_CMD_NOT -2
#define RULES_CMD_AND -3
#define RULES_CMD_OR -4
#define RULES_CMD_OBR -5
#define RULES_CMD_CBR -6
#define RULES_CMD_LAST RULES_CMD_CBR
#define RULES_CMD_NOT -2
#define RULES_CMD_AND -3
#define RULES_CMD_OR -4
#define RULES_CMD_OBR -5
#define RULES_CMD_CBR -6
#define RULES_CMD_LAST RULES_CMD_CBR

/* run option definitions */
#define ROPT_REQRES 0x00000001 /* reserve GPIO lines only during request processing */
#define ROPT_EVMODE 0x00000002 /* event driven run */
#define ROPT_REQRES 0x00000001 /* reserve GPIO lines only during request processing */
#define ROPT_EVMODE 0x00000002 /* event driven run */

/* buffer size for chipName arrays */
#define NUT_GPIO_CHIPNAMEBUF 32
#define NUT_GPIO_SUBTYPEBUF 16
#define NUT_GPIO_SUBTYPEBUF 16

typedef struct rulesint_t { /* structure to store processed rules configuration per each state */
char stateName[12]; /* NUT state name for rules in cRules */
int archVal; /* previous state value */
int currVal; /* current state value */
int subCount; /* element count in translated rules subitem */
int cRules[]; /* translated rules subitem - rules commands followed by line number(s) */
} rulesint;
char stateName[12]; /* NUT state name for rules in cRules */
int archVal; /* previous state value */
int currVal; /* current state value */
int subCount; /* element count in translated rules subitem */
int cRules[]; /* translated rules subitem - rules commands followed by line number(s) */
} rulesint;

typedef struct gpioups_t {
void *lib_data; /* pointer to driver's gpio support library data structure */
const char *chipName; /* port or file name to reference GPIO chip */
int initial; /* initialization flag - 0 on 1st entry */
int runOptions; /* run options, not yet used */
int aInfoAvailable; /* non-zero if previous state information is available */
int chipLinesCount; /* gpio chip lines count, set after sucessful open */
int upsLinesCount; /* no of lines used in rules */
int *upsLines; /* lines numbers */
int *upsLinesStates; /* lines states */
int upsMaxLine; /* maximum line number referenced in rules */
int rulesCount; /* rules subitem count: no of NUT states defined in rules*/
struct rulesint_t **rules;
void *lib_data; /* pointer to driver's gpio support library data structure */
const char *chipName; /* port or file name to reference GPIO chip */
int initial; /* initialization flag - 0 on 1st entry */
int runOptions; /* run options, not yet used */
int aInfoAvailable; /* non-zero if previous state information is available */
int chipLinesCount; /* gpio chip lines count, set after sucessful open */
int upsLinesCount; /* no of lines used in rules */
int *upsLines; /* lines numbers */
int *upsLinesStates; /* lines states */
int upsMaxLine; /* maximum line number referenced in rules */
int rulesCount; /* rules subitem count: no of NUT states defined in rules*/
struct rulesint_t **rules;
} gpioups;

extern struct gpioups_t *gpioupsfd;
Expand All @@ -82,4 +83,4 @@ int calc_rule_states(int upsLinesStates[], int cRules[], int subCount, int sInde
void update_ups_states(struct gpioups_t *gpioupsfd);
# endif /* DRIVERS_MAIN_WITHOUT_MAIN */

#endif /* GENERIC_GPIO_COMMON_H */
#endif /* GENERIC_GPIO_COMMON_H_SEEN */
3 changes: 3 additions & 0 deletions drivers/generic_gpio_libgpiod.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "generic_gpio_common.h"
#include "generic_gpio_libgpiod.h"

#define DRIVER_NAME "GPIO UPS driver"
#define DRIVER_VERSION "1.01"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
DRIVER_NAME,
Expand Down
16 changes: 7 additions & 9 deletions drivers/generic_gpio_libgpiod.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#ifndef GENERIC_GPIO_LIBGPIOD_H
#define GENERIC_GPIO_LIBGPIOD_H
/* generic_gpio_libgpiod.h - gpiod based NUT driver definitions for GPIO attached UPS devices
*
* Copyright (C)
Expand All @@ -22,15 +20,15 @@
*
*/

#include <gpiod.h>
#ifndef GENERIC_GPIO_LIBGPIOD_H_SEEN
#define GENERIC_GPIO_LIBGPIOD_H_SEEN

#define DRIVER_NAME "GPIO UPS driver"
#define DRIVER_VERSION "1.00"
#include <gpiod.h>

typedef struct libgpiod_data_t {
struct gpiod_chip *gpioChipHandle; /* libgpiod chip handle when opened */
struct gpiod_line_bulk gpioLines; /* libgpiod lines to monitor */
struct gpiod_line_bulk gpioEventLines; /* libgpiod lines for event monitoring */
struct gpiod_chip *gpioChipHandle; /* libgpiod chip handle when opened */
struct gpiod_line_bulk gpioLines; /* libgpiod lines to monitor */
struct gpiod_line_bulk gpioEventLines; /* libgpiod lines for event monitoring */
} libgpiod_data;

#endif /* GENERIC_GPIO_LIBGPIOD_H */
#endif /* GENERIC_GPIO_LIBGPIOD_H_SEEN */
2 changes: 1 addition & 1 deletion drivers/generic_modbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "nut_stdint.h"

#define DRIVER_NAME "NUT Generic Modbus driver"
#define DRIVER_VERSION "0.03"
#define DRIVER_VERSION "0.04"

/* variables */
static modbus_t *mbctx = NULL; /* modbus memory context */
Expand Down
2 changes: 1 addition & 1 deletion drivers/genericups.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "nut_stdint.h"

#define DRIVER_NAME "Generic contact-closure UPS driver"
#define DRIVER_VERSION "1.38"
#define DRIVER_VERSION "1.39"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/huawei-ups2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include "timehead.h" /* fallback gmtime_r() variants if needed (e.g. some WIN32) */

#define DRIVER_NAME "NUT Huawei UPS2000 (1kVA-3kVA) RS-232 Modbus driver"
#define DRIVER_VERSION "0.04"
#define DRIVER_VERSION "0.05"

#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
#define MODBUS_SLAVE_ID 1
Expand Down
2 changes: 1 addition & 1 deletion drivers/isbmex.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <string.h>

#define DRIVER_NAME "ISBMEX UPS driver"
#define DRIVER_VERSION "0.07"
#define DRIVER_VERSION "0.08"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/ivtscd.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "attribute.h"

#define DRIVER_NAME "IVT Solar Controller driver"
#define DRIVER_VERSION "0.03"
#define DRIVER_VERSION "0.04"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down
3 changes: 2 additions & 1 deletion drivers/liebert-esp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
#define IsBitSet(val, bit) ((val) & (1 << (bit)))

#define DRIVER_NAME "Liebert ESP-II serial UPS driver"
#define DRIVER_VERSION "0.05"
#define DRIVER_VERSION "0.06"

#define UPS_SHUTDOWN_DELAY 12 /* it means UPS will be shutdown 120 sec */
#define SHUTDOWN_CMD_LEN 8

Expand Down
Loading