Using the SDK
Windows Prerequisites
- The .NET Framework 4.8 or .NET 6.0.
- Microsoft Visual Studio 2022.
- If using a USB device (RedRat-X or RedRat3-II), then the appropriate device driver.
Linux & Mac Prerequisites
The RedRat.dll on Linux supports the irNetBox and RedRat-X (network and USB), but does not currently support the USB RedRat3-II.
To run non-UI applications on Linux, the following are needed:
- .NET 6.0: Installation instructions are available here.
- LibUsb: This is generally installed with a package manager:
- Ubuntu:
sudo apt-get install libusb-1.0-0-dev
.
- Mac: using Homebrew:
brew install libusb
. It may be necessary to set the library load path so that dotnet finds libusb, for example export DYLD_LIBRARY_PATH=/usr/local/lib
Code Examples
Various short code examples giving an introduction to using the RedRat SDK.
Sample Code
The sample Visual Studio 2022 solution (download below) contains a number of projects demonstrating how to work with RedRat devices. RedRat.dll itself needs to be included from Nuget:
- Simple Signal Output: Loads an IR signal database file and transmits signals from this file via a USB RedRat device.
- RR_CLI: Command line interface for basic operations using USB RedRat devices. Can also be used for scripting, however RedRatHub is generally recommended as a better approach.
- Signal Decoding: Demonstrates the code needed to handle input IR signals from a remote control via a USB RedRat. The signals are decoded and a small window is moved around the screen in response to the remote control button presses.
- Custom Signal: Shows how to construct custom IR signals, and then save them in the standard Signal DB Utility XML file format for editing, viewing and future use.
- irNetBox Demo: Transmits IR signals via an irNetBox. This uses both the old synchronous API (sending one signal at a time for older irNetBox versions) and the new asynchronous API which supports simultaneous transmission of multiple IR signals from the MK-III and MK-IV irNetBoxs.
- Key Press Logger: Logs incoming IR signals via a USB RedRat and attempts to decode them.
- Macro Sample: Reads a file containing macros (i.e. sequences of IR signals) and transmits one.
- Test Remote: WinForms application showing a very simple, configurable on-screen remote control.
- RedRatX Demo: Demonstrates most aspects of using the RedRat-X's API.
- IronPython Sample: A .NET version of python which can directly use RedRat.dll for IR input/output operations. To use standard python with RedRat devices, RedRatHub is recommended.