Managing multiple USB-UIRT in c#

Interested in integrating USB-UIRT support into an application? Look here!

Moderator: jrhees

Managing multiple USB-UIRT in c#

Postby thibault2405 » Thu Feb 09, 2006 3:44 pm

Hello,

Is anybody succeded in the way of managing multiple USB-UIRT with the managed Wrapper in c#, or the DLL in Visual Basic ?

If so, I would be interested to know how to.

Regards.

Thibault.

I have the code in c++ but don't know how to write it in C# or VB.

UUIRTDRV_API HUUHANDLE PASCAL UUIRTOpenEx(char *devName, DWORD dwFlagsAndAttributes, void *reserved0, void *reserved1);

typedef HUUHANDLE (WINAPI *pfn_UUIRTOpenEx) (char *devName, DWORD dwFlagsAndAttributes, void *reserved0, void *reserved1);


Handle = UUIRTOpenEx("USB-UIRT", 0, NULL, NULL); for the normal unit

Handle2 = UUIRTOpenEx("USB-UIRT-2", 0, NULL, NULL); for the second unit, Etc
thibault2405
 
Posts: 1
Joined: Thu Feb 09, 2006 2:37 pm

Postby avalanche333 » Fri Feb 15, 2008 3:54 pm

Can anyone confirm that the C++ code posted below works?

I am trying the following and it is still sending to all IR Blasters:

Code: Select all
JNIEXPORT jboolean JNICALL Java_com_tvworks_tools_PersonalKeyserver_IR_USBUIRTCommunicator_transmitIREx( JNIEnv *env, jobject obj, jstring irCode, jstring deviceName )
{
   jboolean      retVal= JNI_FALSE;
   if (hinstLib != NULL)
   {
      /* Convert to a usable C string */
      char *pIRCode = (char*) (*env).GetStringUTFChars( irCode, 0 );
      char *pDeviceName = (char*) (*env).GetStringUTFChars( deviceName, 0 );
      if( pIRCode != NULL ) {
         HUUHANDLE handle = fnUUIRTOpenEx(pDeviceName, 0, NULL, NULL);
         BOOL bTransmitOK = fn_UUIRTTransmitIR(handle, pIRCode, UUIRTDRV_IRFMT_PRONTO, 1, 0, NULL, NULL, NULL);
         if (bTransmitOK) {
            retVal = JNI_TRUE;                                                 
         }
         fnUUIRTClose(handle);
      }                                                                           

      /* Free as a bird.... */                                               
      (*env).ReleaseStringUTFChars( irCode, pIRCode );
      (*env).ReleaseStringUTFChars( deviceName, pDeviceName);
   }                                                                             
   return retVal;                                                               
}
[/code]
avalanche333
 
Posts: 8
Joined: Tue Feb 12, 2008 7:21 pm

Postby avalanche333 » Fri Feb 15, 2008 4:05 pm

My bad, this does actually work. Because the IR blasters were so close to each other, one blaster was picking up the signal of the other and flashing. Once I moved them far enough apart I could see it working properly.
avalanche333
 
Posts: 8
Joined: Tue Feb 12, 2008 7:21 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 0 guests