Skip to content

didUpdate function doesn't get all subscribed services #10

@anurag1991

Description

@anurag1991

Hi Folks,

Thanks for such a great BlueTooth SDK, I appreciated for your hard work.

I am stuck at the point where I don't get BlueSTSDKFeatureMemsSensorFusion feature values in did update function.

I am subscribing for two service one is for battery status BlueSTSDKFeatureBattery and another one for BlueSTSDKFeatureMemsSensorFusion

This is how i am subscribing:

            if let feature =  self.blueSTSDKFeatureMemsSensorFusion {
                node.enableNotification(feature)
                feature.add(self)
            }

            self.blueSTSDKFeatureBattery = node.getFeatureOfType(BlueSTSDKFeatureBattery.self) as? BlueSTSDKFeatureBattery
            if let service = self.blueSTSDKFeatureBattery {
                node.enableNotification(service)
                service.add(self)
                service.readCapacity()
}```
     
in my did update function I get the first 2-3 value for `BlueSTSDKFeatureMemsSensorFusion` feature and after that I am just receiving all the values for `BlueSTSDKFeatureBattery`. i tried to move the device but it's just keep posting me the value for the battery

    func didUpdate(_ feature: BlueSTSDKFeature, sample: BlueSTSDKFeatureSample) {
        if feature == blueSTSDKFeatureBattery {
            print("battery value")
        }
        
        if feature == blueSTSDKFeatureMemsSensorFusion {
            print("read sensor value")
        }

    }

i am not sure why it's happening, is there anything we have to tell the node to enable multiple subscription etc? i am stuck for past 2 days please help me her.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions