.
yy1717
2024-02-18 f4a6a18770eb446c761c159edcfa800cf7fa6008
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
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.jni;
 
 
import android.os.Environment;
 
/**
 * Created by Melvyn on 16/9/29.
 */
public class UStorageTestModule {
    public static StorageTestCommand gStorageTestHandle = null;
 
 
    /** 单例对象 */
    private static UStorageTestModule gUstorageDeviceModule;
    public static final String APP_SDCARD = Environment.getExternalStorageDirectory().getPath();
    /**
     * 单例模式
     * @return DLNAManager的实体单例
     */
    public static UStorageTestModule getInstance() {
        if (gUstorageDeviceModule == null) {
            synchronized (UStorageTestModule.class) {
                if (gUstorageDeviceModule == null) {
                    gUstorageDeviceModule = new UStorageTestModule();
                    gStorageTestHandle = new StorageTestCommand();
                }
            }
        }
        return gUstorageDeviceModule;
    }
 
    /**
     * 设置日志路径
     * @param logPath
     */
    public void initUStorageDeviceModuleWithVirtualDisk(String logPath) {
        gStorageTestHandle.initDeviceCommandDll(logPath);
    }
 
    /**
     * 初始化设备
     */
    public int sonixCamInit(int vid,int pid, int fd, int busnum, int devaddr, String USBFS) {
        int errCode = gStorageTestHandle.SonixCamInit(vid, pid, fd, busnum, devaddr, USBFS);
        return errCode;
    }
 
    /**
     * 反初始化设备
     */
    public int sonixCamUnInit() {
        int errCode = gStorageTestHandle.SonixCamUnInit();
        return errCode;
    }
 
    /**
     * 升级
     */
    public int updateFW(String fwPath) {
        int errCode = gStorageTestHandle.UpdateFW(fwPath);
        return errCode;
    }
}