I have tried to get UUID, major and minor through connect beacon,
my question is “can I get value without connect beacon?”
this is my viewcontroller:
class PairPageController: UIViewController , ESTDeviceManagerDelegate, ESTDeviceConnectableDelegate{
var deviceManger: ESTDeviceManager!
var beaconManger = ESTBeaconManager()
var ownBeaconlistID: Array<String>! = []
@IBAction func menuClick(_ sender: Any) {
navigationController?.view.menu()
}
override func viewDidLoad() {
super.viewDidLoad()
self.deviceManger = ESTDeviceManager()
self.deviceManger.delegate = self
self.deviceManger.startDeviceDiscovery(with: ESTDeviceFilterLocationBeacon(identifiers: self.ownBeaconlistID))
}
//when discover device
func deviceManager(_ manager: ESTDeviceManager, didDiscover devices: [ESTDevice]) {
guard let beacon = devices.first as? ESTDeviceLocationBeacon else { return }
self.deviceManger.stopDeviceDiscovery()
beacon.delegate = self
beacon.connect()
}
func estDeviceConnectionDidSucceed(_ device: ESTDeviceConnectable) {
print("Connected")
guard let beacon_connected = device as? ESTDeviceLocationBeacon else { return }
beacon_connected.settings?.iBeacon.major.readValue(completion: { (_ major: ESTSettingIBeaconMajor?, _ error: Error?) in
print(major?.getValue())
})
}
func estDevice(_ device: ESTDeviceConnectable,
didFailConnectionWithError error: Error) {
print("Connnection failed with error: \(error)")
}
func estDevice(_ device: ESTDeviceConnectable,
didDisconnectWithError error: Error?) {
print("Disconnected")
}
}
thanks for your help!!