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.

Commands to devices over LAN
#9
Hi,

Yes, if you want to send multiple commands from a single event based script you can create a byte object and attach this script to it:
Code:
require('socket.http')
socket.http.TIMEOUT = 15
value = event.getvalue()
if value == 0 then
  socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file.mkv')
elseif value == 1 then
  socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file1.mkv')
elseif value == 2 then
  socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file2.mkv')
elseif value == 3 then
  socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file3.mkv')
elseif value == 4 then
  socket.http.request('http://192.168.0.100/cgi-bin/do?cmd=launch_media_url&media_url=nfs://192.168.0.100:/VideoStorage:/SomeFolder/file4.mkv')
end
In your visu you create 5 buttons that send fixed values 0 to 4 all on the same byte object.

BR,

Erwin
Reply


Messages In This Thread
Commands to devices over LAN - by AlexLV - 22.06.2017, 17:20
RE: Commands to devices over LAN - by AlexLV - 23.06.2017, 07:14
RE: Commands to devices over LAN - by AlexLV - 24.06.2017, 20:38
RE: Commands to devices over LAN - by admin - 25.06.2017, 06:17
RE: Commands to devices over LAN - by AlexLV - 25.06.2017, 15:13
RE: Commands to devices over LAN - by Erwin van der Zwart - 25.06.2017, 18:07
RE: Commands to devices over LAN - by AlexLV - 26.06.2017, 13:43

Forum Jump: