config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBleXport

func BuildBleXport(bc *BleConfig) (xport.Xport, error)

func BuildBllSesnCfg

func BuildBllSesnCfg(bc *BllConfig) (bll.BllSesnCfg, error)

func BuildSerialXport

func BuildSerialXport(sc *nmserial.XportCfg) (*nmserial.SerialXport, error)

func ConnTypeToString

func ConnTypeToString(ct ConnType) string

func FillMtechLoraSesnCfg

func FillMtechLoraSesnCfg(mc *mtech_lora.LoraConfig, sc *sesn.SesnCfg) error

func FillSesnCfg

func FillSesnCfg(bx *nmble.BleXport, bc *BleConfig, sc *sesn.SesnCfg) error

func InitGlobalConnProfileMgr

func InitGlobalConnProfileMgr() error

func NewMtechLoraConfig

func NewMtechLoraConfig() *mtech_lora.LoraConfig

func ParseMtechLoraConnString

func ParseMtechLoraConnString(cs string) (*mtech_lora.LoraConfig, error)

func ParseSerialConnString

func ParseSerialConnString(cs string) (*nmserial.XportCfg, error)

Types

type BleConfig

type BleConfig struct {
	PeerAddrType bledefs.BleAddrType
	PeerAddr     bledefs.BleAddr
	PeerName     string

	OwnAddrType bledefs.BleAddrType
	OwnAddr     bledefs.BleAddr

	// Connection timeout, in seconds.
	ConnTimeout float64

	BlehostdPath   string
	ControllerPath string

	HciIdx int
}

func NewBleConfig

func NewBleConfig() *BleConfig

func ParseBleConnString

func ParseBleConnString(cs string) (*BleConfig, error)

type BllConfig

type BllConfig struct {
	CtlrName    string
	OwnAddrType bledefs.BleAddrType
	PeerId      string
	PeerName    string

	// Connection timeout, in seconds.
	ConnTimeout float64

	HciIdx int
}

func NewBllConfig

func NewBllConfig() *BllConfig

func ParseBllConnString

func ParseBllConnString(cs string) (*BllConfig, error)

type ConnProfile

type ConnProfile struct {
	Name       string   `json:"MyName"`
	Type       ConnType `json:"MyType"`
	ConnString string   `json:"MyConnString"`
}

func NewConnProfile

func NewConnProfile() *ConnProfile

func SortConnProfs

func SortConnProfs(cps []*ConnProfile) []*ConnProfile

func (*ConnProfile) String

func (p *ConnProfile) String() string

type ConnProfileMgr

type ConnProfileMgr struct {
	// contains filtered or unexported fields
}

func GlobalConnProfileMgr

func GlobalConnProfileMgr() *ConnProfileMgr

func NewConnProfileMgr

func NewConnProfileMgr() (*ConnProfileMgr, error)

func (*ConnProfileMgr) AddConnProfile

func (cpm *ConnProfileMgr) AddConnProfile(cp *ConnProfile) error

func (*ConnProfileMgr) DeleteConnProfile

func (cpm *ConnProfileMgr) DeleteConnProfile(name string) error

func (*ConnProfileMgr) GetConnProfile

func (cpm *ConnProfileMgr) GetConnProfile(pName string) (*ConnProfile, error)

func (*ConnProfileMgr) GetConnProfileList

func (cpm *ConnProfileMgr) GetConnProfileList() ([]*ConnProfile, error)

func (*ConnProfileMgr) Init

func (cpm *ConnProfileMgr) Init() error

type ConnType

type ConnType int
const (
	CONN_TYPE_NONE ConnType = iota
	CONN_TYPE_SERIAL_PLAIN
	CONN_TYPE_SERIAL_OIC
	CONN_TYPE_BLL_PLAIN
	CONN_TYPE_BLL_OIC
	CONN_TYPE_BLE_PLAIN
	CONN_TYPE_BLE_OIC
	CONN_TYPE_UDP_PLAIN
	CONN_TYPE_UDP_OIC
	CONN_TYPE_MTECH_LORA_OIC
)

func ConnTypeFromString

func ConnTypeFromString(s string) (ConnType, error)

func (*ConnType) MarshalJSON

func (t *ConnType) MarshalJSON() ([]byte, error)

func (*ConnType) UnmarshalJSON

func (ct *ConnType) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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