Search in sources :

Example 1 with FindPhoneCommand

use of nodomain.freeyourgadget.gadgetbridge.devices.lefun.commands.FindPhoneCommand in project Gadgetbridge by Freeyourgadget.

the class LefunDeviceSupport method handleAntiLoss.

/**
 * Handles find phone request
 *
 * @param data the response
 * @return whether the response has been handled
 */
private boolean handleAntiLoss(byte[] data) {
    try {
        FindPhoneCommand cmd = new FindPhoneCommand();
        cmd.deserialize(data);
        GBDeviceEventFindPhone event = new GBDeviceEventFindPhone();
        event.event = GBDeviceEventFindPhone.Event.START;
        evaluateGBDeviceEvent(event);
        return true;
    } catch (IllegalArgumentException e) {
        LOG.error("Failed to handle anti-loss", e);
        return false;
    }
}
Also used : GBDeviceEventFindPhone(nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventFindPhone) FindPhoneCommand(nodomain.freeyourgadget.gadgetbridge.devices.lefun.commands.FindPhoneCommand)

Aggregations

GBDeviceEventFindPhone (nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventFindPhone)1 FindPhoneCommand (nodomain.freeyourgadget.gadgetbridge.devices.lefun.commands.FindPhoneCommand)1