Example #1
0
    private void onScanComplete()
    {
        // For this Bare Bones example we simply pick the first HRM device in the list of found devices.
        _selectedHRSDevice = _hrmPlugin.hrsDevices[0];

        _hrmPlugin.initializeService(_selectedHRSDevice, callbackQueue, processHRValues);
    }
    private void onConnectClicked()
    {
        int tSelectedIndex;

        // when there was only one HRM detected we didn't push a spaceholder item into the dropdown,
        // so no need to adjust the index reference
        if (_hrmDropdown.options.Count == 1)
        {
            tSelectedIndex = _hrmDropDownGO.GetComponent <Dropdown>().value;
        }
        else
        {
            tSelectedIndex = _hrmDropDownGO.GetComponent <Dropdown>().value - 1;
        }

        _selectedDevice = _hrmPlugin.hrsDevices[tSelectedIndex];

        resetValues();

        _hrmStatusLabel.text = _hrmStatusMsgConnecting;
        _BPMDisplay.text     = "0";

        _connectBtn.enabled    = false;
        _disconnectBtn.enabled = true;

        // Mode B: connect with Queue/Action Producer/Consumer pattern
        _hrmPlugin.initializeService(_selectedDevice, callbackQueue, processHRValues);

        // default is 100 saved byte arrays.
        _hrmPlugin.ReceivedMeasurementDataStorageMax = 20;
    }
Example #3
0
    private void onConnectClicked()
    {
        int tSelectedIndex;

        tSelectedIndex = _hrmDropDownGO.GetComponent <Dropdown>().value;

        _selectedDevice = _hrmPlugin.hrsDevices[tSelectedIndex];

        resetValues();

        _hrmStatusLabel.text = _hrmStatusMsgConnecting;
        _BPMDisplay.text     = "0";

        _connectBtn.enabled    = false;
        _disconnectBtn.enabled = true;

        // connect with Queue/Action callback technique
        _hrmPlugin.initializeService(_selectedDevice, callbackQueue, processHRValues);
    }