RedRat RedRat-X Скачать руководство пользователя страница 7

rrx.Connect(); 

        

// Use the RRX a bit

 

Console

.WriteLine( 

$"Using RedRat-X '

{rrxLi.Name}

'"

 ); 

Console

.WriteLine( 

$"Firmware version: 

{rrx.FirmwareVersion}

"

 ); 

 

// Blink the lights a few times

 

Console

.WriteLine(

"Blinking the LEDs..."

); 

for

 ( 

var

 i = 0; i < 5; i++ ) 

rrx.Blink(); 

Thread

.Sleep( 750 ); 

 

rrx.Disconnect(); 

6.3

 

IR Signal Output 

The RedRat-X has four IR outputs, which in code are referred to as outputs 1 to 4: 
 

Output Number 

Function 

Output port 1 on back of case 

Output port 2 on back of case 

Output port 3 on back of case 

Front IR blaster 

 

6.3.1

 

Using the Front IR Blaster 

To make the API’s use similar to that of the RedRat3-II, if no output ports are enabled and the simple 
synchronous 

OutputModulatedSignal

 method is used, this will transmit the signal via the front blaster. 

 

// Output an IR signal via the blaster

 

       rrx.OutputModulatedSignal( sig ); 
       

Console

.WriteLine( 

"IR out via blaster using sync API" 

); 

 
The async API can also be used where higher IR output throughput is required and concurrent IR 
transmission is needed from the rear IR ports and the blaster. The code below will output an IR signal 5 
times from the front blaster: 
 

// Using the ASYNC API, all ports need to be explicitly set

 

var

 opList = 

new

 

OutputList

 { 

new

 

OutputPort

RedRatX

.IR_BLASTER_PORT, 60 ) }; 

var

 mutex = 

new

 

ManualResetEvent

(

false

); 

 

for

 (

var

 i = 0; i < 5; i++) 

rrx.OutputIRPacketAsync(GetSignal(), opList, 100, 

null

, ar =>              

Console

.WriteLine(

$"IR out via blaster using async API."

); 

mutex.Set(); 

}); 

 

mutex.WaitOne();      

// Wait for IR output completion

 

Thread

.Sleep(750);    

// Wait a bit longer

 

Содержание RedRat-X

Страница 1: ...The RedRat X Integration Guide ...

Страница 2: ...ub Sending Commands from Applications 5 6 Using the RedRat SDK 6 6 1 RedRat X Discovery 6 6 2 Simple Communication Tasks 6 6 3 IR Signal Output 7 6 3 1 Using the Front IR Blaster 7 6 3 2 Using the Rear IR Ports 8 6 4 IR Signal Input 8 6 4 1 The Wide Band Detector 8 6 4 2 The Narrow Band Detector 9 6 5 Handling USB Plug Events 10 7 Porting RedRat3 II Applications to the RedRat X 11 7 1 USB Device D...

Страница 3: ...Ds indicate the operational state of the unit please see the User Guide for details The LED colour and brightness are also adjustable via software control so applications can use this to indicate the state or provide feedback 2 2 Rear USB The RedRat X is powered via its USB port This can be connected to a computer and in which case USB will also be used to control the unit Network Ethernet control...

Страница 4: ...ther RedRat applications and with the SDK The IR data can also be exported in other formats for use in different applications or on different platforms 3 3 RedRat Scheduler If it is necessary to setup a set of remote control operations to happen at particular times then the Scheduler application can be used to do this Individual signals or short sequences of signals macros can be programmed to be ...

Страница 5: ...WPF will not run on Linux or Macs though developing cross platform GUI applications is a potential future area of development With the RedRat X both USB and network communication is supported on Windows and Linux 5 RedRat Hub Sending Commands from Applications RedRat Hub provides perhaps the most straightforward mechanism for integrating RedRat devices with third party software When RedRat Hub sta...

Страница 6: ...st There are a number of ways to do this or do selective searches but perhaps the most straightforward way to find all RedRat Xs is var rrxLis RRUtil FindRedRats LocationInfo RedRatType RedRatX A list of generic LocationInfo objects are returned which contain details about the RedRat device This search will take a few seconds to return as it waits for responses from the network broadcast If only U...

Страница 7: ...mple synchronous OutputModulatedSignal method is used this will transmit the signal via the front blaster Output an IR signal via the blaster rrx OutputModulatedSignal sig Console WriteLine IR out via blaster using sync API The async API can also be used where higher IR output throughput is required and concurrent IR transmission is needed from the rear IR ports and the blaster The code below will...

Страница 8: ...mple except the rear IR ports are selected rather than the front blaster 6 4 IR Signal Input As with the RedRat3 II device the RedRat X has two IR detectors for different purposes as described below 6 4 1 The Wide Band Detector This allows the device to sample the raw IR signal so is used for IR signal capture learning It is fairly short range in operation the recommended distance being between 1m...

Страница 9: ...g code to use the narrow band detector is quite similar to the wide band except that the detector is turned ON for the duration of the period it is in use During this period any number of input events may be received depending on how often the RCU buttons are pressed or what other IR noise may appear as data EventHandler rcDetectorSignalInHandler s ea var siea ea as SignalEventArgs if siea null re...

Страница 10: ... find the RR X that has just been plugged in var xLis RRUtil FindRedRats LocationInfo RedRatType RedRatX_USB OfType RedRatXUsbLocationInfo var xLi usbLis FirstOrDefault li li SerialNumber args deviceSerialNumber Console WriteLine Plugged in device is xLi Name This is then wired up to the UsbPlugHandler object Add plug unplug handler UsbPlugHandler Instance UsbPlugEvent usbPlugHandler Console Write...

Страница 11: ...ole WriteLine No USB RedRat devices found return Where lis is a list of LocationInfo objects i e objects describing the device and its location Code developed for the RedRat3 II device will use the IRedRat3 interface which is also implemented by the RedRat X So by creating an object of this type it can be used regardless of whether the underlying implementation is a RedRat3 II or RedRat X IRedRat3...

Страница 12: ... can host one RF module currently either a Bluetooth Classic and Low Energy module or an RF4CE module As Bluetooth and RF4CE control of TVs and STBs is more complex than using infrared remote control it is not done via APIs in the RedRat dll but using our Toolbox applications and HTTP REST API In addition there is no generic standard for either Bluetooth or RF4CE in that each type of TV or STB has...

Отзывы: