implement SAR messages in ubxtool
parent
a3debb152c
commit
f5cae429ff
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
||||||
CFLAGS = -O3 -Wall -ggdb
|
CFLAGS = -O3 -Wall -ggdb
|
||||||
|
|
||||||
CXXFLAGS:= -std=gnu++17 -Wall -O2 -ggdb -MMD -MP -fno-omit-frame-pointer -Iext/CLI11 \
|
CXXFLAGS:= -std=gnu++17 -Wall -O0 -ggdb -MMD -MP -fno-omit-frame-pointer -Iext/CLI11 \
|
||||||
-Iext/fmt-6.1.2/include/ -Iext/powerblog/ext/simplesocket -Iext/powerblog/ext/ \
|
-Iext/fmt-6.1.2/include/ -Iext/powerblog/ext/simplesocket -Iext/powerblog/ext/ \
|
||||||
-I/usr/local/opt/openssl/include/ \
|
-I/usr/local/opt/openssl/include/ \
|
||||||
-Iext/sgp4/libsgp4/ \
|
-Iext/sgp4/libsgp4/ \
|
||||||
|
|
12
navdump.cc
12
navdump.cc
|
@ -1128,6 +1128,18 @@ try
|
||||||
}
|
}
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
}
|
}
|
||||||
|
else if(nmm.type() == NavMonMessage::SARResponseType) {
|
||||||
|
etstamp();
|
||||||
|
|
||||||
|
string hexstring;
|
||||||
|
string id = nmm.sr().identifier();
|
||||||
|
for(int n = 0; n < 15; ++n)
|
||||||
|
hexstring+=fmt::sprintf("%x", (int)getbitu((unsigned char*)id.c_str(), 4 + 4*n, 4));
|
||||||
|
|
||||||
|
|
||||||
|
cout<<" SAR RLM type "<< nmm.sr().type() <<" from gal sv ";
|
||||||
|
cout<< nmm.sr().gnsssv() << " beacon "<<hexstring <<" code "<<(int)nmm.sr().code()<<" params "<< makeHexDump(nmm.sr().params()) <<endl;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
etstamp();
|
etstamp();
|
||||||
cout<<"Unknown type "<< (int)nmm.type()<<endl;
|
cout<<"Unknown type "<< (int)nmm.type()<<endl;
|
||||||
|
|
35
ubxtool.cc
35
ubxtool.cc
|
@ -1564,8 +1564,6 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(msg.getClass() == 0x02 && msg.getType() == 0x59) { // UBX-RXM-RLM
|
else if(msg.getClass() == 0x02 && msg.getType() == 0x59) { // UBX-RXM-RLM
|
||||||
int type = (int)payload[1];
|
|
||||||
int sv = (int)payload[2];
|
|
||||||
|
|
||||||
NavMonMessage nmm;
|
NavMonMessage nmm;
|
||||||
nmm.set_sourceid(g_srcid);
|
nmm.set_sourceid(g_srcid);
|
||||||
|
@ -1573,34 +1571,29 @@ int main(int argc, char** argv)
|
||||||
nmm.set_localutcnanoseconds(g_gnssutc.tv_nsec);
|
nmm.set_localutcnanoseconds(g_gnssutc.tv_nsec);
|
||||||
|
|
||||||
nmm.set_type(NavMonMessage::SARResponseType);
|
nmm.set_type(NavMonMessage::SARResponseType);
|
||||||
|
|
||||||
|
// short version:
|
||||||
|
// 0 1 2 3 4 - 11 12 13,14 15
|
||||||
|
// version, type, sv, reserved beacon id msg-code param res2
|
||||||
|
|
||||||
|
// long version:
|
||||||
|
// 0 1 2 3 4 - 11 12 13-24 25
|
||||||
|
// version, type, sv, reserved beacon id msg-code params res2
|
||||||
|
|
||||||
nmm.mutable_sr()->set_gnssid(2); // Galileo only for now
|
nmm.mutable_sr()->set_gnssid(2); // Galileo only for now
|
||||||
nmm.mutable_sr()->set_gnsssv(sv);
|
nmm.mutable_sr()->set_gnsssv(payload[2]);
|
||||||
nmm.mutable_sr()->set_sigid(0); // we should fill this in later
|
nmm.mutable_sr()->set_sigid(1); //
|
||||||
nmm.mutable_sr()->set_type(payload[1]);
|
nmm.mutable_sr()->set_type(payload[1]);
|
||||||
nmm.mutable_sr()->set_identifier(string((char*)payload.c_str()+4, 8));
|
nmm.mutable_sr()->set_identifier(string((char*)payload.c_str()+4, 8));
|
||||||
nmm.mutable_sr()->set_code(payload[12]);
|
nmm.mutable_sr()->set_code(payload[12]);
|
||||||
nmm.mutable_sr()->set_params(string((char*)payload.c_str()+13, payload.size()-14));
|
nmm.mutable_sr()->set_params(string((char*)payload.c_str()+13, payload.size()-14));
|
||||||
|
|
||||||
|
|
||||||
string hexstring;
|
string hexstring;
|
||||||
for(int n = 0; n < 15; ++n)
|
for(int n = 0; n < 15; ++n)
|
||||||
hexstring+=fmt::sprintf("%x", (int)getbitu(payload.c_str(), 36 + 4*n, 4));
|
hexstring+=fmt::sprintf("%x", (int)getbitu(payload.c_str(), 36 + 4*n, 4));
|
||||||
|
|
||||||
// if (doDEBUG) { cerr<<humanTimeNow()<<" "<<humanTime(g_gnssutc.tv_sec)<<" SAR RLM type "<<type<<" from gal sv " << sv << " beacon "<<hexstring <<" code "<<(int)payload[12]<<" params "<<payload[12] + 256*payload[13]<<endl; }
|
ns.emitNMM(nmm);
|
||||||
|
|
||||||
// wk.emitLine(sv, "SAR "+hexstring);
|
|
||||||
// cout<<"SAR: sv = "<< (int)msg[2] <<" ";
|
|
||||||
// for(int n=4; n < 12; ++n)
|
|
||||||
// fmt::printf("%02x", (int)msg[n]);
|
|
||||||
|
|
||||||
// for(int n = 0; n < 15; ++n)
|
|
||||||
// fmt::printf("%x", (int)getbitu(msg.c_str(), 36 + 4*n, 4));
|
|
||||||
|
|
||||||
// cout << " Type: "<< (int) msg[12] <<"\n";
|
|
||||||
// cout<<"Parameter: (len = "<<msg.length()<<") ";
|
|
||||||
// for(unsigned int n = 13; n < msg.length(); ++n)
|
|
||||||
// fmt::printf("%02x ", (int)msg[n]);
|
|
||||||
// cout<<"\n";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(msg.getClass()==39 && msg.getType()==0) {
|
else if(msg.getClass()==39 && msg.getType()==0) {
|
||||||
NavMonMessage nmm;
|
NavMonMessage nmm;
|
||||||
|
|
Loading…
Reference in New Issue