Exemplo n.º 1
0
        void TransmissionTest(List <IMilFrame> tdata)
        {
            IMilSpiBridge bridge = new MilSpiBridge(mpsseDeviceSerialNum);

            bridge.Transmit(transmitterAddr, tdata);

            List <IMilFrame> rdata = bridge.WaitReceive(receiverAddr, (ushort)tdata.Count);

            Assert.IsTrue(Enumerable.SequenceEqual(rdata, tdata));
        }
Exemplo n.º 2
0
        public void ResetAndStatusTest()
        {
            IMilSpiBridge bridge = new MilSpiBridge(mpsseDeviceSerialNum);

            List <IMilFrame> tdata = PacketGenerator.randomPacket(1);

            bridge.Transmit(transmitterAddr, tdata);

            Thread.Sleep(500);

            ISPStatus status = bridge.getDeviceStatus(receiverAddr);

            Assert.IsTrue(status.ReceivedQueueSize == 1);

            bridge.DeviceReset(transmitterAddr);

            Thread.Sleep(200);

            status = bridge.getDeviceStatus(receiverAddr);
            Assert.IsTrue(status.ReceivedQueueSize == 0);
        }