public static byte[] getBytes(EPS.eps_hk_vi_t str) { byte[] ans = new byte[133]; //TODO: determine size int index = 0; copyToByteArr(ans, str.commandReply, ref index); copyToByteArr(ans, str.vboost, ref index); copyToByteArr(ans, str.vbatt, ref index); copyToByteArr(ans, str.curin, ref index); copyToByteArr(ans, str.cursun, ref index); copyToByteArr(ans, str.cursys, ref index); copyToByteArr(ans, str.reserved1, ref index); return(ans); }
public void GET_HK_2_VITest() { EPS eps = new EPS(); EPS.eps_hk_vi_t ans = eps.GET_HK_2_VI(1); for (int i = 0; i < 3; i++) { Assert.AreEqual(ans.vboost[i], eps.BoostConverters[i].Volt); Assert.AreEqual(ans.curin[i], eps.BoostConverters[i].CurrentIn); } Assert.AreEqual(ans.vbatt, eps.OnboardBattery.Vbat); ushort systemCurrent = eps.OnboardBattery.CurrentOut; Assert.AreEqual(ans.cursys, systemCurrent); ushort photoCurrent = 0; for (int i = 0; i < 3; i++) { photoCurrent += eps.BoostConverters[i].CurrentOut; } Assert.AreEqual(ans.cursun, photoCurrent); }