Set connected property to true in all connecting functions
This commit is contained in:
parent
a5c90c3b7d
commit
90936d8900
@ -176,6 +176,9 @@ func connectByName(opts *Options) (*Device, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.device.Properties.Connected = true
|
||||
|
||||
// Resolve characteristics
|
||||
err = out.resolveChars()
|
||||
if err != nil {
|
||||
@ -232,6 +235,8 @@ func pair(opts *Options) (*Device, error) {
|
||||
// Pair device
|
||||
out.device.Pair()
|
||||
|
||||
out.device.Properties.Connected = true
|
||||
|
||||
// Set connected to true
|
||||
out.device.Properties.Connected = true
|
||||
|
||||
@ -262,6 +267,8 @@ func ConnectByAddress(addr string) (*Device, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.device.Properties.Connected = true
|
||||
|
||||
// Resolve characteristics
|
||||
err = out.resolveChars()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user