20260115:初步实现了MQTT协议发布指令的功能;完善了部分任务之间的运行逻辑。
This commit is contained in:
9
STM32/Gateway_Node/Application/App_MQTT/App_MQTT.c
Normal file
9
STM32/Gateway_Node/Application/App_MQTT/App_MQTT.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "App_MQTT.h"
|
||||
|
||||
bool bMqttNormalSubscribe(char *pcTopic, char *pcMessage)
|
||||
{
|
||||
char cCmd[256] = {0};
|
||||
snprintf(cCmd, sizeof(cCmd), "AT+MQTT_SUBSCRIBE=\"%s\",\"%s\"", pcTopic, pcMessage);
|
||||
// Add logic to send the command and handle the response
|
||||
return true;
|
||||
}
|
||||
20
STM32/Gateway_Node/Application/App_MQTT/App_MQTT.h
Normal file
20
STM32/Gateway_Node/Application/App_MQTT/App_MQTT.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __APP_MQTT_H__
|
||||
#define __APP_MQTT_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "ESP8266.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MQTT_MODE_NORMAL = 0,
|
||||
MQTT_MODE_PROPERTY,
|
||||
}eMqttMode_t;
|
||||
|
||||
bool bMqttSubMsgFormat(eMqttMode_t ucMode, char *pcReceivedMsg, char *pcTopic, char *pcMessage);
|
||||
bool bMqttNormalSubscribe(char *pcTopic, char *pcMessage);
|
||||
bool bMqttNormalPublish(char *pcTopic, char *pcMessage);
|
||||
|
||||
#endif /* __APP_MQTT_H__ */
|
||||
Reference in New Issue
Block a user