Search in sources :

Example 1 with GBDeviceEventUpdateDeviceState

use of nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdateDeviceState in project Gadgetbridge by Freeyourgadget.

the class SonyHeadphonesProtocol method handleAck.

private GBDeviceEvent handleAck() {
    pendingAcks--;
    if (!requestQueue.isEmpty()) {
        LOG.debug("Outstanding requests in queue: {}", requestQueue.size());
        final Request request = requestQueue.remove();
        return new GBDeviceEventSendBytes(request.encode(sequenceNumber));
    }
    if (GBDevice.State.INITIALIZING.equals(getDevice().getState())) {
        return new GBDeviceEventUpdateDeviceState(GBDevice.State.INITIALIZED);
    }
    return null;
}
Also used : Request(nodomain.freeyourgadget.gadgetbridge.service.devices.sony.headphones.protocol.Request) GBDeviceEventUpdateDeviceState(nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdateDeviceState) GBDeviceEventSendBytes(nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSendBytes)

Aggregations

GBDeviceEventSendBytes (nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSendBytes)1 GBDeviceEventUpdateDeviceState (nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdateDeviceState)1 Request (nodomain.freeyourgadget.gadgetbridge.service.devices.sony.headphones.protocol.Request)1