rokucommunity / roku-debug

A compatibility wrapper around the BrightScript debug protocol https://developer.roku.com/en-ca/docs/developer-program/debugging/socket-based-debugger.md
MIT License
13 stars 9 forks source link

Add support for the sgrendezvous ECP command #123

Closed TwitchBronBron closed 1 year ago

TwitchBronBron commented 1 year ago

Add support for the sgrendezvous ECP command (instead of using the port 8080 commands). https://developer.roku.com/en-gb/docs/developer-program/debugging/external-control-api.md#general-ecp-commands

  1. check the firmware version (from the device-info object added in #121) to make sure it's at least firmware 11.5. if lower, none of the rest of this logic can be applied.
  2. The logic should be added into RendezvousTracker.

We will look at device settings to determine if rendezvouz tracking is enabled. If either of these resolve in true, then rendezvous tracking should be enabled:

  1. If the 8080 logrendezvous status says it's enabled. https://developer.roku.com/en-gb/docs/developer-program/debugging/debugging-channels.md#scenegraph-debug-server-port-8080-commands (run logrendezvous over telnet port 8080, the response should be logrendezvous: rendezvous logging is on, so maybe just check that the string ends with "on").
  2. query this url (http://192.168.1.37:8060/query/sgrendezvous) and check to see if <tracking-enabled>false</tracking-enabled> is set to true or false.

So then, if rendezvous tracking is enabled in either method (8080 or ECP), and firmware is 11.5 or higher, do the following:

  1. Send an ECP "disable rendezvous tracking" command to reset any data left over from previous session
  2. Send ECP "enable rendezvous tracking" command to enable tracking
  3. send query/sgrendezvous ECP requests at regular intervals
  4. emit the results through the RendezvousTracker's standard event emitter, in the same format.
  5. disable emitting rendezvous tracking from the scraped telnet logs in RendezvousTracker (but still remove the items from the log output).

We still need to fall back to the old telnet scraping method, but if we are able to successfully use the ECP command, then the old method's results should be discarded.

To enable rendezvous tracking over ECP:

To disable rendezvous tracking over ECP:

To view rendezvous status over ECP:

MilapNaik commented 1 year ago

Done in PR #150