supla-device
Loading...
Searching...
No Matches
mqtt_channel_handler.h
1/*
2 * Copyright (C) AC SOFTWARE SP. Z O.O
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 */
9
10#ifndef SRC_SUPLA_PROTOCOL_MQTT_CHANNEL_HANDLER_H_
11#define SRC_SUPLA_PROTOCOL_MQTT_CHANNEL_HANDLER_H_
12
13#include <stdint.h>
14
15namespace Supla {
16class Element;
17namespace Protocol {
18
19class Mqtt;
20
22 public:
23 virtual ~MqttChannelHandler() = default;
24
25 virtual int mqttHandledChannelType() const = 0;
26
27 virtual void mqttPublishChannelState(Mqtt *mqtt, Supla::Element *element) = 0;
28 virtual void mqttSubscribeChannel(Mqtt *mqtt, Supla::Element *element) = 0;
29 virtual bool mqttProcessData(Mqtt *mqtt,
30 const char *topic_part,
31 const char *payload,
32 Supla::Element *element) = 0;
33 virtual void mqttPublishHADiscovery(Mqtt *mqtt, Supla::Element *element) = 0;
34
35 MqttChannelHandler *mqttNextHandler() const {
36 return nextHandler;
37 }
38
39 private:
40 friend class Mqtt;
41 MqttChannelHandler *nextHandler = nullptr;
42};
43
44} // namespace Protocol
45} // namespace Supla
46
47#endif // SRC_SUPLA_PROTOCOL_MQTT_CHANNEL_HANDLER_H_
Base class for all elements of SuplaDevice.
Definition element.h:37
Definition mqtt_channel_handler.h:21
Definition mqtt.h:79