I see this is a few months old but it just popped up in a Google search I was doing for another project. Anyway, if it helps, I have recently partially updated my old USBUIRT library which would be much easier to use I believe. Support for the USBUIRT had gone away for a few years but there is a Windows 10 64 bit driver available on the website now.
I say partially updated because I had help converting parts of in into unicode but not all. The non unicode parts will have chinese characters in the captured IR codes but these codes can be transmitted and received just the same.
I have some sample scripts I can post with this if there is still any interest. I likely should just make a new post on the forum.
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;;; USB-UIRT Functions Library ;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Completed by Specter333 (I'm only half evil) ;
; Based almost entirely on the work of Laszlo, cynopsys and Thracx. I would have never been able to ;
; complete this if not for them getting it as far along as they did. Thank You. ;
; http://www.autohotkey.com/forum/viewtopic.php?t=43255&start=0 ;
; ;
; USB-UIRT developed by Jon Rhees, http://www.usbuirt.com/. ; ;
; A large database of IR remote codes can be found here; ;
; http://files.remotecentral.com/ ;
; Test these remote codes by copying them into the edit window of the Transmit IR example script. ;
; ;
; Once installed the uuirt.dll should be in C:\WINDOWS\system32\ ;
; Example scripts and USB-UIRT developer info located at bottom. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/*
USB-UIRT Functions
USBUIRT_LoadDLL() Opens communication with the USB-UIRT.
USBUIRT_ReleaseDLL() Terminates communication with the USB-UIRT.
USBUIRT_ReceiveIR() Receives IR codes suitable for use as a label.
USBUIRT_SendIRRaw(IRCode) Sends IR code stored in parameter in UIRT-native STRUCT or RAW format.
USBUIRT_SendIRPronto(IRCode) Sends IR code stored in parameter in Pronto format.
USBUIRT_DriverInfo() Retrieves driver version.
USBUIRT_HardwareInfo() Retrieves the USB-UIRT's firmware version, protocol version and firmware install date.
USBUIRT_ConfigInfo() Retrieves the USB-UIRT's configuration settings.
USBUIRT_SetConfig(config) Change the configuration.
USBUIRT_LearnRaw() Learn an IR code from a remote control and save in Raw format.
*/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Load the DLL.
USBUIRT_LoadDLL(){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
DllCall("LoadLibrary", Str,"C:\WINDOWS\system32\uuirtdrv.dll")
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Release the DLL.
USBUIRT_ReleaseDLL(){
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTClose", UInt,hndl)
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Receive IR codes for use as labels.
; Functioning but incomplete
USBUIRT_ReceiveIR(){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
getAirIrCodeAddress := RegisterCallback("USBUIRT_AirCode")
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTSetReceiveCallback", UInt, hndl
, UInt, getAirIrCodeAddress ; Address of received IR code.
, Str, Userdata) ; This parameter is useful for carrying context information, etc.
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
USBUIRT_AirCode(IrEventStr,Data){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
VarSetCapacity(IrCode, 2048)
DllCall("lstrcpy", Str, IrCode, UInt, irEventStr) ; Copy the string into the script's variable.
VarSetCapacity(IrCode, -1) ; Update the variable's internally-stored length to reflect its new contents.
If IsLabel(IRcode)
GoSub, %IRcode%
retcode := NumGet(IRcode,0) "-" Userdata
Return retcode
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Transmit an IR code for UIRT-native STRUCT or RAW.
; Unicode Version
USBUIRT_SendIRRaw(IRCode){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTTransmitIR", UInt,hndl
, "Ptr", &IRCode ; Variable containing IR code to transmit
, Int, 0x00 ;Codeformat (UUIRT: 0, UIRT-native STRUCT or RAW: 0x0000)
, Int, 1 ; repeatCount
, Int, 100 ; inactivityWaitTime ms
, Int, 0 ; HANDLE hEvent to signal code sent
, UInt, 0, UInt, 0) ; reserved
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
/*
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Transmit an IR code for UIRT-native STRUCT or RAW.
USBUIRT_SendIRRaw(IRCode){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTTransmitIR", UInt,hndl
, Str, IRCode ; Variable containing IR code to transmit
, Int, 0x00 ;Codeformat (UUIRT: 0, UIRT-native STRUCT or RAW: 0x0000)
, Int, 1 ; repeatCount
, Int, 100 ; inactivityWaitTime ms
, Int, 0 ; HANDLE hEvent to signal code sent
, UInt, 0, UInt, 0) ; reserved
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
*/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Transmit an IR code for PRONTO.
; Unicode Version
USBUIRT_SendIRPronto(IRCode){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTTransmitIR", UInt,hndl
, "Ptr", IRCode ; Variable containing IR code to transmit
, Int, 0x10 ;Codeformat (UUIRT: 0, PRONTO: 0x0010)
, Int, 1 ; repeatCount
, Int, 100 ; inactivityWaitTime ms
, Int, 0 ; HANDLE hEvent to signal code sent
, UInt, 0, UInt, 0) ; reserved
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
/*
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Transmit an IR code for PRONTO.
USBUIRT_SendIRPronto(IRCode){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTTransmitIR", UInt,hndl
, Str, IRCode ; Variable containing IR code to transmit
, Int, 0x10 ;Codeformat (UUIRT: 0, PRONTO: 0x0010)
, Int, 1 ; repeatCount
, Int, 100 ; inactivityWaitTime ms
, Int, 0 ; HANDLE hEvent to signal code sent
, UInt, 0, UInt, 0) ; reserved
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
*/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Retrieve Driver Information.
USBUIRT_DriverInfo(){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
VarSetCapacity(vers,12)
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTGetDrvInfo", UIntP,vers) ; Current driver version
drvvers := NumGet(vers,0)
Return vers
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Retrieve Hardware Information
USBUIRT_HardwareInfo(){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
VarSetCapacity(uInfo,12)
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTGetUUIRTInfo", UInt, hndl
, UInt, &uInfo) ; String containing USB-UIRT hardware information.
fwVersion:= NumGet(uInfo,0)"," ; Firmware Version
ProtocolVersion:= NumGet(uInfo,4)"," ; Protocol Version
FW_DMY:= NumGet(uInfo,9,"UChar") "/" NumGet(uInfo,8,"UChar") "/" NumGet(uInfo,10,"UChar")+2000 ; Firmware install date.
Return fwVersion ProtocolVersion FW_DMY
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Get Current Configuration Info
USBUIRT_ConfigInfo(){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
VarSetCapacity(uInfo,12)
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTGetUUIRTConfig", UInt, hndl
, UInt, &uInfo) ; Current configuration number. See "Set Configuration" below for numbers.
cinf:= NumGet(uInfo)
Return cinf
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Set Configuration
USBUIRT_SetConfig(config){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTSetUUIRTConfig", UInt, hndl
, UInt, config) ; 1 = Blink on receive, 2 = Light on Transmit, 3 = Generate Legacy codes
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
} ; Add numbers together to combine configuration settings. ie, 3 = Blink on receive and light on transmit.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Unicode version
USBUIRT_LearnRaw(){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
VarSetCapacity(IRcode, 2048)
abort = 0
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTLearnIR", UInt,hndl
, Int, 0x100 ; codeFormat: UUIRTDRV_IRFMT_LEARN_FORCERAW
, "Ptr", &IRCode ; the received code
, UInt, CBfunc ; PLEARNCALLBACKPROC progressProc --------------- Not yet implemented
, Str, "Userdata" ; *userData: passed by the USB-UIRT driver to progressProc calls
, UIntP, abort ; *pAbort set to 1 in another thread: requests abort --- Not yet implemented
, UInt, 0 ; param1 = forced frequency
, UInt,0, UInt,0) ; reserved
Return StrGet(&IRCode, "CP0") "-" Userdata
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
/*
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Learn IR Code, Raw Format
; Functioning but incomplete
USBUIRT_LearnRaw(){
currentbatch = %A_BatchLines%
curentwind = %A_WinDelay%
SetBatchLines -1
SetWinDelay -1
hndl := DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTOpen")
VarSetCapacity(IRcode, 2048)
abort = 0
DllCall("C:\WINDOWS\system32\uuirtdrv.dll\UUIRTLearnIR", UInt,hndl
, Int, 0x100 ; codeFormat: UUIRTDRV_IRFMT_LEARN_FORCERAW
, Str, IRCode ; the received code
, UInt, CBfunc ; PLEARNCALLBACKPROC progressProc --------------- Not yet implemented
, Str, "Userdata" ; *userData: passed by the USB-UIRT driver to progressProc calls
, UIntP, abort ; *pAbort set to 1 in another thread: requests abort --- Not yet implemented
, UInt, 0 ; param1 = forced frequency
, UInt,0, UInt,0) ; reserved
Return IRCode "-" Userdata
SetBatchLines %currentbatch%
SetWinDelay %curentwind%
}
*/