1 package net.osdn.gokigen.a01d.camera.nikon.wrapper.command.messages.specific;
3 import androidx.annotation.NonNull;
5 import net.osdn.gokigen.a01d.camera.ptpip.wrapper.command.IPtpIpCommandCallback;
6 import net.osdn.gokigen.a01d.camera.ptpip.wrapper.command.messages.PtpIpCommandBase;
8 import java.nio.ByteBuffer;
11 public class NikonRegistrationMessage extends PtpIpCommandBase
13 private final IPtpIpCommandCallback callback;
15 public NikonRegistrationMessage(@NonNull IPtpIpCommandCallback callback)
17 this.callback = callback;
21 public IPtpIpCommandCallback responseCallback()
29 return (SEQ_REGISTRATION);
33 public boolean receiveAgainShortLengthMessage()
39 public boolean useSequenceNumber()
45 public boolean isIncrementSeqNumber()
51 public int receiveDelayMs()
57 public byte[] commandBody()
59 int uuid = UUID.randomUUID().hashCode();
62 (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
66 (byte)0xad, (byte)0xa5, (byte)0x48, (byte)0x5d, (byte)0x87, (byte)0xb2, (byte)0x7f, (byte)0x0b,
67 (byte)0xd3, (byte)0xd5, (byte)0xde, (byte)0xd0, (byte)0x12, (byte)0x44, (byte)0x99, (byte)0x32,
70 byte[] deviceNameArray = {
71 // device_name 'GOKIGEN_a01'
72 (byte)0x47, (byte)0x00, (byte)0x4f, (byte)0x00, (byte)0x4b, (byte)0x00, (byte)0x49, (byte)0x00,
73 (byte)0x47, (byte)0x00, (byte)0x45, (byte)0x00, (byte)0x4e, (byte)0x00, (byte)0x5f, (byte)0x00,
74 (byte)0x61, (byte)0x00, (byte)0x30, (byte)0x00, (byte)0x31, (byte)0x00, (byte)0x00, (byte)0x00,
76 byte[] versionArray = {
78 (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00,
81 ByteBuffer byteBuffer = ByteBuffer.allocate(4 + 16 + 24 + 4);
82 byteBuffer.put(typeArray);
83 byteBuffer.put(uuidArray);
84 byteBuffer.put(deviceNameArray);
85 byteBuffer.put(versionArray);
87 return (byteBuffer.array());