public bool SendCommand(PSVRCommand Command) { var data = Command.Serialize(); int len; return(writer.Write(data, 1000, out len) == LibUsbDotNet.Main.ErrorCode.None); }
public static PSVRCommand GetSetHDMLeds(LedMask Mask, byte ValueA, byte ValueB, byte ValueC, byte ValueD, byte ValueE, byte ValueF, byte ValueG, byte ValueH, byte ValueI) { ushort mMask = (ushort)Mask; PSVRCommand cmd = new PSVRCommand(); cmd.r_id = 0x15; cmd.magic = 0xaa; cmd.length = 16; cmd.data = new byte[] { (byte)(mMask & 0xFF), (byte)((mMask >> 8) & 0xFF), ValueA, ValueB, ValueC, ValueD, ValueE, ValueF, ValueG, ValueH, ValueI, 0, 0, 0, 0, 0 }; return(cmd); }
public static PSVRCommand GetSetHDMLed(LedMask Mask, byte Value) { ushort mMask = (ushort)Mask; PSVRCommand cmd = new PSVRCommand(); cmd.r_id = 0x15; cmd.magic = 0xaa; cmd.length = 16; cmd.data = new byte[] { (byte)(mMask & 0xFF), (byte)((mMask >> 8) & 0xFF), Value, Value, Value, Value, Value, Value, Value, Value, Value, 0, 0, 0, 0, 0 }; return(cmd); }
public static PSVRCommand GetSetCinematicConfiguration(byte ScreenDistance, byte ScreenSize, byte Brightness, byte MicVolume, bool UnknownVRSetting) { PSVRCommand cmd = new PSVRCommand(); cmd.r_id = 0x21; cmd.magic = 0xaa; cmd.length = 16; cmd.data = new byte[] { 0, ScreenSize, ScreenDistance, 0, 0, 0, 0, 0, 0, 0, Brightness, MicVolume, 0, 0, (byte)(UnknownVRSetting ? 0 : 1), 0 }; return(cmd); }
public static PSVRCommand GetBoxOff() { PSVRCommand cmd = new PSVRCommand(); cmd.r_id = 0x13; cmd.magic = 0xaa; cmd.length = 4; cmd.data = BitConverter.GetBytes(0x00000001); return(cmd); }
public static PSVRCommand GetOff(byte id) { PSVRCommand cmd = new PSVRCommand(); cmd.r_id = id; cmd.magic = 0xaa; cmd.length = 4; cmd.data = BitConverter.GetBytes(0x00000000); return(cmd); }
public static PSVRCommand GetExitVRMode() { PSVRCommand cmd = new PSVRCommand(); cmd.r_id = 0x23; cmd.magic = 0xaa; cmd.length = 4; cmd.data = BitConverter.GetBytes(0x00000000); return(cmd); }
public static PSVRCommand GetBoxOff() { PSVRCommand cmd = new PSVRCommand(); cmd.r_id = 0x13; cmd.magic = 0xaa; cmd.length = 4; byte[] data = new byte[4]; byte[] tmp = BitConverter.GetBytes(0x00000001); Buffer.BlockCopy(tmp, 0, data, 0, 4); cmd.data = data; return(cmd); }
public static PSVRCommand GetEnableVRTracking() { PSVRCommand cmd = new PSVRCommand(); cmd.r_id = 0x11; cmd.magic = 0xaa; cmd.length = 8; byte[] data = new byte[8]; byte[] tmp = BitConverter.GetBytes(0xFFFFFF00); Buffer.BlockCopy(tmp, 0, data, 0, 4); tmp = BitConverter.GetBytes(0x00000000); Buffer.BlockCopy(tmp, 0, data, 4, 4); cmd.data = data; return(cmd); }