mqtt: begin subscription support

This commit is contained in:
Kevin Hester
2021-04-05 08:42:52 +08:00
parent 55b8314a2a
commit 50a69d77e6
2 changed files with 49 additions and 19 deletions

View File

@@ -36,8 +36,6 @@ class MQTT : private concurrency::OSThread
virtual int32_t runOnce();
private:
const char *getCryptTopic(const char *channelId);
/** return true if we have a channel that wants uplink/downlink
*/
bool wantsLink() const;
@@ -45,6 +43,16 @@ class MQTT : private concurrency::OSThread
/** Attempt to connect to server if necessary
*/
void reconnect();
/** Tell the server what subscriptions we want (based on channels.downlink_enabled)
*/
void sendSubscriptions();
/// Just C glue to call onPublish
static void mqttCallback(char *topic, byte *payload, unsigned int length);
/// Called when a new publish arrives from the MQTT server
void onPublish(char *topic, byte *payload, unsigned int length);
};
void mqttInit();