From c27b1cb3be5cc1a49d6d2a8443cc096d9c6e0dd2 Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Thu, 24 Sep 2020 17:07:29 +0200 Subject: [PATCH] Document async Disconnect behaviour This was mentioned by @aykevl in https://github.com/tinygo-org/bluetooth/pull/32#issuecomment-698313299 --- gap_darwin.go | 3 ++- gap_linux.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gap_darwin.go b/gap_darwin.go index ae6c8fb..c062da0 100644 --- a/gap_darwin.go +++ b/gap_darwin.go @@ -128,7 +128,8 @@ func (a *Adapter) Connect(address Addresser, params ConnectionParams) (*Device, } } -// Disconnect from the BLE device. +// Disconnect from the BLE device. This method is non-blocking and does not +// wait until the connection is fully gone. func (d *Device) Disconnect() error { d.cm.CancelConnect(d.prph) return nil diff --git a/gap_linux.go b/gap_linux.go index e135b4a..9d3fd14 100644 --- a/gap_linux.go +++ b/gap_linux.go @@ -267,7 +267,8 @@ func (a *Adapter) Connect(address Addresser, params ConnectionParams) (*Device, }, nil } -// Disconnect from the BLE device. +// Disconnect from the BLE device. This method is non-blocking and does not +// wait until the connection is fully gone. func (d *Device) Disconnect() error { return d.device.Disconnect() }