From 205207c98ab68f83ef61bf77e36ed9bb11914b3b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 7 Nov 2003 16:21:40 +0000 Subject: (get_usb_ups_name) introduce it to map usb devices to hiddev devices --- perl-install/c/stuff.xs.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'perl-install/c') diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index 5ea0f8734..b1e9d0691 100644 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -48,6 +48,9 @@ typedef __uint8_t u8; #include #include +// for UPS on USB: +#include + #include #include #include @@ -404,6 +407,20 @@ usb_probe() unsigned int getpagesize() + +char* +get_usb_ups_name(int fd) + CODE: + /* from nut/drivers/hidups.c::upsdrv_initups() : */ + char name[256]; + ioctl(fd, HIDIOCGNAME(sizeof(name)), name); + RETVAL=name; + ioctl(fd, HIDIOCINITREPORT, 0); + OUTPUT: + RETVAL + + + int hasNetDevice(device) char * device -- cgit v1.2.1