Skip to content

aerobicio/garmin-communicator

Repository files navigation

Garmin Communicator

wercker status Coverage Status Dependency Status

A sane re-write of the Garmin Device Connect JS library.

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.

But why!?

I wanted:

  • No Prototype.js
  • A promise based approach to async operations, no more insane polling!
  • Tests!

For example

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

Runtime Dependencies

Developing

Install developments tools:
  • ./script/bootstrap
Watch files, recompile on change
  • gulp develop
Running specs:
  • gulp spec

About

A (more) sane re-write of the Garmin Device Connect JS library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published