implement nodeinfo ble charstic

This commit is contained in:
geeksville
2020-02-03 21:03:20 -08:00
parent d0027e9f6a
commit 634a547030
5 changed files with 69 additions and 31 deletions

View File

@@ -25,15 +25,24 @@ static NodeNum getDesiredNodeNum()
return r;
}
NodeDB::NodeDB() : ourNodeNum(getDesiredNodeNum()), numNodes(0)
NodeDB::NodeDB() : ourNodeNum(getDesiredNodeNum())
{
}
/// return number msecs since 1970
uint64_t getCurrentTime() {
uint64_t getCurrentTime()
{
return 4403; // FIXME
}
const NodeInfo *NodeDB::readNextInfo()
{
if (readPointer < numNodes)
return &nodes[readPointer++];
else
return NULL;
}
/// given a subpacket sniffed from the network, update our DB state
/// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw
void NodeDB::updateFrom(const MeshPacket &mp)
@@ -52,7 +61,7 @@ void NodeDB::updateFrom(const MeshPacket &mp)
info->last_seen.msecs = getCurrentTime();
info->has_last_seen = true;
switch (p.which_variant)
{
case SubPacket_position_tag: