Messages Transport The transport for the Near Field Proximity: Sharing Protocol is either TCP/IP or Bluetooth/RFCOMM. Each of those is a reliable connection-oriented socket. Message Syntax None of the messages in this protocol has alignment requirements; that is, there are no padding bytes to force a specific alignment. Unless explicitly specified otherwise, all fields use encoding. Most of this protocol consists of a stream of that contain the being transferred; however, there are well-defined header and footer messages, which are described in the following sections. Socket Connect Header The Socket Connect header specifies the connection type of a socket connection to be established. It has the following structure. 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 SessionID ... ConnectionType Reserved1 A Reserved2 SessionID (8 bytes): The ID of the Session object. At the conclusion of the session exchange, each peer has a Session object, and the two Session objects' SessionID fields match. It is used by the Share Receiver to find the correct Session object to associate with the inbound socket. ConnectionType (1 byte): The connection type of the socket connection to be established, from the Connection Type Enumeration (section ). Reserved1 (2 bytes): This field MUST be set to zero when sent and MUST be ignored when received. A (1 bit): The flag. A client sets this flag in order to indicate to the server that the client is required to terminate the session immediately. This flag is useful when, for example, the user has decided not to accept a socket or share connection. Reserved2 (7 bits): This MUST be set to zero when sent and MUST be ignored when received. Share Header The Share header specifies an estimated size of an OPC package. 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 HeaderSize TotalContentSizeEstimate ...
Message Processing Events and Sequencing Rules None. Timer Events None. Other Local Events The following local events change the Share Sender's State, as shown in the diagram in section . Session provided Session socket successfully set up The actions required by these events are specified in the sections that follow. Session Provided This is triggered when the Share Sender's SessionFactory object provides a Session object. If the Share Sender's State is WaitingForSession, this MUST be set as the object's Session element, the State element MUST transition to SetupSocket, and the SessionFactory object MUST be deactivated or destroyed. The behavior for the SetupSocket state is specified in section . Session Socket Successfully Set Up When a Share Sender's Socket object has been successfully set up (section ), the Share Sender state MUST transition to SendingBody, and the following actions MUST be performed: Create a Share header (section ) with the following values: HeaderSize: The value 10 in little-endian encoding (0x0A, 0x00). No other value is valid. TotalContentSizeEstimate: An estimate of the size of the OPC package. If an estimate cannot be determined, this MUST be zero. Send the Share header over the Socket. Synchronously read 2 for the HeaderSize field of a Reply header (section ) from the Socket. Interpret the 2 bytes as a little-endian encoded 16-bit unsigned integer that specifies how many bytes to read for the rest of the message. If nonzero length, synchronously read (HeaderSize – 2) bytes from the Socket. Note If the HeaderSize is exactly 2, there is nothing to read. Set the Share Sender's SymmetricKey element to a 128-bit key derived by taking the SHA256 hash of the Session object's SharedSecretKey element. Send the IV as the first block on the Socket. The Near Field Proximity: Sharing Protocol requires a specific encryption scheme. Each block MUST be encrypted by using a standard AES 128-block cipher with the IV and SymmetricKey objects as input.
Index A 8 C 8 28 Client 13 12 F 9 G 5 I 26 26 6 5 M Messages 12 12 11 11 10 10 11 11 10 10 10 N 6 O 6 P 26 8 8 27 13 R 6 6 6 7 11 S Security 26 26 Server 13 10 11 10 9 T 28 10 V 9 8