Here is my current autorun.brs file:
sub Main()
reg = CreateObject("roRegistrySection", "networking")
reg.write("ssh", "22")
n = CreateObject("roNetworkConfiguration", 0)
n.SetLoginPassword("password")
n.Apply()
reg.flush()
info = CreateObject("roDeviceInfo")
m.PlayerId = info.GetDeviceUniqueId()
m.mPort = CreateObject("roMessagePort")
m.configIR = CreateObject("roAssociativeArray")
m.configIR.source = "Iguana"
m.configIR.encodings = CreateObject("roArray", 1, false)
m.configIR.encodings[0] = "NEC"
m.IRRecep = CreateObject("roIRReceiver", m.configIR)
m.IRRecep.SetPort(m.msgPort)
m.irReceiver = CreateObject("roIRReceiver", m.configIR)
if type(m.irReceiver) = "roIRReceiver" then
m.irReceiver.SetPort(m.mPort)
endif
r = CreateObject("roRectangle", 0, 0, 1920, 1080)
is = {
port: 2999
}
config = {
nodejs_enabled: true
inspector_server: is
brightsign_js_objects_enabled: true
url: "file:///sd:/frontend/index.html"
}
m.node = CreateObject("roNodeJS", "app.js", {message_port: m.mPort})
sleep(5000)
m.h = CreateObject("roHtmlWidget", r, config)
m.h.Show()
while true
' do nothing
endwhile
end sub
In this file, I am trying to register my IguanaWorks IR Receiver, then start an express server, and finally show an html page (which makes calls to the server, hence the 5000 ms wait).
* I am sure there are numerous things wrong with this file, so if you see anything alarming outside my specific needs here, please share. *
I need to add an event listener in my javascript (which is loaded through file:///sd:/frontend/index.html) to be triggered by inputs on the remote. I don't know if I have to use the message port for this or the bs javascript API or both. Can someone steer me in the right direction here?