SIRF binary protocol
寫點東西吧,說不定別人有用,sirfIII的晶片,兩種指令和資料模式
NEMA
Sirf Binary
[@more@]當你執行了NEMA的轉化為sirf格式的指令後,如果用超級終端類的工具會無比鬱悶
恢復為nema的指令如下
A0A20018810201010001010105010101000100010001000100012580013AB0B3
大量的0,字串裡0就是結束符,無論後面是什麼都不會再繼續執行下去了
指令的儲存也不要想偷懶,老老實實一個一個byte存吧
我的一段垃圾程式
byte tt[]={0xA0,0xA2,0x00,0x18, //----------------------/*head*/
0x81,0x02, //message id
0x01,0x01, // GGA output interval , has CheckSum?(1/0) (6,7)
0x00,0x01, // GLL (8,9)
0x01,0x01, //GSA (10,11)
0x05,0x01, //GSV
0x01,0x01, //RMC
0x00,0x01, //VTG
0x00,0x01, //MSS
0x00,0x01, //not defined
0x00,0x01, //ZDA
0x00,0x01, //not defined
0x25,0x80, // bitrate ----------- /*payload*/
0x01,0x3A,0xB0,0xB3 /*checksum and end sequence*/
};
unsigned long dwWrite;
int i;
Word checksum=0;
Word bitrate;
//binary protocol bitrate 為 NMEA->sirf binary 設定的波特率
ComboBox2->Text="COM3";
Edit3->Text="38400";
if(Button6->Enabled==true )Button6->Click();
Sleep(1000);
Button5->Click();
//引數設定
for(i=0;i<10;i++)
{
tt[6+2*i]=NMEAMESSAGE[i].interval;
tt[6+2*i+1]=NMEAMESSAGE[i].hasCheckSum;
}
//設定bitrate
bitrate=BR_COMM;
tt[26]=(byte)(bitrate>>8);
tt[27]=(byte)(bitrate&0x00ff);
//
for(i=4;i<28;i++)
{
checksum+=tt[i];
}
checksum&=0x7fff;
tt[28]=(byte)(checksum>>8);
tt[29]=(byte)(checksum&0x00ff);
WriteFile(hComm,&tt,32,&dwWrite,NULL);
this->Caption=IntToStr(dwWrite);
// this->Caption=IntToStr(checksum);
Edit3->Text=IntToStr(bitrate);
if(Button6->Enabled==true )Button6->Click();
Sleep(1000);
Button5->Click();
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7202070/viewspace-929448/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 網路協議之:memcached binary protocol詳解協議Protocol
- Protocol Buffers 系列 (1) - 什麼是Protocol Buffers?Protocol
- 聊聊SWIM ProtocolSWIMProtocol
- No appropriate protocolAPPProtocol
- location.protocolProtocol
- Jaeger TChannel ——protocolProtocol
- Dubbo on x-protocol——SOFAMesh中的x-protocol示例演示Protocol
- URL protocol 屬性Protocol
- Protocol Buffer 使用指北Protocol
- TarsGo支援Protocol BufferGoProtocol
- TarsGo 支援 protocol bufferGoProtocol
- oracle plsql(一)_binary_float_binary_doubleOracleSQL
- Swift -- enum 繼承 protocolSwift繼承Protocol
- 解密gRPC: Protocol Buffer解密RPCProtocol
- Protocol Buffers 3 學習Protocol
- iOS中使用Protocol BufferiOSProtocol
- Protocol Buffer Basics: C++ProtocolC++
- Convert string to binary and binary to string in C#C#
- MySQL Binary LogMySql
- 執行gedit報No protocol specifiedProtocol
- SIP (Session Initiation Protocol) 協議SessionProtocol協議
- java jdbc Protocol violation錯誤JavaJDBCProtocol
- Thrift之Protocol原始碼分析Protocol原始碼
- protocol buffer 安裝與使用Protocol
- 資料交換格式:Protocol BufferProtocol
- SOAP(Simple Object Access Protocol) (轉)ObjectProtocol
- Oracle Binary CloningOracle
- Mysql Binary Log (1)MySql
- Mysql Binary Log (2)MySql
- B. Quasi Binary
- IE安全系列之——RES ProtocolProtocol
- Protocol Buffers 在 iOS 中的使用ProtocoliOS
- protocol buffer的高效編碼方式Protocol
- Runtime原始碼 protocol(協議)原始碼Protocol協議
- gRPC-Protocol語法指南RPCProtocol
- iOS開發之protocol和delegateiOSProtocol
- Google Protocol Buffer 的使用和原理GoProtocol
- The Bequeath Protocol Adapter [ID 16653.1]ProtocolAPT