# Uplink

The uplink payload is encoded in hex

1. Firstly you need to divide the uplink payload into individual bytes (from left to right)
2. The 1st Byte is always Mode = it tells in what the device operates ([List of modes](https://docs.google.com/spreadsheets/d/1hGcSu_Wcld7ZAccNz29Ni4D3gWtkkKHsiGtZQLGJE6g/edit?pli=1#gid=1882693905))
3. The 2nd Byte is always Event = it tells what action triggered this message (e.g. short press, periodic report, breached the threshold, etc.) ([List of events](https://docs.google.com/spreadsheets/d/1hGcSu_Wcld7ZAccNz29Ni4D3gWtkkKHsiGtZQLGJE6g/edit?pli=1#gid=0))
4. The 3rd Byte - \
   &#x20;       a. If the decimal value of 2nd Byte is lower than 128:\
   &#x20;               i. The 3. Byte is appended payload mask ([Appended payload](https://docs.google.com/spreadsheets/d/1hGcSu_Wcld7ZAccNz29Ni4D3gWtkkKHsiGtZQLGJE6g/edit?pli=1#gid=2040079688))\
   &#x20;               ii. The 4.–12. Bytes are the appended payload

&#x20;              b. If the decimal value of 2. Byte is higher than 127:\
&#x20;                      i. The 3.–12. Bytes are Event specific payload


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ask.simplehw.eu/kb/simple-api-6-generation/uplink.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
