leaps_peer_cfg_set
Sets the MQTT broker / peer server connection parameters including TLS options, port, and hostname. The configuration is stored in non-volatile memory. A network restart is triggered automatically after this command.
Example
TLV Request |
||
|---|---|---|
Type |
Length |
Value |
Byte 0: flags
- Bit 0=use_tls, Bit 1=mutual_auth, Bit 2=use_mac_filter,
- Bit 3=auth_check_CN, Bits[7:4]=reserved
- use_tls: Enable TLS for the connection.
- mutual_auth: Enable mutual TLS authentication (client cert required).
- use_mac_filter: Enable MAC address filter.
- auth_check_CN: Verify server Common Name (CN) in TLS certificate.
Byte 1–2 (reserved): 0x00 0x00
Byte 3–4 (port): little-endian uint16
Byte 5 (host_len): number of host bytes that follow (no null)
Byte 6..6+host_len-1 (host): ASCII string, no null terminator
|
||
0x9A |
0x16 |
01 00 00 B3 22 10 6D 71 74 74 2E 65 78 61 6D 70 6C 65 2E 63 6F 6D |
In this example:
LS enabled,
port 8883,
host "mqtt.example.com" (16 chars)
Type 0x9A (154) means command leaps_peer_cfg_set
TLV response |
||
|---|---|---|
Type |
Length |
Value |
0x40 |
0x01 |
0x00 |
Type 0x40 means status code