public class YMagnetometer extends YSensor
| Modifier and Type | Class and Description |
|---|---|
static interface |
YMagnetometer.TimedReportCallback
TimedReportCallback for Magnetometer
|
static interface |
YMagnetometer.UpdateCallback
Deprecated UpdateCallback for Magnetometer
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
_bandwidth |
protected YMagnetometer.TimedReportCallback |
_timedReportCallbackMagnetometer |
protected YMagnetometer.UpdateCallback |
_valueCallbackMagnetometer |
protected double |
_xValue |
protected double |
_yValue |
protected double |
_zValue |
static int |
BANDWIDTH_INVALID
invalid bandwidth value
|
static double |
XVALUE_INVALID
invalid xValue value
|
static double |
YVALUE_INVALID
invalid yValue value
|
static double |
ZVALUE_INVALID
invalid zValue value
|
_advMode, _cal, _calibrationParam, _currentRawValue, _currentValue, _highestValue, _iresol, _logFrequency, _lowestValue, _prevTR, _reportFrequency, _resolution, _sensorState, _timedReportCallbackSensor, _unit, _valueCallbackSensor, ADVMODE_IMMEDIATE, ADVMODE_INVALID, ADVMODE_PERIOD_AVG, ADVMODE_PERIOD_MAX, ADVMODE_PERIOD_MIN, CALIBRATIONPARAM_INVALID, CURRENTRAWVALUE_INVALID, CURRENTVALUE_INVALID, HIGHESTVALUE_INVALID, LOGFREQUENCY_INVALID, LOWESTVALUE_INVALID, REPORTFREQUENCY_INVALID, RESOLUTION_INVALID, SENSORSTATE_INVALID, UNIT_INVALID_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID| Modifier | Constructor and Description |
|---|---|
protected |
YMagnetometer(String func) |
protected |
YMagnetometer(YAPIContext ctx,
String func) |
| Modifier and Type | Method and Description |
|---|---|
int |
_invokeTimedReportCallback(YMeasure value) |
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YMagnetometer |
FindMagnetometer(String func)
Retrieves a magnetometer for a given identifier.
|
static YMagnetometer |
FindMagnetometerInContext(YAPIContext yctx,
String func)
Retrieves a magnetometer for a given identifier in a YAPI context.
|
static YMagnetometer |
FirstMagnetometer()
Starts the enumeration of magnetometers currently accessible.
|
static YMagnetometer |
FirstMagnetometerInContext(YAPIContext yctx)
Starts the enumeration of magnetometers currently accessible.
|
int |
get_bandwidth()
Returns the measure update frequency, measured in Hz.
|
double |
get_xValue()
Returns the X component of the magnetic field, as a floating point number.
|
double |
get_yValue()
Returns the Y component of the magnetic field, as a floating point number.
|
double |
get_zValue()
Returns the Z component of the magnetic field, as a floating point number.
|
int |
getBandwidth()
Returns the measure update frequency, measured in Hz.
|
double |
getXValue()
Returns the X component of the magnetic field, as a floating point number.
|
double |
getYValue()
Returns the Y component of the magnetic field, as a floating point number.
|
double |
getZValue()
Returns the Z component of the magnetic field, as a floating point number.
|
YMagnetometer |
nextMagnetometer()
Continues the enumeration of magnetometers started using yFirstMagnetometer().
|
int |
registerTimedReportCallback(YMagnetometer.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YMagnetometer.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_bandwidth(int newval)
Changes the measure update frequency, measured in Hz.
|
int |
setBandwidth(int newval)
Changes the measure update frequency, measured in Hz.
|
_applyCalibration, _decodeAvg, _decodeTimedReport, _decodeVal, _encodeCalibrationPoints, _parseCalibStr, _parserHelper, calibrateFromPoints, FindSensor, FindSensorInContext, FirstSensor, FirstSensorInContext, get_advMode, get_calibrationParam, get_currentRawValue, get_currentValue, get_dataLogger, get_highestValue, get_logFrequency, get_lowestValue, get_recordedData, get_reportFrequency, get_resolution, get_sensorState, get_unit, getAdvMode, getCurrentRawValue, getCurrentValue, getHighestValue, getLogFrequency, getLowestValue, getReportFrequency, getResolution, getSensorState, getUnit, isSensorReady, loadCalibrationPoints, nextSensor, registerTimedReportCallback, registerValueCallback, set_advMode, set_calibrationParam, set_highestValue, set_logFrequency, set_lowestValue, set_reportFrequency, set_resolution, setAdvMode, setHighestValue, setLogFrequency, setLowestValue, setReportFrequency, setResolution, startDataLogger, stopDataLogger_AddToCache, _clearDataStreamCache, _decode_json_int, _decode_json_string, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _is_valid_pass, _json_get_array, _json_get_key, _json_get_string, _parse, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, _uploadEx, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_serialNumber, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, isReadOnly, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userDatapublic static final int BANDWIDTH_INVALID
public static final double XVALUE_INVALID
public static final double YVALUE_INVALID
public static final double ZVALUE_INVALID
protected int _bandwidth
protected double _xValue
protected double _yValue
protected double _zValue
protected YMagnetometer.UpdateCallback _valueCallbackMagnetometer
protected YMagnetometer.TimedReportCallback _timedReportCallbackMagnetometer
protected YMagnetometer(YAPIContext ctx, String func)
func - : functionidprotected YMagnetometer(String func)
func - : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val)
throws Exception
_parseAttr in class YSensorExceptionpublic int get_bandwidth()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getBandwidth()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_bandwidth(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the measure update frequency, measured in HzYAPI_Exception - on errorpublic int setBandwidth(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the measure update frequency, measured in HzYAPI_Exception - on errorpublic double get_xValue()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getXValue()
throws YAPI_Exception
YAPI_Exception - on errorpublic double get_yValue()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getYValue()
throws YAPI_Exception
YAPI_Exception - on errorpublic double get_zValue()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getZValue()
throws YAPI_Exception
YAPI_Exception - on errorpublic static YMagnetometer FindMagnetometer(String func)
func - : a string that uniquely characterizes the magnetometer, for instance
Y3DMK002.magnetometer.public static YMagnetometer FindMagnetometerInContext(YAPIContext yctx, String func)
yctx - : a YAPI contextfunc - : a string that uniquely characterizes the magnetometer, for instance
Y3DMK002.magnetometer.public int registerValueCallback(YMagnetometer.UpdateCallback callback)
callback - : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback in class YSensorpublic int registerTimedReportCallback(YMagnetometer.TimedReportCallback callback)
callback - : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and an YMeasure object describing
the new advertised value.public int _invokeTimedReportCallback(YMeasure value)
_invokeTimedReportCallback in class YSensorpublic YMagnetometer nextMagnetometer()
public static YMagnetometer FirstMagnetometer()
public static YMagnetometer FirstMagnetometerInContext(YAPIContext yctx)
yctx - : a YAPI context.Copyright © 2026. All rights reserved.