ttjs

package
v3.21.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package ttjs provides the claiming client implementation for The Things Join Server API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

BasicAuth contains HTTP basic auth settings.

type Component

type Component interface {
	httpclient.Provider
	GetBaseConfig(ctx context.Context) config.ServiceBase
	GetPeerConn(ctx context.Context, role ttnpb.ClusterRole, ids cluster.EntityIdentifiers) (*grpc.ClientConn, error)
	AllowInsecureForCredentials() bool
}

Component abstracts the underlying *component.Component.

type Config

type Config struct {
	NetID           types.NetID         `yaml:"-"`
	JoinEUIPrefixes []types.EUI64Prefix `yaml:"-"`
	NetworkServer   NetworkServer       `yaml:"-"`

	BasicAuth          `yaml:"basic-auth"`
	ClaimingAPIVersion string `yaml:"claiming-api-version"`
	URL                string `yaml:"url"`
	TenantID           string `yaml:"tenant-id"`
}

Config is the configuration to communicate with The Things Join Server End Device Claming API.

func (*Config) NewClient

func (config *Config) NewClient(ctx context.Context, c Component) (*TTJS, error)

NewClient applies the config and returns a new TTJS client.

type NetworkServer added in v3.19.2

type NetworkServer struct {
	Hostname string
	HomeNSID types.EUI64
}

NetworkServer contains information related to the Network Server.

type OUI

type OUI uint32

OUI is the Organisation Unique Identifier.

func (OUI) MarshalText

func (oui OUI) MarshalText() ([]byte, error)

MarshalText implements encoding.TextUnmarshaler interface. This makes sure that the value sent to The Things Join Server is six upper case (UTF-8) hex characters.

func (*OUI) UnmarshalText

func (oui *OUI) UnmarshalText(data []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type TTJS

type TTJS struct {
	Component
	// contains filtered or unexported fields
}

TTJS is a client that claims end devices on a The Things Join Server.

func (*TTJS) Claim

func (client *TTJS) Claim(ctx context.Context, joinEUI, devEUI types.EUI64, claimAuthenticationCode string) error

Claim implements EndDeviceClaimer.

func (*TTJS) GetClaimStatus

func (client *TTJS) GetClaimStatus(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers) (*ttnpb.GetClaimStatusResponse, error)

GetClaimStatus implements EndDeviceClaimer.

func (*TTJS) SupportsJoinEUI

func (client *TTJS) SupportsJoinEUI(eui types.EUI64) bool

SupportsJoinEUI implements EndDeviceClaimer.

func (*TTJS) Unclaim

func (client *TTJS) Unclaim(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers) error

Unclaim implements EndDeviceClaimer.

type VendorSpecific

type VendorSpecific struct {
	OUI  OUI                    `json:"oui"`
	Data interop.TTIVSExtension `json:"data"`
}

VendorSpecific defines vendor specific fields.

func (VendorSpecific) MarshalJSON

func (vs VendorSpecific) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*VendorSpecific) UnmarshalJSON

func (vs *VendorSpecific) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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