public void controllerDeviceVersionAndSNCallback(string data) { PLOG.I("PvrLog DeviceVersionAndSNCallback" + data); //data controllerSerialNum,deviceVersion //controllerSerialNum : 0- controller 0 1- controller 1 deviceVersion: version and SN if (ControllerDeviceVersionAndSNCallbackEvent != null) { ControllerDeviceVersionAndSNCallbackEvent(data); } }
public int getControllerSensorStatus(int id) { int type = -1; #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod <int>(ref type, javaCVClass, "getControllerSensorStatus", id); #endif PLOG.I("PvrLog getControllerSensorStatus:" + type); return(type); }
public void StopScan() { PLOG.I("PvrLog StopScanHBController"); if (iPhoneHMDModeEnabled == 0) { #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaHummingbirdClass, "scanHbDevice", false); #endif } }
public string GetControllerVersion() { string type = ""; #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod <string>(ref type, javaHummingbirdClass, "getControllerVersion"); #endif PLOG.I("PvrLog ControllerVersion:" + type); return(type); }
public void StopCV2PairingMode(int devicetype) { #if ANDROID_DEVICE if (neoserviceStarted) { Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "stopCV2PairingMode", devicetype); } #endif PLOG.I("PvrLog StopCV2PairingMode:" + devicetype); }
public void GetDeviceVersion(int deviceType) { #if ANDROID_DEVICE if (neoserviceStarted) { Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "getDeviceVersion", deviceType); } #endif PLOG.I("PvrLog GetDeviceVersion:" + deviceType); }
//Get the device type public int GetDeviceType() { int type = -1; #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod <int>(ref type, javaHummingbirdClass, "getDeviceType"); #endif PLOG.I("PvrLog DeviceType:" + type); return(type); }
//-------------- public void setHbControllerMac(string mac) { PLOG.I("HBMacRSSI" + mac); controllerlink.hummingBirdMac = mac.Substring(0, 17); controllerlink.hummingBirdRSSI = Convert.ToInt16(mac.Remove(0, 18)); if (SetHbControllerMacEvent != null) { SetHbControllerMacEvent(mac.Substring(0, 17)); } }
//startThread成功的回调 public void controllerThreadStartedCallback() { PLOG.I("ThreadStartSuccess"); if (ControllerThreadStartedCallbackEvent != null) { ControllerThreadStartedCallbackEvent(); } GetCVControllerState(); }
//手柄版本号和SN号回调 public void controllerDeviceVersionAndSNCallback(string data) { PLOG.I("DeviceVersionAndSNCallback" + data); //data格式 controllerSerialNum,deviceVersion //controllerSerialNum : 0-手柄0 1-手柄1 deviceVersion:版本号和SN号 if (ControllerDeviceVersionAndSNCallbackEvent != null) { ControllerDeviceVersionAndSNCallbackEvent(data); } }
//手柄唯一识别码回调 public void controllerUniqueIDCallback(string data) { PLOG.I("controllerUniqueIDCallback" + data); //data格式 controller0ID,controller1ID //controller0ID :手柄0的ID;controller1ID:手柄1的ID (如果当前手柄未连接时ID返回为0) if (ControllerUniqueIDCallbackEvent != null) { ControllerUniqueIDCallbackEvent(data); } }
//OTA升级失败回调 public void controllerOTAStartCodeCallback(string data) { PLOG.I("OTAUpdateCallBack" + data); //data格式:deviceType,statusCode // deviceType:0-station 1-controller statusCode: 0-升级发起成功 1-升级文件未找到 2-升级文件打开失败 if (ControllerOtaStartCodeCallbackEvent != null) { ControllerOtaStartCodeCallbackEvent(data); } }
//station忙碌状态回调 public void controllerStationBusyCallback(string status) { PLOG.I("StationBusyCallBack" + status); //当前station处于繁忙状态无法响应本次控制接口功能 status:标识当前正忙于什么工作状态 //STATION_STATUS{NORMAL = 0, QUERYING, PAIRING, OTA, RESTARTING, CTRLR_UNBINDING, CTRLR_SHUTTING_DOWN}; if (ControllerStationBusyCallbackEvent != null) { ControllerStationBusyCallbackEvent(status); } }
public void controllerUniqueIDCallback(string data) { PLOG.I("PvrLog controllerUniqueIDCallback" + data); //data controller0ID,controller1ID //controller0ID :ID of controller 0;Controller1ID: ID of controller 1 (if the current controller is not connected, the ID will return to 0) if (ControllerUniqueIDCallbackEvent != null) { ControllerUniqueIDCallbackEvent(data); } }
public void SetMainController(int index) { PLOG.I("PvrLog SetMainController:" + index); #if ANDROID_DEVICE if (neoserviceStarted) { Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "setMainController", index); } #endif }
///以下是关于CV手柄的相关回调 //版本号的回调 public void controllerDeviceVersionCallback(string data) { PLOG.I("VersionCallBack" + data); //data格式 device,deviceVersion //device : 0-station 1-手柄0 2-手柄1 deviceVersion:版本号 if (ControllerDeviceVersionCallbackEvent != null) { ControllerDeviceVersionCallbackEvent(data); } }
public void ResetHeadSensorForController() { #if ANDROID_DEVICE if (neoserviceStarted) { Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "resetHeadSensorForController"); } #endif PLOG.I("PvrLog ResetHeadSensorForController:"); }
//手柄SN号回调 public void controllerSnCodeCallback(string data) { PLOG.I("SNCodeCallBack" + data); //data格式:controllerSerialNum,controllerSn //controllerSerialNum : 0-手柄0 1-手柄1 controllerSn:Sn号 手柄的唯一标识 if (ControllerSnCodeCallbackEvent != null) { ControllerSnCodeCallbackEvent(data); } }
//Acquisition of equipment temperature public int GetTemperature() { int value = -1; #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod <int>(ref value, javaHummingbirdClass, "getTemperature"); #endif PLOG.I("PvrLog Temperature:" + value); return(value); }
public bool IsServiceExisted() { bool service = false; #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod <bool>(ref service, javaserviceClass, "isServiceExisted", activity, trackingmode); #endif PLOG.I("PvrLog ServiceExisted ?" + service); return(service); }
public string GetHummingBird2SN() { string type = ""; #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod <string>(ref type, javaHummingbirdClass, "getHummingBird2SN"); #endif PLOG.I("PvrLog HummingBird2SN:" + type); return(type); }
public void ConnectBLE() { PLOG.I("PvrLog ConnectHBController" + hummingBirdMac); if (hummingBirdMac != "") { #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaHummingbirdClass, "connectHbController", hummingBirdMac); #endif } }
public bool IsEnbleTrigger() { bool state = false; #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod <bool>(ref state, javaHummingbirdClass, "isEnbleTrigger"); #endif PLOG.I("PvrLog IsEnbleTrigger:" + state); return(state); }
public void SetUnityVersionToJar(string version) { if (trackingmode == 4) { #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "setUnityVersion", version); #endif PLOG.I("PvrLog SetUnityVersionToJar" + version); } }
public void setIsEnbleHomeKey(bool state) { #if ANDROID_DEVICE if (neoserviceStarted) { Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "setIsEnbleHomeKey", state); } #endif PLOG.I("PvrLog setIsEnbleHomeKey:" + state); }
public void VibateController(int hand, int strength) { #if ANDROID_DEVICE if (neoserviceStarted) { Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "vibrateControllerStrength", hand, strength); } #endif PLOG.I("PvrLog VibateController:" + hand + strength); }
public void setHandness(int hand) { PLOG.I("PvrLog SetHandness =" + hand); #if ANDROID_DEVICE if (iPhoneHMDModeEnabled == 1) { Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaHummingbirdClass, "setHbHandednessInSP", hand); } #endif }
public void VibrateNeo2Controller(float strength, int time, int hand) { #if ANDROID_DEVICE if (neoserviceStarted) { Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "vibrateCV2ControllerStrength", strength, time, hand); } #endif PLOG.I("PvrLog VibrateNeo2Controller:" + strength + time + hand); }
public int GetSysproc() { int prop = -1; #if ANDROID_DEVICE Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod <int>(ref prop, javaserviceClass, "getSysproc"); #endif PLOG.I("PvrLog GetSysproc" + prop); return(prop); }
public void controllerOTAStartCodeCallback(string data) { PLOG.I("PvrLog OTAUpdateCallBack" + data); //data:deviceType,statusCode // deviceType:0-station 1-controller statusCode: 0- upgrade launch success 1- upgrade file not found 2- upgrade file failed to open. if (ControllerOtaStartCodeCallbackEvent != null) { ControllerOtaStartCodeCallbackEvent(data); } }