lbslns

package
v3.24.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package lbslns implements the JSON configuration for the LoRa Basics Station `router_config` message.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconingConfig added in v3.21.2

type BeaconingConfig struct {
	DR     ttnpb.DataRateIndex `json:"DR"`
	Layout [3]int              `json:"layout"`
	Freqs  []uint64            `json:"freqs"`
}

BeaconingConfig contains class B beacon configuration.

type DataRates

type DataRates [16][3]int

DataRates encodes the available datarates of the channel plan for the Station in the format below: [0] -> SF (Spreading Factor; Range: 7...12 for LoRa, 0 for FSK) [1] -> BW (Bandwidth; 125/250/500 for LoRa, ignored for FSK) [2] -> DNONLY (Downlink Only; 1 = true, 0 = false).

type LBSRFConfig added in v3.13.0

type LBSRFConfig struct {
	Enable      bool   `json:"enable"`
	Frequency   uint64 `json:"freq"`
	AntennaGain int    `json:"antenna_gain,omitempty"`
}

LBSRFConfig contains the configuration for one of the radios only fields used for LoRa Basics Station gateways. The other fields of RFConfig (in pkg/pfconfig/shared) are hardware specific and are left out here. - `type`, `rssi_offset`, `tx_enable` and `tx_notch_freq` are set in the gateway. - `tx_freq_min` and `tx_freq_max` are defined in the `freq_range` parameter of `router_config`. - `antenna_gain` is defined by the user for each antenna.

type LBSSX1301Config added in v3.13.0

type LBSSX1301Config struct {
	LBTConfig           *shared.LBTConfig
	Radios              []LBSRFConfig
	Channels            []shared.IFConfig
	LoRaStandardChannel *shared.IFConfig
	FSKChannel          *shared.IFConfig
}

LBSSX1301Config contains the configuration for the SX1301 concentrator for the LoRa Basics Station `router_config` message. This structure incorporates modifications for the `v1.5` and `v2` concentrator reference. https://doc.sm.tc/station/gw_v1.5.html https://doc.sm.tc/station/gw_v2.html The fields `lorawan_public` and `clock_source` are omitted as they should be present in the gateway's `station.conf`.

func (LBSSX1301Config) MarshalJSON added in v3.13.0

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

MarshalJSON implements json.Marshaler.

func (*LBSSX1301Config) UnmarshalJSON added in v3.13.0

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

UnmarshalJSON implements json.Unmarshaler.

type RouterConfig

type RouterConfig struct {
	NetID          []int             `json:"NetID"`
	JoinEUI        [][]int           `json:"JoinEui"`
	Region         string            `json:"region"`
	HardwareSpec   string            `json:"hwspec"`
	FrequencyRange []int             `json:"freq_range"`
	DataRates      DataRates         `json:"DRs"`
	SX1301Config   []LBSSX1301Config `json:"sx1301_conf"`

	// These are debug options to be unset in production gateways.
	// The values are ignored for production gateways, as they produce warnings.
	// https://github.com/lorabasics/basicstation/blob/bd17e53ab1137de6abb5ae48d6f3d52f6c268299/src-linux/sys_linux.c#L728
	NoCCA       bool `json:"nocca,omitempty"`
	NoDutyCycle bool `json:"nodc,omitempty"`
	NoDwellTime bool `json:"nodwell,omitempty"`

	MuxTime float64 `json:"MuxTime"`

	Beacon *BeaconingConfig `json:"bcning"`
}

RouterConfig contains the router configuration. This message is sent by the Gateway Server.

func GetRouterConfig

func GetRouterConfig(
	bandID string,
	fps map[string]*frequencyplans.FrequencyPlan,
	features RouterFeatures,
	dlTime time.Time,
	antennaGain int,
) (RouterConfig, error)

GetRouterConfig returns the routerconfig message to be sent to the gateway. Currently as per the LBS docs, all frequency plans have to be from the same region (band). https://doc.sm.tc/station/tcproto.html#router-config-message.

func (RouterConfig) MarshalJSON

func (conf RouterConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RouterFeatures added in v3.21.2

type RouterFeatures interface {
	IsProduction() bool
}

RouterFeatures contains the features of the LBS router.

Jump to

Keyboard shortcuts

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