d4rken / myolib

Android Myo library with full data access and support for multiple Myos.
Apache License 2.0
38 stars 19 forks source link

BluetoothDevice #7

Closed bbevem closed 7 years ago

bbevem commented 8 years ago

In your description of Advance use, while trying to access the battery level, we must present the bluetooth device in constructor of BaseMyo. Can you please explain where can i get this BluetoothDevice?

BaseMyo baseMyo = new BaseMyo(getContext(), **bluetoothDevice**);
baseMyo.connect();
ReadMsg readMsg = new ReadMsg(Battery.BATTERYLEVEL, new MyoMsg.Callback() {
    @Override
    public void onResult(MyoMsg msg) {
        byte[] result = ((ReadMsg) msg).getValue();
    }
});
baseMyo.submit(readMsg);
d4rken commented 8 years ago

From Androids BluetoothManager https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback) or have the MyoConnector directly give you the Myo object https://github.com/d4rken/myolib/blob/b32b3d925de9737a566dcb45d22c2e08e507393c/myolib/src/main/java/eu/darken/myolib/MyoConnector.java#L77