OSDN Git Service

cb07f3ae25d6f185b635dcb765c96e2737666456
[gokigen/A01d.git] / app / src / main / java / net / osdn / gokigen / a01d / camera / nikon / wrapper / command / messages / specific / NikonLiveViewRequestMessage.java
1 package net.osdn.gokigen.a01d.camera.nikon.wrapper.command.messages.specific;
2
3 import androidx.annotation.NonNull;
4
5 import net.osdn.gokigen.a01d.camera.ptpip.wrapper.command.IPtpIpCommandCallback;
6 import net.osdn.gokigen.a01d.camera.ptpip.wrapper.command.messages.PtpIpCommandBase;
7
8 public class NikonLiveViewRequestMessage extends PtpIpCommandBase
9 {
10     private final IPtpIpCommandCallback callback;
11     private final boolean isDumpLog;
12     private final int delayMs;
13
14     public NikonLiveViewRequestMessage(@NonNull IPtpIpCommandCallback callback,int delayMs, boolean isDumpLog)
15     {
16         this.callback = callback;
17         this.delayMs = delayMs;
18         this.isDumpLog = isDumpLog;
19     }
20
21     @Override
22     public IPtpIpCommandCallback responseCallback()
23     {
24         return (callback);
25     }
26
27     @Override
28     public int getId()
29     {
30         return (SEQ_GET_VIEWFRAME);
31     }
32
33     @Override
34     public byte[] commandBody()
35     {
36         return (new byte[]{
37
38                 // packet type
39                 (byte) 0x06, (byte) 0x00,  (byte) 0x00, (byte) 0x00,
40
41                 // data phase info
42                 (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
43
44                 // operation code
45                 (byte) 0x03, (byte) 0x92,
46
47                 // sequence number
48                 (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
49         });
50     }
51
52     @Override
53     public boolean dumpLog()
54     {
55         return (isDumpLog);
56     }
57
58     @Override
59     public int receiveDelayMs()
60     {
61         return (delayMs);
62     }
63
64     @Override
65     public boolean isRetrySend()
66     {
67         return (false);
68     }
69
70     @Override
71     public int maxRetryCount()
72     {
73         return (3);
74     }
75
76     @Override
77     public boolean isIncrementSequenceNumberToRetry()
78     {
79         return (true);
80     }
81
82 }