示例#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)));
        }