![]() |
PIR Library
2
|
This is the MIT licensed open source library for the Promixis PIR-1 and PIR-4. This library has been tested on Windows and Linux. It supports sending IR codes, receiving IR signals and learning IR signals.
On Windows compilation requires hid.lib, a x86 and x64 version of this library can be found in buildExtras, place them in the appropriate spot when building the Qt version.
The precompiled version of pirlib2_example.exe requires the Visual Studio 2010 redistributables.
Windows x86: http://www.microsoft.com/en-us/download/details.aspx?id=5555
Windows x64: http://www.microsoft.com/en-us/download/details.aspx?id=14632
On Linux the udev daemon typically sets the access permissions of USB-HID devices to 600 for user root. This means that regular users are not able to access the devices. This library accesses the PIR-1 and PIR-4 through /dev/hidraw* and thus we need udev to adjust permission on this.
Easiest way to do this is by creating a file called
/etc/udev/rules.d/99-usb-pir.rules
inside that file add
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="20a0", ATTRS{idProduct}=="413f", MODE="0666"
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="20a0", ATTRS{idProduct}=="4155", MODE="0666"
Then reload the rules with
udevadm control --reload-rules
Last step is to now unplug and replug the PIR-1 / PIR-4 so it can get the new permissions.
The C api can be found here pirlib2.h
The C++ api can be found here Manager
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.8.6