2.2 Message Syntax

In the structures defined in this section, multi-byte field values are ordered in big-endian format, unless specified otherwise, and string values do not include NUL terminators.

This section defines the messages used for starting and stopping Miracast over Infrastructure sessions. This is the general format for Miracast messages.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Size

Version

Command

TLVArray (variable)

...

...

Size (2 bytes): The size of the message, in bytes.

Version (1 byte): The version of this protocol, which is 0x01.

Command (1 byte): The type of message, which determines the TLVs passed in the TLVArray field. The following messages are defined in the sections listed.

Message type

Section

Description

SOURCE_READY

0x01

2.2.1

Indicates the Miracast Source is ready to accept a connection on the RTSP port.

STOP_PROJECTION

0x02

2.2.2

Indicates the end of the projection.

SECURITY_HANDSHAKE

0x03

2.2.3

Used to exchange DTLS handshake messages to initiate a connection with encryption of the multimedia stream.

SESSION_REQUEST

0x04

2.2.4

Indicates the Miracast Source intends to connect to the Sink using the specified options.

PIN_CHALLENGE

0x05

2.2.5

Sent by the Miracast Source to initiate the session using the PIN displayed by the Miracast Sink.

PIN_RESPONSE

0x06

2.2.6

Sent by the Miracast Sink in response to a PIN_CHALLENGE received from the Miracast Source.

TLVArray (variable): An array of one or more Miracast TLVs (section 2.2.7), which specify information for the message.