mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-21 12:38:34 +00:00
delay position plugin start until 60 secs after first boot
This commit is contained in:
parent
c1733a4ac6
commit
71c35304d6
@ -7,6 +7,14 @@
|
|||||||
|
|
||||||
PositionPlugin *positionPlugin;
|
PositionPlugin *positionPlugin;
|
||||||
|
|
||||||
|
PositionPlugin::PositionPlugin()
|
||||||
|
: ProtobufPlugin("position", PortNum_POSITION_APP, Position_fields), concurrency::OSThread("PositionPlugin")
|
||||||
|
{
|
||||||
|
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 &p)
|
||||||
{
|
{
|
||||||
// FIXME - we currently update position data in the DB only if the message was a broadcast or destined to us
|
// FIXME - we currently update position data in the DB only if the message was a broadcast or destined to us
|
||||||
@ -61,8 +69,8 @@ void PositionPlugin::sendOurPosition(NodeNum dest, bool wantReplies)
|
|||||||
service.sendToMesh(p);
|
service.sendToMesh(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t PositionPlugin::runOnce()
|
||||||
int32_t PositionPlugin::runOnce(){
|
{
|
||||||
|
|
||||||
// We limit our GPS broadcasts to a max rate
|
// We limit our GPS broadcasts to a max rate
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
|
@ -20,8 +20,8 @@ class PositionPlugin : public ProtobufPlugin<Position>, private concurrency::OST
|
|||||||
/** Constructor
|
/** Constructor
|
||||||
* name is for debugging output
|
* name is for debugging output
|
||||||
*/
|
*/
|
||||||
PositionPlugin() : ProtobufPlugin("position", PortNum_POSITION_APP, Position_fields), concurrency::OSThread("PositionPlugin") {}
|
PositionPlugin();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send our position into the mesh
|
* Send our position into the mesh
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user