public class YDataLogger extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YDataLogger.TimedReportCallback
TimedReportCallback for DataLogger
|
static interface |
YDataLogger.UpdateCallback
Deprecated UpdateCallback for DataLogger
|
Modifier and Type | Field and Description |
---|---|
protected int |
_autoStart |
protected int |
_beaconDriven |
protected int |
_clearHistory |
protected int |
_currentRunIndex |
protected String |
_dataLoggerURL |
protected int |
_recording |
protected long |
_timeUTC |
protected YDataLogger.UpdateCallback |
_valueCallbackDataLogger |
static int |
AUTOSTART_INVALID |
static int |
AUTOSTART_OFF
invalid autoStart value
|
static int |
AUTOSTART_ON |
static int |
BEACONDRIVEN_INVALID |
static int |
BEACONDRIVEN_OFF
invalid beaconDriven value
|
static int |
BEACONDRIVEN_ON |
static int |
CLEARHISTORY_FALSE
invalid clearHistory value
|
static int |
CLEARHISTORY_INVALID |
static int |
CLEARHISTORY_TRUE |
static int |
CURRENTRUNINDEX_INVALID
invalid currentRunIndex value
|
static int |
RECORDING_INVALID |
static int |
RECORDING_OFF
invalid recording value
|
static int |
RECORDING_ON |
static int |
RECORDING_PENDING |
static long |
TIMEUTC_INVALID
invalid timeUTC 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 |
YDataLogger(String func) |
protected |
YDataLogger(YAPIContext yctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YDataLogger |
FindDataLogger(String func)
Retrieves a data logger for a given identifier.
|
static YDataLogger |
FindDataLoggerInContext(YAPIContext yctx,
String func)
Retrieves a data logger for a given identifier in a YAPI context.
|
static YDataLogger |
FirstDataLogger()
Starts the enumeration of data loggers currently accessible.
|
static YDataLogger |
FirstDataLoggerInContext(YAPIContext yctx)
Starts the enumeration of data loggers currently accessible.
|
int |
forgetAllDataStreams()
Clears the data logger memory and discards all recorded data streams.
|
int |
get_autoStart()
Returns the default activation state of the data logger on power up.
|
int |
get_beaconDriven()
Returns true if the data logger is synchronised with the localization beacon.
|
int |
get_clearHistory() |
int |
get_currentRunIndex()
Returns the current run number, corresponding to the number of times the module was
powered on with the dataLogger enabled at some point.
|
ArrayList<YDataSet> |
get_dataSets()
Returns a list of YDataSet objects that can be used to retrieve
all measures stored by the data logger.
|
int |
get_dataStreams(ArrayList<YDataStream> v)
Builds a list of all data streams hold by the data logger (legacy method).
|
int |
get_recording()
Returns the current activation state of the data logger.
|
long |
get_timeUTC()
Returns the Unix timestamp for current UTC time, if known.
|
int |
getAutoStart()
Returns the default activation state of the data logger on power up.
|
int |
getBeaconDriven()
Returns true if the data logger is synchronised with the localization beacon.
|
int |
getCurrentRunIndex()
Returns the current run number, corresponding to the number of times the module was
powered on with the dataLogger enabled at some point.
|
String |
getData(Integer runIdx,
Integer timeIdx)
Internal function to retrieve datalogger memory
|
int |
getDataStreams(ArrayList<YDataStream> v) |
int |
getRecording()
Returns the current activation state of the data logger.
|
long |
getTimeUTC()
Returns the Unix timestamp for current UTC time, if known.
|
YDataLogger |
nextDataLogger()
Continues the enumeration of data loggers started using yFirstDataLogger().
|
ArrayList<YDataSet> |
parse_dataSets(byte[] json) |
int |
registerValueCallback(YDataLogger.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_autoStart(int newval)
Changes the default activation state of the data logger on power up.
|
int |
set_beaconDriven(int newval)
Changes the type of synchronisation of the data logger.
|
int |
set_clearHistory(int newval) |
int |
set_recording(int newval)
Changes the activation state of the data logger to start/stop recording data.
|
int |
set_timeUTC(long newval)
Changes the current UTC time reference used for recorded data.
|
int |
setAutoStart(int newval)
Changes the default activation state of the data logger on power up.
|
int |
setBeaconDriven(int newval)
Changes the type of synchronisation of the data logger.
|
int |
setRecording(int newval)
Changes the activation state of the data logger to start/stop recording data.
|
int |
setTimeUTC(long newval)
Changes the current UTC time reference used for recorded data.
|
_AddToCache, _clearDataStreamCache, _devRequest, _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, 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_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final int CURRENTRUNINDEX_INVALID
public static final long TIMEUTC_INVALID
public static final int RECORDING_OFF
public static final int RECORDING_ON
public static final int RECORDING_PENDING
public static final int RECORDING_INVALID
public static final int AUTOSTART_OFF
public static final int AUTOSTART_ON
public static final int AUTOSTART_INVALID
public static final int BEACONDRIVEN_OFF
public static final int BEACONDRIVEN_ON
public static final int BEACONDRIVEN_INVALID
public static final int CLEARHISTORY_FALSE
public static final int CLEARHISTORY_TRUE
public static final int CLEARHISTORY_INVALID
protected int _currentRunIndex
protected long _timeUTC
protected int _recording
protected int _autoStart
protected int _beaconDriven
protected int _clearHistory
protected YDataLogger.UpdateCallback _valueCallbackDataLogger
protected String _dataLoggerURL
protected YDataLogger(YAPIContext yctx, String func)
func
- : functionidprotected YDataLogger(String func)
public String getData(Integer runIdx, Integer timeIdx) throws YAPI_Exception
YAPI_Exception
public int get_dataStreams(ArrayList<YDataStream> v) throws YAPI_Exception
v
- : an array of YDataStream objects to be filled inYAPI_Exception
- on errorpublic int getDataStreams(ArrayList<YDataStream> v) throws YAPI_Exception
YAPI_Exception
protected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int get_currentRunIndex() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCurrentRunIndex() throws YAPI_Exception
YAPI_Exception
- on errorpublic long get_timeUTC() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getTimeUTC() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_timeUTC(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the current UTC time reference used for recorded dataYAPI_Exception
- on errorpublic int setTimeUTC(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the current UTC time reference used for recorded dataYAPI_Exception
- on errorpublic int get_recording() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getRecording() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_recording(int newval) throws YAPI_Exception
newval
- : a value among YDataLogger.RECORDING_OFF, YDataLogger.RECORDING_ON and
YDataLogger.RECORDING_PENDING corresponding to the activation state of the data logger to
start/stop recording dataYAPI_Exception
- on errorpublic int setRecording(int newval) throws YAPI_Exception
newval
- : a value among Y_RECORDING_OFF, Y_RECORDING_ON and Y_RECORDING_PENDING corresponding
to the activation state of the data logger to start/stop recording dataYAPI_Exception
- on errorpublic int get_autoStart() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getAutoStart() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_autoStart(int newval) throws YAPI_Exception
newval
- : either YDataLogger.AUTOSTART_OFF or YDataLogger.AUTOSTART_ON, according to the
default activation state of the data logger on power upYAPI_Exception
- on errorpublic int setAutoStart(int newval) throws YAPI_Exception
newval
- : either Y_AUTOSTART_OFF or Y_AUTOSTART_ON, according to the default activation state
of the data logger on power upYAPI_Exception
- on errorpublic int get_beaconDriven() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBeaconDriven() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_beaconDriven(int newval) throws YAPI_Exception
newval
- : either YDataLogger.BEACONDRIVEN_OFF or YDataLogger.BEACONDRIVEN_ON, according to
the type of synchronisation of the data loggerYAPI_Exception
- on errorpublic int setBeaconDriven(int newval) throws YAPI_Exception
newval
- : either Y_BEACONDRIVEN_OFF or Y_BEACONDRIVEN_ON, according to the type of
synchronisation of the data loggerYAPI_Exception
- on errorpublic int get_clearHistory() throws YAPI_Exception
YAPI_Exception
public int set_clearHistory(int newval) throws YAPI_Exception
YAPI_Exception
public static YDataLogger FindDataLogger(String func)
func
- : a string that uniquely characterizes the data loggerpublic static YDataLogger FindDataLoggerInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the data loggerpublic int registerValueCallback(YDataLogger.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 forgetAllDataStreams() throws YAPI_Exception
YAPI_Exception
- on errorpublic ArrayList<YDataSet> get_dataSets() throws YAPI_Exception
YAPI_Exception
- on errorpublic ArrayList<YDataSet> parse_dataSets(byte[] json) throws YAPI_Exception
YAPI_Exception
public YDataLogger nextDataLogger()
public static YDataLogger FirstDataLogger()
public static YDataLogger FirstDataLoggerInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2017. All rights reserved.