OSDN Git Service

最新SDKに更新。
[gokigen/A01d.git] / app / src / main / java / net / osdn / gokigen / a01d / camera / canon / wrapper / connection / CanonCameraDisconnectSequence.java
1 package net.osdn.gokigen.a01d.camera.canon.wrapper.connection;
2
3 import androidx.annotation.NonNull;
4
5 import net.osdn.gokigen.a01d.camera.ptpip.IPtpIpInterfaceProvider;
6 import net.osdn.gokigen.a01d.camera.ptpip.wrapper.command.IPtpIpCommunication;
7
8 class CanonCameraDisconnectSequence implements Runnable
9 {
10     private final IPtpIpCommunication command;
11     private final IPtpIpCommunication async;
12     private final IPtpIpCommunication liveview;
13
14     CanonCameraDisconnectSequence(@NonNull IPtpIpInterfaceProvider interfaceProvider)
15     {
16         this.command = interfaceProvider.getCommandCommunication();
17         this.async = interfaceProvider.getAsyncEventCommunication();
18         this.liveview = interfaceProvider.getLiveviewCommunication();
19     }
20
21     @Override
22     public void run()
23     {
24         try
25         {
26             liveview.disconnect();
27             async.disconnect();
28             command.disconnect();
29         }
30         catch (Exception e)
31         {
32             e.printStackTrace();
33         }
34     }
35 }