internal

package
v3.16.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Internal package contains various Network Server utilities

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCorruptedMACState = errors.DefineCorruption("corrupted_mac_state", "MAC state is corrupted")
	ErrInvalidDataRate   = errors.DefineInvalidArgument("data_rate", "invalid data rate")
	ErrInvalidPayload    = errors.DefineInvalidArgument("payload", "invalid payload")
	ErrUnknownChannel    = errors.Define("unknown_chanel", "channel is unknown")

	ErrNetworkDownlinkSlot  = errors.DefineCorruption("network_downlink_slot", "could not generate network initiated downlink slot")
	ErrUplinkChannel        = errors.DefineCorruption("uplink_channel", "channel does not allow downlinks")
	ErrDownlinkChannel      = errors.DefineCorruption("downlink_channel", "channel does not allow uplinks")
	ErrSession              = errors.DefineCorruption("session", "no device session")
	ErrMACHandler           = errors.DefineCorruption("mac_handler", "missing MAC handler")
	ErrChannelDataRateRange = errors.DefineCorruption("channel_data_rate_range", "could not generate channel datarate range")
	ErrChannelMask          = errors.DefineCorruption("channel_mask", "could not generate channel mask")
)
View Source
var LoRaWANBands = func() map[string]map[ttnpb.PHYVersion]*band.Band {
	bands := make(map[string]map[ttnpb.PHYVersion]*band.Band, len(band.All))
	for id, vers := range band.All {
		m := make(map[ttnpb.PHYVersion]*band.Band, len(vers))
		for ver, b := range vers {
			b := b
			m[ver] = &b
		}
		bands[id] = m
	}
	return bands
}()
View Source
var LoRaWANVersionPairs = map[ttnpb.MACVersion]map[ttnpb.PHYVersion]struct{}{
	ttnpb.MAC_V1_0: {
		ttnpb.TS001_V1_0: struct{}{},
	},
	ttnpb.MAC_V1_0_1: {
		ttnpb.TS001_V1_0_1: struct{}{},
	},
	ttnpb.MAC_V1_0_2: {
		ttnpb.RP001_V1_0_2:       struct{}{},
		ttnpb.RP001_V1_0_2_REV_B: struct{}{},
	},
	ttnpb.MAC_V1_0_3: {
		ttnpb.RP001_V1_0_3_REV_A: struct{}{},
	},
	ttnpb.MAC_V1_1: {
		ttnpb.RP001_V1_1_REV_A: struct{}{},
		ttnpb.RP001_V1_1_REV_B: struct{}{},
	},
}

Functions

func CopyEndDevice

func CopyEndDevice(pb *ttnpb.EndDevice) *ttnpb.EndDevice

CopyEndDevice returns a deep copy of ttnpb.EndDevice pb.

func CopyUplinkMessage

func CopyUplinkMessage(pb *ttnpb.UplinkMessage) *ttnpb.UplinkMessage

CopyUplinkMessage returns a deep copy of ttnpb.UplinkMessage pb.

func DeviceBand

func DeviceBand(dev *ttnpb.EndDevice, fps *frequencyplans.Store) (*band.Band, error)

func EndDevicePtr added in v3.12.0

func EndDevicePtr(v ttnpb.EndDevice) *ttnpb.EndDevice

func FrequencyPlanAndBand added in v3.14.0

func FrequencyPlanAndBand(frequencyPlanID string, phyVersion ttnpb.PHYVersion, fps *frequencyplans.Store) (*frequencyplans.FrequencyPlan, *band.Band, error)

func FullFCnt

func FullFCnt(fCnt uint16, lastFCnt uint32, supports32BitFCnt bool) uint32

FullFCnt returns full FCnt given fCnt, lastFCnt and whether or not 32-bit FCnts are supported.

func LastDownlink(downs ...*ttnpb.DownlinkMessage) *ttnpb.DownlinkMessage
func LastUplink(ups ...*ttnpb.UplinkMessage) *ttnpb.UplinkMessage

func RXMetadataStats

func RXMetadataStats(ctx context.Context, mds []*ttnpb.RxMetadata) (gateways int, maxSNR float32)

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

This section is empty.

Directories

Path Synopsis
Package test contains testing utilities usable by all subpackages of networkserver including itself.
Package test contains testing utilities usable by all subpackages of networkserver including itself.
shared
Package test contains testing utilities usable by all subpackages of networkserver excluding itself.
Package test contains testing utilities usable by all subpackages of networkserver excluding itself.
Package time wraps "time" and allows for custom implementations of key functions.
Package time wraps "time" and allows for custom implementations of key functions.

Jump to

Keyboard shortcuts

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