Commit 6f296a91 authored by 学习的菜鸟's avatar 学习的菜鸟

解决了没有角度

parent 70593ef5
...@@ -69,7 +69,7 @@ void *thread_mqtt_beat(void *arg) { ...@@ -69,7 +69,7 @@ void *thread_mqtt_beat(void *arg) {
g_heartbeat_count++; g_heartbeat_count++;
if(g_mqtt_grc == 0){ if(g_mqtt_grc == 0){
mqtt_wirte();//心跳,3s一个 mqtt_beat_wirte();//心跳,3s一个
} }
} }
return NULL; return NULL;
......
No preview for this file type
...@@ -105,13 +105,14 @@ void angle_mqtt_send() { ...@@ -105,13 +105,14 @@ void angle_mqtt_send() {
} }
//心跳格式,每5s一次心跳 //心跳格式,每5s一次心跳
void mqtt_wirte(){ void mqtt_beat_wirte(){
if( g_heartbeat_count >= 30) { if( g_heartbeat_count >= 30) {
heartbeat_send(); heartbeat_send();
g_heartbeat_count=0; g_heartbeat_count=0;
} }
if( g_device_type == 202) angle_mqtt_send(); if( g_device_type == DEVICE_TANK0202) angle_mqtt_send();
if( g_device_type == DEVICE_TANK0203) angle_mqtt_send();
} }
......
...@@ -8,7 +8,7 @@ extern int g_heartbeat_count; ...@@ -8,7 +8,7 @@ extern int g_heartbeat_count;
extern int g_devcontrol_exit_count; extern int g_devcontrol_exit_count;
void mqtt_wirte(); void mqtt_beat_wirte();
int device_message_receive(cJSON *json); int device_message_receive(cJSON *json);
#endif #endif
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment