I need my custom script plugin to run. I added to the presentation properties. I added as a Timeout and media end events but it looks like its not running. The plugin gets some info from the device and POST to some REST end point.
Function deviceInfo_Initialize(msgPort As Object, userVariables As Object, bsp as Object)
deviceInfo= {}
deviceInfo.msgPort = msgPort
deviceInfo.userVariables = userVariables
deviceInfo.bsp = bsp
deviceInfo.ProcessEvent=deviceInfo_ProcessEvent
deviceInfo.name = "deviceInfo"
deviceInfo.version = 0.1
' --------------- Get the Serial Number of the Unit
player=CreateObject("roDeviceInfo")
deviceInfo.uniqueId = player.GetDeviceUniqueId()
' --------------- Get the Name of the Unit
registrySection=CreateObject("roRegistrySection", "networking")
deviceInfo.unitName = registrySection.Read("un")
' --------------- Get the IP Address of the Unit
net=CreateObject("roNetworkConfiguration", 0)
ifnet= invalidthen
net=CreateObject("roNetworkConfiguration", 1)
endif
deviceInfo.ip = ""
ifnet<> invalidthen
deviceInfo.ip = net.GetCurrentConfig().ip4_address
endif
' --------------- Get the Channel Url
currentSync=CreateObject("roSyncSpec")
deviceInfo.channelUrl = ""
ifnot currentSync.ReadFromFile("current-sync.xml") then
print "### No current sync state available"
else
deviceInfo.channelUrl = currentSync.LookupMetadata("client", "base")
endif
return deviceInfo
End Function
Function deviceInfo_ProcessEvent(event as Object) as boolean
retval = false
print "Type of event is ";type(event)
if type(event) = "roAssociativeArray" then
iftype(event["EventType"]) ="roString"
if (event["EventType"] ="SEND_PLUGIN_MESSAGE") then
if event["PluginName"] ="DeviceInfo"then
print "event DeviceInfo"
pluginMessage$ = event["PluginMessage"]
retval=SendDeviceInfo(pluginMessage$, m)
endif
endif
endif
endif
if type(event) = "roDatagramEvent" then
msg$ = event
retval = SendDeviceInfo(msg, m)
end if
return retval
end Function