lorawan: github.com/brocaar/lorawan/backend/joinserver Index | Files

package joinserver

import "github.com/brocaar/lorawan/backend/joinserver"

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


Package Files

context.go errors.go join_request.go joinserver.go key_wrap.go rejoin_request.go session_keys.go


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


func NewHandler Uses

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

NewHandler creates a new join-sever handler.

type DeviceKeys Uses

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 Uses

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

HandlerConfig holds the join-server handler configuration.

Package joinserver imports 11 packages (graph) and is imported by 1 packages. Updated 2019-01-30. Refresh now. Tools for package owners.