joinserver

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package joinserver provides a http.Handler interface which implements the join-server API as speficied by the LoRaWAN Backend Interfaces.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMIC     = errors.New("invalid mic")
	ErrDevEUINotFound = errors.New("deveui does not exist")
)

Errors

Functions

func NewHandler

func NewHandler(config HandlerConfig) (http.Handler, error)

NewHandler creates a new join-sever handler.

Types

type DeviceKeys

type DeviceKeys struct {
	DevEUI    lorawan.EUI64
	NwkKey    lorawan.AES128Key
	AppKey    lorawan.AES128Key
	JoinNonce int // the join-nonce that must be used for the join-accept
}

DeviceKeys holds the device (root) keys and the join-nonce to be used for join-request and join-accepts. Note: it follows the LoRaWAN 1.1 key naming!

type HandlerConfig

type HandlerConfig struct {
	Logger                    *log.Logger
	GetDeviceKeysByDevEUIFunc func(devEUI lorawan.EUI64) (DeviceKeys, error)    // ErrDevEUINotFound must be returned when the device does not exist
	GetKEKByLabelFunc         func(label string) ([]byte, error)                // must return an empty slice when no KEK exists for the given label
	GetASKEKLabelByDevEUIFunc func(devEUI lorawan.EUI64) (string, error)        // must return an empty string when no label exists
	GetHomeNetIDByDevEUIFunc  func(devEUI lorawan.EUI64) (lorawan.NetID, error) // ErrDevEUINotFound must be returned when the device does not exist
}

HandlerConfig holds the join-server handler configuration.

Jump to

Keyboard shortcuts

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