3.1 Application layer
Application layer is the top layer of the Amazon Sidewalk protocol. This layer supports realization of procedures defined for different activities of an Endpoint. These activities may be Endpoint registration, time synchronization, and data exchange with the cloud. Procedures are executed by sending and receiving a sequence of messages between Endpoint and the other side of communication link. One message shall contain one application command only. The layer takes care of the right order of messages flow, handling exceptions and others that require proper finalization of a procedure.
A user application placed on an Endpoint provides a service to a user. This level application does not have direct access to commands defined and described in this and following sections. A user application interacts with the Amazon Sidewalk protocol stack application layer through the SDK interface. SDK interface description is outside the scope of this technical specification.

Fig. 3.1 Application layer - SDK interface
3.1.1 Application layer frame format
Application layer provides a simple frame format for coding of application commands. This frame contains three fields: Command class, Command ID and Command data.

Fig. 3.2 Application layer - Frame format
A Command class field identifies a high level functionality area. Each Command class contains set of commands that perform a task in the corresponding area. The following Command classes are defined in the Amazon Sidewalk protocol:
- management - group of commands that are dedicated for managing Endpoints in the Amazon Sidewalk network
- custom - group of commands that provide data exchange service for a user application
- metrics - group of commands that are related to various statistics and measurements of communication link
- security - group of commands that implement Amazon Sidewalk security and registration
The Command ID field identifies a command in a Command class. It also indicates an interpretation of Command data bytes.
The Command data field contains data associated with a Command. The size of the field is Command-dependent.
The Command class and Command ID fields may have different lengths. This specification defines five base cases where different sizes and range of values of these fields are determined. Both the Command class and Command ID shall be coded on the same field size and the higher value of either Command class or Command ID specifies the correct case. For example, when Command class is equal to 0x0 and Command ID is equal to 0x108 then both shall be encoded on 12b field size (Case 4).
| Case | Command class range of values | Command ID range of values | Command class and command ID fields size | Comment |
|---|---|---|---|---|
| 1 | 0x0 - 0x7 | 0x0 - 0x3 | 3b | see Figure 3.3 |
| 2 | 0x8 - 0xF | 0x4 - 0xF | 4b | see Figure 3.4 |
| 3 | 0x10 - 0xFF | 0x10 - 0xFF | 8b | see Figure 3.5 |
| 4 | 0x100 - 0xFFF | 0x100 - 0xFFF | 12b | see Figure 3.6 |
| 5 | 0x1000 - 0xFFFF | 0x1000 - 0xFFFF | 16b | see Figure 3.7 |
Fig. 3.3 Application layer - Command format - Case 1
Fig. 3.4 Application layer - Command format - Case 2

Fig. 3.5 Application layer - Command format - Case 3

Fig. 3.6 Application layer - Command format - Case 4

Fig. 3.7 Application layer - Command format - Case 5

