Exemple #1
0
 /**
  * <summary>
  *   Changes the output state of the relays, when used as a simple switch (single throw).
  * <para>
  * </para>
  * <para>
  * </para>
  * </summary>
  * <param name="newval">
  *   either <c>YRelay.OUTPUT_OFF</c> or <c>YRelay.OUTPUT_ON</c>, according to the output state of the
  *   relays, when used as a simple switch (single throw)
  * </param>
  * <para>
  * </para>
  * <returns>
  *   <c>0</c> if the call succeeds.
  * </returns>
  * <para>
  *   On failure, throws an exception or returns a negative error code.
  * </para>
  */
 public int set_output(int newval)
 {
     if (_func == null)
     {
         throw new YoctoApiProxyException("No Relay connected");
     }
     if (newval == _Output_INVALID)
     {
         return(YAPI.SUCCESS);
     }
     // our enums start at 0 instead of the 'usual' -1 for invalid
     return(_func.set_output(newval - 1));
 }