shared

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: 11 Imported by: 0

Documentation

Overview

Package shared contains the configuration that is common to various gateway types.

Index

Constants

View Source
const DefaultGatewayServerUDPPort = 1700

DefaultGatewayServerUDPPort is the default port used for connecting to Gateway Server.

Variables

This section is empty.

Functions

func ParseGatewayServerAddress

func ParseGatewayServerAddress(s string) (string, uint16, error)

ParseGatewayServerAddress parses gateway server address s into hostname and port, port is equal to the port contained in s or DefaultGatewayServerUDPPort otherwise.

Types

type IFConfig

type IFConfig struct {
	Enable       bool   `json:"enable"`
	Radio        uint8  `json:"radio"`
	IFValue      int32  `json:"if"`
	Bandwidth    uint32 `json:"bandwidth,omitempty"`
	SpreadFactor uint8  `json:"spread_factor,omitempty"`
	Datarate     uint32 `json:"datarate,omitempty"`
}

IFConfig contains the configuration for one of the channels.

func (IFConfig) MarshalJSON

func (c IFConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

type LBTChannelConfig

type LBTChannelConfig struct {
	Frequency            uint64 `json:"freq_hz"`
	ScanTimeMicroseconds uint32 `json:"scan_time_us"`
}

LBTChannelConfig contains the listen-before-talk configuration for a channel.

type LBTConfig

type LBTConfig struct {
	Enable         bool               `json:"enable"`
	RSSITarget     float32            `json:"rssi_target"`
	ChannelConfigs []LBTChannelConfig `json:"chan_cfg"`
	RSSIOffset     float32            `json:"sx127x_rssi_offset"`
}

LBTConfig contains the configuration for listen-before-talk.

type RFConfig

type RFConfig struct {
	Enable      bool    `json:"enable"`
	Type        string  `json:"type,omitempty"`
	Frequency   uint64  `json:"freq"`
	RSSIOffset  float32 `json:"rssi_offset"`
	TxEnable    bool    `json:"tx_enable"`
	TxFreqMin   uint64  `json:"tx_freq_min,omitempty"`
	TxFreqMax   uint64  `json:"tx_freq_max,omitempty"`
	TxNotchFreq uint64  `json:"tx_notch_freq,omitempty"`
}

RFConfig contains the configuration for one of the radios.

type SX1301Config

type SX1301Config struct {
	LoRaWANPublic       bool
	ClockSource         uint8
	AntennaGain         float32
	LBTConfig           *LBTConfig
	Radios              []RFConfig
	Channels            []IFConfig
	LoRaStandardChannel *IFConfig
	FSKChannel          *IFConfig
	TxLUTConfigs        []TxLUTConfig
}

SX1301Config contains the configuration for the SX1301 concentrator.

func BuildSX1301Config

func BuildSX1301Config(frequencyPlan *frequencyplans.FrequencyPlan) (*SX1301Config, error)

BuildSX1301Config builds the SX1301 configuration for the given frequency plan.

func (SX1301Config) MarshalJSON

func (c SX1301Config) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*SX1301Config) UnmarshalJSON

func (c *SX1301Config) UnmarshalJSON(msg []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TxLUTConfig

type TxLUTConfig struct {
	PAGain  int `json:"pa_gain"`
	MixGain int `json:"mix_gain"`
	RFPower int `json:"rf_power"`
	DigGain int `json:"dig_gain"`
}

TxLUTConfig contains the configuration for the TX LUT ind

Jump to

Keyboard shortcuts

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