Exemplo n.º 1
0
 public MacConnection Get(byte mcei)
 {
     if (!_connections.TryGetValue(mcei, out var connection))
     {
         connection = new MacConnection(this, mcei);
         _connections.Add(mcei, connection);
     }
     return(connection);
 }
Exemplo n.º 2
0
 public void Close(MacConnection connection)
 {
     _connections.Remove(connection.MCEI);
 }
Exemplo n.º 3
0
 public bool TryGetByPMID(uint pmid, out MacConnection connection)
 {
     connection = _connections.Values.Where(x => x.IsConnected).FirstOrDefault(x => x.PMID == pmid);
     return(connection != null);
 }