0.0.1 • Published 8 years ago

concept2 v0.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

node-concept2

Build Status npm version

HID library for communicating with Concept2 performance monitor modules.

Description

This module provides a wrapper for node-hid for communicating with Concept2 performance monitors. It depends on node-csafe in order to communicate using the CSAFE protocol.

Installation

$ npm install --save concept2

Example

import Concept2 from concept2
import { Command } from csafe

// Connect to an available monitor (with vendor ID 6052)
const pm3 = new concept2

// Listen for error a new-frame events.
pm3.on('error', (err) => {
  console.error(err)
})

pm3.on('frame', (frame) => {
  // Do something with the response!
  console.log(frame)
})

// Write a command to the device.
const getCadenceCmd = new Command('GetCadence')
pm3.write(getCadenceCmd)

Testing

$ npm test

License

The project is licensed under the MIT license.