{"_id":"@adrien-f/ant-plus","_rev":"2-78673f1f4afde17f8e1da517323a00bc","name":"@adrien-f/ant-plus","dist-tags":{"latest":"0.1.26"},"versions":{"0.1.25":{"name":"@adrien-f/ant-plus","version":"0.1.25","description":"A node module for ANT+","main":"ant-plus.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepare":"tsc"},"keywords":["ANT","ANT+"],"author":{"name":"Alessandro Vergani","email":"alessandro.vergani@gmail.com"},"license":"MIT","engines":{"node":">=6.0.0"},"dependencies":{"usb":"^1.6.3"},"devDependencies":{"typescript":"^3.6.4","@types/node":"^6.0.0","@types/usb":"^1.5.1"},"directories":{"example":"./sample","lib":"./src"},"repository":{"type":"git","url":"git+https://github.com/loghorn/ant-plus.git"},"bugs":{"url":"https://github.com/Loghorn/ant-plus/issues"},"gitHead":"99ee65af5b87f72e2a9df21e8b32fb6e3b9d6a76","homepage":"https://github.com/loghorn/ant-plus#readme","_id":"@adrien-f/ant-plus@0.1.25","_nodeVersion":"13.8.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-sq6shKjg8pW03RWRJqSnJgXq4d+oz7LudHy5db5+nNIYZIdGYp8s7I90PxxjeZqgjmk3OYICmfLNYjw2HjYSBA==","shasum":"730c9cc3f0f0d0e523f11958bd88a99f8174b734","tarball":"https://registry.npmjs.org/@adrien-f/ant-plus/-/ant-plus-0.1.25.tgz","fileCount":44,"unpackedSize":325157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4KKdCRA9TVsSAnZWagAAPfcP/RNP7/uVEa6ceWA0uGol\nBE7FnGccu3mAJCnuFFf2NUSAq5Y5hk+eavhAt9g1KXKBt3R6YHvtvqag7SGj\ng/GsgfR92iD7ntrkToSMN7ALkNX5jozjmMFOMbHyL1ZUeeP14W7QsK5v9lXz\n2VHiIesgH1LxSs+0O3bcVjKNb5oerTaj0OJWhu2T8fF7YNiuAK2cqKa4UyqT\n/VaQknx8o2yqU77RiyZ6zucdyADPwcU0SqMD4FVIyQT20nW6d1Z89x240veC\nLdfsmLYEUm4McH/VxSKMuTpI+HNF8xWpnyyAPYx177XB3P9V6ZVRrWnBANnp\nw22S7YaEw0HRrCBHm3+RLAAg/boMpe22LiHtBMps5rrDY+s92dy9xIf8qnLh\nk8/ej3aNhGkWCkz3FhPxNpHxcdumSn3aOtrj7BBW/vdSVSCcFBh6wtL6TtWR\nF31O/Lu06atOtd48pJL7/nPwi0L2hCX/o1YVCqLSigvDzLZyPUdEpHlVxSsY\nCQQu2e1avbbJV5de9wS6renN2NoIetNTx2P22BQ8hl26klRizv40NVVoCIy2\nHzinD8Sq7oDEtEPSzS5gBstuU/i6I/rTAu1jF4zNnDgzivVWHvhkUTHKxeru\nscx+x9cztrKhf024VUMfu93Wr0C5jvz76VUR/hcBR2AY0gefokB+ZEf4xn7W\nInb5\r\n=BT8F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEV/EMk9m/w4qeot7lUmW9v/punUEqAz83a1oP+LoxtTAiARmJW284p1Lme5yq+EucKg1Nn1rikB+3Tu7u2ZK6isug=="}]},"_npmUser":{"name":"adrien-fery","email":"contact@adrien-fery.com"},"maintainers":[{"name":"adrien-fery","email":"contact@adrien-fery.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ant-plus_0.1.25_1608557212713_0.5215972314123414"},"_hasShrinkwrap":false},"0.1.26":{"name":"@adrien-f/ant-plus","version":"0.1.26","description":"A node module for ANT+","main":"ant-plus.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepare":"tsc"},"keywords":["ANT","ANT+"],"author":{"name":"Alessandro Vergani","email":"alessandro.vergani@gmail.com"},"license":"MIT","engines":{"node":">=6.0.0"},"dependencies":{"usb":"^1.6.3"},"devDependencies":{"typescript":"^3.6.4","@types/node":"^6.0.0","@types/usb":"^1.5.1"},"directories":{"example":"./sample","lib":"./src"},"repository":{"type":"git","url":"git+https://github.com/loghorn/ant-plus.git"},"bugs":{"url":"https://github.com/Loghorn/ant-plus/issues"},"gitHead":"99ee65af5b87f72e2a9df21e8b32fb6e3b9d6a76","homepage":"https://github.com/loghorn/ant-plus#readme","_id":"@adrien-f/ant-plus@0.1.26","_nodeVersion":"13.8.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-d3NMMTxXYUV2qc3itkFfP9y+62uD42+yQBC1BOBPhtNErAOZbdnXll7p6Nn4h1v5OSXfiVBtuiIXmU3HeaL84g==","shasum":"9425472233c574f7f4c1062d2a45fcb29111f5ac","tarball":"https://registry.npmjs.org/@adrien-f/ant-plus/-/ant-plus-0.1.26.tgz","fileCount":44,"unpackedSize":325157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4KKzCRA9TVsSAnZWagAATCAP/30qkzkFlkjD7OVua6Oo\npXVc1iEX8nq3jdqExNeIMgThSHz5nxBt1j6dOox+sHa7Ki24nTVvNF0F9+Cg\nVCFqvagYI5N/rnz8NdNR3Dtk63eOTuhadi/oN4AkXH3qx47JXlrSZcufb2ZK\nNwvjtSSG1Wq3DfuuvuOVkV6yrMNLaWaabk2/pJGnJB08bygmJ8dsHwda1eiv\noaHEglePFO3+y3G+I0/75Dtx2pM4QTNqJfqrd3aO9DizXNO8c0u6hzDiZ+Or\nwQwvSGZccaVB3KAYKzqy2sEa+3o5JazF7/XIs84Uky0UfL8C3R+XbMgq07qO\nzTvPGo3Rmo8hB+3Iy640IyeqTpaWGsE3M3hBLdkR4D7/+A4jD14h/Vx/P79a\nV1iZKYZniCe3hX53z7ZVCtICU+gm06n6+7HMHRJXHsCbXItOf45cIPYnFy6i\ncaIQcmFFHu8PsNJ+aZIJpzunNXSzYH56NANcQw27JaL99g7KltLa7qubXZ3n\nM9+anemesDlMwTcjtAFWX2Xjrur397Xh78Iwo9w5NrS0ecTejniRbhudp//1\nFHi954eS4XV5ZamKRy8XRs7KZI/Qtgx/NlLuQWDNsxPqgsAxVOuWWkvGKaM6\nbz2sdqm7i5hbkIIcpuWnSbutely26PsLXpn1tf616OJufyfXSiAIoBnnozsY\nG5eG\r\n=jQOA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDb38jK93QCro7n2Pf3MuLX47dYwuTdP+4TDDMFyAK1MQIhAIFhMVILnVOO5QeqzJutYariJASPO7q9RhtjSavkQARe"}]},"_npmUser":{"name":"adrien-fery","email":"contact@adrien-fery.com"},"maintainers":[{"name":"adrien-fery","email":"contact@adrien-fery.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ant-plus_0.1.26_1608557234761_0.22909751281552904"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-21T13:26:52.470Z","0.1.25":"2020-12-21T13:26:52.859Z","modified":"2022-04-04T11:37:34.285Z","0.1.26":"2020-12-21T13:27:14.973Z"},"maintainers":[{"name":"adrien-fery","email":"contact@adrien-fery.com"}],"description":"A node module for ANT+","homepage":"https://github.com/loghorn/ant-plus#readme","keywords":["ANT","ANT+"],"repository":{"type":"git","url":"git+https://github.com/loghorn/ant-plus.git"},"author":{"name":"Alessandro Vergani","email":"alessandro.vergani@gmail.com"},"bugs":{"url":"https://github.com/Loghorn/ant-plus/issues"},"license":"MIT","readme":"# ant-plus\n\nA node.js module for ANT+\n\n## Prerequisites\n\nLibusb is included as a submodule. On Linux, you'll need libudev to build libusb. On Ubuntu/Debian: `sudo apt-get install build-essential libudev-dev`\n\n### Windows\n\nUse [Zadig](http://sourceforge.net/projects/libwdi/files/zadig/) to install the WinUSB driver for your USB device. Otherwise you will get `LIBUSB_ERROR_NOT_SUPPORTED` when attempting to open devices.\n\n### macOS\n\nOn macOS (tested on High Sierra and Mojave), installing `ant-plus` will also\ninstall the required `libusb`.\n\nMake sure that Garmin Express is not running,\nbecause it will attach to the ANT+ stick and prevent `ant-plus` from doing so.\n\n## Install\n\n```sh\nnpm install ant-plus\n```\n\n## usage\n\n```javascript\nvar Ant = require('ant-plus');\n```\n\n#### Create USB stick\n\n```javascript\nvar stick = new Ant.GarminStick3;\n```\n\n#### Create sensors\n\n```javascript\nvar sensor = new Ant.HeartRateSensor(stick);\n```\n\n#### Attach events\n\n```javascript\nsensor.on('hbData', function (data) {\n    console.log(data.DeviceID, data.ComputedHeartRate);\n});\n\nstick.on('startup', function () {\n    sensor.attach(0, 0);\n});\n```\n\n#### Open stick\n\n```javascript\nif (!stick.open()) {\n    console.log('Stick not found!');\n}\n```\n\n### scanning\n\n```javascript\nsensor.on('hbData', function (data) {\n    console.log(data.DeviceID, data.ComputedHeartRate);\n});\n\nstick.on('startup', function () {\n    sensor.scan();\n);\n\nif (!stick.open()) {\n    console.log('Stick not found!');\n}\n```\n\n## Important notes\n\n* never attach a sensor before receiving the startup event\n* never attach a new sensor before receiving the attached or detached event of the previous sensor\n* never detach a sensor before receiving the attached or detached event of the previous sensor\n\n## Objects\n\n### GarminStick2 and GarminStick3\n\nGarminStick2 is the driver for ANT+ sticks with a USB product ID of `0x1008`.\nAs well as the old Garmin USB2 ANT+ stick, this works with many of the common off-brand clones.\n\nGarminStick3 is the driver for the mini Garmin ANT+ stick\nwhich has a USB product ID of `0x1009`.\n\n#### properties\n\n##### maxChannels\n\nThe maximum number of channels that this stick supports; valid only after startup event fired.\n\n#### methods\n\n##### is_present()\n\nChecks if the stick is present. Returns true if it is, false otherwise.\n\n##### open()\n\nTries to open the stick. Returns false on failure.\n\n##### openAsync(callback)\n\nTries to open the stick, waiting for it if not available right now. Returns a cancellation token with a method `cancel` you can use to stop waiting.\n`callback` is a function accepting a single `Error` parameter and it will be called when the stick is open (with the parameter undefined) or in case of failure (with the parameter set to the error).\n\n##### close()\n\nCloses the stick.\n\n#### events\n\n##### startup\n\nFired after the stick is correctly initialized.\n\n##### shutdown\n\nFired after the stick is correctly closed.\n\n### Common to all Sensors\n\n#### methods\n\n##### attach(channel, deviceId)\n\nAttaches the sensors, using the specified channel and deviceId (use 0 to connect to the first device found).\n\n##### detach()\n\nDetaches the sensor.\n\n#### events\n\n##### attached\n\nFired after the sensor is correctly attached.\n\n##### detached\n\nFired after the sensor is correctly detached.\n\n### Common to all Scanners\n\n#### methods\n\n##### scan()\n\nAttaches the sensors and starts scanning for data from every devices in range.\n\n##### detach()\n\nDetaches the sensor.\n\n#### events\n\n##### attached\n\nFired after the sensor is correctly attached.\n\n##### detached\n\nFired after the sensor is correctly detached.\n\n### HeartRate\n\n#### events\n\n##### hbData\n\nFired when new heartbeat data is received.\n\n### SpeedCadence\n\n#### methods\n\n#### setWheelCircumference(circumferenceInMeters)\n\nCalibrates the speed sensor. Defaults to a wheel with diameter of 70cm (= 2.199).\n\n#### events\n\n##### speedData\n\nFired when a new wheel speed is calculated.\n\n##### cadenceData\n\nFired when a new pedal cadence is calculated.\n\n### StrideSpeedDistance\n\n#### events\n\n##### ssdData\n\nFired when new data been calculated.\n\n### BicyclePower\n\n#### events\n\n##### powerData\n\nFired when new power has been calculated.\n\n### FitnessEquipment\n\n#### events\n\n##### fitnessData\n\nFired when new data is received.\n\n### Environment\n\n#### events\n\n##### envData\n\nFired when data is received.\n\nThe `state.EventCount` value can be used to tell when a new measurement has been made by the sensor -\nit's value will have been incremented.\n","readmeFilename":"README.md"}