UnmarshalMHDR unmarshals b into msg.
(b []byte, msg *ttnpb.MHDR)
| 42 | |
| 43 | // UnmarshalMHDR unmarshals b into msg. |
| 44 | func 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. |
| 55 | func AppendFCtrl(dst []byte, msg *ttnpb.FCtrl, isUplink bool, fOptsLen uint8) ([]byte, error) { |
no test coverage detected