This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Bidirectional example
#1
Hi,

There are various examples provided that show we can read from an 3rd tcp device or write to a tcp device.  I haven't seen a clear example of two way communication with a device.  Take the Denon receiver as an example, http://openrb.com/example-use-lm2-as-tcp...e-theater/

Its clear how this resident script uses an single TCP connection to update an object that shows which Source is selected or the volume level.  The Denon is capable handling a single network connection.   Which means its not possible to use an event based script for a object that would be used to set the volume of the denon.  Given that we cannot create a new connection to the denon,  the resident script should be the one that instructs the denon to change its volume. 


Thanks,

Roger
Reply
#2
Hi,

Just write value from event based to storage record.

In your resident you fetch each loop this var from storage and when changed you write it to your
tcp connection, thus way you have single connection with event based data.

BR,


Erwin
Reply
#3
Hi Erwin,

Thanks, Ok thought of that too. Was hoping that there would be an alternative. Anyway I will go with your suggestion.

Thanks,

Roger
Reply
#4
The Denon can also be controlled through http but this is not officially documented. With http one can have more than one connection.
Reply
#5
Hi,

With the TCP example is there not a way to let the TCP client talk directly with the bus, such as the group monitoring example. http://forum.logicmachine.net/showthread.php?tid=31

Thanks,

Roger
Reply


Forum Jump: