while learning commands, call SendRemoteCommand ?

Software related support

Moderator: marcus

while learning commands, call SendRemoteCommand ?

Postby Fischer » Sat 17. Jan 2009, 09:55

Hello,
i have an itrans usb.

In a multi thread environment,
is is possible to call LearnIRCode() in one thread, to learn some ir commands coming from a Remote Com,
and calling SendRemoteCommand() in an other thread ?

If it is not clear, ask some question please.
Thanks
Regards
Fischer
 
Posts: 31
Joined: Thu 20. Nov 2008, 18:16

Re: while learning commands, call SendRemoteCommand ?

Postby IRTrans » Sat 17. Jan 2009, 15:01

Hi,
that is not possible - the IRTrans Device cannot send codes while it is learning.

Furthermore the irserver not multithreaded either.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: while learning commands, call SendRemoteCommand ?

Postby Fischer » Sat 17. Jan 2009, 15:48

Hello,

lets suppose i am calling LearnIRCode() with a long time out,
is it possible to force to end this call, result can be "Timeout" ?

With your "irtrans client" it is possible to finish learning with the button "Finish learning" !!

thanks
Fischer
 
Posts: 31
Joined: Thu 20. Nov 2008, 18:16

Re: while learning commands, call SendRemoteCommand ?

Postby IRTrans » Sat 17. Jan 2009, 20:42

Hi,
internally there is a call to abort learning (however, I don't think the GUI Client uses it).

The Call is not available in the APIs. Which API are you using ?

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: while learning commands, call SendRemoteCommand ?

Postby Fischer » Sat 17. Jan 2009, 21:29

hello, i use irtrans.h api (see below) :
however gui client is able to interrupt leaarning process.


IRTRANSDLL_API int ConnectIRTransServer (char host[],SOCKET *sock);
IRTRANSDLL_API void DisconnectIRTransServer (SOCKET serv);
IRTRANSDLL_API NETWORKSTATUS *LearnIRCode (SOCKET serv, char rem[],char com[],unsigned short timeout);
IRTRANSDLL_API NETWORKSTATUS *LearnRepeatIRCode (SOCKET serv, char rem[],char com[],unsigned short timeout);
IRTRANSDLL_API NETWORKSTATUS *SendRemoteCommand (SOCKET serv, char rem[],char com[],int mask,int LEDSel,int bus);
IRTRANSDLL_API NETWORKRECV *ReceiveIR (SOCKET serv);
IRTRANSDLL_API NETWORKSTATUS *ReloadIRDatabase (SOCKET serv);
IRTRANSDLL_API int GetDeviceStatus (SOCKET serv, void *result);
IRTRANSDLL_API int GetDeviceStatusExN (SOCKET serv, int offset,void *result);
IRTRANSDLL_API NETWORKSTATUS *SendRemoteCommandEx (SOCKET serv, char rem[],char com[],word mask,byte LEDSel,byte bus);
IRTRANSDLL_API NETWORKSTATUS *SendCCFCommand (SOCKET serv, char ccfstr[],byte repeat,word mask,byte LEDSel,byte bus);
IRTRANSDLL_API NETWORKSTATUS *SendCCFCommandLong (SOCKET serv, char ccfstr[],byte repeat,word mask,byte LEDSel,byte bus);
IRTRANSDLL_API int GetRemotes (SOCKET serv,int16_t offset,REMOTEBUFFER *rem);
IRTRANSDLL_API int GetCommands (SOCKET serv,char rem[],int16_t offset,COMMANDBUFFER *com);
Fischer
 
Posts: 31
Joined: Thu 20. Nov 2008, 18:16

Re: while learning commands, call SendRemoteCommand ?

Postby IRTrans » Sat 17. Jan 2009, 23:04

Well, the GUI Client is not interrupting the Learn process.

If you close the learn dialog while learning a command it will get a timeout error AFTER the learn timeout expired ...

We will see if we can add a cancel for learn commands in a future release of the DLL.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: while learning commands, call SendRemoteCommand ?

Postby IRTrans » Sat 17. Jan 2009, 23:12

Hi,
I just rechecked it: There is no way to interrupt an active learn command.

The reason is, that the irserver is a singlethreaded application that is waiting for the learn result until the timeout expires.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: while learning commands, call SendRemoteCommand ?

Postby Fischer » Thu 29. Jan 2009, 23:18

hello,
concerning interrupting learning function, do you plane to do it it the future ?

How can i use NETWORKRECV *ReceiveIR (SOCKET serv) ?
Where can i retrieve the result/data ?


I have a question, little tricky, ...

lets say irtrans is in listening mode,
this means that he is able to listen all ir commands comming from ir remote commands : tv, recorder, ..
If it receives ir commands, it sends to my client.
My client analyses the command and if the ir command is coming from "the blue button of the tv remote command" i will do some specific action.
I assume that this mode is able to listen/spy the ir command comming from anywhere.
Is this possible ?
I hope i was clear in my request.

Regards
Fischer
 
Posts: 31
Joined: Thu 20. Nov 2008, 18:16

Re: while learning commands, call SendRemoteCommand ?

Postby IRTrans » Fri 30. Jan 2009, 00:38

Hi,
currently we do not have any plans to change the way the learning process works. Changing that would mean to change the whole structure of the server
as multiple threads would be needed.

NETWORKRECV *ReceiveIR (SOCKET serv) will give you back any received IR Code in the NETWORKRECV structure. If the code can be mapped
it will contain the name of the remote and command. Please note that this is not like learning an IR Code - only the data information is returned
and no timing data.

This call will allow you to analyze received IR Commands. Please note that this call will block until an IR Code is received.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32


Return to Software

Who is online

Users browsing this forum: No registered users and 51 guests