Пример #1
0
        internal static CanNodeSession GetNewCanSession()
        {
            var canController   = new CanController();
            var microController = new MockMicroControllerImpl(canController);
            var transceiver     = new CanTransceiver(canController);

            canController.SetControllerProperties(transceiver, microController, new FrameBuilder());

            return(new CanNodeSession(new CanNode(microController, transceiver)));
        }
Пример #2
0
        public CanNodeSession CreateCanNodeSession(Type microcontrollerType)
        {
            var canController = new CanController();
            IMicrocontroller microController = (IMicrocontroller)Activator.CreateInstance(microcontrollerType);

            microController.CanController = canController;
            var transceiver = new CanTransceiver(canController);

            canController.SetControllerProperties(transceiver, microController, new FrameBuilder());

            return(new CanNodeSession(new CanNode(microController, transceiver)));
        }