leaps_peer_cfg_set
This call is available only on the ethernet gateway. It 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. See also the shell command peer.
use_tls: ‘0’ | ‘1’ (‘0’ = TLS disabled, ‘1’ = TLS enabled)
mutual_auth: ‘0’ | ‘1’ (‘1’ = mutual TLS authentication, client certificate required)
use_mac_filter: ‘0’ | ‘1’ (‘1’ = enable MAC address filter)
auth_check_CN: ‘0’ | ‘1’ (‘1’ = verify server Common Name (CN) in TLS certificate)
port: uint16 little-endian (server port number, e.g. 1883 or 8883)
host: ASCII string (server hostname or IP, max 63 characters on wire, no null terminator)
Example
TLS enabled, port 8883, host mqtt.example.com (16 chars):
TLV Request |
||
|---|---|---|
Type |
Length |
Value |
byte 0: flags
bytes 1–2: reserved (0x00 0x00)
bytes 3–4: port (little-endian uint16)
byte 5: host_len
bytes 6..(6+host_len-1): host (ASCII, no null)
|
||
0x9A |
0x16 |
0x01 0x00 0x00 0xB3 0x22 0x10 0x6D 0x71 0x74 0x74 0x2E 0x65 0x78 0x61 0x6D 0x70 0x6C 0x65 0x2E 0x63 0x6F 0x6D |
In this example:
LS enabled,
port 8883,
host “mqtt.example.com” (16 chars)
Type 0x9A (154 dec) means command leaps_peer_cfg_set
TLV response |
||
|---|---|---|
Type |
Length |
Value |
0x40 |
0x01 |
0x00 |
Type 0x40 means status code