資源描述:
《單體激光雷達(dá)網(wǎng)絡(luò)數(shù)據(jù)協(xié)議v00》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、單體激光雷達(dá)數(shù)據(jù)協(xié)議V0.01網(wǎng)絡(luò)協(xié)議組成雷達(dá)采用TCP協(xié)議通信,為服務(wù)器端,端口號(hào):5111z其中5111端口為270°有效數(shù)據(jù),網(wǎng)絡(luò)數(shù)據(jù)TIP為變長(zhǎng)包,包格式為:圖1.TIP包格式其中TIP頭為定長(zhǎng)40字節(jié),數(shù)據(jù)為變長(zhǎng)數(shù)據(jù)TIP的頭定義為:typedcfstructiunsignedcharhoad_ad;//headOxADunsignedcharhecid_49;//head0x0x49unsignedshortcode;//TIPcodeunsignedcharpacktype;//packtype,downstream(0x0:al1,0x1:up,0x2:down);u
2、pstream(0x80:all,0x81:up,0x82:down);unsignedcharsotypc;//sourceobjecttypeunsignedcharsid;//sourceidunsignedchardotype;//destobjecttypeunsignedchardid;//destidunsignedcharrn;//Maximumretriednumberunsignedcharpri;//Prioriyunsignedcharmode;//F1F0/L1E0unsignedcharversion;//versionunsignedchairrunmo
3、de;//systemrunmodeunsignedshortcheck;//checksumunsignedintabtLcn;//lengthofTIPunsignedinttid;//IDofT.B:TIP_T1D_BunsignedintCt111;//Createdtimeintcid;//Cor)nectionTD?Fortransferring?0moanspostedbyPostTTP?non-zeromeansbyphysicalchannel.UNIONINFOrcsparm;//parameterofTIP}STRICTPACKEDTIPJIEAD;字段含義為:
4、字段長(zhǎng)度說明備注headad1OxADhcad_4910x49code2Tip包類型packtype1Pack包類型sotype1源類型sid1源地址dotypc1目的類型did1目的地址rn1網(wǎng)絡(luò)重發(fā)次數(shù)pri1優(yōu)先級(jí)mode1發(fā)送模式version1版本號(hào)runmode1運(yùn)行模式check2Code和abtXen校驗(yàn)和abtLen4TIP本身長(zhǎng)度和data數(shù)據(jù)長(zhǎng)度之和tid4應(yīng)用編號(hào)elm4TIP創(chuàng)建時(shí)間cid4網(wǎng)絡(luò)編號(hào)resparm8保留字其中check的運(yùn)算方式為:unsignedshortTipCheckSum(TIP.HEAD*_tip)unsigncdshortres=
5、0;unsignedshort*tmp=(unsignedshort*)&(_tip->abtLen);res+=tip~>code;res+=tmp[0];res+=tmp[l];returnres;)2?通訊內(nèi)容2?1心跳和心跳回復(fù)當(dāng)連接上服務(wù)器以后,客戶端應(yīng)每個(gè)10s主動(dòng)向雷達(dá)發(fā)送心跳包,服務(wù)器收到心跳包,回發(fā)心跳回復(fù)給客戶端,如果雷達(dá)收不到心跳包會(huì)關(guān)閉當(dāng)前連接。其中心跳包為:字段長(zhǎng)度說明值headad1OxADOxADhcad_4910x490x49code2Tip包類型1packtype1Pack包類型0sotype1源類型0sid1源地址0dotypc1目的類型0did1
6、目的地址0rn1網(wǎng)絡(luò)重發(fā)次數(shù)0x35pri1優(yōu)先級(jí)15mode1發(fā)送模式2version1版本號(hào)0runmode1運(yùn)行模式0check2Code和abtXen校驗(yàn)和見校驗(yàn)和算法abtLen4TIP本身長(zhǎng)度和data數(shù)據(jù)長(zhǎng)度之和40tid4應(yīng)用編號(hào)0elm4TIP創(chuàng)建時(shí)間當(dāng)前時(shí)間cid4網(wǎng)絡(luò)編號(hào)0resparm8保留字0其中心跳回復(fù)包為:字段長(zhǎng)度說明值headad1OxADOxADhead_4910x490x49code2Tip包類型2packtypc1Pack包類型0sotype1源類型44sid1源地址0dotype1目的類型0did1目的地址0rn1網(wǎng)絡(luò)重發(fā)次數(shù)0x35pri1優(yōu)
7、先級(jí)15mode1發(fā)送模式2version1版本號(hào)0runmode1運(yùn)行模式0check2Code和abtLen枚驗(yàn)和見校驗(yàn)和算法abtLen4TIP本身長(zhǎng)度和data數(shù)據(jù)長(zhǎng)度之和40tid4應(yīng)用編號(hào)0elm4TIP創(chuàng)建時(shí)間當(dāng)前時(shí)間cid4網(wǎng)絡(luò)編號(hào)0rcsparm8保留字02.2登錄和登錄回復(fù)當(dāng)連接上服務(wù)器以后,客戶端應(yīng)登錄雷達(dá)服務(wù),登錄成功后,才能進(jìn)行其他信令通訊,登錄命令包為:字段長(zhǎng)度說明值head一ad1OxADOxADhead4910x490x49