Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-[PTDBean readAccelerationAxes] doesn't work well #10

Open
sodastsai opened this issue Apr 30, 2015 · 3 comments
Open

-[PTDBean readAccelerationAxes] doesn't work well #10

sodastsai opened this issue Apr 30, 2015 · 3 comments

Comments

@sodastsai
Copy link
Contributor

I'm using the iOS SDK to fetch both accelerometer and thermometer values.

The SDK usually returns those sensor values correctly (via the delegate methods). And the console log seems well too.

2015-04-30 11:00:28.749 lbbean[3297:942563] App Message Received: MSG_ID_CC_ACCEL_READ: <ebff1d00 f90002>
2015-04-30 11:00:28.777 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:28.928 lbbean[3297:942563] App Message Received: MSG_ID_CC_ACCEL_READ: <e7ff2100 f70002>
2015-04-30 11:00:29.017 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:29.168 lbbean[3297:942563] App Message Received: MSG_ID_CC_ACCEL_READ: <e6ff2100 f80002>
2015-04-30 11:00:29.288 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:29.378 lbbean[3297:942563] App Message Received: MSG_ID_CC_ACCEL_READ: <e8ff1d00 f80002>
2015-04-30 11:00:29.467 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:29.618 lbbean[3297:942563] App Message Received: MSG_ID_CC_ACCEL_READ: <e8ff1c00 000102>
2015-04-30 11:00:29.707 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>

But sometimes, usually after re-connecting to the bean (connect first and then disconnect repeatedly), the bean doesn't report any update about the accelerometer. It only reports the thermometer's, like following.

2015-04-30 11:00:21.677 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:21.767 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:21.858 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:21.948 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:22.038 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:22.128 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:22.219 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>
2015-04-30 11:00:22.308 lbbean[3297:942563] App Message Received: MSG_ID_CC_TEMP_READ: <1c>

The way I used to keep updating the sensor values is like following:

- (void)bean:(PTDBean *)bean didUpdateAccelerationAxes:(PTDAcceleration)acceleration {
    // ... other code ...

    if (bean.state == BeanState_ConnectedAndValidated) {
        [bean readAccelerationAxes];
    }
}
@sodastsai
Copy link
Contributor Author

I've found that the line

[peripheral writeValue:data forCharacteristic:serial_pass_characteristic type:CBCharacteristicWriteWithoutResponse];

in GattSerialProfile.m:119 does be called with a nonnull CBPeripheral object each time when I execute [PTDBean readAccelerationAxes].

But I still don't get any response :(

@zdrewptd
Copy link
Contributor

zdrewptd commented May 5, 2015

Thank you for the report. I will try to reproduce the issue.

@Nobis99
Copy link

Nobis99 commented Mar 20, 2016

What is status? I am beginning a project and would like to know if the OSX is worth attempting.

karelkalthoff pushed a commit that referenced this issue Apr 8, 2016
oad: improve delegate calls by adding more info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants