Exemplo n.º 1
0
        private static void onExtendedDeviceDataImpl(IntPtr hDevice, Device.DataType type, int dataLen, IntPtr data)
        {
            Device d = null;

            if (IntPtr.Zero == hDevice)
            {
#if UNITY_EDITOR
                Debug.Log("onExtendedDeviceDataImpl: Null hDevice");
#endif
                return;
            }
            try
            {
                d = (Device)instance.mDevices[hDevice];
            }
            catch
            {
                // cannot find
                return;
            }
            byte[] dataarray = new byte[dataLen];
            Marshal.Copy(data, dataarray, 0, dataLen);
            foreach (HubListener l in instance.mListeners)
            {
                l.onExtendedDeviceData(d, type, dataarray);
            }
        }
Exemplo n.º 2
0
 public override void onExtendDeviceData(Device device, Device.DataType type, byte[] data)
 {
     foreach (GForceDevice dev in hubcomp.mDeviceComps)
     {
         if (device == dev.device)
         {
             dev.onExtendDeviceData(type, data);
         }
     }
 }
Exemplo n.º 3
0
 public void onExtendDeviceData(Device.DataType type, byte[] data)
 {
     if (0 < data.Length)
     {
         Debug.LogFormat("onExtendDeviceData: {0}: {1}, length = {2}, data: first byte: {3}, last byte: {4}",
                         mDevice, type, data.Length, data[0], data[data.Length - 1]);
     }
     else
     {
         Debug.LogFormat("onExtendDeviceData: {0}: {1}, length = {2}", mDevice, type, data.Length);
     }
 }
Exemplo n.º 4
0
        public override void onExtendedDeviceData(Device device, Device.DataType type, byte[] data)
        {
            if (device == gForceHub_.connectedDevice_)
            {
                System.Console.Write("onExtendedDeviceData, type: {0}, len: {1}, data: ", type, data.Length);

                var sb = new StringBuilder("{");

                foreach (var b in data)
                {
                    sb.Append(b + ",");
                }

                sb.Remove(sb.Length - 1, 1);
                sb.Append("}");

                System.Console.WriteLine(sb.ToString());
            }
        }
Exemplo n.º 5
0
 public virtual void onExtendedDeviceData(Device device, Device.DataType type, byte[] data)
 {
 }
Exemplo n.º 6
0
 public override void onExtendDeviceData(Device device, Device.DataType type, byte[] data)
 {
     Debug.LogFormat("onExtendDeviceData: {0}", type);
 }