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; } }