1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-02 19:36:14 +02:00
Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/requests/SendWatchfaceOperation.java
Vitaliy Tomin c206b8f06f huawei: Implement watchface management
* added watchface management code to HuaweiWatchfaceManager
* HuaweiWatchfaceManager moved from coordinator to support
2024-04-27 09:39:31 +08:00

30 lines
1.1 KiB
Java

package nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.requests;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiPacket;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.packets.Watchface;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.HuaweiSupportProvider;
public class SendWatchfaceOperation extends Request {
private String fileName;
private byte operation;
public SendWatchfaceOperation(HuaweiSupportProvider support, String filename, byte operation) {
super(support);
this.serviceId = Watchface.id;
this.commandId = Watchface.WatchfaceOperation.id;
this.fileName = filename;
this.operation = operation;
}
@Override
protected List<byte[]> createRequest() throws RequestCreationException {
try {
return new Watchface.WatchfaceOperation.Request(this.paramsProvider, this.fileName, this.operation ).serialize();
} catch (HuaweiPacket.CryptoException e) {
throw new RequestCreationException(e);
}
}
}