|
@@ -81,13 +81,16 @@ void net_service::on_message(const std::shared_ptr<client> &clt,const char*data,
|
|
{
|
|
{
|
|
char timebuf[64]{0};
|
|
char timebuf[64]{0};
|
|
unsigned char*t=(unsigned char*)data+10;
|
|
unsigned char*t=(unsigned char*)data+10;
|
|
- sprintf(timebuf,"%d-%d %d:%d:%d",*(t+4)+1,*(t+3),*(t+2),*(t+1),*(t+0));
|
|
|
|
|
|
+ sprintf(timebuf,"%d-%02d-%02d %02d:%02d:%02d",t[5]+2000,t[4]+1,t[3],t[2],t[1],t[0]);
|
|
logn_info(1,"分站数据信息:%s net=%s,sid=%d,tm=%s,sct=%d",(power&1)==0?"true":"false",clt->name().c_str(),site_id,timebuf,t[-2]*256+t[-1]);
|
|
logn_info(1,"分站数据信息:%s net=%s,sid=%d,tm=%s,sct=%d",(power&1)==0?"true":"false",clt->name().c_str(),site_id,timebuf,t[-2]*256+t[-1]);
|
|
}
|
|
}
|
|
#if 1
|
|
#if 1
|
|
if(!site_ptr->check_timestamp(data+10))
|
|
if(!site_ptr->check_timestamp(data+10))
|
|
{
|
|
{
|
|
- logn_error(1,"分站数据时间戳错误:%s",clt->name().c_str());
|
|
|
|
|
|
+ char timebuf[64]{0};
|
|
|
|
+ unsigned char*t=(unsigned char*)&site_ptr->m_timestamp[0];
|
|
|
|
+ sprintf(timebuf,"%d-%02d-%02d %02d:%02d:%02d",t[0]+2000,t[1]+1,t[2],t[3],t[4],t[5]);
|
|
|
|
+ logn_error(1,"分站数据时间戳错误:%s,pre-time=%s",clt->name().c_str(),timebuf);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|