/** * <summary> * Return the controller state. * <para> * Possible states are: * IDLE when the motor is stopped/in free wheel, ready to start; * FORWD when the controller is driving the motor forward; * BACKWD when the controller is driving the motor backward; * BRAKE when the controller is braking; * LOVOLT when the controller has detected a low voltage condition; * HICURR when the controller has detected an over current condition; * HIHEAT when the controller has detected an overheat condition; * FAILSF when the controller switched on the failsafe security. * </para> * <para> * When an error condition occurred (LOVOLT, HICURR, HIHEAT, FAILSF), the controller * status must be explicitly reset using the <c>resetStatus</c> function. * </para> * <para> * </para> * </summary> * <returns> * a value among <c>YMotor.MOTORSTATUS_IDLE</c>, <c>YMotor.MOTORSTATUS_BRAKE</c>, * <c>YMotor.MOTORSTATUS_FORWD</c>, <c>YMotor.MOTORSTATUS_BACKWD</c>, * <c>YMotor.MOTORSTATUS_LOVOLT</c>, <c>YMotor.MOTORSTATUS_HICURR</c>, * <c>YMotor.MOTORSTATUS_HIHEAT</c> and <c>YMotor.MOTORSTATUS_FAILSF</c> * </returns> * <para> * On failure, throws an exception or returns <c>YMotor.MOTORSTATUS_INVALID</c>. * </para> */ public int get_motorStatus() { if (_func == null) { throw new YoctoApiProxyException("No Motor connected"); } // our enums start at 0 instead of the 'usual' -1 for invalid return(_func.get_motorStatus() + 1); }