I am trying to change Minor Value using Estimate SDK. But having problem connecting to Beacon let alone changing the value. Here is my implementation
let beaconConnection = ESTBeaconConnection()
//Start raining Beacon
self.beaconManager.startRangingBeaconsInRegion(CLBeaconRegion(
proximityUUID: NSUUID(UUIDString: "B9407F30-F5F8-466E-AFF9-25556B57FE6D"),
major: 57048, identifier: "monitored region"))
//Connect to in range beacon
func beaconManager(manager: AnyObject!, didRangeBeacons beacons: [AnyObject]!, inRegion region: CLBeaconRegion!) {
beaconConnection.startConnection()
// Change minor value when ConnectionDidSucceed
func beaconConnectionDidSucceed(connection: ESTBeaconConnection!) {
let minor = 22905
let newMinor = 2222
println("connected")
beaconConnection.writeMinor(UInt16(minor), completion: {(newMinor: UInt16, errorMajor: NSError!) -> Void in})
println(NSError)
}
I’ve also implemented didFailWithError to catch any error
func beaconConnection(connection: ESTBeaconConnection!, didFailWithError error: NSError!) {
println("not successful")
println(error)
}
Although didRangeBeacons finds the correct Beacon, but I,m unable to connect to it and it appears that beaconConnection.startConnection() does nothing.
Any help would be much appreciate.