* @brief Forwards a received MQTT message into the frame-reader pipeline. */
| 963 | * @brief Forwards a received MQTT message into the frame-reader pipeline. |
| 964 | */ |
| 965 | void IO::Drivers::MQTT::onMessageReceived(const QByteArray& message, const QMqttTopicName& topic) |
| 966 | { |
| 967 | Q_ASSERT(topic.isValid()); |
| 968 | |
| 969 | const auto& token = Licensing::CommercialToken::current(); |
| 970 | if (!token.isValid() || !SS_LICENSE_GUARD() |
| 971 | || token.featureTier() < Licensing::FeatureTier::Trial) { |
| 972 | qCWarning(lcMqttSub) << "messageReceived dropped: no commercial license"; |
| 973 | return; |
| 974 | } |
| 975 | |
| 976 | if (message.isEmpty()) { |
| 977 | qCInfo(lcMqttSub) << "messageReceived: empty payload on" << topic.name() << "-- dropped"; |
| 978 | return; |
| 979 | } |
| 980 | |
| 981 | QMqttTopicFilter filter(m_topicFilter); |
| 982 | if (!filter.match(topic)) { |
| 983 | qCInfo(lcMqttSub) << "messageReceived: topic" << topic.name() << "did not match filter" |
| 984 | << m_topicFilter << "-- dropped"; |
| 985 | return; |
| 986 | } |
| 987 | |
| 988 | qCDebug(lcMqttSub) << "messageReceived on" << topic.name() << "size=" << message.size() |
| 989 | << "preview=" << message.left(80); |
| 990 | |
| 991 | publishReceivedData(message); |
| 992 | } |
| 993 | |
| 994 | //-------------------------------------------------------------------------------------------------- |
| 995 | // Persistence helpers |
nothing calls this directly
no test coverage detected