"TheEndless" wrote:
"WillEV" wrote:
I see that the v3 of the SDK has now included support for passing parameters directly to a running BrightScript app.
Where'd you see that? There are the new socket components, but an app would have to explicitly implement a listener in order to accept parameters that way. I'm not aware of any other way to talk to a running app..?
Building completely proprietary protocol via sockets for each channel is brain-dead. There is (alas only partial) solution in SDK 3:
Since Firmware version 3.0:
• input enables a developer to send custom events to their Brightscript application. It takes a user defined list of name-value pairs sent as query string uri parameters. The external control server places these name-value pairs into a BrightScript associative array and passes them directly through to the currently executing channel script via a Message Port attached to a created roInput object. Please refer to Section 3.1 below for more detailed recommendations on how to pass your data. Messages of type roInputEvent have a GetInfo() method that will obtain the associative array. The arguments must be URL-encoded. This command is sent via a POST with no body.
Example: POST /input?acceleration.x=0.0&acceleration.y=0.0&acceleration.z=9.8
This ensures only one-way communication, injecting data from outside to running app. But there is no way to query status - this being the kind of synchronous invocation (http request - needs to pause and wait for result while message is passed to queue and wait to be handled and reply returned - then retuen that back) it seems against messaging implementation in brightscript (from the little i have seen). Which is a dirty shame, because i have been looking recently at the external control protocol of DirecTV DVRs - it reports status very nicely, what program is playing now, what's next on which channel etc