Does any file inside the sdk folder record the sensor types

Hi,

I wanna cope with my monkey.jungle with a script, before which I need to know what sensors each device has.

 I have checked the simulator.json inside  ~/Library/Application Support/Garmin/ConnectIQ/Devices/{deviceName}/ . Here is a part for fr245.

"sensorHistory": [
{
"interval": 120,
"size": 120,
"type": "heartrate"
},
{
"interval": 72,
"size": 200,
"type": "elevation"
},
{
"interval": 72,
"size": 200,
"type": "temperature"
},
{
"interval": 72,
"size": 200,
"type": "pressure"
},
{
"interval": 3600,
"size": 192,
"type": "pulseox"
}

It seems to be what I was looking for. However, as the api doc says, https://developer.garmin.com/connect-iq/api-docs/Toybox/SensorHistory.html#getPressureHistory-instance_function  fr245 doesn't has a pressure sensor or cannot invoke getPressureHistory at all. So what does this json part mean actually? Curious.

Top Replies

All Replies

  • I have some other functionlities like draw bigger font text which contains some specific resources and long functions.

    Yeah in that case you probably have to hardcode stuff. I hardcode a lot of stuff in my jungles to do with memory, fonts, screen size/shape, etc. I love the idea of using a script to generate jungles for stuff that you can derive from compiler.json and other device files, tho.

    I don't see how knowing the display name helps so much, unless you're not sure which device id (e.g. fr245m) corresponds to which "friendly Garmin marketing name" (e.g. "Forerunner 245 Music".)

    It does help, but not with the problem you originally asked about.

  • You should be able to use *.api.debug.xml to detect the availability of getPressureHistory() or any of the other sensor functions

    Good idea. I will try this.

  • Let me make an explaination.

    My question is: 

    How to hardcode source folders for sensors equipment before compilation intead of using  something like "Toybox.SensorHistory has :getPressureHistory" in runtime

    1. Find out "getPressureHistory" Supported Devices. 

    https://developer.garmin.com/connect-iq/api-docs/Toybox/SensorHistory.html#

    The name is "displayName" in 

    /Users/kent/Library/Application Support/Garmin/ConnectIQ/Devices/{device}/compiler.json
    e.g.

    compiler.json"  "deviceId": "fr255",
    "displayName": "Forerunner® 255"

    Use some regex to get a device list that friendly to "list" or "array" data structure.

    2. Traverse all the devices my app supported. And parse the compiler.json to filter the model with the displayName in "Supported Devices"

    3. Only add source-pressure for these devices.

  • Let me make a explaination.

    My question is: 

    How to hardcode source folders for sensors equipment before compilation intead of using  something like "Toybox.SensorHistory has :getPressureHistory" in runtime

    1. Find out "getPressureHistory" Supported Devices. 

    https://developer.garmin.com/connect-iq/api-docs/Toybox/SensorHistory.html#

    The name is "displayName" in 

    /Users/kent/Library/Application Support/Garmin/ConnectIQ/Devices/{device}/compiler.json
    e.g.

    compiler.json"  "deviceId": "fr255",
    "displayName": "ForerunnerRegistered 255"

    Use some regex to get a device list that friendly to "list" or "array" data structure.

    2. Traverse all the devices my app supported. And parse the compiler.json to filter the model with the displayName in "Supported Devices"

    3. Only add source-pressure for these devices.

    I see, got it! That's a clever idea. Sorry I missed that. 

    I will say that method might be less reliable, because the docs are known to have mistakes, especially when it comes to supported devices. You also don't know if those device names were auto-generated or not (can they have typos/spelling mistakes?). (The fact that there's often mistakes in supported devices tells me that the lists are either not fully auto-generated and/or not automatically kept up-to-date.)

    I think it would be more reliable to use something in the Devices/ directory like compiler.json, simulator.json or *.api.debug.xml whenever possible. They're obviously meant to be machine-readable, so they're probably also machine-generated (and more likely to be up-to-date and correct.) (I do know of one case where Enduro has the wrong value for glance liveUpdates in simulator.json)

    Also, each device has its own directory full of files only relevant to itself (so you can be reasonably sure they're complete for that device), whereas the docs can easily be missing information on the latest devices (as they sometimes are.). (There's only one set of docs for all devices.)

  • I see, got it! That's a clever idea. Sorry I missed that. 

    Sorry for my brief hints before.

    This forum is so terrible. When you were editing your reply, I clicked the reply and the button misbehaved.

    whereas the docs can easily be missing information on the latest devices. (One set of docs for all devices.

    Indeed. It is not reliable.  

  • OOPPS. I saw it.

     ~/Library/Application Support/Garmin/ConnectIQ/Devices/fr245/fr245.api.debug.xml

  • This forum is so terrible.

    Yeah to say the least. I begged Garmin to use a modern platform like NodeBB or Discourse when they switched over a few years ago but they chose this for some reason. Someone linked to the wahoo forums and I was so sad to see how nice it was. You can instantly jump directly to any post in a thread with 100s of replies, while still being to scroll infinitely.

    But they're just using the same platform (Discourse) that a lot of other people use today.

  • <entry id="8389801" method="true" symbol="getPressureHistory"/>

    Yessss. It is the most reliable method to do that. LOL.

    I got it. XD.

  • Someone linked to the wahoo forums

    Amazing. Wahoo's is really responsive.

  • Amazing. Wahoo's is really responsive.

    Yeah I bet you can quote emojis without being blocked by the forum or edit your post without interrupting the person who is trying to reply. It's probably also not useless on mobile.

    To be fair I don't hear great things about their products. (Never tried them tho.)