b06d666dbf
Remove the Addresser type. It isn't really necessary (the Address type can change between OSes) and makes it difficult to fix a heap allocation in interrupts (on the Nordic SoftDevices). This is a backwards incompatible change, but only programs that use SetConnectHandler should notice this.
12 lines
455 B
Go
12 lines
455 B
Go
package bluetooth
|
|
|
|
// Set this to true to print debug messages, for example for unknown events.
|
|
const debug = false
|
|
|
|
// 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.
|
|
func (a *Adapter) SetConnectHandler(c func(device Address, connected bool)) {
|
|
a.connectHandler = c
|
|
}
|