MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / UnmarshalMHDR

Function UnmarshalMHDR

pkg/encoding/lorawan/messages.go:44–52  ·  view source on GitHub ↗

UnmarshalMHDR unmarshals b into msg.

(b []byte, msg *ttnpb.MHDR)

Source from the content-addressed store, hash-verified

42
43// UnmarshalMHDR unmarshals b into msg.
44func UnmarshalMHDR(b []byte, msg *ttnpb.MHDR) error {
45 if len(b) != 1 {
46 return errExpectedLengthEncodedEqual("MHDR", 1)(len(b))
47 }
48 v := b[0]
49 msg.MType = ttnpb.MType(v >> 5)
50 msg.Major = ttnpb.Major(v & 3)
51 return nil
52}
53
54// AppendFCtrl appends encoded msg to dst.
55func AppendFCtrl(dst []byte, msg *ttnpb.FCtrl, isUplink bool, fOptsLen uint8) ([]byte, error) {

Callers 4

toUplinkMessageMethod · 0.92
toUplinkMessageMethod · 0.92
UnmarshalMessageFunction · 0.85

Calls 3

MTypeTypeAlias · 0.92
MajorTypeAlias · 0.92

Tested by

no test coverage detected