/** * <summary> * Returns the port state diagnostics (Yocto-IO and Yocto-MaxiIO-V2 only). * <para> * Bit 0 indicates a shortcut on * output 0, etc. Bit 8 indicates a power failure, and bit 9 signals overheating (overcurrent). * During normal use, all diagnostic bits should stay clear. * </para> * <para> * </para> * </summary> * <returns> * an integer corresponding to the port state diagnostics (Yocto-IO and Yocto-MaxiIO-V2 only) * </returns> * <para> * On failure, throws an exception or returns <c>YDigitalIO.PORTDIAGS_INVALID</c>. * </para> */ public async Task <int> get_portDiags() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(PORTDIAGS_INVALID); } } res = _portDiags; return(res); }
/** * <summary> * Returns the physical value range measured by the sensor. * <para> * </para> * <para> * </para> * </summary> * <returns> * a string corresponding to the physical value range measured by the sensor * </returns> * <para> * On failure, throws an exception or returns <c>YGenericSensor.VALUERANGE_INVALID</c>. * </para> */ public async Task <string> get_valueRange() { string res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(VALUERANGE_INVALID); } } res = _valueRange; return(res); }
/** * <summary> * Returns the electric signal sampling method to use. * <para> * The <c>HIGH_RATE</c> method uses the highest sampling frequency, without any filtering. * The <c>HIGH_RATE_FILTERED</c> method adds a windowed 7-sample median filter. * The <c>LOW_NOISE</c> method uses a reduced acquisition frequency to reduce noise. * The <c>LOW_NOISE_FILTERED</c> method combines a reduced frequency with the median filter * to get measures as stable as possible when working on a noisy signal. * </para> * <para> * </para> * </summary> * <returns> * a value among <c>YGenericSensor.SIGNALSAMPLING_HIGH_RATE</c>, * <c>YGenericSensor.SIGNALSAMPLING_HIGH_RATE_FILTERED</c>, <c>YGenericSensor.SIGNALSAMPLING_LOW_NOISE</c> * and <c>YGenericSensor.SIGNALSAMPLING_LOW_NOISE_FILTERED</c> corresponding to the electric signal * sampling method to use * </returns> * <para> * On failure, throws an exception or returns <c>YGenericSensor.SIGNALSAMPLING_INVALID</c>. * </para> */ public async Task <int> get_signalSampling() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(SIGNALSAMPLING_INVALID); } } res = _signalSampling; return(res); }
/** * <summary> * throws an exception on error * </summary> */ public async Task <string> get_command() { string res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(COMMAND_INVALID); } } res = _command; return(res); }
/** * <summary> * throws an exception on error * </summary> */ public async Task <int> get_displayMode() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(DISPLAYMODE_INVALID); } } res = _displayMode; return(res); }
/** * <summary> * Returns the audio pre-amplifier volume, in per cents. * <para> * </para> * <para> * </para> * </summary> * <returns> * an integer corresponding to the audio pre-amplifier volume, in per cents * </returns> * <para> * On failure, throws an exception or returns <c>YBluetoothLink.PREAMPLIFIER_INVALID</c>. * </para> */ public async Task <int> get_preAmplifier() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(PREAMPLIFIER_INVALID); } } res = _preAmplifier; return(res); }
/** * <summary> * Returns the bluetooth receiver signal strength, in pourcents, or 0 if no connection is established. * <para> * </para> * <para> * </para> * </summary> * <returns> * an integer corresponding to the bluetooth receiver signal strength, in pourcents, or 0 if no * connection is established * </returns> * <para> * On failure, throws an exception or returns <c>YBluetoothLink.LINKQUALITY_INVALID</c>. * </para> */ public async Task <int> get_linkQuality() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(LINKQUALITY_INVALID); } } res = _linkQuality; return(res); }
/** * <summary> * Returns the state of the PWM at device power on. * <para> * </para> * <para> * </para> * </summary> * <returns> * either <c>YPwmOutput.ENABLEDATPOWERON_FALSE</c> or <c>YPwmOutput.ENABLEDATPOWERON_TRUE</c>, * according to the state of the PWM at device power on * </returns> * <para> * On failure, throws an exception or returns <c>YPwmOutput.ENABLEDATPOWERON_INVALID</c>. * </para> */ public async Task <int> get_enabledAtPowerOn() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(ENABLEDATPOWERON_INVALID); } } res = _enabledAtPowerOn; return(res); }
/** * <summary> * Returns the PWM generators duty cycle at device power on as a floating point number between 0 and 100. * <para> * </para> * <para> * </para> * </summary> * <returns> * a floating point number corresponding to the PWM generators duty cycle at device power on as a * floating point number between 0 and 100 * </returns> * <para> * On failure, throws an exception or returns <c>YPwmOutput.DUTYCYCLEATPOWERON_INVALID</c>. * </para> */ public async Task <double> get_dutyCycleAtPowerOn() { double res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(DUTYCYCLEATPOWERON_INVALID); } } res = _dutyCycleAtPowerOn; return(res); }
/** * <summary> * Returns the PWM pulse length in milliseconds, as a floating point number. * <para> * </para> * <para> * </para> * </summary> * <returns> * a floating point number corresponding to the PWM pulse length in milliseconds, as a floating point number * </returns> * <para> * On failure, throws an exception or returns <c>YPwmOutput.PULSEDURATION_INVALID</c>. * </para> */ public async Task <double> get_pulseDuration() { double res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(PULSEDURATION_INVALID); } } res = _pulseDuration; return(res); }
/** * <summary> * throws an exception on error * </summary> */ public async Task <string> get_pwmTransition() { string res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(PWMTRANSITION_INVALID); } } res = _pwmTransition; return(res); }
/** * <summary> * Returns the PWM period in milliseconds. * <para> * </para> * <para> * </para> * </summary> * <returns> * a floating point number corresponding to the PWM period in milliseconds * </returns> * <para> * On failure, throws an exception or returns <c>YPwmOutput.PERIOD_INVALID</c>. * </para> */ public async Task <double> get_period() { double res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(PERIOD_INVALID); } } res = _period; return(res); }
/** * <summary> * Returns the PWM frequency in Hz. * <para> * </para> * <para> * </para> * </summary> * <returns> * a floating point number corresponding to the PWM frequency in Hz * </returns> * <para> * On failure, throws an exception or returns <c>YPwmOutput.FREQUENCY_INVALID</c>. * </para> */ public async Task <double> get_frequency() { double res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(FREQUENCY_INVALID); } } res = _frequency; return(res); }
/** * <summary> * Returns the voltage source used to drive output bits. * <para> * </para> * <para> * </para> * </summary> * <returns> * a value among <c>YDigitalIO.OUTPUTVOLTAGE_USB_5V</c>, <c>YDigitalIO.OUTPUTVOLTAGE_USB_3V</c> and * <c>YDigitalIO.OUTPUTVOLTAGE_EXT_V</c> corresponding to the voltage source used to drive output bits * </returns> * <para> * On failure, throws an exception or returns <c>YDigitalIO.OUTPUTVOLTAGE_INVALID</c>. * </para> */ public async Task <int> get_outputVoltage() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(OUTPUTVOLTAGE_INVALID); } } res = _outputVoltage; return(res); }
/** * <summary> * Returns an opaque string if a PIN code has been configured in the device to access * the SIM card, or an empty string if none has been configured or if the code provided * was rejected by the SIM card. * <para> * </para> * <para> * </para> * </summary> * <returns> * a string corresponding to an opaque string if a PIN code has been configured in the device to access * the SIM card, or an empty string if none has been configured or if the code provided * was rejected by the SIM card * </returns> * <para> * On failure, throws an exception or returns <c>YBluetoothLink.PAIRINGPIN_INVALID</c>. * </para> */ public async Task <string> get_pairingPin() { string res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(PAIRINGPIN_INVALID); } } res = _pairingPin; return(res); }
/** * <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 overcurrent 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 async Task <int> get_motorStatus() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(MOTORSTATUS_INVALID); } } res = _motorStatus; return(res); }
/** * <summary> * Returns the bluetooth name the remote device, if found on the bluetooth network. * <para> * </para> * <para> * </para> * </summary> * <returns> * a string corresponding to the bluetooth name the remote device, if found on the bluetooth network * </returns> * <para> * On failure, throws an exception or returns <c>YBluetoothLink.REMOTENAME_INVALID</c>. * </para> */ public async Task <string> get_remoteName() { string res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(REMOTENAME_INVALID); } } res = _remoteName; return(res); }
/** * <summary> * Returns the braking force applied to the motor, as a percentage. * <para> * The value 0 corresponds to no braking (free wheel). * </para> * <para> * </para> * </summary> * <returns> * a floating point number corresponding to the braking force applied to the motor, as a percentage * </returns> * <para> * On failure, throws an exception or returns <c>YMotor.BRAKINGFORCE_INVALID</c>. * </para> */ public async Task <double> get_brakingForce() { double res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(BRAKINGFORCE_INVALID); } } res = _brakingForce; return(res); }
/** * <summary> * Returns the connected headset volume, in per cents. * <para> * </para> * <para> * </para> * </summary> * <returns> * an integer corresponding to the connected headset volume, in per cents * </returns> * <para> * On failure, throws an exception or returns <c>YBluetoothLink.VOLUME_INVALID</c>. * </para> */ public async Task <int> get_volume() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(VOLUME_INVALID); } } res = _volume; return(res); }
/** * <summary> * Returns the threshold voltage under which the controller automatically switches to error state * and prevents further current draw. * <para> * This setting prevents damage to a battery that can * occur when drawing current from an "empty" battery. * </para> * <para> * </para> * </summary> * <returns> * a floating point number corresponding to the threshold voltage under which the controller * automatically switches to error state * and prevents further current draw * </returns> * <para> * On failure, throws an exception or returns <c>YMotor.CUTOFFVOLTAGE_INVALID</c>. * </para> */ public async Task <double> get_cutOffVoltage() { double res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(CUTOFFVOLTAGE_INVALID); } } res = _cutOffVoltage; return(res); }
/** * <summary> * Returns a short informative description of the formula. * <para> * </para> * <para> * </para> * </summary> * <returns> * a string corresponding to a short informative description of the formula * </returns> * <para> * On failure, throws an exception or returns <c>YArithmeticSensor.DESCRIPTION_INVALID</c>. * </para> */ public async Task <string> get_description() { string res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(DESCRIPTION_INVALID); } } res = _description; return(res); }
/** * <summary> * Returns the current threshold (in mA) above which the controller automatically * switches to error state. * <para> * A zero value means that there is no limit. * </para> * <para> * </para> * </summary> * <returns> * an integer corresponding to the current threshold (in mA) above which the controller automatically * switches to error state * </returns> * <para> * On failure, throws an exception or returns <c>YMotor.OVERCURRENTLIMIT_INVALID</c>. * </para> */ public async Task <int> get_overCurrentLimit() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(OVERCURRENTLIMIT_INVALID); } } res = _overCurrentLimit; return(res); }
/** * <summary> * Returns the text currently displayed on the screen. * <para> * </para> * <para> * </para> * </summary> * <returns> * a string corresponding to the text currently displayed on the screen * </returns> * <para> * On failure, throws an exception or returns <c>YSegmentedDisplay.DISPLAYEDTEXT_INVALID</c>. * </para> */ public async Task <string> get_displayedText() { string res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(DISPLAYEDTEXT_INVALID); } } res = _displayedText; return(res); }
/** * <summary> * Returns the duration (in ms) during which the motor is driven at low frequency to help * it start up. * <para> * </para> * <para> * </para> * </summary> * <returns> * an integer corresponding to the duration (in ms) during which the motor is driven at low frequency to help * it start up * </returns> * <para> * On failure, throws an exception or returns <c>YMotor.STARTERTIME_INVALID</c>. * </para> */ public async Task <int> get_starterTime() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(STARTERTIME_INVALID); } } res = _starterTime; return(res); }
/** * <summary> * Returns the current value of the electrical signal measured by the sensor. * <para> * </para> * <para> * </para> * </summary> * <returns> * a floating point number corresponding to the current value of the electrical signal measured by the sensor * </returns> * <para> * On failure, throws an exception or returns <c>YGenericSensor.SIGNALVALUE_INVALID</c>. * </para> */ public async Task <double> get_signalValue() { double res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(SIGNALVALUE_INVALID); } } res = Math.Round(_signalValue * 1000) / 1000; return(res); }
/** * <summary> * Returns the delay in milliseconds allowed for the controller to run autonomously without * receiving any instruction from the control process. * <para> * When this delay has elapsed, * the controller automatically stops the motor and switches to FAILSAFE error. * Failsafe security is disabled when the value is zero. * </para> * <para> * </para> * </summary> * <returns> * an integer corresponding to the delay in milliseconds allowed for the controller to run autonomously without * receiving any instruction from the control process * </returns> * <para> * On failure, throws an exception or returns <c>YMotor.FAILSAFETIMEOUT_INVALID</c>. * </para> */ public async Task <int> get_failSafeTimeout() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(FAILSAFETIMEOUT_INVALID); } } res = _failSafeTimeout; return(res); }
/** * <summary> * Returns the electric signal bias for zero shift adjustment. * <para> * A positive bias means that the signal is over-reporting the measure, * while a negative bias means that the signal is underreporting the measure. * </para> * <para> * </para> * </summary> * <returns> * a floating point number corresponding to the electric signal bias for zero shift adjustment * </returns> * <para> * On failure, throws an exception or returns <c>YGenericSensor.SIGNALBIAS_INVALID</c>. * </para> */ public async Task <double> get_signalBias() { double res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(SIGNALBIAS_INVALID); } } res = _signalBias; return(res); }
/** * <summary> * Returns the MAC-48 address of the bluetooth interface, which is unique on the bluetooth network. * <para> * </para> * <para> * </para> * </summary> * <returns> * a string corresponding to the MAC-48 address of the bluetooth interface, which is unique on the * bluetooth network * </returns> * <para> * On failure, throws an exception or returns <c>YBluetoothLink.OWNADDRESS_INVALID</c>. * </para> */ public async Task <string> get_ownAddress() { string res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(OWNADDRESS_INVALID); } } res = _ownAddress; return(res); }
/** * <summary> * Returns the barometric pressure adjusted to sea level used to compute * the altitude (QNH). * <para> * </para> * <para> * </para> * </summary> * <returns> * a floating point number corresponding to the barometric pressure adjusted to sea level used to compute * the altitude (QNH) * </returns> * <para> * On failure, throws an exception or returns <c>YAltitude.QNH_INVALID</c>. * </para> */ public async Task <double> get_qnh() { double res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(YAPI.DefaultCacheValidity) != YAPI.SUCCESS) { return(QNH_INVALID); } } res = _qnh; return(res); }
/** * <summary> * Returns the number of seconds elapsed without detecting a signal. * <para> * </para> * <para> * </para> * </summary> * <returns> * an integer corresponding to the number of seconds elapsed without detecting a signal * </returns> * <para> * On failure, throws an exception or returns <c>YAudioOut.NOSIGNALFOR_INVALID</c>. * </para> */ public async Task <int> get_noSignalFor() { int res; if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (await this.load(await _yapi.GetCacheValidity()) != YAPI.SUCCESS) { return(NOSIGNALFOR_INVALID); } } res = _noSignalFor; return(res); }