/** * <summary> * Changes the measuring unit for the measured temperature. * <para> * That unit is a string. * If that strings end with the letter F all temperatures values will returned in * Fahrenheit degrees. If that String ends with the letter K all values will be * returned in Kelvin degrees. If that string ends with the letter C all values will be * returned in Celsius degrees. If the string ends with any other character the * change will be ignored. Remember to call the * <c>saveToFlash()</c> method of the module if the modification must be kept. * WARNING: if a specific calibration is defined for the temperature function, a * unit system change will probably break it. * </para> * <para> * </para> * </summary> * <param name="newval"> * a string corresponding to the measuring unit for the measured temperature * </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_unit(string newval) { if (_func == null) { throw new YoctoApiProxyException("No Temperature connected"); } if (newval == _Unit_INVALID) { return(YAPI.SUCCESS); } return(_func.set_unit(newval)); }