50 const char* AshtechPBEN::myId =
"PBN";
53 void AshtechPBEN::reallyGetRecord(
FFStream& ffs)
59 string& rawData = stream.
rawData;
63 if (
id ==
"" && rawData.size()>=11 &&
64 rawData.substr(0,7) == preamble &&
66 id = rawData.substr(7,3);
70 if (
id ==
"" || !checkId(
id))
77 void AshtechPBEN::decode(
const std::string&
data)
82 if (str.length() == 69)
85 header = str.substr(0,11); str.erase(0,11);
86 sow = 1e-3 * decodeVar<int32_t>(str);
87 sitename = str.substr(0,4); str.erase(0,4);
88 navx = decodeVar<double>(str);
89 navy = decodeVar<double>(str);
90 navz = decodeVar<double>(str);
91 navt = decodeVar<float>(str);
92 navxdot = decodeVar<float>(str);
93 navydot = decodeVar<float>(str);
94 navzdot = decodeVar<float>(str);
95 navtdot = decodeVar<float>(str);
96 pdop = decodeVar<uint16_t>(str);
97 lat = lon = alt = numSV = hdop = vdop = tdop = 0;
99 checksum = decodeVar<uint16_t>(str);
103 int len=
data.size()-3-11;
104 string body(
data.substr(11, len));
105 while (body.size()>1)
106 csum += decodeVar<uint16_t>(body);
108 if (csum != checksum)
112 cout <<
"checksum error, computed:" << hex << csum
113 <<
" received:" << checksum << dec << endl;
120 header = str.substr(0,11); str.erase(0,11);
121 stringstream iss(str);
122 double latMin,lonMin;
125 >> navx>> c >> navy >> c >> navz >> c
126 >> lat >> c >> latMin >> c >> lon >> c >> lonMin >> c >> alt >> c
127 >> navxdot>> c >> navydot>> c >> navzdot >> c
129 getline(iss, sitename,
',');
130 iss >> pdop>> c >> hdop>> c >> vdop>> c >> tdop;
153 oss << getName() <<
"1:"
155 <<
" #SV:" << (int)numSV
156 <<
" PDOP:" << (
int)pdop
158 <<
" ClkDft:" <<
asString(navtdot, 3)
159 <<
" sitename:" << sitename
160 <<
" " << (ascii?
"ascii":
"bin")
170 out << oss.str() << flush;