I have no time for this now, but a few months ago I checked a few funtion calls. Maybe you will find something useful in this:
Code:
#SingleInstance Force
#NoEnv
SetBatchLines -1
SetWinDelay -1
DllCall("LoadLibrary", Str,"c:\t\USB-UIRT\uuirtdrv.dll")
hndl := DllCall("uuirtdrv.dll\UUIRTOpen") ; open communication to UIRT
VarSetCapacity(IRcode, 2048)
abort = 0
DllCall("uuirtdrv.dll\UUIRTLearnIR", UInt,hndl
, Int, 0x100 ; codeFormat: UUIRTDRV_IRFMT_LEARN_FORCERAW
, Str, IRCode ; the received code
, UInt,CBfunc ; PLEARNCALLBACKPROC progressProc
, Str, "Userdata" ; *userData: passed by the USB-UIRT driver to progressProc calls
, UIntP, abort ; *pAbort set to 1 in another thread: requests abort
, UInt, 0 ; param1 = forced frequency
, UInt,0, UInt,0) ; reserved
Msgbox %IRCode%
MsgBox [%res%]`n[%ErrorLevel%]
DllCall("uuirtdrv.dll\UUIRTClose", UInt,hndl)
/*
DllCall("uuirtdrv.dll\UUIRTGetDrvInfo", UIntP,vers) ; driver vers = 256
VarSetCapacity(uInfo,12)
DllCall("uuirtdrv.dll\UUIRTGetUUIRTInfo", UInt, hndl, UInt, &uInfo)
MsgBox % "fwVersion: " NumGet(uInfo,0) "`nProtocolVersion: " NumGet(uInfo,4)
. "`nFW D/M/Y :" NumGet(uInfo,8,"UChar") "/" NumGet(uInfo,9,"UChar") "/" NumGet(uInfo,10,"UChar")
; Set non-volatile config flag: LED blinks @ signal receive + lights @ IR send
DllCall("uuirtdrv.dll\UUIRTSetUUIRTConfig", UInt,hHandle, UInt,3)
DllCall("uuirtdrv.dll\UUIRTTransmitIR", UInt,hndl, Str,"123456" ; Code to be sent
, Int, 0x10 ; Codeformat (UUIRT: 0, PRONTO: 0x0010)
, Int, 1 ; repeatCount
, Int, 0 ; inactivityWaitTime ms
, Int, 0 ; HANDLE hEvent to signal code sent
, UInt,0, UInt,0)
MsgBox [%res%]`n[%ErrorLevel%]
*/
/* USB-UIRT API: uuirtdrv.dll (www.usbuirt.com/api_example_code.zip)
c:\t\USB-UIRT\uuirtdrv.dll
UUIRTDRV_API HUUHANDLE PASCAL UUIRTOpen(void);
Opens communication with the USB-UIRT. On success, returns a handle to be
used in subsequent calls to USB-UIRT functions. On failure, returns
INVALID_HANDLE_VALUE. A call to UUIRTOpen should occur prior to any other
driver function calls (with the exception of UUIRTGetDrvInfo below).
UUIRTDRV_API BOOL PASCAL UUIRTClose(HUUHANDLE hHandle);
Terminates communication with the USB-UIRT. Should be called prior to
terminating host program.
UUIRTDRV_API BOOL PASCAL UUIRTGetDrvInfo(unsigned int *puDrvVersion);
Retrieves information about the *driver* (not the hardware itself). This is
intended to allow version control on the .DLL driver and accomodate future
changes and enhancements to the API. Returns TRUE on success, as well as a
driver version number in *puDrvVersion. NOTE: This call may be called prior
to a call to UUIRTOpen.
UUIRTDRV_API BOOL PASCAL UUIRTGetUUIRTInfo(HUUHANDLE hHandle, PUUINFO *puuInfo);
Retrieves information about the UUIRT hardware. On success, returns TRUE and
fills in the structure PUUINFO, defined as follows:
typedef struct {
unsigned int fwVersion; // version of firmware residing on the USB-UIRT.
unsigned int protVersion; // protocol version supported by the USB-UIRT firmware.
unsigned char fwDateDay; // firmware revision date
unsigned char fwDateMonth;//
unsigned char fwDateYear; //
} UUINFO, *PUUINFO;
UUIRTDRV_API BOOL PASCAL UUIRTGetUUIRTConfig(HUUHANDLE hHandle, PUINT32 puConfig);
Retrieves the current feature configuration bits from the USB-UIRT's
nonvolatile configuration memory. These various configuration bits control
how the USB-UIRT behaves. Most are reserved for future implementation and
shout be read and written as Zero. Using this API call is optional and is
only needed to support changing USB-UIRT's internal 'preferences'. Bits
defined in uConfig are as follows:
#define UUIRTDRV_CFG_LEDRX 0x01 // Indicator LED on USB-UIRT blinks when remote signals are received
#define UUIRTDRV_CFG_LEDTX 0x02 // Indicator LED on USB-UIRT lights during IR transmission.
#define UUIRTDRV_CFG_LEGACYRX 0x04 // Generate 'legacy' UIRT-compatible codes on receive
#define RESERVED0 0x08
#define RESERVED1 0x10
...
UUIRTDRV_API BOOL PASCAL UUIRTSetUUIRTConfig(HUUHANDLE hHandle, UINT32 uConfig);
Configures the current feature configuration bits for the USB-UIRT's
nonvolatile configuration memory. These various configuration bits control
how the USB-UIRT behaves. See definition of uConfig in UUIRGetUUIRTConfig
above
UUIRTDRV_API BOOL PASCAL UUIRTTransmitIR(HUUHANDLE hHandle, char *IRCode,
int codeFormat, int repeatCount, int inactivityWaitTime, HANDLE hEvent, void
*reserved0, void *reserved1);
Transmits an IR code via the USB-UIRT hardware. The IR code is a
null-terminated *string*. codeFormat is a format specifier which identifies
the format of the IRCode code. Currently, supported formats are
Compressed_UIRT (STRUCT), RAW, and Pronto-RAW. RepeatCount indicates how
many iterations of the code should be sent (in the case of a 2-piece code,
the first stream is sent once followed by the second stream sent repeatCount
times). InactivityWaitTime is the time in milliseconds since the last
received IR activity to wait before sending an IR code -- normally pass 0
for this parameter. hEvent is an optional event handle which is obtained by
a call to CreateEvent. If hEvent is NULL, the call to UUIRTTransmitIR will
block and not return until the IR code has been fully transmitted to the
air. If hEvent is not NULL, it must be a valid Windows event hande. In this
case, UUIRTTransmitIR will return immediately and when the IR stream has
completed transmission this event will be signalled by the driver. The last
parameters, labelled 'reservedx' are for future expansion and should be
NULL.
UUIRTDRV_API BOOL PASCAL UUIRTLearnIR(HUUHANDLE hHandle, int codeFormat,
char *IRCode, PLEARNCALLBACKPROC progressProc, void *userData, BOOL *pAbort,
unsigned int param1, void *reserved0, void *reserved1);
Instructs the USB-UIRT and the API to learn an IR code. The IR code learned
will be a complete IR stream suitable for subsequent transmission via
UUIRTTransmitIR. Consequently, the same formats supported by Transmit are
also available for learn. It is recommended to use either RAW or Pronto-RAW
codeFormat to offer the best compatibility; compressed-UIRT format is often
too limiting, although it does produce the smallest codes. IRCode will be
filled with the learned IR code upon return -- it is the responsibility of
the caller to allocate space for this string -- suggested string size is at
least 2048 bytes. ProgressProc is a caller-supplied callback function which
will be called periodically during the learn process and may be used to
update user dialogs, etc. Information passed to the callback are learn
progress %, signal quality, and carrier frequency. The parameter userData
will be passed by the USB-UIRT driver to any calls of progressProc. The
pAbort parameter should pass the pointer to a Boolean variable which should
be initialized to FALSE (0) prior to the call. Setting this variable TRUE
during the learn process will cause the UUIRTLearnIR process to abort and
the function to return. Since the UUIRTLearnIR function will block for the
duration of the learn process, one could set the *pAbort to TRUE either
within the callback function or from another thread. Param1 is currently
used only when the codeFormat includes the UUIRTDRV_IRFMT_LEARN_FORCEFREQ
flag (not normally needed) -- in which case param1 should indicate the
forced carrier frequency. The last parameters, labelled 'reservedx' are for
future expansion and should be NULL.
UUIRTDRV_API BOOL PASCAL UUIRTSetReceiveCallback(HUUHANDLE hHandle,
PUUCALLBACKPROC receiveProc, void *userData);
Registers a receive callback function which the driver will call when an IR
code is received from the air. receiveProc should contain the address of a
PUUCALLBACKPROC function defined as:
typedef void (WINAPI *PUUCALLBACKPROC) (char *IREventStr, void *userData);
When the USB-UIRT receives a code from the air, it will call the callback
function with a null-terminated, twelve-character (like IRMAN) ir code in
IREventStr. The driver will also pass the parameter userData, which is a
general-purpose 32-bit value supplied by the caller to
UUIRTSetReceiveCallback. This parameter is useful for carrying context
information, etc. Note that the types of codes which are passed to
IREventStr are *not* the same as the type of codes passed back from a
UUIRTLearnIR call (the codes from a UUIRTLearnIR are much larger and contain
all the necessary data to reproduce a code, whereas the codes passed to
IREventStr are simpler representations of IR codes only long enough to be
unique).
#define UUIRTDRV_IRFMT_UUIRT 0x0000 // For UIRT-native STRUCT or RAW
#define UUIRTDRV_IRFMT_PRONTO 0x0010 // For PRONTO
#define UUIRTDRV_IRFMT_LEARN_FORCERAW 0x0100
#define UUIRTDRV_IRFMT_LEARN_FORCESTRUC 0x0200
#define UUIRTDRV_IRFMT_LEARN_FORCEFREQ 0x0400
#define UUIRTDRV_IRFMT_LEARN_FREQDETECT 0x0800
Public Const INVALID_HANDLE_VALUE = -1
Public Const ERROR_IO_PENDING = 997
Public Const UUIRTDRV_ERR_NO_DEVICE= &H20000001
Public Const UUIRTDRV_ERR_NO_RESP = &H20000002
Public Const UUIRTDRV_ERR_NO_DLL = &H20000003
Public Const UUIRTDRV_ERR_VERSION = &H20000004
Public Const UUIRTDRV_CFG_LEDRX = &H1
Public Const UUIRTDRV_CFG_LEDTX = &H2
Public Const UUIRTDRV_CFG_LEGACYRX = &H4
Public Const UUIRTDRV_IRFMT_TRANSMIT_DC = &H80
*/