mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +00:00
Moved sender short name method into protobuf module (#1398)
* Moved sender short name method into protobuf module * Correct factory reset code for NRF (from 1.2) * Use the correct fs abstraction Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -48,6 +48,17 @@ template <class T> class ProtobufModule : protected SinglePortModule
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the short name from the sender of the mesh packet
|
||||
* Returns "???" if unknown sender
|
||||
*/
|
||||
const char *getSenderShortName(const MeshPacket &mp)
|
||||
{
|
||||
auto node = nodeDB.getNode(getFrom(&mp));
|
||||
const char *sender = (node) ? node->user.short_name : "???";
|
||||
return sender;
|
||||
}
|
||||
|
||||
private:
|
||||
/** Called to handle a particular incoming message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user