Delete 'src/main.go'
This commit is contained in:
parent
90275d18ea
commit
4f8dc7737b
69
src/main.go
69
src/main.go
@ -1,69 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"tinygo.org/x/bluetooth"
|
||||
)
|
||||
|
||||
var adapter = bluetooth.DefaultAdapter
|
||||
var target bluetooth.Address
|
||||
var attacker bluetooth.Addresser
|
||||
var connected bool
|
||||
var disconnected bool = true
|
||||
|
||||
func must(action string, err error) {
|
||||
if err != nil {
|
||||
panic("failed to" + action + ": " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func String() string {
|
||||
|
||||
return "00:00"
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
func ohai() {
|
||||
|
||||
target = bluetooth.Address{00:00:00:00:00}
|
||||
attacker = bluetooth.Addresser{"00:00:00"}
|
||||
adapter.Connect()
|
||||
}
|
||||
*/
|
||||
|
||||
func main() {
|
||||
|
||||
err := adapter.Enable()
|
||||
if err != nil {
|
||||
println("BLE stack unstable, could not enable", err.Error())
|
||||
return
|
||||
}
|
||||
//turn the stuff on
|
||||
//must("BLE stack", adapter.Enable())
|
||||
|
||||
var foundDevice bluetooth.ScanResult
|
||||
|
||||
println("Scanning")
|
||||
err = adapter.Scan(func(adapter *bluetooth.Adapter, result bluetooth.ScanResult) {
|
||||
if err != nil {
|
||||
println("could not enable the stack", err.Error())
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
connectToStuff := func(addr bluetooth.Addresser, device *bluetooth.Device) {
|
||||
d, _ := adapter.Connect(addr, bluetooth.ConnectionParams{}, err ==
|
||||
*device == d)
|
||||
color.Red("Trying a connection", addr)
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
println("scanss")
|
||||
err := adapter.Scan(func(adapter *bluetooth.Adapter, device bluetooth.ScanResult) {
|
||||
color.Cyan("found device:", device.Address.String(), device.RSSI, device.LocalName())
|
||||
})
|
||||
must("start scan", err)
|
||||
*/
|
||||
}
|
Loading…
Reference in New Issue
Block a user