Skip to content

[SL-ONLY] Make MQTT Subscribe/Publish QoS configurable via MqttClientConfig - #1190

Open
chirag-silabs wants to merge 1 commit into
feature/add-matter-servicefrom
bugfix/fix_qos_level
Open

chirag-silabs wants to merge 1 commit into
feature/add-matter-servicefrom
bugfix/fix_qos_level

Conversation

@chirag-silabs

@chirag-silabs chirag-silabs commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add MqttClientConfig::qos so Subscribe/Publish QoS is selected from config (QoS0 / QoS1) instead of a per-call argument.
  • Update MqttClient::Subscribe / Publish to use mConfig.qos after Init.
  • Point the thermostat MQTT demo at the config default (no hardcoded MqttQoS at the call site).

willQoS remains Last Will–only (used when willEnable is true) and is independent of application Subscribe/Publish QoS.

Related issues

NA

Testing

Tested with 917SoC thermostat dual stack app with QoS0 and QoS1 enabled

QoS0

1789039735: Sending CONNACK to WISECONNECT_SDK_TOPIC (0, 0)
1789039735: Received SUBSCRIBE from WISECONNECT_SDK_TOPIC
1789039735:     THERMOSTAT-DATA (QoS 0)
1789039735: WISECONNECT_SDK_TOPIC 0 THERMOSTAT-DATA
1789039735: Sending SUBACK to WISECONNECT_SDK_TOPIC
1789039735: Received PUBLISH from WISECONNECT_SDK_TOPIC (d0, q0, r0, m0, 'THERMOSTAT-DATA', ... (41 bytes))
1789039735: Sending PUBLISH to WISECONNECT_SDK_TOPIC (d0, q0, r0, m0, 'THERMOSTAT-DATA', ... (41 bytes)

QoS1

1789039652: Sending CONNACK to WISECONNECT_SDK_TOPIC (0, 0)
1789039652: Received SUBSCRIBE from WISECONNECT_SDK_TOPIC
1789039652:     THERMOSTAT-DATA (QoS 1)
1789039652: WISECONNECT_SDK_TOPIC 1 THERMOSTAT-DATA
1789039652: Sending SUBACK to WISECONNECT_SDK_TOPIC
1789039652: Received PUBLISH from WISECONNECT_SDK_TOPIC (d0, q1, r0, m2, 'THERMOSTAT-DATA', ... (41 bytes))
1789039652: Sending PUBLISH to WISECONNECT_SDK_TOPIC (d0, q1, r0, m1, 'THERMOSTAT-DATA', ... (41 bytes))
1789039652: Sending PUBACK to WISECONNECT_SDK_TOPIC (m2, rc0)
1789039652: Received PUBACK from WISECONNECT_SDK_TOPIC (Mid: 1, RC:0)

@chirag-silabs
chirag-silabs requested a review from a team as a code owner September 10, 2026 11:33
@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Public API signature change for Silabs MqttClient; behavior depends on config defaults (QoS1) rather than per-call QoS, so misconfigured Init could silently use wrong QoS.

Overview
Silabs MQTT QoS is now set once in MqttClientConfig instead of on every Subscribe/Publish call.

Adds MqttClientConfig::qos (default QoS1) for subscribe and publish; willQoS stays separate for Last Will when willEnable is true. MqttClient::Subscribe and Publish drop the per-call MqttQoS argument and use mConfig.qos after Init. Docs in mqtt_client.h note that apps can pick QoS0/QoS1 via config defaults only.

The thermostat Silabs MQTT demo stops passing hardcoded MqttQoS::QoS1 and relies on config defaults (with a short comment at init).

Breaking change: any caller must update signatures—Subscribe(topic, callback) and Publish(topic, payload, retained, callback).

Reviewed by Cursor Bugbot for commit 5aea46f. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant