shuichan_old/V1.4/STM32F103_App1/HardWare/NETWORK/net_wifi.h

18 lines
646 B
C
Raw 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;
int net_wifi_init(void); /* 阻塞建链复位→连AP(已存→固定→SmartConfig)→透传→MQTT, 0=就绪 */
void net_wifi_process(void); /* 非阻塞轮询:解析下行报文 + 心跳保活 */
void net_wifi_publish_up(const char *json); /* 向 /iot/data/up/<cid> 发布 JSON */
#endif /* NET_WIFI_H */