• Garmin Insider

Find Devices

 

The plug-in can communicate with one or more connected Garmin devices. This method discovers what devices are visible, as well as the types of devices connected.

Developers must implement the onFinishFindDevices call-back method to access
the device data.

Example Request

 

 

    var listener = Class.create();
    listener.prototype = {
        initialize: function() { },
        onFinishFindDevices: function(json) {
            var devices = json.controller.getDevices();
            var str = "Found: "+devices.length+" devices: ";
            for( var i=0; i < devices.length; i++ ) {
                str += devices[i].getDisplayName()+", ";
             alert(str);
        }
    }
    function load() { //called from the html page onload event
        control = new Garmin.DeviceControl();
        control.register(new listener());
        var unlocked = control.unlock("http://mydomain.com","pasteYourKeyInHere");
        control.findDevices();
    }

Developer Resources