shuichan_old/V1.1/STM32F103_App1/HardWare/NETWORK/network.h

27 lines
906 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 NETWORK_H
#define NETWORK_H
#include "main.h"
#include <stdint.h>
/*===== 网络状态 =====*/
extern volatile uint8_t g_net_mqtt_ready;
extern volatile uint8_t g_net_first_publish_ok;
extern volatile uint8_t g_no_sim_detected;
/* 网络发送互斥:置位期间 NET_publish_* 直接丢弃OTA 下载等 AT 交互期间使用,
* 防止业务发布与进行中的 AT 指令在 USART3 上交织导致应答误判) */
extern volatile uint8_t g_net_tx_busy;
/*===== API =====*/
void NET_init(void);
void NET_process(void);
void NET_publish_status(int feeding, int sw2, int sw3, int sw4,
float weight_kg, float once_wt_kg, float zero_kg);
void NET_publish_response(const char *cmd_id, int ok, const char *msg);
void NET_publish_power(int on);
void NET_mqtt_report(const char *header, const char *ota_id, int val);
void NET_ota_confirm(void);
#endif /* NETWORK_H */