conf

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Eu868NsDefault string = `` /* 1247-byte string literal not displayed */
View Source
const Eu868PfDefault = `` /* 3860-byte string literal not displayed */
View Source
const GbDefault = `` /* 1210-byte string literal not displayed */
View Source
const Us915NsDefault = `` /* 925-byte string literal not displayed */
View Source
const Us915PfDefault = `` /* 3903-byte string literal not displayed */

Variables

View Source
var ErrorBsConfigFileNotFound = errors.New("bs config file not found")

Functions

func GenerateDir

func GenerateDir(cups bool, path string, suffix string) string

func GenerateUri

func GenerateUri(cups bool, tls bool, addr string, port int) string

Types

type Auth

type Auth struct {
	Uri   *File
	Key   *File
	Crt   *File
	Trust *File
}

type BsAuth

type BsAuth interface {
	GetAuth(dir string) *Auth
	ApiMode() *api.GateWayMode
}

type BsConfig

type BsConfig struct {
	BsAuth
}

type DebugConf

type DebugConf struct {
	RefPayload []struct {
		Id string `json:"id"`
	} `json:"ref_payload"`

	LogFile string `json:"log_file"`
}

type File

type File struct {
	Dir     string
	Content []byte
}

type GatewayConfig

type GatewayConfig struct {
	ServerAddress string `json:"server_address" mapstructure:"server_address"`
	ServPortUp    int32  `json:"serv_port_up" mapstructure:"serv_port_up"`
	ServPortDown  int32  `json:"serv_port_down" mapstructure:"serv_port_down"`

	GatewayID          string  `json:"gateway_ID"`
	KeepaliveInterval  int32   `json:"keepalive_interval"`
	StatInterval       int32   `json:"stat_interval"`
	PushTimeoutMs      int32   `json:"push_timeout_ms"`
	ForwardCrcValid    bool    `json:"forward_crc_valid"`
	ForwardCrcError    bool    `json:"forward_crc_error"`
	ForwardCrcDisabled bool    `json:"forward_crc_disabled"`
	GPSTTYPath         string  `json:"gps_tty_path,omitempty"`
	RefLatitude        float32 `json:"ref_latitude"`
	RefLongitude       float32 `json:"ref_longitude"`
	RefAltitude        int32   `json:"ref_altitude"`
	AutoquitThreshold  int32   `json:"autoquit_threshold,omitempty"`
	BeaconPeriod       int32   `json:"beacon_period"`
	BeaconFreqHZ       int32   `json:"beacon_freq_hz"`
	BeaconFreqNB       int32   `json:"beacon_freq_nb"`
	BeaconFreqStep     int32   `json:"beacon_freq_step"`
	BeaconDatarate     int32   `json:"beacon_datarate"`
	BeaconBwHZ         int32   `json:"beacon_bw_hz"`
	BeaconPower        int32   `json:"beacon_power"`
	BeaconInfodesc     int32   `json:"beacon_infodesc,omitempty"`
}

type GbConfig

type GbConfig struct {
	Filters struct {
		NetIDs   []string    `mapstructure:"net_ids"`
		JoinEUIs [][2]string `mapstructure:"join_euis"`
	} `mapstructure:"filters"`
}

func NewGbConfig

func NewGbConfig(a *api.Filter) *GbConfig

func (*GbConfig) ApiFilter

func (c *GbConfig) ApiFilter() *api.Filter

type NoAuth

type NoAuth struct {
	UseCups    bool
	ServerAddr string
	ServerPort int32
}

func (*NoAuth) ApiMode

func (c *NoAuth) ApiMode() *api.GateWayMode

func (*NoAuth) GetAuth

func (c *NoAuth) GetAuth(dir string) *Auth

type NsConfig

type NsConfig struct {
	NetworkServer struct {
		NetID string `mapstructure:"net_id"`

		Band struct {
			Name string `mapstructure:"name"`
		} `mapstructure:"band"`

		NetworkSettings struct {
			InstallationMargin float64 `mapstructure:"installation_margin"`
			RX1Delay           int     `mapstructure:"rx1_delay"`
			RX1DROffset        int     `mapstructure:"rx1_dr_offset"`
			RX2DR              int     `mapstructure:"rx2_dr"`
			RX2Frequency       int     `mapstructure:"rx2_frequency"`
			// DownlinkTXPower       int                 `mapstructure:"downlink_tx_power"`
			EnabledUplinkChannels []int               `mapstructure:"enabled_uplink_channels"`
			DisableADR            bool                `mapstructure:"disable_adr"`
			ExtraChannels         []band.ExtraChannel `mapstructure:"extra_channels"`
		} `mapstructure:"network_settings"`
	} `mapstructure:"network_server"`
}

func NewNsConfig

func NewNsConfig(b band.Band, a *api.BuiltInNetworkServer) *NsConfig

func (*NsConfig) ApiMode

func (c *NsConfig) ApiMode(adrDrMin int, adrDrMax int) *api.GateWayMode

type PfConfig

type PfConfig struct {
	band.SX130xConfig `json:"SX130x_conf" mapstructure:"SX130x_conf"`
	GatewayConfig     `json:"gateway_conf" mapstructure:"gateway_conf"`
	DebugConf         `json:"debug_conf" mapstructure:"debug_conf"`
}

func (*PfConfig) ApiMode

func (c *PfConfig) ApiMode() *api.GateWayMode

type TlsServerAndClientAuth

type TlsServerAndClientAuth struct {
	NoAuth
	Key   []byte
	Trust []byte
	Crt   []byte
}

func (*TlsServerAndClientAuth) ApiMode

func (c *TlsServerAndClientAuth) ApiMode() *api.GateWayMode

func (*TlsServerAndClientAuth) GetAuth

func (c *TlsServerAndClientAuth) GetAuth(dir string) *Auth

type TlsServerAuth

type TlsServerAuth struct {
	NoAuth
	Trust []byte
}

func (*TlsServerAuth) ApiMode

func (c *TlsServerAuth) ApiMode() *api.GateWayMode

func (*TlsServerAuth) GetAuth

func (c *TlsServerAuth) GetAuth(dir string) *Auth

type TlsServerAuthAndClientToken

type TlsServerAuthAndClientToken struct {
	NoAuth
	Trust []byte
	Key   []byte
}

func (*TlsServerAuthAndClientToken) ApiMode

func (*TlsServerAuthAndClientToken) GetAuth

func (c *TlsServerAuthAndClientToken) GetAuth(dir string) *Auth

Jump to

Keyboard shortcuts

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