public void MtpData_WhenAssigned_ShouldUpdated() { var value = new MtpData(); this.subject.SetMtpData(value); Assert.Same(value, this.subject.GetMtpData()); }
public override void Read(Stream s) { _root = new MtpData(); ReadHeader(s); ReadContent(s); ReadEnding(s); }
public MtpDataTests() { this.block = uint256.Parse("8837eaa25fca59b88dddcb3f89d68a6a2400d62b1e6985d30567a72d7f4cc191"); this.hash = uint256.Parse("7bb82cb092cac59974bcbbec1828a70def4334a51d5ace60a61dff15805584ff"); this.reserved1 = uint256.Parse("adb0e22904c14d6a73fc083da5edfaeb36325e1126fdc53c918681123c61790e"); this.reserved2 = uint256.Parse("6002cb7a2ffda2365d46f651691978ad4afd68b3bf4e8c28bc422b9706ddf620"); this.subject = new MtpData(this.block, this.hash, 100, this.reserved1, this.reserved2); }
/// <summary> /// Thetaに接続する /// </summary> /// <returns></returns> public bool Connect() { // 接続済みならtrueを返して終了 if (IsConnected) { return(true); } string thetaId = null; string[] ids = mtp.GetDeviceIds(); foreach (string id in ids) { int vid = id.IndexOf("vid_05ca"); int pid = id.IndexOf("pid_0366"); if (vid != -1 && pid != -1) { thetaId = id; break; } } // Thetaがなければfalseを返す if (thetaId == null) { return(false); } // Thetaに接続する mtp.Open(thetaId); IsConnected = true; // 静止画撮影モードにする MtpResponse res; res = mtp.Execute(MtpOperationCode.SetDevicePropValue, new uint[1] { (uint)MtpDevicePropCode.StillCaptureMode }, BitConverter.GetBytes(((ushort)0x0001))); // 撮影モードをオートにする res = mtp.Execute(MtpOperationCode.SetDevicePropValue, new uint[1] { (uint)MtpDevicePropCode.ExposureProgramMode }, BitConverter.GetBytes(((ushort)0x0002))); // ストレージIDを取得する res = mtp.Execute(MtpOperationCode.GetStorageIDs, null, null); storageId = MtpData.GetUInt32Array(res)[0]; return(true); }