Example #1
0
 public void Connect(IGPIOReceiver destination, int destinationNumber)
 {
     if (destination == null)
     {
         throw new ArgumentNullException("destination");
     }
     Validate(destination, destinationNumber);
     lock (sync)
     {
         target       = destination;
         targetNumber = destinationNumber;
         target.OnGPIO(destinationNumber, state);
     }
 }
Example #2
0
File: GPIO.cs Project: rte-se/emul8
 public void Connect(IGPIOReceiver destination, int destinationNumber)
 {
     if(destination == null)
     {
         throw new ArgumentNullException("destination");
     }
     Validate(destination, destinationNumber);
     lock(sync)
     {
         target = destination;
         targetNumber = destinationNumber;
         target.OnGPIO(destinationNumber, state);
     }
 }
Example #3
0
 public void Connect(IGPIOReceiver destination, int destinationNumber)
 {
     if (destination == null)
     {
         throw new ArgumentNullException("destination");
     }
     Validate(destination, destinationNumber);
     lock (sync)
     {
         if (!targets.Any(x => x.Receiver == destination && x.Number == destinationNumber))
         {
             targets.Add(new GPIOEndpoint(destination, destinationNumber));
             destination.OnGPIO(destinationNumber, state);
         }
     }
 }