enddevices

package
v3.22.1 Latest Latest
Warning

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

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

Documentation

Overview

Package enddevices provides functions to configure End Device claiming clients.

Index

Constants

View Source
const JSClientConfigurationName = "config.yml"

JSClientConfigurationName is the filename of Join Server client configuration.

Variables

This section is empty.

Functions

This section is empty.

Types

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   `name:"net-id" description:"NetID of this network to configure as home NetID when claiming"`
	NetworkServer NetworkServer `name:"network-server" description:"Network Server of the cluster that handles claimed device traffic"`

	Source    string                `name:"source" description:"Source of the file containing Join Server settings (directory, url, blob)"`
	Directory string                `name:"directory" description:"OS filesystem directory, which contains the config.yml and the client-specific files"`
	URL       string                `name:"url" description:"URL, which contains Join Server client configuration"`
	Blob      config.BlobPathConfig `name:"blob"`
}

Config contains options for end device claiming clients.

func (Config) Fetcher

func (c Config) Fetcher(ctx context.Context, blobConf config.BlobConfig, httpClientProvider httpclient.Provider) (fetch.Interface, error)

Fetcher returns a fetch.Interface based on the configuration. If no configuration source is set, this method returns nil, nil.

type EndDeviceClaimer

type EndDeviceClaimer interface {
	// SupportsJoinEUI returns whether the Join Server supports this JoinEUI.
	SupportsJoinEUI(joinEUI types.EUI64) bool
	// Claim claims an End Device.
	Claim(ctx context.Context, joinEUI, devEUI types.EUI64, claimAuthenticationCode string) error
	// GetClaimStatus returns the claim status an End Device.
	GetClaimStatus(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers) (*ttnpb.GetClaimStatusResponse, error)
	// Unclaim releases the claim on an End Device.
	Unclaim(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers) (err error)
}

EndDeviceClaimer provides methods for Claiming End Devices on (external) Join Server.

type NetworkServer added in v3.19.2

type NetworkServer struct {
	Hostname string      `name:"hostname" description:"Hostname of the Network Server. Must not contain a port"`
	HomeNSID types.EUI64 `name:"home-ns-id" description:"HomeNSID of the Network Server (EUI)"`
}

NetworkServer contains information related to the Network Server.

type Option

type Option func(*Upstream)

Option configures Upstream.

func WithDeviceRegistry

func WithDeviceRegistry(reg ttnpb.EndDeviceRegistryClient) Option

WithDeviceRegistry overrides the device registry of the Upstream.

type Upstream

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

Upstream abstracts EndDeviceClaimingServer.

func NewUpstream

func NewUpstream(ctx context.Context, conf Config, c Component, opts ...Option) (*Upstream, error)

NewUpstream returns a new Upstream.

func (*Upstream) Claim

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

Claim implements EndDeviceClaimingServer.

func (*Upstream) GetClaimStatus

func (upstream *Upstream) GetClaimStatus(ctx context.Context, in *ttnpb.EndDeviceIdentifiers) (*ttnpb.GetClaimStatusResponse, error)

GetClaimStatus implements EndDeviceClaimingServer.

func (*Upstream) GetInfoByJoinEUI

func (upstream *Upstream) GetInfoByJoinEUI(ctx context.Context, in *ttnpb.GetInfoByJoinEUIRequest) (*ttnpb.GetInfoByJoinEUIResponse, error)

GetInfoByJoinEUI implements EndDeviceClaimingServer.

func (*Upstream) Unclaim

func (upstream *Upstream) Unclaim(ctx context.Context, in *ttnpb.EndDeviceIdentifiers) (*pbtypes.Empty, error)

Unclaim implements EndDeviceClaimingServer.

Directories

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

Jump to

Keyboard shortcuts

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