public class YMultiSensController extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YMultiSensController.TimedReportCallback
TimedReportCallback for MultiSensController
|
static interface |
YMultiSensController.UpdateCallback
Deprecated UpdateCallback for MultiSensController
|
Modifier and Type | Field and Description |
---|---|
protected String |
_command |
protected int |
_lastAddressDetected |
protected int |
_maintenanceMode |
protected int |
_maxSensors |
protected int |
_nSensors |
protected YMultiSensController.UpdateCallback |
_valueCallbackMultiSensController |
static String |
COMMAND_INVALID
invalid command value
|
static int |
LASTADDRESSDETECTED_INVALID
invalid lastAddressDetected value
|
static int |
MAINTENANCEMODE_FALSE
invalid maintenanceMode value
|
static int |
MAINTENANCEMODE_INVALID |
static int |
MAINTENANCEMODE_TRUE |
static int |
MAXSENSORS_INVALID
invalid maxSensors value
|
static int |
NSENSORS_INVALID
invalid nSensors value
|
_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 |
YMultiSensController(String func) |
protected |
YMultiSensController(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YMultiSensController |
FindMultiSensController(String func)
Retrieves a multi-sensor controller for a given identifier.
|
static YMultiSensController |
FindMultiSensControllerInContext(YAPIContext yctx,
String func)
Retrieves a multi-sensor controller for a given identifier in a YAPI context.
|
static YMultiSensController |
FirstMultiSensController()
Starts the enumeration of multi-sensor controllers currently accessible.
|
static YMultiSensController |
FirstMultiSensControllerInContext(YAPIContext yctx)
Starts the enumeration of multi-sensor controllers currently accessible.
|
String |
get_command() |
int |
get_lastAddressDetected()
Returns the I2C address of the most recently detected sensor.
|
int |
get_maintenanceMode()
Returns true when the device is in maintenance mode.
|
int |
get_maxSensors()
Returns the maximum configurable sensor count allowed on this device.
|
int |
get_nSensors()
Returns the number of sensors to poll.
|
int |
get_sensorAddress()
Triggers the I2C address detection procedure for the only sensor connected to the device.
|
int |
getLastAddressDetected()
Returns the I2C address of the most recently detected sensor.
|
int |
getMaintenanceMode()
Returns true when the device is in maintenance mode.
|
int |
getMaxSensors()
Returns the maximum configurable sensor count allowed on this device.
|
int |
getNSensors()
Returns the number of sensors to poll.
|
YMultiSensController |
nextMultiSensController()
Continues the enumeration of multi-sensor controllers started using yFirstMultiSensController().
|
int |
registerValueCallback(YMultiSensController.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_command(String newval) |
int |
set_maintenanceMode(int newval)
Changes the device mode to enable maintenance and to stop sensor polling.
|
int |
set_nSensors(int newval)
Changes the number of sensors to poll.
|
int |
setMaintenanceMode(int newval)
Changes the device mode to enable maintenance and to stop sensor polling.
|
int |
setNSensors(int newval)
Changes the number of sensors to poll.
|
int |
setupAddress(int addr)
Configures the I2C address of the only sensor connected to the device.
|
_AddToCache, _clearDataStreamCache, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _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, userData
public static final int NSENSORS_INVALID
public static final int MAXSENSORS_INVALID
public static final int MAINTENANCEMODE_FALSE
public static final int MAINTENANCEMODE_TRUE
public static final int MAINTENANCEMODE_INVALID
public static final int LASTADDRESSDETECTED_INVALID
public static final String COMMAND_INVALID
protected int _nSensors
protected int _maxSensors
protected int _maintenanceMode
protected int _lastAddressDetected
protected String _command
protected YMultiSensController.UpdateCallback _valueCallbackMultiSensController
protected YMultiSensController(YAPIContext ctx, String func)
func
- : functionidprotected YMultiSensController(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int get_nSensors() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getNSensors() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_nSensors(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the number of sensors to pollYAPI_Exception
- on errorpublic int setNSensors(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the number of sensors to pollYAPI_Exception
- on errorpublic int get_maxSensors() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getMaxSensors() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_maintenanceMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getMaintenanceMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_maintenanceMode(int newval) throws YAPI_Exception
newval
- : either YMultiSensController.MAINTENANCEMODE_FALSE or
YMultiSensController.MAINTENANCEMODE_TRUE, according to the device mode to enable maintenance and
to stop sensor pollingYAPI_Exception
- on errorpublic int setMaintenanceMode(int newval) throws YAPI_Exception
newval
- : either YMultiSensController.MAINTENANCEMODE_FALSE or
YMultiSensController.MAINTENANCEMODE_TRUE, according to the device mode to enable maintenance and
to stop sensor pollingYAPI_Exception
- on errorpublic int get_lastAddressDetected() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLastAddressDetected() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_command() throws YAPI_Exception
YAPI_Exception
public int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public static YMultiSensController FindMultiSensController(String func)
func
- : a string that uniquely characterizes the multi-sensor controller, for instance
YTEMPIR1.multiSensController.public static YMultiSensController FindMultiSensControllerInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the multi-sensor controller, for instance
YTEMPIR1.multiSensController.public int registerValueCallback(YMultiSensController.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 YFunction
public int setupAddress(int addr) throws YAPI_Exception
addr
- : new address of the connected sensorYAPI_Exception
- on errorpublic int get_sensorAddress() throws YAPI_Exception
YAPI_Exception
- on errorpublic YMultiSensController nextMultiSensController()
public static YMultiSensController FirstMultiSensController()
public static YMultiSensController FirstMultiSensControllerInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2022. All rights reserved.