fuliqi
2024-08-29 4163c93761115c7524ef74a557a1f5e01eafb429
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
43
44
45
46
47
48
49
50
package com.ycl.api.YS.maintenance;
 
import com.ycl.api.YS.NetDemo;
 
import javax.swing.*;
 
/**
 * @description Reboot the device.
 * @introduction Support IPC/NVR/VMS
 */
public class Maintenance {
    /**
     * @introduction Reboot the device.
     * @description Calling the interface of NETDEV_Reboot.
     */
    public static void Reboot() {
        if(null == NetDemo.lpUserID)
        {
            JOptionPane.showMessageDialog(null, "Please Login device first. error code" + NetDemo.netdevsdk.NETDEV_GetLastError());
            return;
        }
        boolean bRet = NetDemo.netdevsdk.NETDEV_Reboot(NetDemo.lpUserID);
        if(bRet != true)
        {
            System.out.printf("NETDEV_Reboot failed:%d\n", NetDemo.netdevsdk.NETDEV_GetLastError());
            return;
        }
        else 
        {
            JOptionPane.showMessageDialog(null, "Reboot success");
        }
    }
    /**
     * @description Factory data reset.
     * @introduction Calling the interface of NETDEV_RestoreConfig.
     */
    public static void factoryDefault() {
        if(null == NetDemo.lpUserID)
        {
            JOptionPane.showMessageDialog(null, "Please Login device first. error code"+NetDemo.netdevsdk.NETDEV_GetLastError());
            return;
        }
        boolean bRet = NetDemo.netdevsdk.NETDEV_RestoreConfig(NetDemo.lpUserID);
        if(bRet != true)
        {
            System.out.printf("NETDEV_RestoreConfig failed:%d\n", NetDemo.netdevsdk.NETDEV_GetLastError());
            return;
        }
    }
}