Skip to content
Snippets Groups Projects
Commit f5248437 authored by Pep Martí Saumell's avatar Pep Martí Saumell
Browse files

[ublox] new data notifiers

parent 10a3a2b6
No related branches found
No related tags found
2 merge requests!20new tag,!19new tag
......@@ -14,8 +14,11 @@ class UBloxRaw
int addDataStream(const std::vector<u_int8_t>& data_stream);
const Observations& getObservations() const;
const Navigation& getNavigation() const;
Observations getObservations();
Navigation getNavigation();
inline bool newObsData(){return new_obs_;};
inline bool newNavData(){return new_nav_;};
private:
raw_t raw_data_;
......@@ -23,6 +26,9 @@ class UBloxRaw
Observations obs_;
Navigation nav_;
bool new_obs_;
bool new_nav_;
void updateObservations();
};
......
......@@ -9,6 +9,9 @@ UBloxRaw::UBloxRaw()
assert("Failed when allocating memory for raw_t");
return;
}
new_obs_ = false;
new_nav_ = false;
};
UBloxRaw::~UBloxRaw(){};
......@@ -26,6 +29,7 @@ int UBloxRaw::addDataStream(const std::vector<u_int8_t>& data_stream)
{
case 1:
updateObservations();
new_obs_ = true;
break;
case 2:
// Ephemeris
......@@ -35,6 +39,7 @@ int UBloxRaw::addDataStream(const std::vector<u_int8_t>& data_stream)
nav_.addEphemeris(*(raw_data_.nav.eph));
nav_.addGLONASSEphemeris(*(raw_data_.nav.geph));
nav_.addSBASEphemeris(*(raw_data_.nav.seph));
new_nav_ = true;
break;
case 3:
// SBAS
......@@ -45,19 +50,30 @@ int UBloxRaw::addDataStream(const std::vector<u_int8_t>& data_stream)
nav_.addGLONASSEphemeris(*(raw_data_.nav.geph));
nav_.addSBASEphemeris(*(raw_data_.nav.seph));
updateObservations();
new_obs_ = true;
new_nav_ = true;
break;
case 9:
// Almanac
nav_.clearAlmanac();
nav_.addAlmanac(*(raw_data_.nav.alm));
new_nav_ = true;
break;
}
return update_type;
}
const Observations& UBloxRaw::getObservations() const {return obs_;}
const Navigation& UBloxRaw::getNavigation() const {return nav_;}
Observations UBloxRaw::getObservations()
{
new_obs_ = false;
return obs_;
}
Navigation UBloxRaw::getNavigation()
{
new_nav_ = false;
return nav_;
}
void UBloxRaw::updateObservations()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment