Documentation ¶
Index ¶
- type Data
- type Format
- type LoRaAllianceTR005
- func (m *LoRaAllianceTR005) Encode(dev *ttnpb.EndDevice) error
- func (m *LoRaAllianceTR005) EndDeviceTemplate() *ttnpb.EndDeviceTemplate
- func (m *LoRaAllianceTR005) FormatID() string
- func (m LoRaAllianceTR005) MarshalText() ([]byte, error)
- func (m *LoRaAllianceTR005) UnmarshalText(text []byte) error
- func (m LoRaAllianceTR005) Validate() error
- type LoRaAllianceTR005Draft2
- func (m *LoRaAllianceTR005Draft2) Encode(dev *ttnpb.EndDevice) error
- func (m *LoRaAllianceTR005Draft2) EndDeviceTemplate() *ttnpb.EndDeviceTemplate
- func (m *LoRaAllianceTR005Draft2) FormatID() string
- func (m LoRaAllianceTR005Draft2) MarshalText() ([]byte, error)
- func (m *LoRaAllianceTR005Draft2) UnmarshalText(text []byte) error
- func (m LoRaAllianceTR005Draft2) Validate() error
- type LoRaAllianceTR005Draft2Format
- type LoRaAllianceTR005Draft3
- func (m *LoRaAllianceTR005Draft3) Encode(dev *ttnpb.EndDevice) error
- func (m *LoRaAllianceTR005Draft3) EndDeviceTemplate() *ttnpb.EndDeviceTemplate
- func (m *LoRaAllianceTR005Draft3) FormatID() string
- func (m LoRaAllianceTR005Draft3) MarshalText() ([]byte, error)
- func (m *LoRaAllianceTR005Draft3) UnmarshalText(text []byte) error
- func (m LoRaAllianceTR005Draft3) Validate() error
- type LoRaAllianceTR005Draft3Format
- type LoRaAllianceTR005Format
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data interface { qrcode.Data Encode(*ttnpb.EndDevice) error // FormatID returns the ID of the format used to parse the QR Code data. FormatID() string // EndDeviceTemplate returns the End Device Template corresponding to the QR code data. EndDeviceTemplate() *ttnpb.EndDeviceTemplate }
Data represents end device QR code data.
type Format ¶
type Format interface { Format() *ttnpb.QRCodeFormat New() Data }
Format is a end device QR code format.
type LoRaAllianceTR005 ¶
type LoRaAllianceTR005 struct { JoinEUI, DevEUI types.EUI64 VendorID, ModelID [2]byte Checksum, OwnerToken, SerialNumber, Proprietary string }
LoRaAllianceTR005 is the LoRa Alliance defined format in Technical Recommendation TR005. See https://lora-alliance.org/wp-content/uploads/2020/11/TR005_LoRaWAN_Device_Identification_QR_Codes.pdf
func (*LoRaAllianceTR005) Encode ¶
func (m *LoRaAllianceTR005) Encode(dev *ttnpb.EndDevice) error
Encode implements the Data interface.
func (*LoRaAllianceTR005) EndDeviceTemplate ¶
func (m *LoRaAllianceTR005) EndDeviceTemplate() *ttnpb.EndDeviceTemplate
EndDeviceTemplate implements the Data interface.
func (*LoRaAllianceTR005) FormatID ¶
func (m *LoRaAllianceTR005) FormatID() string
FormatID implements the Data interface.
func (LoRaAllianceTR005) MarshalText ¶
func (m LoRaAllianceTR005) MarshalText() ([]byte, error)
MarshalText implements the TextMarshaler interface.
func (*LoRaAllianceTR005) UnmarshalText ¶
func (m *LoRaAllianceTR005) UnmarshalText(text []byte) error
UnmarshalText implements the TextUnmarshaler interface.
func (LoRaAllianceTR005) Validate ¶
func (m LoRaAllianceTR005) Validate() error
Validate implements the Data interface.
type LoRaAllianceTR005Draft2 ¶
type LoRaAllianceTR005Draft2 struct { JoinEUI, DevEUI types.EUI64 VendorID, ModelID [2]byte DeviceValidationCode, SerialNumber, Proprietary string }
LoRaAllianceTR005Draft2 is the LoRa Alliance defined format in Technical Recommendation TR005 Draft 2.
func (*LoRaAllianceTR005Draft2) Encode ¶
func (m *LoRaAllianceTR005Draft2) Encode(dev *ttnpb.EndDevice) error
Encode implements the Data interface.
func (*LoRaAllianceTR005Draft2) EndDeviceTemplate ¶
func (m *LoRaAllianceTR005Draft2) EndDeviceTemplate() *ttnpb.EndDeviceTemplate
EndDeviceTemplate implements the Data interface.
func (*LoRaAllianceTR005Draft2) FormatID ¶
func (m *LoRaAllianceTR005Draft2) FormatID() string
FormatID implements the Data interface.
func (LoRaAllianceTR005Draft2) MarshalText ¶
func (m LoRaAllianceTR005Draft2) MarshalText() ([]byte, error)
MarshalText implements the TextMarshaler interface.
func (*LoRaAllianceTR005Draft2) UnmarshalText ¶
func (m *LoRaAllianceTR005Draft2) UnmarshalText(text []byte) error
UnmarshalText implements the TextUnmarshaler interface.
func (LoRaAllianceTR005Draft2) Validate ¶
func (m LoRaAllianceTR005Draft2) Validate() error
Validate implements the Data interface.
type LoRaAllianceTR005Draft2Format ¶
type LoRaAllianceTR005Draft2Format struct{}
LoRaAllianceTR005Draft2Format implements the LoRa Alliance TR005 Draft2 Format.
func (LoRaAllianceTR005Draft2Format) Format ¶
func (LoRaAllianceTR005Draft2Format) Format() *ttnpb.QRCodeFormat
Format implements the Format interface.
func (LoRaAllianceTR005Draft2Format) ID ¶
func (LoRaAllianceTR005Draft2Format) ID() string
ID is the identifier of the format as a string.
func (LoRaAllianceTR005Draft2Format) New ¶
func (LoRaAllianceTR005Draft2Format) New() Data
New implements the Format interface.
type LoRaAllianceTR005Draft3 ¶
type LoRaAllianceTR005Draft3 struct { JoinEUI, DevEUI types.EUI64 VendorID, ModelID [2]byte DeviceValidationCode, SerialNumber, Proprietary string }
LoRaAllianceTR005Draft3 is the LoRa Alliance defined format in Technical Recommendation TR005 Draft 3.
func (*LoRaAllianceTR005Draft3) Encode ¶
func (m *LoRaAllianceTR005Draft3) Encode(dev *ttnpb.EndDevice) error
Encode implements the Data interface.
func (*LoRaAllianceTR005Draft3) EndDeviceTemplate ¶
func (m *LoRaAllianceTR005Draft3) EndDeviceTemplate() *ttnpb.EndDeviceTemplate
EndDeviceTemplate implements the Data interface.
func (*LoRaAllianceTR005Draft3) FormatID ¶
func (m *LoRaAllianceTR005Draft3) FormatID() string
FormatID implements the Data interface.
func (LoRaAllianceTR005Draft3) MarshalText ¶
func (m LoRaAllianceTR005Draft3) MarshalText() ([]byte, error)
MarshalText implements the TextMarshaler interface.
func (*LoRaAllianceTR005Draft3) UnmarshalText ¶
func (m *LoRaAllianceTR005Draft3) UnmarshalText(text []byte) error
UnmarshalText implements the TextUnmarshaler interface.
func (LoRaAllianceTR005Draft3) Validate ¶
func (m LoRaAllianceTR005Draft3) Validate() error
Validate implements the Data interface.
type LoRaAllianceTR005Draft3Format ¶
type LoRaAllianceTR005Draft3Format struct{}
LoRaAllianceTR005Draft3Format implements the LoRa Alliance TR005 Draft3 Format.
func (LoRaAllianceTR005Draft3Format) Format ¶
func (LoRaAllianceTR005Draft3Format) Format() *ttnpb.QRCodeFormat
Format implements the Format interface.
func (LoRaAllianceTR005Draft3Format) ID ¶
func (LoRaAllianceTR005Draft3Format) ID() string
ID is the identifier of the format as a string.
func (LoRaAllianceTR005Draft3Format) New ¶
func (LoRaAllianceTR005Draft3Format) New() Data
New implements EndDeviceFormat.
type LoRaAllianceTR005Format ¶
type LoRaAllianceTR005Format struct{}
LoRaAllianceTR005Format implements the LoRa Alliance TR005 Format.
func (LoRaAllianceTR005Format) Format ¶
func (LoRaAllianceTR005Format) Format() *ttnpb.QRCodeFormat
Format implements the Format interface.
func (LoRaAllianceTR005Format) ID ¶
func (LoRaAllianceTR005Format) ID() string
ID is the identifier of the format as a string.
func (LoRaAllianceTR005Format) New ¶
func (LoRaAllianceTR005Format) New() Data
New implements the Format interface.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides methods for end device QR codes.
func (*Server) GetEndDeviceFormat ¶
GetEndDeviceFormat returns the converter by ID.
func (*Server) GetEndDeviceFormats ¶
GetEndDeviceFormats returns the registered end device QR code formats.
func (*Server) Parse ¶
Parse attempts to parse the given QR code data. It returns the parser and the format ID that successfully parsed the QR code.
func (*Server) RegisterEndDeviceFormat ¶
RegisterEndDeviceFormat registers the given end device QR code format. Existing registrations with the same ID will not be overwritten. While matching, the slice will be traversed in a FIFO manner.