add OSNMA and other fields to Galileo storage
parent
8eff5956b2
commit
cab1ec9594
|
@ -36,6 +36,11 @@ message NavMonMessage {
|
|||
required uint32 gnssSV =4;
|
||||
required bytes contents =5;
|
||||
optional uint32 sigid = 6;
|
||||
optional bytes reserved1 = 7;
|
||||
optional bytes reserved2 = 8;
|
||||
optional bytes sar = 9;
|
||||
optional bytes spare = 10;
|
||||
optional bytes crc = 11;
|
||||
}
|
||||
|
||||
message GalileoFnav {
|
||||
|
|
29
ubx.cc
29
ubx.cc
|
@ -3,6 +3,7 @@
|
|||
#include "fmt/format.h"
|
||||
#include "fmt/printf.h"
|
||||
#include "bits.hh"
|
||||
#include "navmon.hh"
|
||||
|
||||
using namespace std;
|
||||
uint16_t calcUbxChecksum(uint8_t ubxClass, uint8_t ubxType, std::basic_string_view<uint8_t> str)
|
||||
|
@ -60,7 +61,12 @@ std::basic_string<uint8_t> buildUbxMessage(uint8_t ubxClass, uint8_t ubxType, st
|
|||
return msg;
|
||||
}
|
||||
|
||||
basic_string<uint8_t> getInavFromSFRBXMsg(std::basic_string_view<uint8_t> msg)
|
||||
basic_string<uint8_t> getInavFromSFRBXMsg(std::basic_string_view<uint8_t> msg,
|
||||
basic_string<uint8_t>& reserved1,
|
||||
basic_string<uint8_t>& reserved2,
|
||||
basic_string<uint8_t>& sar,
|
||||
basic_string<uint8_t>& spare,
|
||||
basic_string<uint8_t>& crc)
|
||||
{
|
||||
// byte order adjustment
|
||||
std::basic_string<uint8_t> payload;
|
||||
|
@ -74,10 +80,14 @@ basic_string<uint8_t> getInavFromSFRBXMsg(std::basic_string_view<uint8_t> msg)
|
|||
for (i=0,j= 4;i<15;i++,j+=8) setbitu(crc_buff,j,8,getbitu(payload.c_str() ,i*8,8));
|
||||
for (i=0,j=118;i<11;i++,j+=8) setbitu(crc_buff,j,8,getbitu(payload.c_str()+16,i*8,8));
|
||||
if (rtk_crc24q(crc_buff,25) != getbitu(payload.c_str()+16,82,24)) {
|
||||
cout << "CRC mismatch, " << rtk_crc24q(crc_buff, 25) << " != " << getbitu(payload.c_str()+16,82,24) <<endl;
|
||||
cerr << "CRC mismatch, " << rtk_crc24q(crc_buff, 25) << " != " << getbitu(payload.c_str()+16,82,24) <<endl;
|
||||
throw CRCMismatch();
|
||||
}
|
||||
|
||||
crc.clear();
|
||||
for(i=0; i < 3; ++i)
|
||||
crc.append(1, getbitu(payload.c_str()+16,82+i*8,8));
|
||||
|
||||
std::basic_string<uint8_t> inav;
|
||||
|
||||
for (i=0,j=2; i<14; i++, j+=8)
|
||||
|
@ -85,6 +95,21 @@ basic_string<uint8_t> getInavFromSFRBXMsg(std::basic_string_view<uint8_t> msg)
|
|||
for (i=0,j=2; i< 2; i++, j+=8)
|
||||
inav.append(1, (unsigned char)getbitu(payload.c_str()+16,j,8));
|
||||
|
||||
reserved1.clear();
|
||||
for(i=0, j=18; i < 5 ; i++, j+=8)
|
||||
reserved1.append(1, (unsigned char)getbitu(payload.c_str()+16, j, 8));
|
||||
// cerr<<"reserved1: "<<makeHexDump(reserved1)<<endl;
|
||||
|
||||
sar.clear();
|
||||
for(i=0, j=58; i < 3 ; i++, j+=8) // you get 24 bits
|
||||
sar.append(1, (unsigned char)getbitu(payload.c_str()+16, j, 8));
|
||||
|
||||
spare.clear();
|
||||
spare.append(1, (unsigned char)getbitu(payload.c_str()+16, 80, 2));
|
||||
|
||||
reserved2.clear();
|
||||
reserved2.append(1, (unsigned char)getbitu(payload.c_str()+16, 106, 8));
|
||||
|
||||
return inav;
|
||||
}
|
||||
|
||||
|
|
8
ubx.hh
8
ubx.hh
|
@ -6,7 +6,13 @@ std::basic_string<uint8_t> buildUbxMessage(uint8_t ubxClass, uint8_t ubxType, st
|
|||
|
||||
std::basic_string<uint8_t> buildUbxMessage(uint8_t ubxClass, uint8_t ubxType, const std::initializer_list<uint8_t>& str);
|
||||
|
||||
std::basic_string<uint8_t> getInavFromSFRBXMsg(std::basic_string_view<uint8_t> msg);
|
||||
std::basic_string<uint8_t> getInavFromSFRBXMsg(std::basic_string_view<uint8_t> msg,
|
||||
std::basic_string<uint8_t>& reserved1,
|
||||
std::basic_string<uint8_t>& reserved2,
|
||||
std::basic_string<uint8_t>& sar,
|
||||
std::basic_string<uint8_t>& spare,
|
||||
std::basic_string<uint8_t>& crc);
|
||||
|
||||
std::basic_string<uint8_t> getGPSFromSFRBXMsg(std::basic_string_view<uint8_t> msg);
|
||||
std::basic_string<uint8_t> getGlonassFromSFRBXMsg(std::basic_string_view<uint8_t> msg);
|
||||
std::basic_string<uint8_t> getBeidouFromSFRBXMsg(std::basic_string_view<uint8_t> msg);
|
||||
|
|
10
ubxtool.cc
10
ubxtool.cc
|
@ -927,7 +927,7 @@ int main(int argc, char** argv)
|
|||
enableUBXMessageOnPort(fd, 0x02, 0x59, ubxport); // UBX-RXM-RLM
|
||||
}
|
||||
|
||||
if (doDEBUG) { cerr<<humanTimeNow()<<" Enabling UBX-MON-HW"<<endl; } // SAR
|
||||
if (doDEBUG) { cerr<<humanTimeNow()<<" Enabling UBX-MON-HW"<<endl; }
|
||||
enableUBXMessageOnPort(fd, 0x0A, 0x09, ubxport, 16); // UBX-MON-HW
|
||||
|
||||
|
||||
|
@ -1385,7 +1385,8 @@ int main(int argc, char** argv)
|
|||
ns.emitNMM( nmm);
|
||||
}
|
||||
else if(id.first ==2) { // GALILEO
|
||||
auto inav = getInavFromSFRBXMsg(payload);
|
||||
basic_string<uint8_t> reserved1, reserved2, sar, spare, crc;
|
||||
auto inav = getInavFromSFRBXMsg(payload, reserved1, reserved2, sar, spare, crc);
|
||||
unsigned int wtype = getbitu(&inav[0], 0, 6);
|
||||
|
||||
uint32_t satTOW;
|
||||
|
@ -1466,6 +1467,11 @@ int main(int argc, char** argv)
|
|||
nmm.mutable_gi()->set_gnsssv(id.second);
|
||||
nmm.mutable_gi()->set_sigid(sigid);
|
||||
nmm.mutable_gi()->set_contents((const char*)&inav[0], inav.size());
|
||||
nmm.mutable_gi()->set_reserved1((const char*)&reserved1[0], reserved1.size());
|
||||
nmm.mutable_gi()->set_reserved2((const char*)&reserved2[0], reserved2.size());
|
||||
nmm.mutable_gi()->set_sar((const char*) &sar[0], sar.size());
|
||||
nmm.mutable_gi()->set_crc((const char*) &crc[0], crc.size());
|
||||
nmm.mutable_gi()->set_spare((const char*)&spare[0], spare.size());
|
||||
|
||||
ns.emitNMM( nmm);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue