> For the complete documentation index, see [llms.txt](https://docs.bituo-technik.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bituo-technik.com/device-api/spm-sdm-open-wi-fi-api-overview/ble-advertising.md).

# BLE Advertising

Encrypted business advertising

{% hint style="info" %}
**Status:** Active | **Applies to:** Lite / Pro (secured BLE, service `A003`) | **Updated:** 2026-10-16&#x20;
{% endhint %}

\
This page is only about reading voltage, current, power, and energy **without a GATT connection**. Provisioning, the handshake, and the read/write characteristics are in the Secured BLE API. The handshake and key derivation are in the crypto protocol.

### 1. Whether you need this page

| What you are building                                                                | Where to read                                             |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------- |
| Provisioning, commands, snapshots                                                    | Secured BLE API. Skip this page                           |
| A phone or gateway that reads electrical values from advertising, with no connection | This page                                                 |
| Your own decryptor                                                                   | Section 4 below. Key derivation is crypto protocol §3.5.1 |

The long packet's `broadcast_key` is derived when the first J-PAKE succeeds, and the device stores it together with the LTK **after Wi-Fi association succeeds**. A meter that has never finished secured provisioning has no such key, and the long packet cannot be decrypted.

The GATT business envelope and the advertising AES-CCM **do not share parameters** (tag length and nonce construction differ). Do not reuse one for the other.

### 2. Two packet lengths

Only secured-BLE meters switch between a short and a long manufacturer payload. Plaintext BLE (Basic / Basic+) does not use these packets.

The device's `step` (see crypto protocol section 5) chooses the length:

<table><thead><tr><th>Condition</th><th width="224.2222900390625">Length</th><th>Contents</th></tr></thead><tbody><tr><td><code>step = 0</code> (still waiting for J-PAKE round 1)</td><td><strong>5 bytes</strong></td><td>Plaintext, so a scanner can tell meters apart</td></tr><tr><td><code>step ≠ 0</code></td><td><strong>26 bytes</strong></td><td>AES-128-CCM ciphertext carrying the electrical values</td></tr></tbody></table>

In the long-packet case the advertising interval is about **200 ms**. After each packet the meter rotates phase or circuit, so consecutive packets may be phase A, then B, then C. The phase count depends on the model.

### 3. Short format (5 bytes)

Multi-byte integers are **little-endian**.

<table><thead><tr><th width="135.3333740234375">Offset</th><th width="127.666748046875">Length</th><th>Contents</th></tr></thead><tbody><tr><td>0–1</td><td>2</td><td>Fixed <code>0xFF 0xFF</code></td></tr><tr><td>2</td><td>1</td><td>Provisioning state: the whole byte <code>0</code> means still waiting for J-PAKE round 1; <code>1</code> means a later phase</td></tr><tr><td>3–4</td><td>2</td><td>12-bit discriminator. Take the first 3 hex digits of the SN (12 hex digits) and place them in the low 12 bits of this 16-bit field</td></tr></tbody></table>

The short packet is not encrypted, and it does not contain voltage or current.

### 4. Long format (26 bytes)

The whole block is **one** manufacturer-data entry in the advertisement.

<table><thead><tr><th width="125.3333740234375">Offset</th><th width="142.6666259765625">Length</th><th>Contents</th></tr></thead><tbody><tr><td>0–1</td><td>2</td><td>Fixed <code>0xFF 0xFF</code></td></tr><tr><td>2</td><td>1</td><td>Control byte, see below</td></tr><tr><td>3–6</td><td>4</td><td>Advertising counter, unsigned 32-bit, <strong>little-endian</strong>, increments by 1 for each packet that goes on air</td></tr><tr><td>7–21</td><td>15</td><td>CCM ciphertext. Decrypted, this is the 15 bytes in section 4.1</td></tr><tr><td>22–25</td><td>4</td><td>CCM authentication tag, <strong>4 bytes</strong> (the GATT envelope does not use this length)</td></tr></tbody></table>

**Control byte**

<table><thead><tr><th width="174.5555419921875">Bits</th><th>Meaning</th></tr></thead><tbody><tr><td>bit7</td><td>Whether the application GATT provisioning service is still in the advertisement (1 = yes)</td></tr><tr><td>bit6–4</td><td>Encoding version. Current value is <strong>1</strong>, which means section 4.1</td></tr><tr><td>bit3–2</td><td>Phase or circuit index</td></tr><tr><td>bit1–0</td><td>Product class</td></tr></tbody></table>

<table><thead><tr><th width="177.888916015625">bit1–0</th><th>Models</th></tr></thead><tbody><tr><td><code>0b11</code> (3)</td><td>Three-phase: <code>SDM01_3PN</code> / <code>SPM02</code></td></tr><tr><td><code>0b10</code> (2)</td><td>Two circuits: <code>SDM02</code></td></tr><tr><td><code>0b01</code> (1)</td><td>Single-phase: <code>SDM01_1PN</code> / <code>SPM01</code></td></tr><tr><td><code>0b00</code> (0)</td><td>Other (including <code>SRS01A</code> / <code>SRS01B</code>)</td></tr></tbody></table>

**Decrypt parameters**

* Key: `broadcast_key`, 16 bytes. An open GATT connection is not required.
* Nonce (12 bytes): the first 8 bytes are `0x00`, the last 4 bytes are the counter above in **big-endian**. The counter in the advertisement is little-endian; the numeric value is the same.
* 15-byte plaintext, no AAD, 4-byte tag.

`nonce_12 = 0^8 || BE32(counter)`.

#### 4.1 The 15 bytes after decrypt

The plaintext is fixed-length binary, **not JSON**. Multi-byte integers are little-endian. Encoding version 1 (control bits 6–4) uses this layout.

| Plaintext offset | Length | Type              | Scale | Quantity           | Unit |
| ---------------- | ------ | ----------------- | ----- | ------------------ | ---- |
| 0–1              | 2      | unsigned `uint16` | ÷10   | voltage `V`        | V    |
| 2–3              | 2      | unsigned `uint16` | ÷100  | current `I`        | A    |
| 4–6              | 3      | signed `int24`    | ÷1000 | active power `P`   | kW   |
| 7–10             | 4      | unsigned `uint32` | ÷100  | import energy `FE` | kWh  |
| 11–14            | 4      | unsigned `uint32` | ÷100  | export energy `RE` | kWh  |

Physical value = integer ÷ scale. A voltage field of `0x08FC` (little-endian `FC 08`) is `2300 / 10 = 230.0` V.

`int24`: combine three bytes as `b0 | (b1<<8) | (b2<<16)`. If bit 7 of `b2` is 1, treat the value as negative (subtract `0x1000000`). Power may be negative.

A non-finite measurement is encoded as 0. `uint16` saturates at `0…65535`. `int24` saturates at `−0x800000…0x7FFFFF`.

Control bits 3–2 say which circuit this packet belongs to. A single-circuit model keeps the index at 0.

| Product class       | Circuits | Index 0          | Index 1   | Index 2 |
| ------------------- | -------- | ---------------- | --------- | ------- |
| `0b01` single-phase | 1        | the only circuit | —         | —       |
| `0b00` and `SRS01A` | 1        | the only circuit | —         | —       |
| `0b00` and `SRS01B` | 2        | circuit 1        | circuit 2 | —       |
| `0b10` `SDM02`      | 2        | circuit 1        | circuit 2 | —       |
| `0b11` three-phase  | 3        | phase A          | phase B   | phase C |

On `SRS01A` / `SRS01B` the four export-energy bytes are always 0. An unrecognized model fills all 15 bytes with 0.

The units match the read-characteristic short keys `V` / `I` / `P` / `FE` / `RE`. Advertising is fixed-point binary; the read characteristic uses decimal strings. See Business Command Reference §5.

### 5. Advertising and GATT when Wi-Fi is connected

After Wi-Fi connects, if provisioning did **not** include `enableble:true`, the meter removes the application service UUID from advertising and stops exposing the application GATT. Advertising then mainly carries the manufacturer data. You can still read electrical values from the air, and you cannot open GATT.

Sending `enableble:true` in the provisioning command (see Business Command Reference §2.2) stores that choice. On the next boot, GATT and the service UUID stay even when Wi-Fi is already connected, and the dynamic manufacturer data keeps updating.

Factory reset clears that choice, and also clears the LTK and the broadcast key.
