完成景点播报、云端接收解析等功能,修复不能正确显示最近景点的问题
This commit is contained in:
parent
1ff4910f55
commit
712c1f5b41
|
|
@ -13,11 +13,13 @@
|
|||
#include "app_common.h"
|
||||
#include "app_uart.h"
|
||||
|
||||
|
||||
#include "control_out.h"
|
||||
#include "attr_broadcast.h"
|
||||
#include "gps_config.h"
|
||||
#include "local_tts.h"
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
#include "app_uart.h"
|
||||
#define DEBUG(fmt, args...) app_printf("[Broadcast]" fmt, ##args)
|
||||
#else
|
||||
|
|
@ -682,12 +684,12 @@ static AttractionNode* find_nearest_attraction(Location current_pos) {
|
|||
current_pos
|
||||
);
|
||||
|
||||
if(distance <= current->radius) {
|
||||
|
||||
if (distance < min_distance) {
|
||||
min_distance = distance;
|
||||
nearest = current;
|
||||
}
|
||||
}
|
||||
|
||||
current = current->next;
|
||||
}
|
||||
|
||||
|
|
@ -774,7 +776,7 @@ static void attr_broadcast_task(void* arg) {
|
|||
}
|
||||
DEBUG("stat ok:%d\r\n",should_play);
|
||||
// 触发播报
|
||||
if (should_play && !broadcast_state.is_playing) {
|
||||
if ((should_play && !broadcast_state.is_playing) && (1 == sys_sta.MAG_MODE )) {
|
||||
DEBUG("ready to play\r\n");
|
||||
play_attraction_info(nearest, distance);
|
||||
broadcast_state.is_playing=0;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <stdlib.h>
|
||||
#include "jt808_util.h"
|
||||
|
||||
#define JT808_DEBUG_ENABLE 1
|
||||
#define JT808_DEBUG_ENABLE 0
|
||||
|
||||
#if JT808_DEBUG_ENABLE
|
||||
#include "app_uart.h"
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ static int jt808_BodyParse(void *Prsmsg_body, PrsResult_t *Result){
|
|||
// 转换为实际经纬度(除以10^6)
|
||||
double actual_lat = (double)center_lat / 1000000.0;
|
||||
double actual_lon = (double)center_lon / 1000000.0;
|
||||
JT808_DEBUG("actual_lat=%f,actual_lon=%f\r\n",actual_lat,actual_lon);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -667,7 +667,7 @@ void jt808_set_term_param_init(void){
|
|||
memcpy(jt808_term_param_item.big_term_attr_resp.manufacturer_id, "LAT01", 5); // 制造商ID
|
||||
memcpy(jt808_term_param_item.big_term_attr_resp.term_model, jt808_term_param_item.big_reg_info.term_model, 20); // 终端型号
|
||||
memcpy(jt808_term_param_item.big_term_attr_resp.term_id, jt808_term_param_item.big_reg_info.term_id, 7); // 终端ID
|
||||
// memcpy(jt808_term_param_item.big_term_attr_resp.term_ICCID+4, jt808_term_param_item.phone_BCDnum, 6); // 终端手机号码
|
||||
// memcpy(jt808_term_param_item.big_term_attr_resp.term_ICCID+4, jt808_term_param_item.phone_BCDnum, 6); // 终端手机号码 但是你照这个来云端收到的iccid全是,因为BCDnum参数本身没有初始化
|
||||
|
||||
char str_hw_ver[] = "1.0.0"; // 硬件版本
|
||||
char str_fw_ver[] = "1.0.1"; // 固件版本 原本为1.0.0
|
||||
|
|
@ -772,6 +772,7 @@ void jt808_set_term_param_init(void){
|
|||
}
|
||||
JT808_DEBUG_DATA("\n");
|
||||
|
||||
//正确的读取云端所需要的iccid
|
||||
size_t iccid_len = strlen(cm_iccid);
|
||||
if(iccid_len > 0) {
|
||||
// 确保不超过term_ICCID容量(10字节=20位BCD)
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ static void RADAR_TaskHandle(void *param){
|
|||
}
|
||||
|
||||
// 进入游客模式开启雷达 //管理员模式优先于游客模式
|
||||
if(((0 != sys_sta.O_door_lock) && ((1 == sys_sta.MAG_MODE)&&(1 == sys_sta.PLT_MODE ))) && sys_sta.P_Radar_EN){
|
||||
if(((0 != sys_sta.O_door_lock) && ((1 == sys_sta.MAG_MODE)&&(1 == sys_sta.PLT_MODE ))) && (1 == sys_sta.P_Radar_EN)){
|
||||
// 根据倒车状态确定雷达ID
|
||||
// DEBUG("SendCMD:ID=%#02x", (0 == sys_sta.IO_RX_back)?RADAR_ID_Back:RADAR_ID_Front);
|
||||
radar_Sendcmd((0 == sys_sta.IO_RX_back)?RADAR_ID_Back:RADAR_ID_Front, RADAR_MODE_Real);
|
||||
|
|
|
|||
Loading…
Reference in New Issue