Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
    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);
    }
Beispiel #3
0
    public void StopScan()
    {
        PLOG.I("PvrLog StopScanHBController");
        if (iPhoneHMDModeEnabled == 0)
        {
#if ANDROID_DEVICE
            Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaHummingbirdClass, "scanHbDevice", false);
#endif
        }
    }
Beispiel #4
0
    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);
    }
Beispiel #5
0
    public void StopCV2PairingMode(int devicetype)
    {
#if ANDROID_DEVICE
        if (neoserviceStarted)
        {
            Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "stopCV2PairingMode", devicetype);
        }
#endif
        PLOG.I("PvrLog StopCV2PairingMode:" + devicetype);
    }
Beispiel #6
0
    public void GetDeviceVersion(int deviceType)
    {
#if ANDROID_DEVICE
        if (neoserviceStarted)
        {
            Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "getDeviceVersion", deviceType);
        }
#endif
        PLOG.I("PvrLog GetDeviceVersion:" + deviceType);
    }
Beispiel #7
0
    //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);
    }
Beispiel #8
0
 //--------------
 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));
     }
 }
Beispiel #9
0
    //startThread成功的回调
    public void controllerThreadStartedCallback()
    {
        PLOG.I("ThreadStartSuccess");
        if (ControllerThreadStartedCallbackEvent != null)
        {
            ControllerThreadStartedCallbackEvent();
        }

        GetCVControllerState();
    }
Beispiel #10
0
 //手柄版本号和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);
     }
 }
Beispiel #11
0
 //手柄唯一识别码回调
 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);
     }
 }
Beispiel #12
0
 //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);
     }
 }
Beispiel #13
0
 //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);
     }
 }
Beispiel #14
0
 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);
     }
 }
Beispiel #15
0
    public void SetMainController(int index)
    {
        PLOG.I("PvrLog SetMainController:" + index);
#if ANDROID_DEVICE
        if (neoserviceStarted)
        {
            Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "setMainController", index);
        }
#endif
    }
Beispiel #16
0
 ///以下是关于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);
     }
 }
Beispiel #17
0
    public void ResetHeadSensorForController()
    {
#if ANDROID_DEVICE
        if (neoserviceStarted)
        {
            Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "resetHeadSensorForController");
        }
#endif
        PLOG.I("PvrLog ResetHeadSensorForController:");
    }
Beispiel #18
0
 //手柄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);
     }
 }
Beispiel #19
0
    //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);
    }
Beispiel #20
0
    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);
    }
Beispiel #21
0
    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);
    }
Beispiel #22
0
    public void ConnectBLE()
    {
        PLOG.I("PvrLog ConnectHBController" + hummingBirdMac);
        if (hummingBirdMac != "")
        {
#if ANDROID_DEVICE
            Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaHummingbirdClass, "connectHbController", hummingBirdMac);
#endif
        }
    }
Beispiel #23
0
    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);
    }
Beispiel #24
0
    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);
        }
    }
Beispiel #25
0
    public void setIsEnbleHomeKey(bool state)
    {
#if ANDROID_DEVICE
        if (neoserviceStarted)
        {
            Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(javaCVClass, "setIsEnbleHomeKey", state);
        }
#endif
        PLOG.I("PvrLog setIsEnbleHomeKey:" + state);
    }
Beispiel #26
0
    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);
    }
Beispiel #27
0
    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
    }
Beispiel #28
0
    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);
    }
Beispiel #29
0
    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);
    }
Beispiel #30
0
 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);
     }
 }