OSDN Git Service

6dee4a3f9e4222624ff01dfb4f96952fbb7af7c8
[gokigen/Gr2Control.git] / app / src / main / java / net / osdn / gokigen / gr2control / camera / fuji_x / wrapper / command / messages / changemode / ChangeToPlayback1st.java
1 package net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.messages.changemode;
2
3 import androidx.annotation.NonNull;
4
5 import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.IFujiXCommandCallback;
6 import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.IFujiXMessages;
7 import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.messages.FujiXCommandBase;
8
9 public class ChangeToPlayback1st  extends FujiXCommandBase
10 {
11     private final int holdId;
12     private final IFujiXCommandCallback callback;
13
14     public ChangeToPlayback1st(int holdId, @NonNull IFujiXCommandCallback callback)
15     {
16         this.holdId = holdId;
17         this.callback = callback;
18     }
19
20     @Override
21     public IFujiXCommandCallback responseCallback()
22     {
23         return (callback);
24     }
25
26     @Override
27     public int getId()
28     {
29         return (IFujiXMessages.SEQ_CHANGE_TO_PLAYBACK_1ST);
30     }
31
32     @Override
33     public byte[] commandBody()
34     {
35         return (new byte[] {
36                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
37                 (byte)0x01, (byte)0x00,
38
39                 // message_header.type : two_part (0x1016) : SetDevicePropValue
40                 (byte)0x16, (byte)0x10,
41
42                 // sequence number
43                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
44
45                 // data ...
46                 (byte)0x00, (byte)0xdf, (byte)0x00, (byte)0x00,
47         });
48     }
49
50     @Override
51     public byte[] commandBody2()
52     {
53         return (new byte[] {
54                 // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
55                 (byte)0x02, (byte)0x00,
56
57                 // message_header.type : two_part (0x1016) : SetDevicePropValue
58                 (byte)0x16, (byte)0x10,
59
60                 // sequence number
61                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
62
63                 // data ...
64                 (byte)0x06, (byte)0x00,
65
66         });
67     }
68
69     @Override
70     public int getHoldId()
71     {
72         return (holdId);
73     }
74
75     @Override
76     public boolean isHold()
77     {
78         return (true);
79     }
80
81     @Override
82     public boolean isRelease()
83     {
84         return (false);
85     }
86 }