/** * <summary> * Changes the temperature sensor type. * <para> * This function is used * to define the type of thermocouple (K,E...) used with the device. * It has no effect if module is using a digital sensor or a thermistor. * Remember to call the <c>saveToFlash()</c> method of the module if the * modification must be kept. * </para> * <para> * </para> * </summary> * <param name="newval"> * a value among <c>YTemperature.SENSORTYPE_DIGITAL</c>, <c>YTemperature.SENSORTYPE_TYPE_K</c>, * <c>YTemperature.SENSORTYPE_TYPE_E</c>, <c>YTemperature.SENSORTYPE_TYPE_J</c>, * <c>YTemperature.SENSORTYPE_TYPE_N</c>, <c>YTemperature.SENSORTYPE_TYPE_R</c>, * <c>YTemperature.SENSORTYPE_TYPE_S</c>, <c>YTemperature.SENSORTYPE_TYPE_T</c>, * <c>YTemperature.SENSORTYPE_PT100_4WIRES</c>, <c>YTemperature.SENSORTYPE_PT100_3WIRES</c>, * <c>YTemperature.SENSORTYPE_PT100_2WIRES</c>, <c>YTemperature.SENSORTYPE_RES_OHM</c>, * <c>YTemperature.SENSORTYPE_RES_NTC</c>, <c>YTemperature.SENSORTYPE_RES_LINEAR</c>, * <c>YTemperature.SENSORTYPE_RES_INTERNAL</c>, <c>YTemperature.SENSORTYPE_IR</c>, * <c>YTemperature.SENSORTYPE_RES_PT1000</c> and <c>YTemperature.SENSORTYPE_CHANNEL_OFF</c> * corresponding to the temperature sensor type * </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_sensorType(int newval) { if (_func == null) { throw new YoctoApiProxyException("No Temperature connected"); } if (newval == _SensorType_INVALID) { return(YAPI.SUCCESS); } // our enums start at 0 instead of the 'usual' -1 for invalid return(_func.set_sensorType(newval - 1)); }