コード例 #1
0
ファイル: Server.cs プロジェクト: reututy/SatelliteCSharp
        public static byte[] getBytes(EPS.eps_hk_basic_t str)
        {
            byte[] ans   = new byte[133]; //TODO: determine size
            int    index = 0;

            copyToByteArr(ans, str.commandReply, ref index);

            ushort roundUpToIntSize1 = 0;

            copyToByteArr(ans, roundUpToIntSize1, ref index);

            copyToByteArr(ans, str.counter_boot, ref index);
            copyToByteArr(ans, str.temp, ref index);
            //copyToByteArr(ans, str.bootcause, ref index); //20
            ans[index] = str.bootcause;
            index     += 1;

            ans[index] = str.battmode;
            index     += 1;

            ans[index] = str.pptmode;
            index     += 1;
            //copyToByteArr(ans, str.battmode, ref index); //21


            //copyToByteArr(ans, str.pptmode, ref index); //22
            copyToByteArr(ans, str.reserved2, ref index);

            return(ans);
        }
コード例 #2
0
ファイル: EPSTests.cs プロジェクト: reututy/SatelliteCSharp
        public void GET_HK_2_BASICTest()
        {
            EPS eps = new EPS();

            EPS.eps_hk_basic_t ans = eps.GET_HK_2_BASIC(4);
            Assert.AreEqual(ans.counter_boot, eps.RebootCount);
            Assert.AreEqual(ans.bootcause, eps.LastResetCause);
            Assert.AreEqual(ans.pptmode, (byte)eps.CurrentConfig.PptMode);
            Assert.AreEqual(ans.battmode, (byte)eps.OnboardBattery.BattState);
            int i;

            for (i = 0; i < 3; i++)
            {
                Assert.AreEqual(ans.temp[i], eps.BoostConverters[i].Temperture);
            }
            Assert.AreEqual(ans.temp[3], eps.OnboardBattery.Temperture);
            Assert.AreEqual(ans.temp[4], eps.OnboardBattery.Temperture);
            Assert.AreEqual(ans.temp[5], eps.OnboardBattery.Temperture);
        }