qrcode

package
v3.12.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package qrcode implements working with QR codes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEndDeviceFormats

func GetEndDeviceFormats() map[string]EndDeviceFormat

GetEndDeviceFormats returns the registered end device QR code formats.

func RegisterEndDeviceFormat

func RegisterEndDeviceFormat(id string, f EndDeviceFormat)

RegisterEndDeviceFormat registers the given end device QR code format. Existing registrations with the same ID will be overwritten.

Types

type AuthenticatedEndDeviceIdentifiers

type AuthenticatedEndDeviceIdentifiers interface {
	AuthenticatedEndDeviceIdentifiers() (joinEUI, devEUI types.EUI64, authenticationCode string)
}

AuthenticatedEndDeviceIdentifiers defines end device identifiers with authentication code.

type Data

type Data interface {
	Validate() error
	encoding.TextMarshaler
	encoding.TextUnmarshaler
}

Data represents QR code data.

func Parse

func Parse(data []byte) (Data, error)

Parse attempts to parse the given QR code data.

type EndDeviceData

type EndDeviceData interface {
	Data
	Encode(*ttnpb.EndDevice) error
}

EndDeviceData represents end device QR code data.

type EndDeviceFormat

type EndDeviceFormat interface {
	Format() *ttnpb.QRCodeFormat
	New() EndDeviceData
}

EndDeviceFormat is a end device QR code format.

func GetEndDeviceFormat

func GetEndDeviceFormat(id string) EndDeviceFormat

GetEndDeviceFormat returns the converter by ID.

type LoRaAllianceTR005 added in v3.11.3

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) AuthenticatedEndDeviceIdentifiers added in v3.11.3

func (m *LoRaAllianceTR005) AuthenticatedEndDeviceIdentifiers() (joinEUI, devEUI types.EUI64, authenticationCode string)

AuthenticatedEndDeviceIdentifiers implements the AuthenticatedEndDeviceIdentifiers interface.

func (*LoRaAllianceTR005) Encode added in v3.11.3

func (m *LoRaAllianceTR005) Encode(dev *ttnpb.EndDevice) error

Encode implements the Data interface.

func (LoRaAllianceTR005) MarshalText added in v3.11.3

func (m LoRaAllianceTR005) MarshalText() ([]byte, error)

MarshalText implements the TextMarshaler interface.

func (*LoRaAllianceTR005) UnmarshalText added in v3.11.3

func (m *LoRaAllianceTR005) UnmarshalText(text []byte) error

UnmarshalText implements the TextUnmarshaler interface.

func (LoRaAllianceTR005) Validate added in v3.11.3

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) AuthenticatedEndDeviceIdentifiers

func (m *LoRaAllianceTR005Draft2) AuthenticatedEndDeviceIdentifiers() (joinEUI, devEUI types.EUI64, authenticationCode string)

AuthenticatedEndDeviceIdentifiers implements the AuthenticatedEndDeviceIdentifiers interface.

func (*LoRaAllianceTR005Draft2) Encode

func (m *LoRaAllianceTR005Draft2) Encode(dev *ttnpb.EndDevice) error

Encode 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 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) AuthenticatedEndDeviceIdentifiers

func (m *LoRaAllianceTR005Draft3) AuthenticatedEndDeviceIdentifiers() (joinEUI, devEUI types.EUI64, authenticationCode string)

AuthenticatedEndDeviceIdentifiers implements the AuthenticatedEndDeviceIdentifiers interface.

func (*LoRaAllianceTR005Draft3) Encode

func (m *LoRaAllianceTR005Draft3) Encode(dev *ttnpb.EndDevice) error

Encode 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL