Search in sources :

Example 1 with SetEnabledFeaturesRequest

use of nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SetEnabledFeaturesRequest in project Gadgetbridge by Freeyourgadget.

the class LefunDeviceSupport method sendEnabledFeaturesSetting.

/**
 * Sends enabled features settings to the device
 *
 * @param cmd the features command to send
 */
private void sendEnabledFeaturesSetting(FeaturesCommand cmd) {
    try {
        TransactionBuilder builder = performInitialized(SetEnabledFeaturesRequest.class.getSimpleName());
        SetEnabledFeaturesRequest request = new SetEnabledFeaturesRequest(this, builder);
        request.setCmd(cmd);
        request.perform();
        inProgressRequests.add(request);
        performConnected(builder.getTransaction());
    } catch (IOException e) {
        GB.toast(getContext(), "Failed to set enabled features", Toast.LENGTH_SHORT, GB.ERROR, e);
    }
}
Also used : SetEnabledFeaturesRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SetEnabledFeaturesRequest) TransactionBuilder(nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 TransactionBuilder (nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder)1 SetEnabledFeaturesRequest (nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SetEnabledFeaturesRequest)1