Documentation ¶
Index ¶
- Constants
- Variables
- func DelayMs(ms int)
- func GetIP() string
- func PlayMp3(mp3 string) error
- func PlayWav(wav string) error
- func Record(sec int, saveTo string) error
- func Reverse(s string) string
- func SetVolume(v int) error
- func StartMotion(config ...string) error
- func StopMotion() error
- func StopMp3() error
- func StopWav() error
- func WaitQuit(beforeQuitFunc func())
- type Email
- type EmailConfig
- type EmailInfo
- type GPSLogger
- type History
- type Mode
- type Point
- type RpiModel
Constants ¶
View Source
const ( // DevMode ... DevMode = "dev" // PrdMode ... PrdMode = "prd" )
Variables ¶
View Source
var ErrEmpty = errors.New("empty")
ErrEmpty ...
Functions ¶
func Record ¶
Record records voice using arecord you need to setup a micro-phone and set it as default device arecord usage: -D: device, use commond "$arecord -l" for viewing card number and device number like 1,0 -d 3: 3 seconds -t wav: wav type -r 16000: Rate 16000 Hz -c 1: 1 channel -f S16_LE: Signed 16 bit Little Endian
func StartMotion ¶
StartMotion start the Motion Service if config file doesn't be provided, the default config file will be used the default config file locates /etc/motion/motion.conf
Types ¶
type Email ¶
type Email struct { SMTP string SMTPPort int POP string POPPort int Address string Password string }
Email ...
type EmailConfig ¶
type EmailConfig struct { SMTP string `json:"smtp"` SMTPPort int `json:"smtp_port"` POP string `json:"pop"` POPPort int `json:"pop_port"` Address string `json:"addr"` Password string `json:"password"` }
EmailConfig ...
type RpiModel ¶
type RpiModel string
RpiModel ...
const ( // RpiUnknown ... RpiUnknown RpiModel = "Raspberry Pi X Model" // Rpi0 ... Rpi0 RpiModel = "Raspberry Pi Zero Model" // RpiA ... RpiA RpiModel = "Raspberry Pi A Model" // RpiB ... RpiB RpiModel = "Raspberry Pi B Model" // Rpi2 ... Rpi2 RpiModel = "Raspberry Pi 2 Model" // Rpi3 ... Rpi3 RpiModel = "Raspberry Pi 3 Model" // Rpi4 ... Rpi4 RpiModel = "Raspberry Pi 4 Model" )
Click to show internal directories.
Click to hide internal directories.