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 requests may now be issued.
Since the Engine uses an event-based model, a device must request a subscription to a particular service. All services use this generic subscription command:
Syntax
SUBSCRIBE|<service_type>|<service_subject>|END
Parameters
The <service_type> parameter can be one of
three message categories INPUT, SERVICE, or WIDGET:
INPUT is used to subscribe to keyboard and navigation inputs from the Engine that are not app-specific. The <service_subject>
value for the INPUT type must be keyboard, navigation, or mediacontrol. A subcription to this type causes all keyboard, navigation, and media transport control events to be sent
with the PUBLISH command.
SERVICE is used to support advanced services such as media launching, app (formerly called widget) launching, app listing, and others
to be specified (TBS).
The <service_subject> value for the SERVICE type must be medialaunch, widgetlaunch, or widgetlist.
WIDGET is used to send application-specific communication to and from apps. The <service_subject> value for the WIDGET type is the TV App ID (formerly called Widget ID).
Both the Engine and the device may publish messages. Messages are limited to 20,480 bytes for the entire message, including headers and end tags. All publish commands follow this syntax:
Syntax
PUBLISH|<service_type>|<service_subject>|<payload>|END
Parameters
The <service_type> parameter can be one of three message categories INPUT, SERVICE, or WIDGET:
INPUT is used to send keyboard and navigation events from the Engine that are not application-specific. The <service_subject>
value for the INPUT type must be keyboard, navigation, or mediacontrol. If the <service_subject> is keyboard, the very first keyboard event is sent
when the consumer opens a keyboard on the TV display. The keyboard message <payload> contains the full state of the keyboard as a JSON string.
The navigation message <payload> contains the action/key name and is not a JSON string. The media control message <payload> contains the media transport control state and is a JSON string.
SERVICE is used to support advanced services such as media launching, app (formerly called) launching, app
listing, and others to be specified (TBS). The <service_subject> values for the SERVICE type must be medialaunch, widgetlaunch, or widgetlist.
The message <payload> is a JSON string.
WIDGET is used to send application-specific communication to and from apps. The <service_subject> value for the WIDGET
type is the TV App ID (formerly called Widget ID). The message <payload> is a JSON string.