Ejemplo n.º 1
0
        public void CRCPacketBuilderTest()
        {
            var                    table      = new LookUpTable(0x1021);
            var                    calculator = new CRCChecksumCalculator(table);
            IPacketBuilder         _builder   = new CRCPacketBuilder(calculator);
            IXModemProtocolOptions _options   = new XModemProtocolOptions();

            RunTest(Tuple.Create(_builder, _options, 127));
            RunTest(Tuple.Create(_builder, _options, 129));
        }
Ejemplo n.º 2
0
        void TableChanged()
        {
            _cRCCalculator        = new CRCChecksumCalculator(_table);
            _crcChecksumValidator = new CRCChecksumValidator(_cRCCalculator);
            _CRCvalidator         = new PacketValidator(_crcChecksumValidator);

            _CRCPacketBuilder  = new CRCPacketBuilder(_cRCCalculator);
            _oneKPacketBuilder = new OneKPacketBuilder(_cRCCalculator);

            _oneKTool = new XModemTool {
                Builder   = _oneKPacketBuilder,
                Validator = _CRCvalidator
            };

            _CRCTool = new XModemTool {
                Builder   = _CRCPacketBuilder,
                Validator = _CRCvalidator
            };
        }