SmartGlass Protocol
Basic communication
The SmartGlass protocol communicates over UDP port 5050. Only the discovery and power on messages are transmitted in plain text, the rest is encrypted (see Cryptography).
Nano protocol uses dynamic ports (UDP/TCP), negotioated via SmartGlass protocol's broadcast channel.
Client connection
- Console might be powered on by Power On packet
- Client sends Discovery Request to console
- Console responds with Discovery Response
- Client parses Certificate in that response
- Client sets up a Crypto Context using the console's public key
- Client sends a Connect Request to the console
- Console responds with Connect Response
- Client sends a Local Join Message, announcing itself
- Upon Acknowledgement client opens several Channels
- Received / sent Heartbeat packets ensure that client/host is alive
Packet layout
General packet layout looks like the following:
Name | Note |
---|---|
Packet Header | Either SimpleMessage or Message |
Unprotected Payload | For all SimpleMessage packets |
Protected Payload | For Connect or Message packet |
*Hash | Only if packet has Protected Payload , see Message Authentication |
NOTE: All numeric values in the SmartGlass Protocol are in network / big-endian byteorder.
Strings in SmartGlass packets
Usually strings are represented like the following:
Type | Description |
---|---|
uint16 | String length (excl. null-terminator) |
uchar * length | String |
uchar '\0' | Null-terminator |
In this documentation, these strings are referenced as SGString