D2 family don't seem to implement Sensor.setEnabledSensors( [Sensor.SENSOR_HEARTRATE]);

Hi,

Adding a few extra devices to my app but getting odd behaviour on code that works perfectly on all other devices.

The D2 Delta, Delta S, D2, Px don't get any HR data.

However, D2 Air, Air x10, Mach 1 all work fine and HR data is seen.

API 3.1.0 and SDK 4.1.7

Any thoughts welcome.

As an aside I've never seen this come back true ... but I do have min API set to 3.1.0. I thought this would use higher API on devices that support them.

if (Sensor has :enableSensorType) {

regards

David

  • I do have min API set to 3.1.0. I thought this would use higher API on devices that support them.

    That just means that:

    - you won't be able to build for devices which lack support for 3.1.0

    - if a device supports 3.1.0 but currently has a lower firmware version installed, the user will not be allowed to download your app (I think they'll be prompted to update first)

    - if an APAC device variant doesn't support 3.1.0, users of those devices won't be able to download your app, they won't see their device variant in the list of supported devices (if their device has a different name/variant compared to worldwide devices - e.g. Foreathlete vs Forerunner), and if they search for apps supported by their device (i.e. in the Connect IQ app), they won't see your app. (At least for previous generations of watches, APAC variants were often stuck on lower levels of firmware for much longer than worldwide variants)

    The availability of an API level-dependent feature is unaffected by setting the min API or not. Instead, it's determined by the firmware that's installed on the device (specifically, the CIQ version supported by that firmware.)

    You'll also note that since System 4 is 3.2 / 4.0, System 5 is 3.3 / 4.1 and System 6 is 3.4 / 4.2, there's no way to use minApiLevel to definitively include/exclude devices by system level.

    For example, if you wanted to include System 5 devices and only System 5 devices, you could try to set minApiLevel to 3.3, but that would incorrectly include any 4.x devices which are still on 4.0.x for whatever reason. If you set minApiLevel to 4.1, you'd incorrectly exclude 3.3 devices.

  • Hi,

    Thanks for a very informative answer. I had select my devices from the product list. So you may have solved a different problem for me as someone couldn't see a device on the store. However, my issue is with the simulator...

    1. The D2 delta series don't seem to give any HR data from the sensor

    2. No device in the simulator (and in reality when TXT file sused to exist) would return true to has :enableSensorType

    help much appreciated

    David

  • ah ha moment.

    Issue (1) is due to the fact that devices do not support beat to beat intervals (I'm assuming just from the optical sensor). However, I would hope the simulator could fake an ANT strap to provide that data but I can't see a way of doing so.

    Regards,

    David

  • Thanks for a very informative answer. I had select my devices from the product list. So you may have solved a different problem for me as someone couldn't see a device on the store.

    No worries! Yeah, the "standard" advice these days is to use either has and/or jungle exclusions to select features. IMO with the advent of the System X scheme where there's dual firmware version tracks which get the same features, minApiLevel isn't so useful anymore.

    The downside is some ppl may be able to download your app, but won't be able to use certain functionality and will only find out after they install the app.

    Issue (1) is due to the fact that devices do not support beat to beat intervals (I'm assuming just from the optical sensor).

    Interesting. I guess you could try to play back a recorded FIT file that has ANT+ strap data. Strange that you apparently need support for HRV data just to get any HR data at all. I *think* you might also be able to use a real ANT+ device with the sim if you buy a dongle.

  • I use jungle exclusions on small memory/large memory devices but have then then specify devices in the jungle to work out which is which. Having an API to call to get the device name would be really helpful as then some work could be done in the code itself.

    I did see the dongle suggestion but it would have to appear via the sensor hub and not as an ANT+ connection (which I removed from my code several versions ago to save code memory and user confusion).

  • You can get the part number of the device, but it sounds like you're trying to hack something you might not need to. When you export your project then each device will have its own org file and then all of them are collected in the iq file. So it's easy to differentiate between the devices by using jungle file.

  • Hi,

    I already use the jungle to differentiate devices and resource JSON files for various display configuration to save memory. Sometimes though different devices have slightly different font rendering for instance and it would have been easier to manage the difference through a couple of lines of code eg if device X then font a else font b rather than jungle entries and another set of source code/resources to change manage.

    Regards,

    David 

  • Why? If you know what to chose in monkey c why can't you do the same choice in jungle?

    If you don't do it in jungle then will you include a map from part number to font in your code? Will it include all part numbers? Or only the subset that are possible according to how you split your code in your current jungle file?

    Eventually you'll need to do a part number to font map, that is even harder to do than  what you want because there are more part numbers than device names. And if you can do it in mc then you can also do it in jungle

  • I'll review this again. I am using device resolution and a resource ID to add certain features. I could pull these out in to a function which I can then include/exclude via a jungle though this will add more jungle device entries.

    Thanks for the insight and gentle persuasion.

  • For scripts that generate jungle files maybe it's worth to look in the SDK's devices/*/*.json files