ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/truck/SteeringWheelRemote/SteeringWheelRemote.cpp
(Generate patch)

Comparing SteeringWheelRemote/SteeringWheelRemote.cpp (file contents):
Revision 3 by douglas, 2007-04-26T01:51:35-07:00 vs.
Revision 4 by douglas, 2007-04-26T05:19:05-07:00

# Line 9 | Line 9
9  
10   #include <err.h>
11   #include <fcntl.h>
12 < #include <usbhid.h>
12 > #include <sys/ioctl.h>
13  
14   #include <common.hpp>
15 + #include <fdstream.hpp>
16   #include <foreach.hpp>
17   #include <posix.hpp>
18   #include <regex.hpp>
# Line 49 | Line 50 | int main(int argc, char *argv[])
50          if (device.empty())
51                  return Usage(argv[0]);
52  
53 <        std::cerr << device << std::endl;
53 > //      if (!debug)
54 > //              Posix::CheckError(::daemon(0, 0));
55 >
56 >        ext::ifdstream uhid(Posix::CheckError(::open(device.c_str(), O_RDONLY)));
57 >        char buffer[8];
58 >
59 >        while (uhid.read(buffer, sizeof (buffer)))
60 >                _forall (int, index, 0, 8)
61 >                        std::printf("0x%08x 0x%08x\n", buffer[3], ~buffer[4] - 0x4);
62  
63          return 0;
64   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines