WIP phone api changes for dev1.2

This commit is contained in:
Kevin Hester
2021-02-17 19:04:41 +08:00
parent 60a01567d9
commit 69a11e7375
18 changed files with 82 additions and 63 deletions

View File

@@ -10,15 +10,15 @@ PositionPlugin *positionPlugin;
PositionPlugin::PositionPlugin()
: ProtobufPlugin("position", PortNum_POSITION_APP, Position_fields), concurrency::OSThread("PositionPlugin")
{
isPromiscuous = true; // We always want to update our nodedb, even if we are sniffing on others
setIntervalFromNow(60 *
1000); // Send our initial position 60 seconds after we start (to give GPS time to setup)
}
bool PositionPlugin::handleReceivedProtobuf(const MeshPacket &mp, const Position &p)
bool PositionPlugin::handleReceivedProtobuf(const MeshPacket &mp, const Position *pptr)
{
// FIXME - we currently update position data in the DB only if the message was a broadcast or destined to us
// it would be better to update even if the message was destined to others.
auto p = *pptr;
if (p.time) {
struct timeval tv;