18 lines
646 B
C
18 lines
646 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;
|
|||
|
|
|
|||
|
|
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 */
|