<commit_before>Cordova Ant+ plugin
=======

Originally created for MoBio app:
* [MoBio](https://github.com/NEUROINFORMATICS-GROUP-FAV-KIV-ZCU/MoBio) 

Cordova plugin based on ANT+ SDK for communication with ANT+ devices

Android only

Documentation will be added soon.<commit_msg>searchDevices documented<commit_after># ANT+ plugin for Apache Cordova

This plugin enables communication between Android phone and ANT+ devices

Originally created for MoBio app:
* [MoBio](https://github.com/NEUROINFORMATICS-GROUP-FAV-KIV-ZCU/MoBio) 

## Supported Platforms

* Android

# ANT support

In order to use this plugin install the following apps to your phone.
The apps enable the communication with ANT+ OTG modul if you are using it.
* [ANT Radio Service] (https://play.google.com/store/apps/details?id=com.dsi.ant.service.socket)
* [ANT+ Plugins Service] (https://play.google.com/store/apps/details?id=com.dsi.ant.plugins.antplus)   
* [ANT USB Service] (https://play.google.com/store/apps/details?id=com.dsi.ant.usbservice)

# Installing

## Cordova

    $ cordova plugin add cordova-plugin-antplus

# API

## Methods

- [antplus.searchDevices](#searchDevices)

## searchDevices

Search and discover ANT+ devices.

    antplus.searchDevices(comma_separated_device_definition, success, failure)

### Description

Function `searchDevices` scans for the defined ANT+ devices. Success callback is called every time the a device is discovered.
First parameter is string - comma separated values of device types that the function scans for. 
Possible values are:
- HEARTRATE
- BIKE_SPD
- BIKE_CADENCE
- BIKE_SPDCAD
- STRIDE_SDM
- WEIGHT_SCALE

### success response parameters

- resultID
- describeContents
- antDeviceNumber
- antDeviceType
- deviceDisplayName
- isAlreadyConnected
- isPreferredDevice
- isUserRecognizedDevice

### error response parameters

- event
- message
- code
{'fraction_non_alphanumeric': 0.09343299519487454, 'fraction_numerical': 0.0, 'mean_word_length': 4.713414634146342, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5762537', 'n_tokens_mistral': 603, 'n_tokens_neox': 576, 'n_words': 172}