Exemplo n.º 1
0
        public static BusMaster <T> CreateConnection <T>(this BusSlave <T> slave, string busName = null)
            where T : BusData, new()
        {
            var bus = slave.GetOrAddBus(busName);

            return(new BusMaster <T>(bus, busName));
        }
Exemplo n.º 2
0
        public static Bus <T> ConnectTo <T>(this BusSlave <T> slave, BusMaster <T> master, string busName = null)
            where T : BusData, new()
        {
            Bus <T> bus = Connect(master, slave, busName);

            if (bus == null)
            {
                if (busName == null)
                {
                    busName = slave.Name;
                }
                bus = slave.GetOrAddBus(busName);
                master.ConnectTo(bus);
            }

            return(bus);
        }
Exemplo n.º 3
0
        public static BusMaster CreateConnection(this BusSlave slave, string busName = null)
        {
            var bus = slave.GetOrAddBus(busName);

            return(new BusMaster(bus, busName));
        }