mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-15 17:42:12 +00:00
positions now sent using the new API
This commit is contained in:
parent
9b24cc6dd6
commit
f1179bd3ea
@ -8,13 +8,14 @@ For app cleanup:
|
|||||||
* require a recent python api to talk to these new device loads
|
* require a recent python api to talk to these new device loads
|
||||||
* on android for received positions handle either old or new positions
|
* on android for received positions handle either old or new positions
|
||||||
* on android side send old or new positions as needed
|
* on android side send old or new positions as needed
|
||||||
* fix position sending to use new plugin
|
* DONE fix position sending to use new plugin
|
||||||
* Add SinglePortNumPlugin - as the new most useful baseclass
|
* Add SinglePortNumPlugin - as the new most useful baseclass
|
||||||
* move positions into regular data packets (use new app framework)
|
* DONE move positions into regular data packets (use new app framework)
|
||||||
* move user info into regular data packets (use new app framework)
|
* move user info into regular data packets (use new app framework)
|
||||||
* test that positions, text messages and user info still work
|
* test that positions, text messages and user info still work
|
||||||
* test that position, text messages and user info work properly with new android app and old device code
|
* test that position, text messages and user info work properly with new android app and old device code
|
||||||
* call the plugin setup functions
|
* call the plugin setup functions
|
||||||
|
* fix the RTC drift bug
|
||||||
|
|
||||||
For high speed/lots of devices/short range tasks:
|
For high speed/lots of devices/short range tasks:
|
||||||
|
|
||||||
|
2
proto
2
proto
@ -1 +1 @@
|
|||||||
Subproject commit 8b24fbab195ca76932e70456750cd0172d47db79
|
Subproject commit be48f1cbef1f00a4dbe67c81780dc53916ba5335
|
@ -284,10 +284,10 @@ void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies)
|
|||||||
int MeshService::onGPSChanged(const meshtastic::GPSStatus *unused)
|
int MeshService::onGPSChanged(const meshtastic::GPSStatus *unused)
|
||||||
{
|
{
|
||||||
// Update our local node info with our position (even if we don't decide to update anyone else)
|
// Update our local node info with our position (even if we don't decide to update anyone else)
|
||||||
MeshPacket *p = router->allocForSending();
|
|
||||||
p->decoded.which_payload = SubPacket_position_tag;
|
|
||||||
|
|
||||||
Position &pos = p->decoded.position;
|
Position pos;
|
||||||
|
|
||||||
|
memset(&pos, 0, sizeof(pos));
|
||||||
|
|
||||||
if (gps->hasLock()) {
|
if (gps->hasLock()) {
|
||||||
if (gps->altitude != 0)
|
if (gps->altitude != 0)
|
||||||
@ -304,20 +304,17 @@ int MeshService::onGPSChanged(const meshtastic::GPSStatus *unused)
|
|||||||
|
|
||||||
// DEBUG_MSG("got gps notify time=%u, lat=%d, bat=%d\n", pos.latitude_i, pos.time, pos.battery_level);
|
// DEBUG_MSG("got gps notify time=%u, lat=%d, bat=%d\n", pos.latitude_i, pos.time, pos.battery_level);
|
||||||
|
|
||||||
|
// Update our current position in the local DB
|
||||||
|
nodeDB.updatePosition(nodeDB.getNodeNum(), pos);
|
||||||
|
|
||||||
// We limit our GPS broadcasts to a max rate
|
// We limit our GPS broadcasts to a max rate
|
||||||
static uint32_t lastGpsSend;
|
static uint32_t lastGpsSend;
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
if (lastGpsSend == 0 || now - lastGpsSend > getPref_position_broadcast_secs() * 1000) {
|
if (lastGpsSend == 0 || now - lastGpsSend > getPref_position_broadcast_secs() * 1000) {
|
||||||
lastGpsSend = now;
|
lastGpsSend = now;
|
||||||
DEBUG_MSG("Sending position to mesh\n");
|
DEBUG_MSG("Sending position to mesh (not requesting replies)\n");
|
||||||
|
positionPlugin.sendOurPosition();
|
||||||
sendToMesh(p);
|
}
|
||||||
} else {
|
|
||||||
// We don't need to send this packet to anyone else, but it still serves as a nice uniform way to update our local state
|
|
||||||
nodeDB.updateFrom(*p);
|
|
||||||
|
|
||||||
releaseToPool(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user