sforkowany z mirror/meshtastic-firmware
send dynamic probed GPS status to the phone
rodzic
33437b5246
commit
79ce7d929c
|
@ -13,6 +13,8 @@
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "CallbackCharacteristic.h"
|
#include "CallbackCharacteristic.h"
|
||||||
|
|
||||||
|
#include "GPS.h"
|
||||||
|
|
||||||
// This scratch buffer is used for various bluetooth reads/writes - but it is safe because only one bt operation can be in proccess at once
|
// This scratch buffer is used for various bluetooth reads/writes - but it is safe because only one bt operation can be in proccess at once
|
||||||
static uint8_t trBytes[_max(_max(_max(_max(ToRadio_size, RadioConfig_size), User_size), MyNodeInfo_size), FromRadio_size)];
|
static uint8_t trBytes[_max(_max(_max(_max(ToRadio_size, RadioConfig_size), User_size), MyNodeInfo_size), FromRadio_size)];
|
||||||
|
|
||||||
|
@ -93,6 +95,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// wrap our protobuf version with something that forces the service to reload the config
|
// wrap our protobuf version with something that forces the service to reload the config
|
||||||
class RadioCharacteristic : public ProtobufCharacteristic
|
class RadioCharacteristic : public ProtobufCharacteristic
|
||||||
{
|
{
|
||||||
|
@ -102,6 +105,16 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onRead(BLECharacteristic *c)
|
||||||
|
{
|
||||||
|
DEBUG_MSG("Reading radio config\n");
|
||||||
|
|
||||||
|
// update gps connection state
|
||||||
|
devicestate.has_radio = gps.isConnected;
|
||||||
|
|
||||||
|
BLEKeepAliveCallbacks::onRead(c);
|
||||||
|
}
|
||||||
|
|
||||||
void onWrite(BLECharacteristic *c)
|
void onWrite(BLECharacteristic *c)
|
||||||
{
|
{
|
||||||
ProtobufCharacteristic::onWrite(c);
|
ProtobufCharacteristic::onWrite(c);
|
||||||
|
|
|
@ -52,7 +52,7 @@ void NodeDB::init()
|
||||||
devicestate.has_my_node = true;
|
devicestate.has_my_node = true;
|
||||||
devicestate.has_radio = true;
|
devicestate.has_radio = true;
|
||||||
devicestate.has_owner = true;
|
devicestate.has_owner = true;
|
||||||
devicestate.has_radio = true;
|
devicestate.has_radio = false;
|
||||||
devicestate.radio.has_channel_settings = true;
|
devicestate.radio.has_channel_settings = true;
|
||||||
devicestate.radio.has_preferences = true;
|
devicestate.radio.has_preferences = true;
|
||||||
devicestate.node_db_count = 0;
|
devicestate.node_db_count = 0;
|
||||||
|
|
Ładowanie…
Reference in New Issue