Search in sources :

Example 1 with Communicator

use of org.hwyl.sexytopo.comms.Communicator in project sexytopo by richsmith.

the class DeviceActivity method updateComms.

private void updateComms() {
    BluetoothDevice device = getPairedDevice();
    Instrument instrument = Instrument.byDevice(device);
    try {
        if (instrument != getInstrument()) {
            setInstrument(instrument);
            Communicator communicator = instrument.getNewCommunicator(this, device);
            setComms(communicator);
            invalidateOptionsMenu();
        }
    } catch (Exception exception) {
        Log.e(exception);
        String name = instrument.getName();
        Log.device("Failed to create communicator for " + name);
    }
}
Also used : Communicator(org.hwyl.sexytopo.comms.Communicator) BluetoothDevice(android.bluetooth.BluetoothDevice) Instrument(org.hwyl.sexytopo.comms.Instrument)

Aggregations

BluetoothDevice (android.bluetooth.BluetoothDevice)1 Communicator (org.hwyl.sexytopo.comms.Communicator)1 Instrument (org.hwyl.sexytopo.comms.Instrument)1