/** * <summary> * Changes the state of all digital IO port's channels at once: the parameter * is an integer where each bit represents a channel, with bit 0 matching channel #0. * <para> * To set all channels to 0 -> <c>0b00000000</c> -> parameter = 0 * To set channel #0 to 1 -> <c>0b00000001</c> -> parameter = 1 * To set channel #1 to 1 -> <c>0b00000010</c> -> parameter = 2 * To set channel #0 and #1 -> <c>0b00000011</c> -> parameter = 3 * To set channel #2 to 1 -> <c>0b00000100</c> -> parameter = 4 * an so on.... * Only channels configured as outputs will be affecter, according to the value * configured using <c>set_portDirection</c>. * </para> * <para> * </para> * </summary> * <param name="newval"> * an integer corresponding to the state of all digital IO port's channels at once: the parameter * is an integer where each bit represents a channel, with bit 0 matching channel #0 * </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_portState(int newval) { if (_func == null) { throw new YoctoApiProxyException("No DigitalIO connected"); } if (newval == _PortState_INVALID) { return(YAPI.SUCCESS); } return(_func.set_portState(newval)); }