Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.16 KB

README.md

File metadata and controls

51 lines (35 loc) · 1.16 KB

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.