swift2 - swift background BLE scanning with scanForPeripheralsWithServices UUID not taken into account -


i'm performing ble devices scan in specific thread. if want app run in background, need specify scanforperipheralswithservices specific range of services.

when launching following (with nil) :

func startscanning() {     print("start scanning...")        if let central = centralmanager {             central.scanforperipheralswithservices(nil, options: nil)         } } 

i can find ble device uuid "b737d0e7-af53-9b83-e5d2-922140a92e00", apple documentation mentioned cannot ruined in background mode.

then if specify uuid function:

func startscanning() {     print("start scanning...")        if let central = centralmanager {             let ble = [cbuuid(string: "b737d0e7-af53-9b83-e5d2-922140a92e00")]             central.scanforperipheralswithservices(ble, options: nil)         } } 

scan never called. miss ?


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -