CIQ 3.2 - Wow!

Just installed 3.2 (see https://forums.garmin.com/developer/connect-iq/b/news-announcements/posts/connect-iq-3-2-now-available),

and in looking at the change log in the SDK README file, a bunch of new features!

Time to start trying stuff!

  • Assume var result=null;

    then in initiaze():

    // check for ciq 3.2 or greater

    var ciqVer=sSettings.monkeyVersion;
    if(ciqVer[0]>=3) {
    if(ciqVer[0]>3 || ciqVer[1]>=2) {
    useStorage=true;
    }
    }


    if(useStorage) {result=App.Storage.getValue(SCANR);}

    Then in the code, if result!=null, do the paring, otherwise start scanning.

    and in onConnectedStateChanged(), when there's a connection:

    if(view.useStorage) {
    Application.Storage.setValue(SCANR, view.result);
    }

  • Jim's stuff is good as always, additionally for reference here is sample from my code to either connect to stored one or start scanning. I do some type checking and also see if there are available connections:

    function startScan() {
            if ((storedScanResult != null) && (storedScanResult instanceof Ble.ScanResult)) {
                Sys.println("startScan: connecting to stored Scanresult");
                if (Ble.getAvailableConnectionCount() > 0) {
                    Ble.pairDevice(storedScanResult);
                } else {
                    Sys.println("startScan: no available connections");
                }
            } else {
                Ble.setScanState(Ble.SCAN_STATE_SCANNING);
            }
        }

  • Former Member
    Former Member over 4 years ago in reply to jim_m_58

    Thanks a lot for the example, do you know if it's possible to create a bond connection on the watch? I have a device which has a BLE teaching mode for the connection and I don't want to go throw that teaching mode every time I run the app. It is possible to save somehow the information first time and than just connect to the device?

  • Not sure what you mean by teaching mode, but that's the whole things with saving the  scan result in storage.  If that's done and available, you can skip the scanning stage and go right to connecting.

  • Former Member
    Former Member over 4 years ago in reply to jim_m_58

    The teach mode is a security process in place to prevent random connection from other wearables that are in range. To start the teach mode I press a button, now the watch can connect to the device, than I press the button again to end the teach mode. Just after that I can perform read/write operations. If I exit the app I have to go throw that teaching mode again. It is possible to skip the whole process and go right to connecting?

  • That sounds like something specific to your sensor where you are actually turning on  BLE on it.

  • Former Member
    Former Member over 4 years ago in reply to jim_m_58

    I tried to connect with nRF Connect to the device and there is a Bond option. After the two are bonded I can connect to the device without going through the teach mode. I thought maybe I could do something like that on the watch.

  • Hi mates,

    Does anyone else have issue with SDK manager?

    few hours ago no problem with it, right now nothing happens when I start it,

    I checked the update and whether I have the last plug in (3.2.2)

    Is there an other way to start it?

    have a great day

  • When it was downloaded, it was installed on your system, and in the case of Windows, under (user)/appdata/roaming/garmin/connectIQ if I recall.  Go to the sdkmanager diretory and just run it.

  • that what I tried, i don't have any sdklanager.exe or else,

    only 

    sdkmanager-config.ini

    sdkmanager-location.cfg (which link to C:\Users\steve\AppData\Local\Temp\Rar$EXa86488.31681\sdkmanager.exe which does not exist)