1
zhanghua
2024-09-26 c775c6953d9759e70f08acbfa8f6d7490aaae3d1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.netsdk.demo.customize.JordanPSD.module;
 
import com.netsdk.lib.NetSDKLib;
import com.netsdk.lib.enumeration.ENUMERROR;
 
/**
 * @author 47040
 * @since Created at 2021/5/25 20:58
 */
public class DeviceControlModule {
 
    static NetSDKLib NetSdk = NetSDKLib.NETSDK_INSTANCE;
 
    // 重启当前设备
    public static boolean DeviceReboot(NetSDKLib.LLong m_hLoginHandle) {
 
        if (!NetSdk.CLIENT_ControlDevice(m_hLoginHandle, NetSDKLib.CtrlType.CTRLTYPE_CTRL_REBOOT, null, 3000)) {
            System.err.println("ControlDevice Reboot Failed!" + ENUMERROR.getErrorCode());
            return false;
        }
        return true;
    }
 
    // 关闭当前设备
    public static boolean DeviceShutdown(NetSDKLib.LLong m_hLoginHandle) {
 
        if (!NetSdk.CLIENT_ControlDevice(m_hLoginHandle, NetSDKLib.CtrlType.CTRLTYPE_CTRL_SHUTDOWN, null, 3000)) {
            System.err.println("ControlDevice Shutdown Failed!" + ENUMERROR.getErrorCode());
            return false;
        }
        return true;
    }
 
    // 远程关机
    public static boolean RemoteShutDown(NetSDKLib.LLong m_hLoginHandle) {
        if (!NetSdk.CLIENT_ShutDownDev(m_hLoginHandle)) {
            System.err.println("ShutDownDev Shutdown Failed!" + ENUMERROR.getErrorCode());
            return false;
        }
        return true;
    }
}