VA and Alert Tones (Not supported?)

I only just realised that according to this API doc, http://developer.garmin.com/downloads/connect-iq/monkey-c/doc/frames.html#!Toybox/Attention.html The VA does not support for any form of Alert Tones at all.
However, it should be able to support http://developer.garmin.com/downloads/connect-iq/monkey-c/doc/frames.html#!Toybox/Attention.html the "tonesOn()" api.

if (Sys.getDeviceSettings().tonesOn) { Attn.playTone (tone); }
if (Sys.getDeviceSettings().vibrateOn) { Attn.vibrate([ new Attn.VibeProfile(25, 600) ]); }


shouldn't these 2 lines be able to determine if the device supports tones or otherwise?
What is the default for the VA? Is this "tonesOn()" by default returns as TRUE or FALSE?

I don't have a VA to test this on and this threw the app into a error state. (of course on the Simulator it works fine)

Thanks
  • No tones on the VA

    From the 1.1.4 doc "Not all devices support this API."

    You need to check using "has" or by knowing the device you are on. Search this forum to see how you can determine your device in the code...
  • I don't have a VA to test this on and this threw the app into a error state. (of course on the Simulator it works fine)

    Thanks


    This is why you should NOT check a device to support in the build unless you have a friendly tester check it out by sideloading, or you understand the differences yourself.
  • I understand that from the API Doc which I referenced above. But seems like the 2nd link is the same as the 1st. Here' another try

    http://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/System/DeviceSettings.html#tonesOn-instance_method

    - (Object) tonesOn

    True if tones are enabled on the unit, false if they are disabled return [Boolean]

    Since:
    1.0.0


    The above does not state / restrict this call to any specific device. i would have thought that this functions same as the "phoneConnected()" call.
    Should it not give a "false" result by default and thus indicate that the next step (of executing) the tone to NOT happen.

    This app is VA specific, so it's trivial for me to remove it but I would like to get a little more clarification on the "tonesOn" that's all.

    Thanks Jim (if you have any input - I also know you have a VA - so do you know what is the default return value from that tonesON()? )

    cheers.

    This is why you should NOT check a device to support in the build unless you have a friendly tester check it out by sideloading, or you understand the differences yourself.


    This is from a Friendly Tester.
    Thank you for your advise (as always) :-p

    Of course, the other way to see this is that the Simulator isn't actually doing a good job. Perhaps what we need is an emulator (and one that actually uses the device FW so that all idiosyncracies from the FW can be netted out.)
  • Using tones on a device that doesn't support tones will cause a crash. Same with "TextPicker" - it will crash va!

    Use "has" or detect the device you are on...

    "Has" is very useful. Set a boolean in initialize, and then only use use tones if "supportsTones" is true...
  • Thanks.. I search the forums (focusing on phone connected) and seems to me it's a serious drawback.
    the doc does not indicate that it whether a device supports that call or otherwise and thus one 'presumes' that it does. (dangerous thing this assumption :-)

    so, using HAS seems to be the best way to add code bloat then.

    if (Toybox.System.getDeviceSettings() has honeConnected)
    {//do something}



    CIQ guys - perhaps some update of the docs are in order?
  • The Attention module is already calls out exactly which devices support which features, so I think that should be clear. The question at hand is how tonesOn() should report on a device that does not have tone support.

    It looks like the vivoactive in the simulator reports TRUE, but the device reports FALSE (as I would expect). I'll report this as a bug and try to get some clarification on what's expected in this case (I don't have any requirements for this case). In my opinion, if a device doesn't support tones natively, it should return false when checking to see if tones are on in the system settings.

    That said, Jim's recommendation to use 'has' really is the way we suggest handling this. If the device can't play a tone, it really doesn't matter what the system settings are. :)
  • Appreciate the info Brandon.

    Agree that the attention module states it as such.
    Agree that the question is on the TonesOn() output.

    You mentioned that the simulator reruns true, however u also said that the device returns false (as you & I would expect) but this is not what's happening for real. What's happening on the device is its being reported as true. That's the area of contention currently and I think u agree that it's a bug.

    Has is a nice way of checking. But I really would like to reduce the amount of checking if there is already a method (like tonesOn()) which can do that rather than 2 functions to check 1 thing. Want to reduce code clutter if at all possible.


    Thanks (as usual!!)