SendRemoteCommand() timing

The place where software developers meet

Moderator: marcus

SendRemoteCommand() timing

Postby jbroeker » Fri 6. Apr 2012, 14:15

Hi,

Did not find any detailed documentation on the timing of the SendRemoteCommand() (C DLL): When does the function return? After the command was transmitted on the IR channel or earlier?

In other words: If I want to put the maximum load on the IR channel, do I just call SendRemoteCommand() as fast as possible or do I have to add delays to ensure no commands are lost?

Best regards,

Jörg
jbroeker
 
Posts: 8
Joined: Fri 6. Apr 2012, 14:07

Re: SendRemoteCommand() timing

Postby IRTrans » Fri 6. Apr 2012, 17:00

Hi,
in general you will need to wait for the acknowledge before you can send the next command.

After you send the first command the call will return immediately, for further commands it will return after sending of the command has started.

As long as you wait for the acknowledge no command will be lost. There is no need add any additional delay.

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

Re: SendRemoteCommand() timing

Postby jbroeker » Sun 8. Apr 2012, 13:01

Hi,

Thanx for the quick response.

One more question. How do I wait for the ack? I apologize if this is a stupid question (I do not have any IRTrans documentation at hand right now).

Best regards,

Jörg
jbroeker
 
Posts: 8
Joined: Fri 6. Apr 2012, 14:07

Re: SendRemoteCommand() timing

Postby IRTrans » Mon 9. Apr 2012, 09:42

The ACK is the result code that is sent back when doing the call.

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

Re: SendRemoteCommand() timing

Postby jbroeker » Tue 10. Apr 2012, 08:48

Hi IRTrans,

Sorry, but I am afraid I do not understand. Do I have to do anything special to wait for the ACK or does the SendRemoteCommand() function return after receiving the ACK anyways?

Best regards,

Jörg
jbroeker
 
Posts: 8
Joined: Fri 6. Apr 2012, 14:07

Re: SendRemoteCommand() timing

Postby IRTrans » Tue 10. Apr 2012, 09:13

The ACK is the result code that is returned by the call. If you wait for the function to return before sending a new code everything will be fine.

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

Re: SendRemoteCommand() timing

Postby jbroeker » Tue 10. Apr 2012, 09:25

Hi IRTrans,

One more question: If I check the return code of SendRemoteCommand() like in your example (of course with the correct rem and com)

stat = SendRemoteCommand (irt_server,"sony","play",0,0,0);
if (stat) {
printf ("Error: %s\n",stat->message);
}

I always get a value stat != 0 returned (the IR command seems to be transmitted ok). The stat->message is an empty string. Is this an error or is the example missleading? Is there a documentation on the NETWORKSTATUS structure?

Best regards,

Jörg
jbroeker
 
Posts: 8
Joined: Fri 6. Apr 2012, 14:07

Re: SendRemoteCommand() timing

Postby IRTrans » Tue 10. Apr 2012, 16:59

Hmm, that is strange, normally stat should be NULL if there is no error.

I will need to check that.

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

Re: SendRemoteCommand() timing

Postby jbroeker » Thu 12. Apr 2012, 10:03

Hi IRTrans,

any news on this topic?

Best regards,

Jörg
jbroeker
 
Posts: 8
Joined: Fri 6. Apr 2012, 14:07

Re: SendRemoteCommand() timing

Postby IRTrans » Thu 12. Apr 2012, 16:10

Hi,
we have tested it here and it works as it should.

Which version of the .NET DLL are you using?

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

Next

Return to APIs

Who is online

Users browsing this forum: No registered users and 7 guests