Removed unused err return value from NewDeviceWatcher.
This commit is contained in:
parent
a92512cf8f
commit
92af9f1b15
|
@ -51,7 +51,7 @@ func main() {
|
||||||
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
fmt.Println("Watching for device state changes.")
|
fmt.Println("Watching for device state changes.")
|
||||||
watcher, err := adb.NewDeviceWatcher(adb.ClientConfig{})
|
watcher := adb.NewDeviceWatcher(adb.ClientConfig{})
|
||||||
for event := range watcher.C() {
|
for event := range watcher.C() {
|
||||||
fmt.Printf("\t[%s]%+v\n", time.Now(), event)
|
fmt.Printf("\t[%s]%+v\n", time.Now(), event)
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ type deviceWatcherImpl struct {
|
||||||
startServer func() error
|
startServer func() error
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDeviceWatcher(config ClientConfig) (*DeviceWatcher, error) {
|
func NewDeviceWatcher(config ClientConfig) *DeviceWatcher {
|
||||||
watcher := &DeviceWatcher{&deviceWatcherImpl{
|
watcher := &DeviceWatcher{&deviceWatcherImpl{
|
||||||
config: config.sanitized(),
|
config: config.sanitized(),
|
||||||
eventChan: make(chan DeviceStateChangedEvent),
|
eventChan: make(chan DeviceStateChangedEvent),
|
||||||
|
@ -49,7 +49,7 @@ func NewDeviceWatcher(config ClientConfig) (*DeviceWatcher, error) {
|
||||||
|
|
||||||
go publishDevices(watcher.deviceWatcherImpl)
|
go publishDevices(watcher.deviceWatcherImpl)
|
||||||
|
|
||||||
return watcher, nil
|
return watcher
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -14,7 +14,6 @@ Eg.
|
||||||
client := NewHostClient()
|
client := NewHostClient()
|
||||||
client.StartServer()
|
client.StartServer()
|
||||||
client.ListDevices()
|
client.ListDevices()
|
||||||
client.GetAnyDevice() // see DeviceClient
|
|
||||||
|
|
||||||
See list of services at https://android.googlesource.com/platform/system/core/+/master/adb/SERVICES.TXT.
|
See list of services at https://android.googlesource.com/platform/system/core/+/master/adb/SERVICES.TXT.
|
||||||
*/
|
*/
|
||||||
|
@ -23,21 +22,6 @@ type HostClient struct {
|
||||||
config ClientConfig
|
config ClientConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
// func NewHostClient() (*HostClient, error) {
|
|
||||||
// return NewHostClientPort(AdbPort)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func NewHostClientPort(port int) (*HostClient, error) {
|
|
||||||
// return NewHostClientDialer(wire.NewDialer("localhost", port))
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func NewHostClientDialer(d wire.Dialer) (*HostClient, error) {
|
|
||||||
// if d == nil {
|
|
||||||
// return nil, errors.New("dialer cannot be nil.")
|
|
||||||
// }
|
|
||||||
// return &HostClient{d}, nil
|
|
||||||
// }
|
|
||||||
|
|
||||||
func NewHostClient(config ClientConfig) *HostClient {
|
func NewHostClient(config ClientConfig) *HostClient {
|
||||||
return &HostClient{config.sanitized()}
|
return &HostClient{config.sanitized()}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue