chore: mqtt impl, fix more wiznet bugs
This commit is contained in:
25
include/mqtt_handler.h
Normal file
25
include/mqtt_handler.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef MQTT_HANDLER_H
|
||||
#define MQTT_HANDLER_H
|
||||
|
||||
#include <DHCP/dhcp.h>
|
||||
|
||||
#include "ch32v003fun.h"
|
||||
#include "w5500.h"
|
||||
|
||||
typedef struct {
|
||||
Network network;
|
||||
MQTTClient client;
|
||||
ch32_mqtt_options_t opts;
|
||||
uint32_t last_reconnect;
|
||||
uint32_t last_yield;
|
||||
uint8_t is_connected;
|
||||
char base_topic[64];
|
||||
} mqtt_state_t;
|
||||
|
||||
void mqtt_init(mqtt_state_t* state);
|
||||
void mqtt_process(mqtt_state_t* state);
|
||||
void message_arrived(MessageData* md);
|
||||
void publish_value(MQTTClient* client, const char* device_name,
|
||||
const char* property, uint16_t value);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user