Documentation ¶
Index ¶
- Constants
- func AlmostEqual(a, b float64) bool
- func DelayMin(d time.Duration)
- func DelayMs(d time.Duration)
- func DelaySec(d time.Duration)
- func DelayUs(d time.Duration)
- func GetIP() string
- func GetVolume() (int, error)
- func IncludedAngle(from, to float64) float64
- 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 Logger
- type MapRender
- func (m *MapRender) AddMarker(marker *sm.Marker)
- func (m *MapRender) ClearMarker()
- func (m *MapRender) Render() ([]byte, error)
- func (m *MapRender) RenderImg() (*image.Image, error)
- func (m *MapRender) SetCache(cache sm.TileCache)
- func (m *MapRender) SetCenter(pt *geo.Point)
- func (m *MapRender) SetSize(width, height int)
- func (m *MapRender) SetTileProvider(tileProvider *sm.TileProvider)
- func (m *MapRender) SetZoom(zoom int)
- type Mode
- type NoopLogger
- type Point
- type Streamer
Constants ¶
const ( // Epsilon ... Epsilon = 1e-9 // DevMode ... DevMode = "dev" // PrdMode ... PrdMode = "prd" )
Variables ¶
This section is empty.
Functions ¶
func AlmostEqual ¶
func GetVolume ¶
GetVolume gets the volume using amixer
command line: amixer -M get PCM output: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Simple mixer control 'PCM',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 255 Mono: Playback 115 [45%] [-127.55dB] [on]
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
func IncludedAngle ¶
IncludedAngle caculates the included angle betweet fromAngle to toAngle
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 MapRender ¶
type MapRender struct {
// contains filtered or unexported fields
}
func NewMapRender ¶
func NewMapRender() *MapRender
func (*MapRender) ClearMarker ¶
func (m *MapRender) ClearMarker()
func (*MapRender) SetTileProvider ¶
func (m *MapRender) SetTileProvider(tileProvider *sm.TileProvider)
type NoopLogger ¶
type NoopLogger struct{}
func NewNoopLogger ¶
func NewNoopLogger() *NoopLogger
func (*NoopLogger) Close ¶
func (l *NoopLogger) Close()
func (*NoopLogger) Printf ¶
func (n *NoopLogger) Printf(format string, v ...interface{})