19 lines
666 B
C
19 lines
666 B
C
#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); /* 向 /iot/data/up/<cid> 发布 JSON */
|
||
|
||
#endif /* NET_WIFI_H */
|