use of nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder in project Gadgetbridge by Freeyourgadget.
the class LefunDeviceSupport method onSetCallState.
@Override
public void onSetCallState(CallSpec callSpec) {
switch(callSpec.command) {
case CallSpec.CALL_INCOMING:
try {
TransactionBuilder builder = performInitialized(SetTimeRequest.class.getSimpleName());
SendCallNotificationRequest request = new SendCallNotificationRequest(this, builder);
request.setCallNotification(callSpec);
request.perform();
performConnected(builder.getTransaction());
} catch (IOException e) {
GB.toast(getContext(), "Failed to send call notification", Toast.LENGTH_SHORT, GB.ERROR, e);
}
break;
}
}
use of nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder in project Gadgetbridge by Freeyourgadget.
the class LefunDeviceSupport method sendHydrationReminderIntervalSetting.
/**
* Sends the hydration reminder interval setting to the device
*
* @param period the reminder interval
*/
private void sendHydrationReminderIntervalSetting(int period) {
try {
TransactionBuilder builder = performInitialized(SetHydrationReminderIntervalRequest.class.getSimpleName());
SetHydrationReminderIntervalRequest request = new SetHydrationReminderIntervalRequest(this, builder);
request.setInterval(period);
request.perform();
inProgressRequests.add(request);
performConnected(builder.getTransaction());
} catch (IOException e) {
GB.toast(getContext(), "Failed to set hydration reminder interval", Toast.LENGTH_SHORT, GB.ERROR, e);
}
}
use of nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder in project Gadgetbridge by Freeyourgadget.
the class Y5Support method onHeartRateTest.
@Override
public void onHeartRateTest() {
try {
TransactionBuilder builder = performInitialized("HeartRateTest");
builder.write(ctrlCharacteristic, commandWithChecksum(JYouConstants.CMD_SET_HEARTRATE_AUTO, 0, 0));
performConnected(builder.getTransaction());
} catch (Exception e) {
LOG.warn(e.getMessage());
}
}
use of nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder in project Gadgetbridge by Freeyourgadget.
the class BFH16DeviceSupport method onHeartRateTest.
// TODO: check
@Override
public void onHeartRateTest() {
try {
TransactionBuilder builder = performInitialized("HeartRateTest");
builder.write(ctrlCharacteristic, commandWithChecksum(BFH16Constants.CMD_MEASURE_HEART, 0, 1));
builder.queue(getQueue());
} catch (Exception e) {
LOG.warn(e.getMessage());
}
}
use of nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder in project Gadgetbridge by Freeyourgadget.
the class BFH16DeviceSupport method onSetTime.
// working
@Override
public void onSetTime() {
try {
TransactionBuilder builder = performInitialized("SetTime");
syncDateAndTime(builder);
builder.queue(getQueue());
} catch (IOException e) {
LOG.warn(e.getMessage());
}
}
Aggregations