Method Calling

At this point, an SSL connection between the device and the Engine has been established and left open. A device communication session has been configured and granted and method calls/responses may now be issued.

Calling a Method

Both the Engine and the device can make method calls. Messages are limited to 20,480 bytes for the entire message, including headers and end tags. All call commands follow this syntax:

Syntax

CALL|<method_name>|<target>|<payload>|<unique_call_id>|END

Parameters

The <method_name> parameter is the name of the method being called.

The <target> optional parameter is the TV App ID identifying the app (formerly called widget) implementing the method. This parameter is ignored by the Engine if it is not needed by the implementation.

The <payload> parameter is the String data payload needed for the method being called. This parameter may or may not be a JSON string depending on the implementation.

The <unique_call_id> parameter is the unique identifier of the method call, used to match the return results and support multiple simultaneous calls.

Returning from a Method

Both the Engine and the device can return results from a method call. Messages are limited to 20,480 bytes for the entire message, including headers and end tags. All return commands follow this syntax:

Syntax

RETURN|<method_name>|<target>|<result>|<unique_call_id>|END

Parameters

The <method_name> parameter is the name of the method returning.

The <target> optional parameter is the TV App ID identifying the app (formerly called widget) returning the results. This parameter is ignored by the Engine if it is not needed by the implementation.

The <result> parameter is the String data results returned from the method being called. This parameter may or may not be a JSON string depending on the implementation.

The <unique_call_id> parameter is the unique identifier of the method call, used to match the return results and support multiple simultaneous calls.

Table of Contents