band

package
v0.0.0-...-3a83b89 Latest Latest
Warning

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

Go to latest
Published: May 12, 2017 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package band provides band specific defaults and configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Band

type Band struct {
	// DefaultTXPower defines the default radiated transmit output power
	DefaultTXPower int

	// ImplementsCFlist defines if the band implements the optional channel
	// frequency list.
	ImplementsCFlist bool

	// RX2Frequency defines the fixed frequency for the RX2 receive window
	RX2Frequency int

	// RX2DataRate defines the fixed data-rate for the RX2 receive window
	RX2DataRate int

	// MaxFcntGap defines the MAC_FCNT_GAP default value.
	MaxFCntGap uint32

	// ADRACKLimit defines the ADR_ACK_LIMIT default value.
	ADRACKLimit int

	// ADRACKDelay defines the ADR_ACK_DELAY default value.
	ADRACKDelay int

	// ReceiveDelay1 defines the RECEIVE_DELAY1 default value.
	ReceiveDelay1 time.Duration

	// ReceiveDelay2 defines the RECEIVE_DELAY2 default value.
	ReceiveDelay2 time.Duration

	// JoinAcceptDelay1 defines the JOIN_ACCEPT_DELAY1 default value.
	JoinAcceptDelay1 time.Duration

	// JoinAcceptDelay2 defines the JOIN_ACCEPT_DELAY2 default value.
	JoinAcceptDelay2 time.Duration

	// ACKTimeoutMin defines the ACK_TIMEOUT min. default value.
	ACKTimeoutMin time.Duration

	// ACKTimeoutMax defines the ACK_TIMEOUT max. default value.
	ACKTimeoutMax time.Duration

	// DataRates defines the available data rates.
	DataRates []DataRate

	// MaxPayloadSize defines the maximum payload size, per data-rate.
	MaxPayloadSize []MaxPayloadSize

	// RX1DataRate defines the RX1 data-rate given the uplink data-rate
	// and a RX1DROffset value.
	RX1DataRate [][]int

	// TXPower defines the TX power configuration.
	TXPower []int

	// UplinkChannels defines the list of (default) configured uplink channels.
	UplinkChannels []Channel

	// DownlinkChannels defines the list of (default) configured downlink
	// channels.
	DownlinkChannels []Channel
	// contains filtered or unexported fields
}

Band defines an region specific ISM band implementation for LoRa.

func (*Band) GetDataRate

func (b *Band) GetDataRate(dr DataRate) (int, error)

GetDataRate returns the index of the given DataRate.

func (*Band) GetRX1Channel

func (b *Band) GetRX1Channel(txChannel int) int

GetRX1Channel returns the channel to use for RX1 given the channel used for uplink.

func (*Band) GetRX1DataRateForOffset

func (b *Band) GetRX1DataRateForOffset(dr, drOffset int) (int, error)

GetRX1DataRateForOffset returns the data-rate for the given offset.

func (*Band) GetRX1Frequency

func (b *Band) GetRX1Frequency(txFrequency int) (int, error)

GetRX1Frequency returns the frequency to use for RX1 given the uplink frequency.

type Channel

type Channel struct {
	Frequency int   // frequency in Hz
	DataRates []int // each int mapping to an index in DataRateConfiguration
}

Channel defines the channel structure

type DataRate

type DataRate struct {
	Modulation   Modulation `json:"modulation"`
	SpreadFactor int        `json:"spreadFactor,omitempty"` // used for LoRa
	Bandwidth    int        `json:"bandwidth,omitempty"`    // in kHz, used for LoRa
	BitRate      int        `json:"bitRate,omitempty"`      // bits per second, used for FSK
}

DataRate defines a data rate

type MaxPayloadSize

type MaxPayloadSize struct {
	M int // The maximum MACPayload size length
	N int // The maximum application payload length in the absence of the optional FOpt control field
}

MaxPayloadSize defines the max payload size

type Modulation

type Modulation string

Modulation defines the modulation type.

const (
	LoRaModulation Modulation = "LORA"
	FSKModulation  Modulation = "FSK"
)

Possible modulation types.

type Name

type Name string

Name defines the band-name type.

Jump to

Keyboard shortcuts

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