USB IR Remote Receiver (AVR Multiprotocol Receiver) DLL description

 

Function prototypes in "USB IR Remote Receiver.dll" library:

The DLL will handle the communication between the HID AVR device and the host.
The USB IR Remote Receiver DLL can be used directly with DVBViewer in the '\Plugins' directory as input plugin.
The USB IR Remote Receiver DLL can be also used directly with Girder. Tested with Girder 3.2.9 (last Freeware version), 4.0.5.2 and 5.0.10.

Also it can be used for other programs to handle the device with the functions InitNative or InitPAnsiChar.

Hardware schematic:
                    USB IR Remote Receiver

Screen shot:
                    Screen


Delphi:

const
  USBIRRemoteReceiver= 'USB_IR_Remote_Receiver.dll';

function Version():PAnsiChar; stdcall external USBIRRemoteReceiver name 'Version';
function Copyright():PAnsiChar; stdcall external USBIRRemoteReceiver name 'Copyright';
function PluginName():PAnsiChar; stdcall external USBIRRemoteReceiver name 'PluginName';
procedure ShowSettings(Handle : THandle); stdcall external USBIRRemoteReceiver name 'ShowSettings';

function InitNative(Callback : TCallbackNativeIRData):boolean; stdcall external USBIRRemoteReceiver name 'InitNative';
function InitPAnsiChar(Callback : TCallbackPAnsiChar):boolean; stdcall external USBIRRemoteReceiver name 'InitPAnsiChar';

type
    TCallbackNativeIRData = procedure(IRCode : TIRData); stdcall;

type
    TCallbackPAnsiChar = procedure(Protocol, Address, Command, Flags : PAnsiChar); stdcall;

type
    TIRData = packed record
        Protocol : byte;
        Address : word;
        Command : word;
        Flags : byte;
    end;


C++ Builder / Microsoft Visual C++:

#define USBIRRemoteReceiver    "USB_IR_Remote_Receiver.dll";

const char * __stdcall Version();
const char * __stdcall Copyright();
const char * __stdcall PluginName();
void __stdcall ShowSettings( HWND Handle );

BOOL __stdcall InitNative( CallbackNativeIRData * Callback );
BOOL __stdcall InitPAnsiChar( CallbackPAnsiChar * Callback );

typedef void ( __stdcall * CallbackNativeIRData) ( IRMP_DATA IRCode );
typedef void ( __stdcall * CallbackPAnsiChar) ( char * Protocol , char * Address , char * Command , char * Flags  );

typedef struct
{
    byte    Protocol;
    word    Address;
    word    Command;
    byte    Flags;

} IRMP_DATA;


function Version():PAnsiChar; stdcall external USBIRRemoteReceiver name 'Version';

    Function will return the plugin version as PAnsiChar.
Parameters
   none

Return values
    Function will return USB IR Remote Receiver DLL version as PAnsiChar.


function Copyright():PAnsiChar; stdcall external USBIRRemoteReceiver name 'Copyright';

    Function to get copyright of USB IR Remote Receiver DLL.
Parameters
   none

Return values
    Function will return copyright as PAnsiChar.


function PluginName():PAnsiChar; stdcall external USBIRRemoteReceiver name 'PluginName';

    Function to get USB IR Remote Receiver DLL plugin name.
Parameters
   none

Return values
 
   Function will return USB IR Remote Receiver DLL plugin name as PAnsiChar.


procedure ShowSettings(Handle : THandle); stdcall external USBIRRemoteReceiver name 'ShowSettings';

    Procedure to show options/settings dialog of USB IR Remote Receiver DLL.
Parameters
  Handle
        [in] Window handle of the calling program. The dialog will be shown modal.

Notes:
 
   The options/settings dialog will only be shown if the DLL got initialized first by InitNative / InitPAnsiChar.


function InitNative(Callback : TCallbackNativeIRData):boolean; stdcall external USBIRRemoteReceiver name 'InitNative';

    Function to init USB IR Remote Receiver for native callback.
Parameters
   Callback
        [in] Procedure pointer of a procedure of type struct TCallbackNativeIRData.

Return values
   
If the function succeeds, the return value is True.
    If the function fails, the return value is False.

Notes:
    The device get only opend if the Callback procedure pointer isn't NIL / NULL.
    For closing the device, unloading/disable the plugin call this function again with Callback = NIL / NULL.

    The defined Callback procedure will receive the IR codes like the type struct TIRData.


function InitPAnsiChar(Callback : TCallbackPAnsiChar):boolean; stdcall external USBIRRemoteReceiver name 'InitPAnsiChar';

    Function to init USB IR Remote Receiver for native callback.
Parameters
   Callback
        [in] Procedure pointer of a procedure of type struct TCallbackPAnsiChar.

Return values
   
If the function succeeds, the return value is True.
    If the function fails, the return value is False.

Notes:
    The device get only opend if the Callback procedure pointer isn't NIL / NULL.
    For closing the device, unloading/disable the plugin call this function again with Callback = NIL / NULL.

    The defined Callback procedure will receive the IR codes as Protocol, Adress, Command and Flags : PAnsiChar.


For more information see also the demo application.

Copyright © 2010  Portisch.