EndDeviceIdentifiers returns the end device identifiers (DevEUI/JoinEUI/DevAddr) available for the message payload. Note that if the payload is nil, the end device identifiers will be nil.
()
| 1169 | // EndDeviceIdentifiers returns the end device identifiers (DevEUI/JoinEUI/DevAddr) available for the message payload. |
| 1170 | // Note that if the payload is nil, the end device identifiers will be nil. |
| 1171 | func (m *Message) EndDeviceIdentifiers() *EndDeviceIdentifiers { |
| 1172 | if h := m.GetMacPayload().GetFHdr(); h != nil { |
| 1173 | devAddr := types.MustDevAddr(h.DevAddr).OrZero() |
| 1174 | return &EndDeviceIdentifiers{ |
| 1175 | DevAddr: devAddr.Bytes(), |
| 1176 | } |
| 1177 | } |
| 1178 | if p := m.GetJoinRequestPayload(); p != nil { |
| 1179 | devEUI, joinEUI := types.MustEUI64(p.DevEui).OrZero(), types.MustEUI64(p.JoinEui).OrZero() |
| 1180 | return &EndDeviceIdentifiers{ |
| 1181 | DevEui: devEUI.Bytes(), |
| 1182 | JoinEui: joinEUI.Bytes(), |
| 1183 | } |
| 1184 | } |
| 1185 | if p := m.GetJoinAcceptPayload(); p != nil { |
| 1186 | devAddr := types.MustDevAddr(p.DevAddr).OrZero() |
| 1187 | return &EndDeviceIdentifiers{ |
| 1188 | DevAddr: devAddr.Bytes(), |
| 1189 | } |
| 1190 | } |
| 1191 | if p := m.GetRejoinRequestPayload(); p != nil { |
| 1192 | devEUI, joinEUI := types.MustEUI64(p.DevEui).OrZero(), types.MustEUI64(p.JoinEui).OrZero() |
| 1193 | return &EndDeviceIdentifiers{ |
| 1194 | DevEui: devEUI.Bytes(), |
| 1195 | JoinEui: joinEUI.Bytes(), |
| 1196 | } |
| 1197 | } |
| 1198 | return nil |
| 1199 | } |
| 1200 | |
| 1201 | // FieldIsZero returns whether path p is zero. |
| 1202 | func (v *RelaySecondChannel) FieldIsZero(p string) bool { |
no test coverage detected