SIGABRT during deactivateAsync
I am trying to download accelerometer data from my MetaTrackr device. When I run my function (see below), I receive a SIGABRT error in the deactivateAsync BFTask (see specifically where below). I have reset the device, re-written this function in several different projects, but continually get this error.
Any ideas what might be going on?
@IBAction func StopMonitoring(_sender: Any){
print("Stop Monitoring tapped")
StartMonitoringButton.isEnabled = true
StopMonitoringButton.isEnabled = false
device.led?.setLEDOnAsync(false, withOptions: 1)
device.accelerometer!.dataReadyEvent.downloadLogAndStopLoggingAsync(true)
.success{ array in self.accelerometerBMI160Data = array as! [MBLAccelerometerData]
for obj in self.accelerometerBMI160Data {
print("x: ", obj.x, ", y: ", obj.y, ", z: ", obj.z)
}
}
}
- (BFTask *)deactivateAsync
{
return [BFTask taskFromMetaWearWithBlock: ^id{
self.activateCount--;
if (self.activateCount == 0) {
activateTask = [[[self.module deactivateAsync] continueOnMetaWearWithSuccessBlock: ^id _Nullable(BFTask * _Nonnulltask) {
return [self perform AsyncDeactivation];
}] continueOnMetawearWithBlock: ^id _Nullable(BFTask* _Nonnull task) {
if(task.faulted) {
self.activateCount++;
}
return task;
}];
}
#ifdef DEBUG
assert(self.activateCount >= 0); <<<<< ERROR: "Thread12: SIGABRT"
self.activateCount = MAX(self.activateCount, 0);
return activeTask;
}];
This discussion has been closed.
Comments