Set connected property to true in all connecting functions

This commit is contained in:
Elara 2021-11-25 20:33:06 -08:00
parent bd057815cf
commit 522c10a9c0

View File

@ -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 {