Example #1
0
        public void MockEcuStreamEcuIdentifier()
        {
            MockEcuStream stream  = MockEcuStream.CreateInstance();
            SsmPacket     send    = SsmPacket.CreateEcuIdentifierRequest();
            SsmPacket     receive = SsmPacket.CreateEcuIdentifierResponse();

            MockEcuStreamTest.SendReceive("EcuId", stream, send, receive);
        }
Example #2
0
        public void SsmPacketEcuIdentifierResponse()
        {
            SsmPacket packet = SsmPacket.CreateEcuIdentifierResponse();

            IList <byte> expected = SamplePacketData.EcuInitResponse;

            Utility.CompareArrays("EcuIdentifierResponse", expected, packet.Data);
            Assert.AreEqual(SsmDirection.FromEcu, packet.Direction, "Direction");
            Assert.AreEqual(SsmCommand.EcuInitResponse, packet.Command, "Command");
            Assert.AreEqual("2F12785206", packet.EcuIdentifier, "EcuIdentifier");

            byte[] expectedData = new byte[] {
                0x73, 0xFA, 0xCB, 0xA6, 0x2B, 0x81, 0xFE, 0xA8,
                0x00, 0x00, 0x00, 0x60, 0xCE, 0x54, 0xF9, 0xB1,
                0xE4, 0x00, 0x0C, 0x20, 0x00, 0x00, 0x00, 0x00,
                0x00, 0xDC, 0x00, 0x00, 0x5D, 0x1F, 0x30, 0xC0,
                0xF2, 0x26, 0x00, 0x00, 0x43, 0xFB, 0x00, 0xE1,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC1, 0xF0,
                0x28,
            };
            Utility.CompareArrays("CompatibilityMap", expectedData, packet.CompatibilityMap);
        }