C example for talking to Concept2 ergometers over USB independent of the Concept2 SDK libraries.
- To understand how to talk to Concept2 ergs.
- Simple reference for the CSAFE protocol.
- Absence of simple command line application for talking to ergs.
- All commands from the spec are in.
- API is pretty loose and needs more work.
- Implemented commands in the CLI app are tested; others should work.
Based on the Concept2 Communication Interface Definition 0.15 available in the Concept2 SDK.
- hidapi for USB HID interface.
- Builds on OS X.
- Should build on Linux.
$ # install hidapi
$ export HIDAPI_INCDIR=/path/to/hidapi/include
$ export HIDAPI_LIBDIR=/path/to/hidapi/lib
$ make
Set time of monitor to local time:
$ ./c2 -s
Set workout time of 0:15:00:
$ ./c2 -r -t 0:15:0 -p 0 -y idle -y haveid -y inuse
Set workout distance of 500m:
$ ./c2 -r -d 500 -p 0 -y idle -y haveid -y inuse
Get erg and workout info:
$ ./c2 -g erg -g workoout
Go back to ready state:
$ ./c2 -y finished -y ready
Help:
$ ./c2 -h