Skip to content

Commit

Permalink
Merge pull request #76 from TheThingsNetwork/feature/relax-devaddr-va…
Browse files Browse the repository at this point in the history
…lidation

Do not validate device address
  • Loading branch information
adriansmares committed May 30, 2023
2 parents 3f22c13 + e76ca83 commit ac72de9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/source/tts/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package tts

import (
"bytes"
"encoding/hex"
"strconv"
"strings"

Expand Down Expand Up @@ -51,7 +52,6 @@ func validateDeviceIds(a, b *ttnpb.EndDeviceIdentifiers) error {
{[]byte(a.DeviceId), []byte(b.DeviceId), "device_id"},
{a.DevEui, b.DevEui, "dev_eui"},
{a.JoinEui, b.JoinEui, "join_eui"},
{a.DevAddr, b.DevAddr, "dev_addr"},
}
if x, y := a.ApplicationIds, b.ApplicationIds; x != nil && y != nil {
pairs = append(pairs, pair{[]byte(x.ApplicationId), []byte(y.ApplicationId), "application_ids.application_id"})
Expand All @@ -67,7 +67,11 @@ func validateDeviceIds(a, b *ttnpb.EndDeviceIdentifiers) error {
if bytes.Equal(s.x, s.y) {
continue
}
return errDeviceIdentifiersMismatch.WithAttributes("field", s.name, "a", s.x, "b", s.y)
return errDeviceIdentifiersMismatch.WithAttributes(
"field", s.name,
"a", hex.EncodeToString(s.x),
"b", hex.EncodeToString(s.y),
)
}
return nil
}
Expand Down

0 comments on commit ac72de9

Please sign in to comment.