Merge branch 'development' of ssh://git.tcp.direct:2222/freqy/protomolecule into development
This commit is contained in:
commit
287add1fcc
@ -20,10 +20,11 @@ import (
|
||||
"time"
|
||||
|
||||
//"errors"
|
||||
"git.tcp.direct/kayos/prototooth"
|
||||
projVars "protomolecule/src/vars"
|
||||
|
||||
bluetooth "git.tcp.direct/kayos/prototooth"
|
||||
"github.com/prologic/bitcask"
|
||||
"github.com/rs/zerolog/log"
|
||||
projVars "protomolecule/src/vars"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -132,8 +132,35 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
|
||||
//adbytes := payload.Bytes()
|
||||
uuids := payload.ServiceUUIDOut()
|
||||
rssi := result.RSSI
|
||||
//manuf := uuids[0]
|
||||
// manufBool := payload.HasServiceUUID(manuf)
|
||||
EnumedManuf := ""
|
||||
|
||||
//---attempts to set the manufacturer value----
|
||||
//range through the uuids in the payload and compare
|
||||
//known manufacturers list
|
||||
for range uuids {
|
||||
|
||||
//for every element within the manufacturers list
|
||||
// check each UUID
|
||||
for _, man := range eros.Manufacturers.Entries /* known maufacturer data from eros */ {
|
||||
|
||||
// pull the UUID the current element of the manufacturer list
|
||||
currManufErosOut := man.UUIDs /* current element from manufacturer data */
|
||||
|
||||
// for each manufacturer's UUID's comapre check the
|
||||
// advertisment payload for a match
|
||||
for _, manusss := range currManufErosOut {
|
||||
manufBool := payload.HasServiceUUID(manusss)
|
||||
//if there is a UUID match then assign the Manufacturer's name
|
||||
// to the output variable EnumedManuf
|
||||
if manufBool == true {
|
||||
EnumedManuf = man.Name
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
var sublog zerolog.Logger
|
||||
|
||||
//ManufOut := ManfCheck(payload)
|
||||
@ -151,7 +178,7 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
|
||||
log.Info().
|
||||
Str("Name", fromEros.Name).
|
||||
Str("MAC", fromEros.MAC).
|
||||
Str("ManuF", fromEros.Manufacturer).
|
||||
Str("ManuF", EnumedManuf). //needs to be changed back to fromEros.Manufacturer
|
||||
Int16("Current_RSSI", fromEros.RSSIlast).
|
||||
Int("Service_Count", len(fromEros.Services)).
|
||||
Msg("EROS_RECALL")
|
||||
@ -164,7 +191,7 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
|
||||
// only each device
|
||||
sublog = log.With().Int("Scan_ID", s.ID).
|
||||
Str("LocalName", lname).Str("MAC", addr).
|
||||
//Str("ManuF", manuf).
|
||||
Str("ManuF", EnumedManuf).
|
||||
Int16("RSSI", rssi).Logger()
|
||||
|
||||
// Skipping duplicate results unless tracking mode enabled (to store RSSI as devices move)
|
||||
@ -180,7 +207,7 @@ func (s *Scan) resultHandler(scanAdapter *bluetooth.Adapter, result bluetooth.Sc
|
||||
s.Activity = time.Now()
|
||||
|
||||
//dev := s.NewDevice(lname, addr, ManufOut, rssi)
|
||||
dev := s.NewDevice(lname, addr, "", rssi)
|
||||
dev := s.NewDevice(lname, addr, EnumedManuf, rssi)
|
||||
|
||||
//AdvServBuf := make([]byte, 255)
|
||||
// Record all the services advertised, append them into the nested struct within Device
|
||||
|
Loading…
Reference in New Issue
Block a user