From 522c10a9c0a7ece777af0346a6fbd3c5ee9592f9 Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Thu, 25 Nov 2021 20:33:06 -0800 Subject: [PATCH] Set connected property to true in all connecting functions --- infinitime.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/infinitime.go b/infinitime.go index 9f25897..0988c4d 100644 --- a/infinitime.go +++ b/infinitime.go @@ -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 {