Software RedRat SDK

RedRat SDK

The RedRat SDK is intended for the development of applications based on RedRat technology or to support its integration into third party systems. The SDK supports irNetBox and RedRat3 using .NET on Windows OS and irNetBox using Mono on Linux (from V3.04 onwards).

Using the SDK

Windows Prerequisites

  • The .NET Framework 4.5.1 or higher.
  • RedRat.dll – V4.15.zip
  • RedRat hardware. This is actually optional, but only minimal testing will be possible without hardware.

Instructions

Reference the file RedRat.dll in your .NET project to access its API. Several sample projects show the basics of using RedRat devices. Sample .NET Code (C#, VB.NET, VC++) Download (zip)

  • SimpleSignalOutput: Shows how to find a USB RedRat3 device, load an IR signal database file and output a signal from this file via the RedRat3.
  • RR_CLI: A command line program for the output of IR signals, described in more detail here.
  • SignalDecoding: Demonstrates the code needed to handle input IR signals from the RC detector on a RedRat3, decode them and perform an action as a result. In this case, a small window is moved around the screen using cursor keys on a remote control.
  • CustomSignal: shows how to construct a couple of IR signals, and then save them in the standard Signal DB Utility XML file format so that you can load them into the Signal DB Utility for further use.
  • irNetBox-III-Demo: Shows how to output IR signals via the irNetBox-III. This uses both the old synchronous API (sending one signal at a time, which is applicable to older irNetBox versions) and the new asynchronous API which supports sending multiple, different IR signals from the MK-III irNetBox.
  • VB-Net-Sample: A small VB.NET application that tests many RedRat3 functions to show API use with VB.NET.
  • VC++_NET_Sample: Shows use of the RedRat API using managed VC++.

Code Examples

Take a look at various code examples giving an introduction to using the RedRat SDK.

Change History

V4.13 – 1 Feb 2017
  • Initial support for the RedRat-X added.
  • Code for RF4CE and Bluetooth modules is production ready, though not necessarily feature complete.
  • LibUsbDotNet.dll is now not needed with RedRat.dll on Windows. It is dynamically loaded on Linux if needed.
  • OutputUtil (for LabView) now supports Macros and clearing of cached XML files.

V4.12 – 4 Nov 2016

  • irNetBox-IV discovery port to the same as the MK-III. Need to use at least this version of the RedRat.dll if working with irNetBox-IVs.
  • Fixes and improved error handling.
V4.11 – 21 April 2016
  • Improved irNetBox search.
  • BREAKING CHANGES
    • Refactored the product ids, versions and serial numbers to be consistent across devices.
    • Refactored port-enabling code. Now single commands exist for all devices.
V4.10 – 25 Nov 2015
  • Initial support for Bluetooth and RF4CE module boards.
  • Initial functionality for continuous IR output where supported by devices.
  • Improved logging.
  • Several bug fixes.
  • BREAKING CHANGES
    • Device lookup for each type is via the FindDevices() method call on each device type.
    • USB code moved to two separate name spaces – Cypress and XMOS.
    • IRedRat4-III.ResetIRMicro() has been changed to ResetDevice(bool factory).
    • Removed code for USB control of irNetBox-IIIs.
V4.02 – 1 May 2015
  • Moved to .NET 4.5.1.
  • Improved irNetBox communication retry code.
  • All remoting and WCF code removed (use RedRat Hub instead).
  • Removed all RedRat2 support.
  • Toggle and double signals are handled on a port by port basis for the irNetBox rather than at a device level.
  • Numerous other small bug fixes.
V3.10 – 9 September 2013
  • Supports the new XPort-05 (firmware X9). Further information on this is available here.
  • Improved exception handling with some network I/O.
  • irNetBox feature discovery can take place via TCP in addition to UDP.
  • Various other small bug fixes.
V3.05 – 28 June 2012
  • With long IR signals output via a RedRat3, the USB timeout is now adjusted automatically to prevent a comm timeout error.
  • With long IR signals sent via an irNetBox-III using asynchronous mode there were also comm timeout problems, so this has now been fixed.
  • The object controlling an irNetBox-III can now only have one instance of an AsyncOutputManager object.
V3.04 – 30 May 2012
  • Can read setup information of an irNetBox if UDP blocked on a network, falling back to use TCP instead.
  • Fixed typo in name of event IRedRat4.IROuputsChanged -> IROutputsChanged. (May break code!)
  • Registry storage of device properties made more generic so that RedRat.dll will run on Mono.
  • Various minor bug fixes.
V3.02 – Oct 2011
  • Moved to .NET 3.5.
  • COM API removed, so use and deployment much simplified.
  • Removed dependency on DriverWrapper.dll, so pure .NET assembly.
  • Can be used in applications targeting both x86 and x64 platforms.
  • The original EzUSB.sys device driver for older RedRat3 devices no longer supported. Use instead the newer CuUSB.sys device driver which now supports the old RedRat3 (V3.4.4 onwards).
  • USB RedRat device naming changed to RedRat-N, which is common to MK-I and MK_II RedRat3s.
  • Moved registry key storage of device information from HKLM to HKCU so that there are no warnings when RedRat code is run on Vista and Win7 in non-Admin mode.
  • Added support for the irNetBox-III.
V2.30 – 19 Oct 10
  • If an irNetBox is discovered twice (e.g. two network cards in PC) then only one is added to list of devices.
  • RedRat lookup and irNetBox output group lookup is now case insensitive.
  • Fixed bug that sometimes caused all irNetBox outputs in an output group to be all set to low power.
  • IROutputState for the USB irNetBox has now been implemented.
  • If a very long signal (or one with many repeats) is output via an IP irNetBox, the timeout will be automatically adjusted so that no premature timeout takes place.
V2.23 – 12 Oct 09
  • Improved output power level selection for irNetBox-II, including a couple of small bug fixes. For reliable operation on the irNetBox-II, please update to firmware version 2.03IP or higher.
  • Assembly versioning incorrect in SDK V2.22, which has been corrected here.
V2.22 – 7 Oct 09 (includes V2.21 changes)
  • Supports RR3-II high speed capture mode for IR signals; standard and Keyboard Modulated Signals.
  • Fixed bug when exporting irNetBox IR signal data blocks with more than 16 length values.
  • XMP1SignalKey object’s comparison method now looks as XMP1 signal TAG and OWNER fields.
  • Added support for using RedRat hardware attached to remote machines using RR-Multiplexer code.
  • RedRat4XPortDeviceInfo now gives product name as ‘irNetBox-IP’ or ‘irNetBox-II-IP’.
  • Due to the expanding number of hardware variants, have completely redesigned the LocationInfo.RedRatType enumeration. It is now ‘flags’ based, so can give information such as ‘RedRat3 | MKII’. This may require changes to application code.
  • All device finder methods now return LocationInfo objects rather than string names.This may require changes to application code.
  • Added further support for irNetBox-II output power levels:
    • IROutputChangedEventArgs now uses power state rather than just boolean values.
    • IROutputGroup also uses the OutputPower enumeration rather then bool on/off values.
  • COM API supports the use of the USB irNetBox-II.
  • Many other bug fixes and small improvements.
V2.20 – 8 May 08
  • Supports RedRat3-II, i.e. MK-II versions.
  • DoubleSignal.SignalLength() returns the length of the longest signal, rather than 0.0.
  • RedRat3USBImpl: When RCOneShot was set, and there was an error when disabling the RC detector then a background, unhandled exception would be generated. This now fails quietly.
  • RedRat4 XPorts IP versions can now be set as being found directly by IP address.
V2.06 – 1 Feb 08
  • Minimum fuzz length on RedRat3 can now be set to 0 when used with Firmware V0.33 or greater. This gives faster length processing on signal input.
  • Added XMP-1 signal decoding.
  • Added RC5 signal generation from system/command codes.
  • Added DO_TOGGLE_TIMEOUT to SignalDataCache so that the A signal will always be used following a certain timeout period.
  • RegistryKeyValue code changed to open HKLM reg entries as read-only if it can’t open as read/write.
  • CCWRedRat3 & CCWRedRat4: Learning signal input, when cancelled or timeout, the event wasn’t passed through the CCW layer, so never arrived.
  • Fixed bug not allowing DoubleSignals to be output via ‘fastpath’ COM API OutputSignal().
  • Allow DB XML file to be opened read-only mode through the COM interface.
  • When a RedRat3 was unplugged while the RC detector was enabled, exceptions would be generated in a very tight loop, causing high CPU and memory usage. This has now been throttled.
V2.05 – 25 June 07
  • Added a function to COM interface to allow unhooking of RedRat events prior to application shutdown. This prevents a COM error raised when the application is closed. See VB6 sample for details.
V2.04 – 12 June 07
  • Ported the SDK to .NET 2.0
  • Added support for USB irNetBox
  • The irNetBox can now output flash type IR signals
  • Changes to SDK to support Vista
  • Improvements to the Macro code
  • Small improvements to irNetBox connection management
  • Supports easier use of a “default” RedRat rather than a named one in applications.
  • CCWDoubleModulatedSignals can now be added to IR databases via the COM API
  • Various minor bug fixes.
V1.24 – 25 April 07
  • Fix a bug in the signal decoder improving its accuracy.
  • Added support for the output of DoubleSignals via the COM API.
V1.23 – 8 Nov 06
  • Added some additional synchronization and fixes for multi-threaded use.
  • RRUtil.PrintFoundRedRat3s() includes the location name in the detail it prints.
  • Fixed some bugs with signal decoding – create & decode delta.
  • Fixed RedRatNameToLocInfo() – would not return information if a full lookup had not been made.
  • Added support for XPort-03 “X5” (i.e. XPort firmware 6.X).
  • Validates the X5 version of the XPort is in an irNetBox, i.e. looks for the RedRat ID in XPort setup records.
V1.22 – 4 Dec 05
  • Default signal decoder still not always picked up. Now fixed.
  • On RR3 object initialisation, do not now insist on reset of endpoint 2. If another application was inputting via this RR3 it meant that this second application could not start.
  • Added a connection state change event to the RedRat4StreamIOImpl.
  • Fixed bug with signal memory allocation on irNetBox on re-connect following connection loss.
To V1.21 – 31 July 05
  • Added support for keyboard type modulated signals, i.e. 3-part. This needs RR3 firmware V0.27 or later.
  • USB vendor request failures now throw a VendorRequestedFailedException.
  • Can specify what types of RedRat hardware to find in lookup.
  • Minor improvements in TCP connection to irNetBox.
  • Fixed bug in RR4 signal input – connection monitor thread has to be stopped.
  • NO_SIGNAL_DATA error message from RedRat3 added.
  • In RR3USBImpl, for IR signal output lock EP0 over BulkOut data output operation so that no additional commands are sent between bulk out and output signal vendor command.
  • Put lock release in bulk out in finally clause.
  • A couple of minor bug fixes to RedRat2 signal conversion.
  • Added VirtualRR2 class for mapping RedRat2 calls to the RedRat3. Plus CCW code.
  • Added the [N] command to the VirtualRR2 to obtain the serial number.
  • Added plugin structure for signal decoders.
  • Fixed a bug in the signal decoding.
  • Added the support for being able to change the RC-Correction per device fro signal decoding.
  • Locates irNetBoxes using the XPort with firmware type “X2” as well as “X1”.
  • COM interface now supports the use of DoubleSignals.
V1.17
  • Fixed concurrency issues in the output of macros to irNetBoxes.
  • Added queuing for macro output.
  • Improved the runtime. Some applications developed with the SDK did not work correctly when installed with the runtime. This has now been fixed.
V1.16
  • Fixed a memory leak in the caching of output IR signal data which crops up in some circumstances.
  • Added IrDa-like IR signal support for the irNetBox (RedRat4).
  • Improved lookup and network connection handling for irNetBox.
  • Added some support for the old RedRat2.
V1.11
  • First bug fix in RedRat4 COM interface.
V1.10
  • Major change: First version of irNetBox (RedRat4) support. Not yet documented.
  • Pronto conversion can now take “5000” type pre-defined signals.
  • Added support for “DoubleSignals”, i.e. when a single remote button sends two alternating signals.
  • Added support for “KeyboardSignals”, i.e. when a single button has different press and release signals.
  • One bug fix in RedRat3 COM interface.
V1.00
  • Moved to V1.00 as the Microsoft installer manages versions better when greater than 1.00.
  • Added support for the Philips Pronto signal data.
  • Fixed a bug that can cause deadlock with rapid switching on/off of RC detector
V0.20
  • Minor upgrade fixing a problem with CCWAVDeviceInfo struct in the COM API.
V0.19
  • Added additional methods to COM API for AVDevice DB management, i.e AddAVDevice(), RemoveAVDevice(), Get/SetAVDeviceInfo().
V0.18
  • Added to/from XML methods for IrDaPacket on both .NET and COM APIs.
  • Added GetDeviceNames() and GetSignalNames() to signal DB COM API.
V0.17
  • Added support for IrDa-like signals (Telewest and some NTL boxes in UK). Need to upgrade firmware to 0.17 or later for this.
  • Added timestamp info. to incoming signal events.
  • COM API now uses SAFEARRAYs for passing arrays of primitive types and structs.
V0.16
  • Moved to the .NET Framework 1.1.
V0.15
  • Added method to COM API for saving signal DBs.
  • Fixed a bug in “learning” signal input in CCW API.
V0.14
  • Fixed to work with Windows 98.
  • Concurrency mechanisms only worked for one RedRat3 per machine. Fixed to work with all RedRats on machine.
  • On IR signal output, the RedRat3 is now first checked to determine whether sufficient memory has been allocated to hold all signal data.
  • Added a simple ModulatedSignal.CompareSignal() for simple checking of approximate signal equivalence.
V0.12
  • This version of the SDK incorporates many changes for resource locking and synchronization of concurrent RedRat3 access from multiple threads or processes. To use this version of the SDK (or later) you will have to update your RedRat3 firmware to version 0.14 (or later) as some aspects of the USB device to host communication have changed.
V0.11
  • De-coupled incoming remote control signal events from event processing, i.e. added an incoming signal queue.
  • Improved signal decoding algorithm to use scores to rank multiple positive hits.
  • Fixed remote control detector usage when the PC goes into standby.
  • Updated CCW interface for addition and deletion of signals from signal database.