mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-06-02 19:36:14 +02:00
c206b8f06f
* added watchface management code to HuaweiWatchfaceManager * HuaweiWatchfaceManager moved from coordinator to support
30 lines
1.1 KiB
Java
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);
|
|
}
|
|
}
|
|
|
|
}
|