Skip to content

Commit 8c9f2bc

Browse files
authored
Merge 420be53 into 5d3ff46
2 parents 5d3ff46 + 420be53 commit 8c9f2bc

File tree

6 files changed

+42
-4
lines changed

6 files changed

+42
-4
lines changed

drivers/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ usbhid_ups_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
245245
tripplite_usb_SOURCES = tripplite_usb.c $(LIBUSB_IMPL) usb-common.c
246246
tripplite_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
247247

248-
bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c usb-common.c
248+
bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c $(LIBUSB_IMPL) usb-common.c
249249
bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
250250

251251
blazer_usb_SOURCES = blazer.c blazer_usb.c $(LIBUSB_IMPL) usb-common.c

drivers/bcmxcp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,8 +2216,10 @@ void upsdrv_help(void)
22162216
{
22172217
}
22182218

2219-
/* list flags and values that you want to receive via -x */
2220-
void upsdrv_makevartable(void)
2219+
/* list flags and values that you want to receive via -x
2220+
* or ups.conf to all bcmxcp* family of drivers
2221+
*/
2222+
void bcmxcp_makevartable(void)
22212223
{
22222224
/* NOTE: The USB variant of this driver currently does not
22232225
* involve nut_usb_addvars() method like others do. When

drivers/bcmxcp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,4 +622,6 @@ typedef enum ebool { FALSE, TRUE } bool_t;
622622
typedef int bool_t;
623623
#endif
624624

625+
void bcmxcp_makevartable(void);
626+
625627
#endif /* NUT_BCMXCP_H_SEEN */

drivers/bcmxcp_ser.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@ static void pw_comm_setup(const char *port)
410410
# pragma GCC diagnostic pop
411411
#endif
412412

413+
void upsdrv_makevartable(void)
414+
{
415+
bcmxcp_makevartable();
416+
}
417+
413418
void upsdrv_initups(void)
414419
{
415420
upsfd = ser_open(device_path);

drivers/bcmxcp_usb.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "bcmxcp.h"
33
#include "bcmxcp_io.h"
44
#include "common.h"
5+
#include "nut_libusb.h"
56
#include "usb-common.h"
67
#include "timehead.h"
78
#include "nut_stdint.h" /* for uint16_t */
@@ -11,7 +12,7 @@
1112
#include <unistd.h>
1213

1314
#define SUBDRIVER_NAME "USB communication subdriver"
14-
#define SUBDRIVER_VERSION "0.27"
15+
#define SUBDRIVER_VERSION "0.28"
1516

1617
/* communication driver description structure */
1718
upsdrv_info_t comm_upsdrv_info = {
@@ -367,6 +368,14 @@ void upsdrv_comm_good(void)
367368
nutusb_comm_good();
368369
}
369370

371+
void upsdrv_makevartable(void)
372+
{
373+
bcmxcp_makevartable();
374+
375+
/* allow -x vendor=X, vendorid=X, product=X, productid=X, serial=X */
376+
nut_usb_addvars();
377+
}
378+
370379
void upsdrv_initups(void)
371380
{
372381
upsdev = nutusb_open("USB");

tools/nut-scanner/Makefile.am

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,26 @@ lib_LTLIBRARIES =
5656
include_HEADERS =
5757
dist_noinst_HEADERS =
5858

59+
# Separate the .deps of other dirs from this one
60+
# NOTE: Not using "$<" due to a legacy Sun/illumos dmake bug with resolver
61+
# of dynamic vars, see e.g. https://man.omnios.org/man1/make#BUGS
62+
LINKED_SOURCE_FILES += serial.c
63+
serial.c: $(top_srcdir)/drivers/serial.c
64+
test -s "$@" || ln -s -f "$(top_srcdir)/drivers/serial.c" "$@"
65+
66+
LINKED_SOURCE_FILES += bcmxcp_ser.c bcmxcp.c
67+
bcmxcp_ser.c: $(top_srcdir)/drivers/bcmxcp_ser.c
68+
test -s "$@" || ln -s -f "$(top_srcdir)/drivers/bcmxcp_ser.c" "$@"
69+
70+
bcmxcp.c: $(top_srcdir)/drivers/bcmxcp.c
71+
test -s "$@" || ln -s -f "$(top_srcdir)/drivers/bcmxcp.c" "$@"
72+
73+
CLEANFILES += $(LINKED_SOURCE_FILES)
74+
BUILT_SOURCES += $(LINKED_SOURCE_FILES)
75+
76+
$(top_builddir)/include/nut_version.h:
77+
@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F)
78+
5979
# Note: we only build nut-scanner, and its library, if libltdl was found (required ATM!)
6080
if WITH_NUT_SCANNER
6181
bin_PROGRAMS += nut-scanner

0 commit comments

Comments
 (0)