Date: Wed, 11 Dec 2013 10:09:19 +0900 From: Kouichi Hirabayashi <kh@mogami.com> To: freebsd-users-jp@FreeBSD.org Subject: [FreeBSD-users-jp 95096] =?iso-2022-jp?b?VVNCIBskQjI5RVk3VxsoQg==?= Message-ID: <20131211100919.bfae2453ee355311ed3946b9@mogami.com>
next in thread | raw e-mail | index | archive | help
$B4JC1$J<<29Jd@5$rI,MW$H$9$kB,Dj$N$?$a$K29EY7W$rC5$7$F$_$?$N$G$9$,!"(B http://www.pcsensor.comindex.php_a=product&product_id=41 $B$,(B FreeBSD-8.4 $B$G$b;H$($k$h$&$G$9!#9qFb$G$b!"(B http://www.donya.jp/item/24167.html $B$H$+(B amazon $B$J$I$G<h07$,$"$C$F!"(B1,000 $B1_$A$g$C$H$GF~<j$G$-$^$9!#(B $B%G%P%$%9$=$N$b$N$O!"(BHid $B$H$7$F@_7W$5$l$F$$$F!"(B usbconfig dump_device_desc $B$N7k2L$O2<5-$N$h$&$K$J$j$^$9!#(B ugen0.2: <TEMPerV1.4 RDing> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0008 idVendor = 0x0c45 idProduct = 0x7401 bcdDevice = 0x0001 iManufacturer = 0x0001 <RDing> iProduct = 0x0002 <TEMPerV1.4> iSerialNumber = 0x0000 <no string> bNumConfigurations = 0x0001 $BIUB0(B CD-ROM $B$K$O(B Windows $B$N%"%W%j%1!<%7%g%s$7$+$"$j$^$;$s$,!"(B Linux community $B$G3+H/$5$l$?(B pcsensor-1.0.0-multi.tgz $B$,(B http://momtchil.momtchev.com/node/6 $B$K$"$j$^$9$N$G!"$3$l$K2<5-$N%Q%C%A$r$"$F$F!"(Bmake $B$9$l$P!"(B FreeBSD-8.4 $B$GF0:n$9$k(B pcsensor $B$,$G$-$^$9!#(B --- pcsensor.c.orig 2013-12-11 09:10:15.000000000 +0900 +++ pcsensor.c 2013-12-11 09:19:40.000000000 +0900 @@ -34,8 +34,13 @@ #include <string.h> #include <errno.h> #include <signal.h> - - +#ifdef __FreeBSD__ +#include <stdlib.h> +#include <unistd.h> +#include <libusb.h> +#endif + + #define VERSION "1.0.0" #define VENDOR_ID 0x0c45 @@ -80,17 +85,21 @@ ret = usb_detach_kernel_driver_np(lvr_winusb, iInterface); if(ret) { +#ifndef __FreeBSD__ if(errno == ENODATA) { if(debug) { printf("Device already detached\n"); } } else { +#endif if(debug) { printf("Detach failed: %s[%d]\n", strerror(errno), errno); printf("Continuing anyway\n"); } +#ifndef __FreeBSD__ } +#endif } else { if(debug) { printf("detach successful\n"); --- Makefile 2013-12-10 17:19:15.000000000 +0900 +++ makefile 2013-12-11 09:07:53.000000000 +0900 @@ -3,10 +3,9 @@ CFLAGS = -O2 -Wall pcsensor: pcsensor.c - ${CC} -DUNIT_TEST -o $@ $^ -lusb + cc -g -o pcsensor pcsensor.c -lusb + chmod 4755 pcsensor + chown root pcsensor clean: - rm -f pcsensor *.o - -rules-install: # must be superuser to do this - cp 99-tempsensor.rules /etc/udev/rules.d + rm -f pcsensor --< cut >-- $B$3$N%W%m%0%i%`(B(pcsensor)$B$r<B9T$9$k$H!"2<5-$N$h$&$J=PNO$,F@$i$l$^$9!#(B $ pcsensor 2013/12/11 09:50:08 Temperature 72.05F 22.25C $BC;$$%W%m%0%i%`$G$9$+$i!"<+J,$,$[$7$$5!G=$K=q$-49$($k$N$b4JC1$G$9!#(B $B$J$*!"$3$N%W%m%0%i%`$O(B libusb(http://www.libusb.org/) $B$N(B 0.1 $B$r;H(B $B$C$F$$$F!"4{$K(B legacy $BHG$G$9$,!"(BFreeBSD-8.4 $B$G$O$^$@;H$($k$b$N$N!"(B $B$^$H$b$J%^%K%e%"%k$,$"$j$^$;$s$N$G!"(Blibusb $B$K$D$$$F$O!"(B http://libusb.sourceforge.net/doc/ $B$r;2>H$7$F$/$@$5$$!#8=9THG(B 1.0 $B$N%^%K%e%"%k$O(B http://libusb.sourceforge.net/api-1.0/ $B$G$9!#(B $BJ?NS(B $B9@0l(B
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131211100919.bfae2453ee355311ed3946b9>