random

package
v2.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: MIT Imports: 7 Imported by: 68

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppEUI

func AppEUI() types.AppEUI

func AppID

func AppID() string

func AppNonce

func AppNonce() types.AppNonce

func Bool

func Bool() bool

Bool generates a random boolean

func Bytes

func Bytes(n int) []byte

Bytes generates a random byte slice of length n

func Codr

func Codr() string

Codr generates Codr for instance: 4/6

func Datr

func Datr() string

Datr generates Datr for instance: SF4BW125

func DevAddr

func DevAddr() types.DevAddr

func DevEUI

func DevEUI() types.DevEUI

func DevID

func DevID() string

func DevNonce

func DevNonce() types.DevNonce

func EUI64

func EUI64() types.EUI64

func Freq

func Freq() float32

Freq generates a frequency between 865.0 and 870.0 Mhz

func ID

func ID() string

func Intn

func Intn(n int) int

Intn returns random int with max n

func Lsnr

func Lsnr() float32

Lsnr generates LoRa SNR ratio in db. Tend towards generating good ratio with low noise

func NetID

func NetID() types.NetID

func Rssi

func Rssi() int32

Rssi generates RSSI signal between -120 < rssi < 0

func String

func String(n int) string

String returns a random string of length n

Types

type TTNRandom

type TTNRandom struct {
	random.Interface
}

TTNRandom is used as a wrapper around math/rand

func New

func New() *TTNRandom

New returns a new TTNRandom, in most cases you can just use the global funcs

func (*TTNRandom) AppEUI

func (r *TTNRandom) AppEUI() (eui types.AppEUI)

func (*TTNRandom) AppID

func (r *TTNRandom) AppID() string

AppID returns randomly generated AppID

func (*TTNRandom) AppNonce

func (r *TTNRandom) AppNonce() (appNonce types.AppNonce)

func (*TTNRandom) Bool

func (r *TTNRandom) Bool() bool

Bool return randomly generated bool value

func (*TTNRandom) Codr

func (r *TTNRandom) Codr() string

Codr generates Codr for instance: 4/6

func (*TTNRandom) Datr

func (r *TTNRandom) Datr() string

Datr generates Datr for instance: SF4BW125

func (*TTNRandom) DevAddr

func (r *TTNRandom) DevAddr() (devAddr types.DevAddr)

func (*TTNRandom) DevEUI

func (r *TTNRandom) DevEUI() (eui types.DevEUI)

func (*TTNRandom) DevID

func (r *TTNRandom) DevID() string

DevID returns randomly generated DevID

func (*TTNRandom) DevNonce

func (r *TTNRandom) DevNonce() (devNonce types.DevNonce)

func (*TTNRandom) EUI64

func (r *TTNRandom) EUI64() (eui types.EUI64)

func (*TTNRandom) Freq

func (r *TTNRandom) Freq() float32

Freq generates a frequency between 867.1 and 905.3 Mhz

func (*TTNRandom) ID

func (r *TTNRandom) ID() string

ID returns randomly generated ID

func (*TTNRandom) Lsnr

func (r *TTNRandom) Lsnr() float32

Lsnr generates LoRa SNR ratio in db. Tend towards generating good ratio with low noise

func (*TTNRandom) NetID

func (r *TTNRandom) NetID() (netID types.NetID)

func (*TTNRandom) Rssi

func (r *TTNRandom) Rssi() int32

Rssi generates RSSI signal between -120 < rssi < 0

Jump to

Keyboard shortcuts

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