attempting to extract Service UUIDs from advertisment packets
This commit is contained in:
parent
d8f9d5af05
commit
f4b352bf43
@ -33,6 +33,8 @@ func Scanners() {
|
|||||||
lname := device.LocalName()
|
lname := device.LocalName()
|
||||||
adbytes := device.AdvertisementPayload.Bytes()
|
adbytes := device.AdvertisementPayload.Bytes()
|
||||||
rssi := device.RSSI
|
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()] {
|
if lname == projVars.ScanList[device.Address.String()] {
|
||||||
log.Debug().Str("lname", lname).Str("device_address", projVars.ScanList[device.Address.String()]).Msg("Skipping existing device")
|
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)).
|
//Str("AdvertisementPayload", string(adbytes)).
|
||||||
Msg("new_device")
|
Msg("new_device")
|
||||||
|
|
||||||
|
println(srvcPld)
|
||||||
|
|
||||||
//places captured devices into the eros DB
|
//places captured devices into the eros DB
|
||||||
//log.Debug().Msg("Storing data with Eros")
|
//log.Debug().Msg("Storing data with Eros")
|
||||||
eros.Remember(device.Address.String(), lname, adbytes)
|
eros.Remember(device.Address.String(), lname, adbytes)
|
||||||
|
@ -2,6 +2,7 @@ package projVars
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"github.com/rs/zerolog"
|
"github.com/rs/zerolog"
|
||||||
"tinygo.org/x/bluetooth"
|
"tinygo.org/x/bluetooth"
|
||||||
)
|
)
|
||||||
@ -11,6 +12,11 @@ var ScanList map[string]string
|
|||||||
|
|
||||||
var InitResults []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..
|
//hold the values for the initial ble scan results..
|
||||||
// ... i.e. the mac and broadcast name string
|
// ... i.e. the mac and broadcast name string
|
||||||
var C = make(chan bluetooth.ScanResult)
|
var C = make(chan bluetooth.ScanResult)
|
||||||
|
Loading…
Reference in New Issue
Block a user