ToClientID returns the client identifier of the specified unique ID.
(uid string)
| 62 | |
| 63 | // ToClientID returns the client identifier of the specified unique ID. |
| 64 | func ToClientID(uid string) (id *ttnpb.ClientIdentifiers, err error) { |
| 65 | id = &ttnpb.ClientIdentifiers{ClientId: uid} |
| 66 | if err := id.ValidateFields("client_id"); err != nil { |
| 67 | return nil, errUniqueIdentifier.WithCause(err).WithAttributes("uid", uid) |
| 68 | } |
| 69 | return id, nil |
| 70 | } |
| 71 | |
| 72 | // ToDeviceID returns the end device identifier of the specified unique ID. |
| 73 | func ToDeviceID(uid string) (id *ttnpb.EndDeviceIdentifiers, err error) { |