server

package
v0.0.0-...-a3207ce Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(cfg *Config)

Types

type BaiduAPIConfig

type BaiduAPIConfig struct {
	Speech *BaiduKey `json:"speech"`
	Image  *BaiduKey `json:"image"`
}

type BaiduKey

type BaiduKey struct {
	APIKey    string `json:"apiKey"`
	SecretKey string `json:"secretKey"`
}

type Config

type Config struct {
	LedPin         uint8                `json:"led"`
	SG90DataPin    uint8                `json:"sg90"`
	BuzzerPin      uint8                `json:"buzzer"`
	RelayPin       uint8                `json:"relay"`
	L298N          *L298NConfig         `json:"l298n"`
	US100          *US100Config         `json:"us100"`
	GY25           *GY25Config          `json:"gy25"`
	Joystick       *JoystickConfig      `json:"joystick"`
	SelfDriving    *SelfDrivingConfig   `json:"selfDriving"`
	SelfTracking   *SelfTrackingConfig  `json:"SelfTracking"`
	SpeechDriving  *SpeechDrivingConfig `json:"speechDriving"`
	SelfNav        *SelfNavConfig       `json:"selfnav"`
	BaiduAPIConfig *BaiduAPIConfig      `json:"baidu"`
	Volume         int                  `json:"volume"`
	Speed          uint32               `json:"speed"`
	Host           string               `json:"host"`
	VideoHost      string               `json:"videoHost"`
}

Config ...

func LoadConfig

func LoadConfig(file string) (*Config, error)

type GPSConfig

type GPSConfig struct {
	Dev  string `json:"dev"`
	Baud int    `json:"baud"`
}

type GY25Config

type GY25Config struct {
	Dev  string `json:"dev"`
	Baud int    `json:"baud"`
}

type JoystickConfig

type JoystickConfig struct {
	Enabled     bool         `json:"enabled"`
	LC12SConfig *LC12SConfig `json:"lc12s"`
}

type L298NConfig

type L298NConfig struct {
	IN1Pin uint8 `json:"in1"`
	IN2Pin uint8 `json:"in2"`
	IN3Pin uint8 `json:"in3"`
	IN4Pin uint8 `json:"in4"`
	ENAPin uint8 `json:"ena"`
	ENBPin uint8 `json:"enb"`
}

type LC12SConfig

type LC12SConfig struct {
	Dev  string `json:"dev"`
	Baud int    `json:"baud"`
	CS   uint8  `json:"cs"`
}

type Op

type Op string

type SelfDrivingConfig

type SelfDrivingConfig struct {
	Enabled bool `json:"enabled"`
}

type SelfNavConfig

type SelfNavConfig struct {
	Enabled       bool           `json:"enabled"`
	GPSConfig     *GPSConfig     `json:"gps"`
	TileMapConfig *TileMapConfig `json:"tileMap"`
}

type SelfTrackingConfig

type SelfTrackingConfig struct {
	Enabled  bool    `json:"enabled"`
	VideoURL string  `json:"videoURL"`
	LH       float64 `json:"lh"`
	LS       float64 `json:"ls"`
	LV       float64 `json:"lv"`
	HH       float64 `json:"hh"`
	HS       float64 `json:"hs"`
	HV       float64 `json:"hv"`
}

type SpeechDrivingConfig

type SpeechDrivingConfig struct {
	Enabled bool `json:"enabled"`
}

type TileMapConfig

type TileMapConfig struct {
	MapFile  string    `json:"mapFile"`
	Box      *geo.Bbox `json:"bbox"`
	GridSize float64   `json:"gridSize"`
}

type US100Config

type US100Config struct {
	Dev     string `json:"dev"`
	Baud    int    `json:"baud"`
	TrigPin uint8  `json:"trig"`
	EchoPin uint8  `json:"echo"`
}

Jump to

Keyboard shortcuts

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