2019-11-09 15:07:07 +03:00
|
|
|
package bluetooth
|
|
|
|
|
2020-05-25 18:26:24 +03:00
|
|
|
// Set this to true to print debug messages, for example for unknown events.
|
|
|
|
const debug = false
|
2020-09-10 18:17:45 +03:00
|
|
|
|
|
|
|
// SetConnectHandler sets a handler function to be called whenever the adaptor connects
|
|
|
|
// or disconnects. You must call this before you call adaptor.Connect() for centrals
|
|
|
|
// or adaptor.Start() for peripherals in order for it to work.
|
2023-04-25 03:12:05 +03:00
|
|
|
func (a *Adapter) SetConnectHandler(c func(device Address, connected bool)) {
|
2020-09-10 18:17:45 +03:00
|
|
|
a.connectHandler = c
|
|
|
|
}
|