internal

package
v0.0.0-...-60b8695 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 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")
)
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 _, b := range band.All {
		vers := b.Versions()
		m := make(map[ttnpb.PHYVersion]*band.Band, len(vers))
		for _, ver := range vers {
			b, err := b.Version(ver)
			if err != nil {
				panic(fmt.Errorf("failed to obtain %s band of version %s", b.ID, ver))
			}
			m[ver] = &b
		}
		bands[b.ID] = m
	}
	return bands
}()
View Source
var LoRaWANVersionPairs = map[ttnpb.MACVersion]map[ttnpb.PHYVersion]struct{}{
	ttnpb.MAC_V1_0: {
		ttnpb.PHY_V1_0: struct{}{},
	},
	ttnpb.MAC_V1_0_1: {
		ttnpb.PHY_V1_0_1: struct{}{},
	},
	ttnpb.MAC_V1_0_2: {
		ttnpb.PHY_V1_0_2_REV_A: struct{}{},
		ttnpb.PHY_V1_0_2_REV_B: struct{}{},
	},
	ttnpb.MAC_V1_0_3: {
		ttnpb.PHY_V1_0_3_REV_A: struct{}{},
	},
	ttnpb.MAC_V1_1: {
		ttnpb.PHY_V1_1_REV_A: struct{}{},
		ttnpb.PHY_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

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

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