Problem coding IRCode with UUIRTTransmitIR in perl

Hello !
I am trying to create a program in perl for IR transmit with my USB-UIRT.
I use Active Perl 5.8 (downloaded from www.activestate.com in msi format)
with Win32-API package (to install it, launch ppm and type : Install Win32-API)
My first program is :
Work nice !
Now, I wish to transmit some IR code to my USB-UIRT
For the test I use a simple IR code (channel change on my TV) in pronto format.
I add this code in the middle of my program :
But that doesn't work. It always return ERROR.
In fact if I put 0 in $intcodeFormat the program work, the UIRT LED blink, but nothing occurs on my TV.
What's wrong ?
What is the correct intcodeFormat for Pronto format ?
Thank's if you can help me...
Christophe
I am trying to create a program in perl for IR transmit with my USB-UIRT.
I use Active Perl 5.8 (downloaded from www.activestate.com in msi format)
with Win32-API package (to install it, launch ppm and type : Install Win32-API)
My first program is :
- Code: Select all
use Win32::API;
Win32::API::Type->typedef("HUUHANDLE","PHANDLE");
Win32::API->Import("uuirtdrv","HUUHANDLE UUIRTOpen()");
Win32::API->Import("uuirtdrv","BOOL UUIRTTransmitIR(HUUHANDLE hHandle, PCHAR IRCode,
INT codeFormat, INT repeatCount, INT inactivityWaitTime,
HANDLE hEvent, PVOID reserved0, PVOID reserved1)");
Win32::API->Import("uuirtdrv","BOOL UUIRTClose(HUUHANDLE hHandle)");
$uirt = UUIRTOpen();
if ($uirt ne -1) {
print "USB-UIRT Opened\n";
# ...
UUIRTClose($uirt);
} else {
print "Error opening USB-UIRT\n";
}
Work nice !
Now, I wish to transmit some IR code to my USB-UIRT
For the test I use a simple IR code (channel change on my TV) in pronto format.
I add this code in the middle of my program :
- Code: Select all
$IRCode = "0000 0072 0000 000D 0020 0021 0020 0021 0040 0021 0020 0021 0020 0021 0020 0021 0020 0021 0020 0021 0020 0021 0020 0021 0020 0021 0020 0041 0020 0CAE";
$intcodeFormat = 2;
$repeatCount = 1;
if (!UUIRTTransmitIR($uirt,$IRCode,$intcodeFormat,$repeatCount,0,0,$reserved0,$reserved1)) {
print("ERROR\n");
} else {
print("OK\n");
}
But that doesn't work. It always return ERROR.
In fact if I put 0 in $intcodeFormat the program work, the UIRT LED blink, but nothing occurs on my TV.
What's wrong ?
What is the correct intcodeFormat for Pronto format ?
Thank's if you can help me...
Christophe