only display messages destined to us

1.2-legacy
geeksville 2020-02-17 16:32:51 -08:00
rodzic c0fdf227b7
commit 47d278b3b9
3 zmienionych plików z 17 dodań i 9 usunięć

Wyświetl plik

@ -247,14 +247,20 @@ void NodeDB::updateFrom(const MeshPacket &mp)
updateGUIforNode = info; updateGUIforNode = info;
break; break;
case SubPacket_data_tag: { case SubPacket_data_tag:
{
// Keep a copy of the most recent text message. // Keep a copy of the most recent text message.
if(p.variant.data.typ == Data_Type_CLEAR_TEXT) { if (p.variant.data.typ == Data_Type_CLEAR_TEXT)
{
DEBUG_MSG("Received text msg from=0%0x, msg=%.*s\n", mp.from, p.variant.data.payload.size, p.variant.data.payload.bytes); DEBUG_MSG("Received text msg from=0%0x, msg=%.*s\n", mp.from, p.variant.data.payload.size, p.variant.data.payload.bytes);
if (mp.to == NODENUM_BROADCAST || mp.to == nodeDB.getNodeNum())
{
// We only store/display messages destined for us.
devicestate.rx_text_message = mp; devicestate.rx_text_message = mp;
devicestate.has_rx_text_message = true; devicestate.has_rx_text_message = true;
updateTextMessage = true; updateTextMessage = true;
} }
}
break; break;
} }

Wyświetl plik

@ -47,6 +47,7 @@ public:
/// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw /// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw
void updateFrom(const MeshPacket &p); void updateFrom(const MeshPacket &p);
/// @return our node number
NodeNum getNodeNum() { return myNodeInfo.my_node_num; } NodeNum getNodeNum() { return myNodeInfo.my_node_num; }
size_t getNumNodes() { return *numNodes; } size_t getNumNodes() { return *numNodes; }

Wyświetl plik

@ -544,6 +544,7 @@ uint32_t screen_loop()
if (wakeScreen || nodeDB.updateTextMessage) // If a new text message arrived, turn the screen on immedately if (wakeScreen || nodeDB.updateTextMessage) // If a new text message arrived, turn the screen on immedately
{ {
lastPressMs = millis(); // if we were told to wake the screen, reset the press timeout
screen_on(); // make sure the screen is not asleep screen_on(); // make sure the screen is not asleep
wakeScreen = false; wakeScreen = false;
} }