"startConnection" api with the "sensorIntent" parameter causing problems using combined parameters

"startConnection" api with the "sensorIntent" parameter causing problems using combined parameters

randyfongrandyfong Member Posts: 7
When using the new "startConnection" api with the "sensorIntent" parameter overload, I get an error screen stating:

"Device not supported. 
Unfortunately this app does not support your product".

Combined Paramenters


The following parameter combinations result in the above error.

let sensors:Set = [SensorType.accelerometer,SensorType.gameRotation,SensorType.magnetometer]
let samplePeriods:Set = [SamplePeriod._20ms,SamplePeriod._40ms,SamplePeriod._80ms]
let sensorIntent = SensorIntent(sensors:  sensors, samplePeriods:samplePeriods)

BoseWearable.shared.startConnection(mode: mode, sensorIntent: sensorIntent)

Parameters used in the “Heading Example”


But, in the “Heading Example” that comes with the SDK download folder, the following parameter combination works fine.

let sensorIntent = SensorIntent(sensors: [.rotation], samplePeriods: [._20ms])

When the parameters in the first example are substituted, the problem occurs.

There is something about the combined parameters in the first example that is causing a problem.

Configuration 
Bose ALTO Frame
Firmware 4.0.3

SDK V4.08 (29)

Comments

  • daniel@bose[email protected] Member Posts: 41
    @randyfong

    Thanks for your feedback!  This will help others in our developer community as they migrate to V4.0.X of our SDK.

    There's a couple of issues that we should discuss: 

    The first issue you encountered relates to setting the SensorIntent with a SensorType that is not supported by the device.  

    Admittedly un-intuitive,  when using SensorIntent you must pass a Set of known valid SensorTypes to the method BoseWearable.shared.startConnection
       
      BoseWearable.shared.startConnection(mode: mode, sensorIntent: sensorIntent)

    If you inspect the WearableDeviceInformation you will see Bose ALTO Frame doesn't not directly support SensorType.magnetometer - that's because the magnetometer data is abstracted into the rotation sensor.

     WearableDeviceInformation: { ...  
    availableSensors=[Gyroscope, Game rotation, Rotation, Accelerometer],
    availableGestures=[Double-tap, Input, Head shake, Negative, Head nod, Affirmative],
     ...}


    Thus the only valid SensorTypes are:
    [Rotation, Game rotation, Gyroscope, Accelerometer]

    The second issue I see is this, if you try to use an invalid sensor  the error message fails to accurately describe the problem to the user as seen below:   This app doesn't support your device.  That's inaccurate,  so we'll file that issue with our SDK team.  

    Thanks for contributing here,

    @[email protected]






Sign In or Register to comment.