MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / setMqttVersion

Method setMqttVersion

app/src/MQTT/Publisher.cpp:1503–1518  ·  view source on GitHub ↗

* @brief Sets the MQTT protocol version by index. */

Source from the content-addressed store, hash-verified

1501 * @brief Sets the MQTT protocol version by index.
1502 */
1503void MQTT::Publisher::setMqttVersion(const quint8 version)
1504{
1505 quint8 index = 0;
1506 for (auto i = m_mqttVersions.begin(); i != m_mqttVersions.end(); ++i) {
1507 if (index == version) {
1508 if (i.value() == m_protocolVersion)
1509 return;
1510
1511 m_protocolVersion = i.value();
1512 markConfigChanged();
1513 return;
1514 }
1515
1516 ++index;
1517 }
1518}
1519
1520/**
1521 * @brief Sets the SSL protocol by index.

Callers 3

Calls 2

beginMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected