开发暂时完成封箱版本,待增加OTA功能
This commit is contained in:
parent
090958a731
commit
524226f4a4
|
|
@ -703,8 +703,8 @@ static void play_attraction_info(AttractionNode* attraction, double distance) {
|
||||||
|
|
||||||
// 构建距离提示
|
// 构建距离提示
|
||||||
char distance_msg[100];
|
char distance_msg[100];
|
||||||
snprintf(distance_msg, sizeof(distance_msg), "您已到达%s,距离%.1f米。",
|
snprintf(distance_msg, sizeof(distance_msg), "您已到达%s。",
|
||||||
attraction->name, distance);
|
attraction->name);
|
||||||
|
|
||||||
// 创建播放数组(距离提示 + 所有描述分段)
|
// 创建播放数组(距离提示 + 所有描述分段)
|
||||||
int total_segments = attraction->description.count + 1;
|
int total_segments = attraction->description.count + 1;
|
||||||
|
|
|
||||||
|
|
@ -416,7 +416,10 @@ osThreadFunc_t Autoreport_param_ThreadId;
|
||||||
|
|
||||||
uint16_t scenic_Fence_Polygon_count = 0;
|
uint16_t scenic_Fence_Polygon_count = 0;
|
||||||
uint16_t ban_Fence_Polygon_count = 0;
|
uint16_t ban_Fence_Polygon_count = 0;
|
||||||
|
uint16_t ban_unlock_count = 0;
|
||||||
uint16_t delay_off_count = 0; // 延时关闭计数
|
uint16_t delay_off_count = 0; // 延时关闭计数
|
||||||
|
uint8_t ban_unlock_flag = 0; //0:围栏非空 1:空围栏
|
||||||
|
|
||||||
|
|
||||||
uint8_t Rsp_locked_condition = 0; // 锁车状态, BYTE
|
uint8_t Rsp_locked_condition = 0; // 锁车状态, BYTE
|
||||||
|
|
||||||
|
|
@ -478,6 +481,7 @@ void jt808_LocReport_param_update(void){
|
||||||
uint32_t lng = nmea_ndeg2degree(gps_data_msg.info.lon) * 1e6;
|
uint32_t lng = nmea_ndeg2degree(gps_data_msg.info.lon) * 1e6;
|
||||||
uint8_t flag = 0; //0:围栏非空 1:空围栏
|
uint8_t flag = 0; //0:围栏非空 1:空围栏
|
||||||
|
|
||||||
|
|
||||||
// lat = 44939236;
|
// lat = 44939236;
|
||||||
// lng = 121369446;
|
// lng = 121369446;
|
||||||
// lat = 34939236;
|
// lat = 34939236;
|
||||||
|
|
@ -502,12 +506,31 @@ void jt808_LocReport_param_update(void){
|
||||||
scenic_Fence_Polygon_count = 0;
|
scenic_Fence_Polygon_count = 0;
|
||||||
}
|
}
|
||||||
if(Rsp_Bigban_Fence_Polygon_area_ID != 0){
|
if(Rsp_Bigban_Fence_Polygon_area_ID != 0){
|
||||||
|
|
||||||
|
ban_unlock_count++;
|
||||||
|
if(1 == ban_unlock_flag)
|
||||||
|
{
|
||||||
|
//sys_sta.O_door_lock = 1; // 开锁
|
||||||
|
//Rsp_locked_condition = 0; // 复位锁车状态
|
||||||
|
if(0 == (ban_unlock_count % 5))
|
||||||
|
{
|
||||||
|
local_tts_text_play("您已驶入禁行区域,请尽快离开",0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ban_unlock_count >= 20)
|
||||||
|
{
|
||||||
|
ban_unlock_flag = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
delay_off_count++;
|
delay_off_count++;
|
||||||
if((delay_off_count >= jt808_term_param_item.set_term_param.Ban_Fence_Polygon_Delay_OFF) && (0 == flag)){ // 5S
|
if((delay_off_count >= jt808_term_param_item.set_term_param.Ban_Fence_Polygon_Delay_OFF) && (0 == flag)){ // 5S
|
||||||
delay_off_count = 0;
|
delay_off_count = 0;
|
||||||
|
ban_unlock_count = 0; //禁区解锁计数
|
||||||
sys_sta.O_door_lock = 0; // 锁车
|
sys_sta.O_door_lock = 0; // 锁车
|
||||||
Rsp_locked_condition = 1; // 锁车状态
|
Rsp_locked_condition = 1; // 锁车状态
|
||||||
local_tts_text_play("已锁车,请联系管理员解除禁止入内限制!",0,0);
|
ban_unlock_flag = 1; //进入禁区标志
|
||||||
|
local_tts_text_play("已锁车,请在小程序上解除锁定并离开禁区!",0,0);
|
||||||
jt808_pkg_send(ID_LocReport,10000/5); // 发送位置信息上报包
|
jt808_pkg_send(ID_LocReport,10000/5); // 发送位置信息上报包
|
||||||
}
|
}
|
||||||
ban_Fence_Polygon_count++;
|
ban_Fence_Polygon_count++;
|
||||||
|
|
@ -516,19 +539,23 @@ void jt808_LocReport_param_update(void){
|
||||||
local_tts_text_play("您已进入禁区,请尽快离开!",0,0);
|
local_tts_text_play("您已进入禁区,请尽快离开!",0,0);
|
||||||
jt808_pkg_send(ID_LocReport,10000/5); // 发送位置信息上报包
|
jt808_pkg_send(ID_LocReport,10000/5); // 发送位置信息上报包
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
delay_off_count = 0;
|
delay_off_count = 0;
|
||||||
ban_Fence_Polygon_count = 0;
|
ban_Fence_Polygon_count = 0;
|
||||||
|
ban_unlock_count = 0;
|
||||||
|
ban_unlock_flag = 0;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
scenic_Fence_Polygon_count = 0;
|
scenic_Fence_Polygon_count = 0;
|
||||||
ban_Fence_Polygon_count = 0;
|
ban_Fence_Polygon_count = 0;
|
||||||
delay_off_count = 0;
|
delay_off_count = 0;
|
||||||
|
ban_unlock_count = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JT808_DEBUG("list null\r\n");
|
JT808_DEBUG("list null\r\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -594,6 +621,23 @@ void Autoreport_param_Task(void *arg){
|
||||||
|
|
||||||
jt808_LocReport_param_update(); // 更新位置信息参数
|
jt808_LocReport_param_update(); // 更新位置信息参数
|
||||||
|
|
||||||
|
if(1 == sys_sta.O_door_lock)
|
||||||
|
{
|
||||||
|
if((0 == (count_Sec % 5))){
|
||||||
|
if((gps_data_msg.info.fix == 1)||(gps_data_msg.info.sig == 0)){ // 不可用// 未定位时发送心跳包
|
||||||
|
jt808_pkg_send(ID_Term_HB,0); // 发送心跳包 // 不接收应答
|
||||||
|
// jt808_pkg_send(ID_LocReport,0);
|
||||||
|
// jt808_pkg_send(ID_Car_CtrlResp,0);
|
||||||
|
JT808_DEBUG("Bat_Percent:%d,Bat_Voltage:%d,Bat_STA:%X\r\n",BAT_Message.Bat_Percent,BAT_Message.Bat_Voltage,BAT_Message.Bat_STA);
|
||||||
|
}else{
|
||||||
|
jt808_pkg_send(ID_LocReport,10000/5); // 发送位置信息上报包
|
||||||
|
JT808_DEBUG("auto report\r\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
// jt808_term_param_item.big_loc_report.basic_info.alarm_flag.gnss_fault = 0 == gps_data_msg.info.sig ? 1 : 0; // 0:无故障,1:有故障
|
// jt808_term_param_item.big_loc_report.basic_info.alarm_flag.gnss_fault = 0 == gps_data_msg.info.sig ? 1 : 0; // 0:无故障,1:有故障
|
||||||
if((0 == (count_Sec % jt808_term_param_item.set_term_param.HeartBeatInterval))){
|
if((0 == (count_Sec % jt808_term_param_item.set_term_param.HeartBeatInterval))){
|
||||||
if((gps_data_msg.info.fix == 1)||(gps_data_msg.info.sig == 0)){ // 不可用// 未定位时发送心跳包
|
if((gps_data_msg.info.fix == 1)||(gps_data_msg.info.sig == 0)){ // 不可用// 未定位时发送心跳包
|
||||||
|
|
@ -608,6 +652,7 @@ void Autoreport_param_Task(void *arg){
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
count_Sec++;
|
count_Sec++;
|
||||||
osDelay(1000/5); // 1S
|
osDelay(1000/5); // 1S
|
||||||
}
|
}
|
||||||
|
|
@ -656,7 +701,7 @@ void jt808_set_term_param_init(void){
|
||||||
// memcpy(jt808_term_param_item.big_term_attr_resp.term_ICCID+4, jt808_term_param_item.phone_BCDnum, 6); // 终端手机号码 但是你照这个来云端收到的iccid全是,因为BCDnum参数本身没有初始化
|
// 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_hw_ver[] = "1.0.0"; // 硬件版本
|
||||||
char str_fw_ver[] = "1.0.8"; // 固件版本 原本为1.0.0
|
char str_fw_ver[] = "1.1.6"; // 固件版本 原本为1.0.0
|
||||||
jt808_term_param_item.big_term_attr_resp.hw_ver_len = strlen(str_hw_ver); // 硬件版本长度
|
jt808_term_param_item.big_term_attr_resp.hw_ver_len = strlen(str_hw_ver); // 硬件版本长度
|
||||||
jt808_term_param_item.big_term_attr_resp.fw_ver_len = strlen(str_fw_ver); // 固件版本长度
|
jt808_term_param_item.big_term_attr_resp.fw_ver_len = strlen(str_fw_ver); // 固件版本长度
|
||||||
memcpy(jt808_term_param_item.big_term_attr_resp.str_hw_ver, str_hw_ver, strlen(str_hw_ver)); // 硬件版本
|
memcpy(jt808_term_param_item.big_term_attr_resp.str_hw_ver, str_hw_ver, strlen(str_hw_ver)); // 硬件版本
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ void radar_CheckData(uint8_t *data, uint16_t data_len){
|
||||||
// 定时处理数和获取数据
|
// 定时处理数和获取数据
|
||||||
static void RADAR_TaskHandle(void *param){
|
static void RADAR_TaskHandle(void *param){
|
||||||
uint8_t temp_count =0;
|
uint8_t temp_count =0;
|
||||||
uint16_t time_count =0;
|
uint32_t time_count =0;
|
||||||
while(1){
|
while(1){
|
||||||
|
|
||||||
// sys_sta.P_Radar_EN=jt808_term_param_item.set_term_param.RadarEN;
|
// sys_sta.P_Radar_EN=jt808_term_param_item.set_term_param.RadarEN;
|
||||||
|
|
@ -187,7 +187,7 @@ static void RADAR_TaskHandle(void *param){
|
||||||
sys_sta.A_Speed_Cut =0; // 清空自动减速状态
|
sys_sta.A_Speed_Cut =0; // 清空自动减速状态
|
||||||
sys_sta.A_brake =0; // 清空自动刹车状态
|
sys_sta.A_brake =0; // 清空自动刹车状态
|
||||||
|
|
||||||
if(time_count>=100)
|
if(time_count>=400)
|
||||||
{
|
{
|
||||||
sys_sta.P_Radar_EN=1;
|
sys_sta.P_Radar_EN=1;
|
||||||
time_count=0;
|
time_count=0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue