shuichan_new/STM32F103_App1/HardWare/NETWORK/net_wifi.h

20 lines
775 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef NET_WIFI_H
#define NET_WIFI_H
#include "main.h"
#include <stdint.h>
/* WiFi 后端ESP-01S(TCP透传) + 软件MQTT。
* 与 4G 后端(air780e.c) 对网络层暴露同构接口,由 network.c 按当前通道路由。 */
extern volatile uint8_t g_wifi_mqtt_ready;
extern volatile uint8_t g_wifi_first_publish_ok;
extern volatile uint8_t g_wifi_restore_req; /* 置1请求 WiFi 模块恢复出厂(net任务执行) */
int net_wifi_init(void); /* 阻塞建链复位→连AP(已存→固定→SmartConfig)→透传→MQTT, 0=就绪 */
void net_wifi_process(void); /* 非阻塞轮询:解析下行报文 + 心跳保活 */
void net_wifi_publish_up(const char *json);
int net_wifi_publish_qos1(const char *json, uint16_t pkt_id); /* QoS1 发布(指令应答用), 0=已发 -1=未就绪 */ /* 向 /iot/data/up/<cid> 发布 JSON */
#endif /* NET_WIFI_H */