gateways

package
v3.33.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package gateways provides a QR code parser for gateways.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data interface {
	// FormatID returns the ID of the format used to parse the QR Code data.
	FormatID() string
	GatewayEUI() types.EUI64
	OwnerToken() string
	encoding.TextUnmarshaler
}

Data represents gateway QR code data.

type Format

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

Format is a gateway QR code format.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server provides methods for gateways QR codes.

func New

func New() *Server

New returns a new Server.

func (*Server) Formats

func (s *Server) Formats() []*ttnpb.QRCodeFormat

Formats returns the registered gateway QR code formats.

func (*Server) GetGatewayFormat

func (s *Server) GetGatewayFormat(id string) Format

GetGatewayFormat returns the format by ID.

func (*Server) GetGatewayFormats

func (s *Server) GetGatewayFormats() map[string]Format

GetGatewayFormats returns the registered gateway QR code formats.

func (*Server) Parse

func (s *Server) Parse(formatID string, data []byte) (ret Data, err error)

Parse the given QR code data. If formatID is provided, only that format is used. Otherwise, the first format registered will be used.

func (*Server) RegisterGatewayFormat

func (s *Server) RegisterGatewayFormat(id string, f Format)

RegisterGatewayFormat registers the given gateway QR code format.

type TTIGPRO1Format

type TTIGPRO1Format struct{}

TTIGPRO1Format implements the TTIGPRO1 Format.

func (TTIGPRO1Format) Format

func (TTIGPRO1Format) Format() *ttnpb.QRCodeFormat

Format implements the Format interface.

func (TTIGPRO1Format) ID

func (TTIGPRO1Format) ID() string

ID is the identifier of the format as a string.

func (TTIGPRO1Format) New

func (TTIGPRO1Format) New() Data

New implements the Format interface.

Jump to

Keyboard shortcuts

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