|
@@ -54,6 +54,10 @@ void message_locinfo::load(zistream&is,bool tdoa)
|
|
|
is>>b>>m_card_id>>m_card_ct>>m_batty_status;
|
|
|
|
|
|
|
|
|
+
|
|
|
+ if(m_card_id & 0xFFFF0000)
|
|
|
+ log_warn("card_id=%#X,CT=%d,大于0xFFFF.",m_card_id,m_card_ct);
|
|
|
+
|
|
|
m_card_id &= 0xFFFF; //卡号不会大于65535,分站上传数据的bug
|
|
|
|
|
|
m_card_type=b;
|
|
@@ -72,8 +76,7 @@ void message_locinfo::load(zistream&is,bool tdoa)
|
|
|
//加速度
|
|
|
is>>b;
|
|
|
const auto &c=card_list::instance()->get(tool_other::type_id_to_u64(m_card_type,m_card_id));
|
|
|
- if(m_card_type==1 && c)
|
|
|
- c->handle_message(m_card_ct,m_batty_status);
|
|
|
+
|
|
|
if(m_card_type == 1 ||(c && tool_other::is_coal_or_driving(m_card_type,c->get_vehicle_type_id())))
|
|
|
m_acc=b;
|
|
|
else
|
|
@@ -98,8 +101,13 @@ void message_locinfo::load(zistream&is,bool tdoa)
|
|
|
uint16_t sp1=0,sp2=0;
|
|
|
is>>sp1>>sp2;
|
|
|
m_rssi=10*log10(1.*sp1*(1<<17)/pow(sp2-64.,2))-121.74;
|
|
|
- log_info("timestamp=%llu,type=%d,card=%d,site=%d,ct=%d,status=%d,acc=%d,tof=%llu,ant_id=%d,spq=%d",
|
|
|
+ log_info("timestamp=%llu,type=%d,card=%d,site=%d,ct=%d,bat=%#X,acc=%d,tof=%llu,ant_id=%d,spq=%d",
|
|
|
m_time_stamp,m_card_type,m_card_id,m_site_id,m_card_ct,m_batty_status,m_acc,m_tof,m_ant_id,m_rssi);
|
|
|
+
|
|
|
+ if(m_card_type==1 && c)
|
|
|
+ {
|
|
|
+ c->handle_message(m_card_ct,m_batty_status);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//优化协议数据解析
|