Enabling and disabling Ibeacon/advertisement through events in a disconnected state
Ok, so I'm using the Metawear to detect orientation changes and notify an intel edison of the moment via ble advertisement packets. This part of the project works well! I'm successfully reading the packets on the edison and I'm able to see all advertised data. So moving forward i would like to only send ble advertisements when the Metawear detects an orientation change, then immediately disable advertisements. so, heres what I've tried:
[accelerometerMMA8452Q.orientationEvent programCommandsToRunOnEvent:^{;
device.name = @On;
[device.iBeacon setBeaconOn:YES];
device.name = @Off;
[device.iBeacon setBeaconOn:NO];
[accelerometerMMA8452Q.orientationEvent eraseCommandsToRunOnEvent];
}];
I've not shown it but this is wrapped within a connection to a handler and ends with a disconnect from the handler
unfortunately this never seems to disable advertisement
This discussion has been closed.
Comments
[self.device.settings startAdvertisementAsync];
}];