Exemplo n.º 1
0
 /**
  * <summary>
  *   Changes the state of the relays at device startup (A for the idle position,
  *   B for the active position, UNCHANGED to leave the relay state as is).
  * <para>
  *   Remember to call the matching module <c>saveToFlash()</c>
  *   method, otherwise this call will have no effect.
  * </para>
  * <para>
  * </para>
  * </summary>
  * <param name="newval">
  *   a value among <c>YRelay.STATEATPOWERON_UNCHANGED</c>, <c>YRelay.STATEATPOWERON_A</c> and
  *   <c>YRelay.STATEATPOWERON_B</c> corresponding to the state of the relays at device startup (A for
  *   the idle position,
  *   B for the active position, UNCHANGED to leave the relay state as is)
  * </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_stateAtPowerOn(int newval)
 {
     if (_func == null)
     {
         throw new YoctoApiProxyException("No Relay connected");
     }
     if (newval == _StateAtPowerOn_INVALID)
     {
         return(YAPI.SUCCESS);
     }
     // our enums start at 0 instead of the 'usual' -1 for invalid
     return(_func.set_stateAtPowerOn(newval - 1));
 }