diff options
Diffstat (limited to 'util.go')
| -rw-r--r-- | util.go | 23 |
1 files changed, 0 insertions, 23 deletions
@@ -2,31 +2,8 @@ package meshtastic import ( pbuf "buf.build/gen/go/meshtastic/protobufs/protocolbuffers/go/meshtastic" - "encoding/binary" - "fmt" - "math" ) -type NodeID uint32 - -func (n NodeID) Uint32() uint32 { - return uint32(n) -} - -func (n NodeID) String() string { - return fmt.Sprintf("!%08x", uint32(n)) -} - -// Bytes converts the NodeID to a byte slice -func (n NodeID) Bytes() []byte { - bytes := make([]byte, 4) // uint32 is 4 bytes - binary.BigEndian.PutUint32(bytes, n.Uint32()) - return bytes -} - -// BroadcastNodeID is the special NodeID used when broadcasting a packet to a channel. -const BroadcastNodeID NodeID = math.MaxUint32 - type Node struct { LongName string ShortName string |
