attempting to extract Service UUIDs from advertisment packets

This commit is contained in:
freqyXin 2021-05-09 13:53:35 -07:00
parent d8f9d5af05
commit f4b352bf43
2 changed files with 10 additions and 0 deletions

@ -33,6 +33,8 @@ func Scanners() {
lname := device.LocalName()
adbytes := device.AdvertisementPayload.Bytes()
rssi := device.RSSI
//Trying to extract the service UUIDs from advertisment packets
srvcPld := device.AdvertisementPayload.HasServiceUUID(bluetooth.UUID{})
if lname == projVars.ScanList[device.Address.String()] {
log.Debug().Str("lname", lname).Str("device_address", projVars.ScanList[device.Address.String()]).Msg("Skipping existing device")
@ -46,6 +48,8 @@ func Scanners() {
//Str("AdvertisementPayload", string(adbytes)).
Msg("new_device")
println(srvcPld)
//places captured devices into the eros DB
//log.Debug().Msg("Storing data with Eros")
eros.Remember(device.Address.String(), lname, adbytes)

@ -2,6 +2,7 @@ package projVars
import (
"flag"
"github.com/rs/zerolog"
"tinygo.org/x/bluetooth"
)
@ -11,6 +12,11 @@ var ScanList map[string]string
var InitResults []string
//var to hold service UUIDs
var SrvcUUID uint32
//var SrvcUUIDList map[uint32]string
//hold the values for the initial ble scan results..
// ... i.e. the mac and broadcast name string
var C = make(chan bluetooth.ScanResult)