Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { LongName string ShortName string ID uint32 HardwareModel pbuf.HardwareModel }
func (*Node) EncryptPacket ¶
func (n *Node) EncryptPacket(pkt *pbuf.MeshPacket, channelName string, key []byte) *pbuf.MeshPacket
Not actually in use yet 😅
type NodeID ¶
type NodeID uint32
NodeID holds the node identifier. This is a uint32 value which uniquely identifies a node within a mesh.
func RandomNodeID ¶ added in v0.1.5
RandomNodeID returns a randomised NodeID. It's recommended to call this the first time a node is started and persist the result.
Hardware meshtastic nodes first try a NodeID of the last four bytes of the BLE MAC address. If that ID is already in use or invalid, a random NodeID is generated. Source: https://github.com/meshtastic/firmware/blob/d1ea58975755e146457a8345065e4ca357555275/src/mesh/NodeDB.cpp#L466
func (NodeID) DefaultLongName ¶ added in v0.1.5
DefaultLongName returns the default long node name based on the NodeID. Source: https://github.com/meshtastic/firmware/blob/d1ea58975755e146457a8345065e4ca357555275/src/mesh/NodeDB.cpp#L382
func (NodeID) DefaultShortName ¶ added in v0.1.5
DefaultShortName returns the default short node name based on the NodeID. Last two bytes of the NodeID represented in hex. Source: https://github.com/meshtastic/firmware/blob/d1ea58975755e146457a8345065e4ca357555275/src/mesh/NodeDB.cpp#L382
type PacketDeduplicator ¶ added in v0.1.5
type PacketDeduplicator struct { sync.RWMutex // RWMutex is used to protect the seen map from concurrent access. // contains filtered or unexported fields }
PacketDeduplicator is a structure that prevents processing of duplicate packets. It keeps a record of seen packets and the time they were last seen.
func NewDeduplicator ¶ added in v0.1.5
func NewDeduplicator(hasher hash.Hash, expiresAfter time.Duration) *PacketDeduplicator
NewDeduplicator creates a new PacketDeduplicator with a given hasher and expiration duration for packet records. It starts a background goroutine to periodically clean up expired packet records.
func (*PacketDeduplicator) Seen ¶ added in v0.1.5
func (p *PacketDeduplicator) Seen(sender, packetID uint32) bool
Seen checks whether a packet with the given sender and packetID has been seen before. If not, it records the packet as seen and returns false. Otherwise, it returns true.
func (*PacketDeduplicator) SeenData ¶ added in v0.1.5
func (p *PacketDeduplicator) SeenData(data []byte) bool
SeenData checks whether the data has been seen before based on its hashed value. If not, it records the data as seen and returns false. Otherwise, it returns true.
Directories
¶
Path | Synopsis |
---|---|
Package lora provides utilities to assess the signal quality of LoRa (Long Range) communication based on RSSI (Received Signal Strength Indicator) and SNR (Signal-to-Noise Ratio) values.
|
Package lora provides utilities to assess the signal quality of LoRa (Long Range) communication based on RSSI (Received Signal Strength Indicator) and SNR (Signal-to-Noise Ratio) values. |