UnmarshalDLSettings unmarshals b into msg.
(b []byte, msg *ttnpb.DLSettings)
| 209 | |
| 210 | // UnmarshalDLSettings unmarshals b into msg. |
| 211 | func UnmarshalDLSettings(b []byte, msg *ttnpb.DLSettings) error { |
| 212 | if len(b) != 1 { |
| 213 | return errExpectedLengthEncodedEqual("DLSettings", 1)(len(b)) |
| 214 | } |
| 215 | v := uint32(b[0]) |
| 216 | msg.OptNeg = (v >> 7) != 0 |
| 217 | msg.Rx1DrOffset = ttnpb.DataRateOffset((v >> 4) & 0x7) |
| 218 | msg.Rx2Dr = ttnpb.DataRateIndex(v & 0xf) |
| 219 | return nil |
| 220 | } |
| 221 | |
| 222 | var errMaxCFListFrequency = unexpectedValue( |
| 223 | errors.DefineInvalidArgument("max_cflist_frequency", "expected CFList frequency to be less or equal to 0xFFFFFF", valueKey), |
no test coverage detected