mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-05-04 22:17:39 +08:00
33 lines
535 B
Go
33 lines
535 B
Go
![]() |
package gobot
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
type Device struct {
|
||
|
Name string
|
||
|
Pin string
|
||
|
Parent string
|
||
|
Connection string
|
||
|
Interval string
|
||
|
Driver string
|
||
|
}
|
||
|
|
||
|
//func (d *Device) New() *Device{
|
||
|
// return d
|
||
|
//}
|
||
|
|
||
|
func (d *Device) Start() {
|
||
|
fmt.Println("Device " + d.Name + "started")
|
||
|
}
|
||
|
|
||
|
func (d *Device) determineConnection(c Connection){
|
||
|
//d.Parent.connections(c) if c
|
||
|
}
|
||
|
|
||
|
func (d *Device) defaultConnection() {
|
||
|
//d.Parent.connections.first
|
||
|
}
|
||
|
|
||
|
func requireDriver(driverName string) {
|
||
|
fmt.Println("dynamic load driver" + driverName)
|
||
|
}
|