better everyday

This commit is contained in:
freqyXin 2021-04-14 14:20:58 -07:00
parent f5d232231e
commit 90275d18ea

@ -21,15 +21,22 @@ func Scanners() {
// Start scanning.
println("scanning...")
err := projVars.ScanAdapter.Scan(func(scanAdapter *bluetooth.Adapter, device bluetooth.ScanResult) {
color.Cyan("found device:")
println(device.Address.String(), device.RSSI, device.LocalName())
if projVars.ScanList[device.LocalName()] != "" {
//could create a more
//color.Yellow("Device Already in Mapped")
} else {
//TODO: create localname for devices that dont broadcast one
projVars.ScanList[device.LocalName()] = device.Address.String()
color.Cyan("found device:")
println(device.Address.String(), device.RSSI, device.LocalName())
//fucking sanity check
i := projVars.ScanList[device.LocalName()]
color.Red(i)
//TODO: create localname for devices that dont broadcast one
projVars.ScanList[device.LocalName()] = device.Address.String()
//fucking sanity check
i := projVars.ScanList[device.LocalName()]
color.Red(i)
}
})
dust.Must("start scan", err)
}