private void button2_Click(object sender, EventArgs e) { wc = new WarehouseController(); if (EthernetPort.InsureTcpPort(wc.ServerPort) && EthernetPort.InsureFirewall("Kenmec-Warehouse", this.wc.ServerPort)) { wc.StartServer(); } }
public static void Main(string[] args) { /* * ForeignDevicePortOptions options = new ForeignDevicePortOptions() * { * PortId = 1, * BbmdHost = "<bbmd-ip-here>", * BbmdPort = 47808, * LocalHost = "0.0.0.0", * LocalPort = 47808, * RegistrationInterval = TimeSpan.FromSeconds(30) * }; */ EthernetPortOptions ethOptions = new EthernetPortOptions() { PortId = 1 }; PortManagerOptions portMgrOptions = new PortManagerOptions(); RouterOptions routerOpts = new RouterOptions(); routerOpts.PortNetworkMappings.Add(new KeyValuePair <byte, ushort>(1, 0)); HostOptions hostOpts = new HostOptions(); DeviceFinderOptions finderOpts = new DeviceFinderOptions(); //using (ForeignDevicePort port = new ForeignDevicePort(options)) using (EthernetPort port = new EthernetPort(ethOptions)) using (PortManager manager = new PortManager(portMgrOptions)) using (Router router = new Router(routerOpts)) using (Host host = new Host(hostOpts)) using (DeviceFinder finder = new DeviceFinder(finderOpts)) using (Session session = new Session(port, manager, router, host, finder)) { var client = new BACnet.Client.Client(host); // as long as there is at least 1 new devices found every 10 seconds, // for each found device, read that devices name and print it to the console finder.Timeout(TimeSpan.FromSeconds(10)) .Catch(Observable.Empty <DeviceTableEntry>()) .ForEachAsync(entry => { Console.WriteLine(entry.Instance); }) .Wait(); } }
public EthernetFrame(EthernetPort dst, EthernetPort src, Option <ushort> vlan, Layer3Packet layer3Packet) { _apiEthernet = Generators.Ethernet(dst, src) | Generators.Dot1Q(vlan); _apiEthernet = layer3Packet.Merge(_apiEthernet); }
public EthernetFrame(EthernetPort dst, EthernetPort src, Layer3Packet layer3Packet) { _apiEthernet = Generators.Ethernet(dst, src); _apiEthernet = layer3Packet.Merge(_apiEthernet); }