This project is a re-implementation of the official Garmin Communicator Device Connect Javascript API, specifically it is an alternative to Garmin.DevicePlugin
. It is intended as a replacement for the (seemingly) unmaintained official project.
It should be considered a work in progress, and is by no means a full re-implementation, and probably never will be. Currently only reading operations are supported, but support for writing is planned.
The main goal is to provide a better interface for interacting with Garmin devices via the Communicator Browser plugin.
I wanted:
- No Prototype.js
- A promise based approach to async operations, no more insane polling!
- Tests!
garmin = new Garmin(unlockCodes: your: 'codes here')
# Unlock the plugin
garmin.unlock() if garmin.isInstalled()
# Fetch a list of devices
devicesPromise = garmin.devices() # promise
devicesPromise.then (devices) ->
device = devices[0]
device.canReadFITActivities # boolean
device.canReadActivities # boolean
# Fetch activities from a device
activitiesPromise = devices.getActivities() # promise
activitiesPromise.then (activities) ->
# Read activity data, could be XML or FIT binary, or whatever
activities[0].getData() # promise
lodash
(http://lodash.com)Q
(https://github.com/kriskowal/q)
./script/bootstrap
gulp develop
gulp spec