new: ble.enum and ble.write now support autocompletion

This commit is contained in:
evilsocket 2019-02-18 13:06:41 +01:00
commit 49e2116d46
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
4 changed files with 55 additions and 12 deletions

View file

@ -95,3 +95,12 @@ func (b *BLE) Devices() (devices []*BLEDevice) {
}
return
}
func (b *BLE) EachDevice(cb func(mac string, d *BLEDevice)) {
b.Lock()
defer b.Unlock()
for m, dev := range b.devices {
cb(m, dev)
}
}