public class YRealTimeClock extends YFunction
| Modifier and Type | Class and Description |
|---|---|
static interface |
YRealTimeClock.TimedReportCallback
TimedReportCallback for RealTimeClock
|
static interface |
YRealTimeClock.UpdateCallback
Deprecated UpdateCallback for RealTimeClock
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
_dateTime |
protected int |
_disableHostSync |
protected int |
_timeSet |
protected long |
_unixTime |
protected int |
_utcOffset |
protected YRealTimeClock.UpdateCallback |
_valueCallbackRealTimeClock |
static String |
DATETIME_INVALID
invalid dateTime value
|
static int |
DISABLEHOSTSYNC_FALSE
invalid disableHostSync value
|
static int |
DISABLEHOSTSYNC_INVALID |
static int |
DISABLEHOSTSYNC_TRUE |
static int |
TIMESET_FALSE
invalid timeSet value
|
static int |
TIMESET_INVALID |
static int |
TIMESET_TRUE |
static long |
UNIXTIME_INVALID
invalid unixTime value
|
static int |
UTCOFFSET_INVALID
invalid utcOffset 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 |
YRealTimeClock(String func) |
protected |
YRealTimeClock(YAPIContext ctx,
String func) |
| Modifier and Type | Method and Description |
|---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YRealTimeClock |
FindRealTimeClock(String func)
Retrieves a real-time clock for a given identifier.
|
static YRealTimeClock |
FindRealTimeClockInContext(YAPIContext yctx,
String func)
Retrieves a real-time clock for a given identifier in a YAPI context.
|
static YRealTimeClock |
FirstRealTimeClock()
Starts the enumeration of real-time clocks currently accessible.
|
static YRealTimeClock |
FirstRealTimeClockInContext(YAPIContext yctx)
Starts the enumeration of real-time clocks currently accessible.
|
String |
get_dateTime()
Returns the current time in the form "YYYY/MM/DD hh:mm:ss".
|
int |
get_disableHostSync()
Returns true if the automatic clock synchronization with host has been disabled,
and false otherwise.
|
int |
get_timeSet()
Returns true if the clock has been set, and false otherwise.
|
long |
get_unixTime()
Returns the current time in Unix format (number of elapsed seconds since Jan 1st, 1970).
|
int |
get_utcOffset()
Returns the number of seconds between current time and UTC time (time zone).
|
String |
getDateTime()
Returns the current time in the form "YYYY/MM/DD hh:mm:ss".
|
int |
getDisableHostSync()
Returns true if the automatic clock synchronization with host has been disabled,
and false otherwise.
|
int |
getTimeSet()
Returns true if the clock has been set, and false otherwise.
|
long |
getUnixTime()
Returns the current time in Unix format (number of elapsed seconds since Jan 1st, 1970).
|
int |
getUtcOffset()
Returns the number of seconds between current time and UTC time (time zone).
|
YRealTimeClock |
nextRealTimeClock()
Continues the enumeration of real-time clocks started using yFirstRealTimeClock().
|
int |
registerValueCallback(YRealTimeClock.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_disableHostSync(int newval)
Changes the automatic clock synchronization with host working state.
|
int |
set_unixTime(long newval)
Changes the current time.
|
int |
set_utcOffset(int newval)
Changes the number of seconds between current time and UTC time (time zone).
|
int |
setDisableHostSync(int newval)
Changes the automatic clock synchronization with host working state.
|
int |
setUnixTime(long newval)
Changes the current time.
|
int |
setUtcOffset(int newval)
Changes the number of seconds between current time and UTC time (time zone).
|
_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, _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, userDatapublic static final long UNIXTIME_INVALID
public static final String DATETIME_INVALID
public static final int UTCOFFSET_INVALID
public static final int TIMESET_FALSE
public static final int TIMESET_TRUE
public static final int TIMESET_INVALID
public static final int DISABLEHOSTSYNC_FALSE
public static final int DISABLEHOSTSYNC_TRUE
public static final int DISABLEHOSTSYNC_INVALID
protected long _unixTime
protected String _dateTime
protected int _utcOffset
protected int _timeSet
protected int _disableHostSync
protected YRealTimeClock.UpdateCallback _valueCallbackRealTimeClock
protected YRealTimeClock(YAPIContext ctx, String func)
func - : functionidprotected YRealTimeClock(String func)
func - : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val)
throws Exception
_parseAttr in class YFunctionExceptionpublic long get_unixTime()
throws YAPI_Exception
YAPI_Exception - on errorpublic long getUnixTime()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_unixTime(long newval)
throws YAPI_Exception
newval - : an integer corresponding to the current timeYAPI_Exception - on errorpublic int setUnixTime(long newval)
throws YAPI_Exception
newval - : an integer corresponding to the current timeYAPI_Exception - on errorpublic String get_dateTime() throws YAPI_Exception
YAPI_Exception - on errorpublic String getDateTime() throws YAPI_Exception
YAPI_Exception - on errorpublic int get_utcOffset()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getUtcOffset()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_utcOffset(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the number of seconds between current time and UTC time (time zone)YAPI_Exception - on errorpublic int setUtcOffset(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the number of seconds between current time and UTC time (time zone)YAPI_Exception - on errorpublic int get_timeSet()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getTimeSet()
throws YAPI_Exception
YAPI_Exception - on errorpublic int get_disableHostSync()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getDisableHostSync()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_disableHostSync(int newval)
throws YAPI_Exception
newval - : either YRealTimeClock.DISABLEHOSTSYNC_FALSE or YRealTimeClock.DISABLEHOSTSYNC_TRUE,
according to the automatic clock synchronization with host working stateYAPI_Exception - on errorpublic int setDisableHostSync(int newval)
throws YAPI_Exception
newval - : either YRealTimeClock.DISABLEHOSTSYNC_FALSE or YRealTimeClock.DISABLEHOSTSYNC_TRUE,
according to the automatic clock synchronization with host working stateYAPI_Exception - on errorpublic static YRealTimeClock FindRealTimeClock(String func)
func - : a string that uniquely characterizes the real-time clock, for instance
YHUBGSM5.realTimeClock.public static YRealTimeClock FindRealTimeClockInContext(YAPIContext yctx, String func)
yctx - : a YAPI contextfunc - : a string that uniquely characterizes the real-time clock, for instance
YHUBGSM5.realTimeClock.public int registerValueCallback(YRealTimeClock.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 YFunctionpublic YRealTimeClock nextRealTimeClock()
public static YRealTimeClock FirstRealTimeClock()
public static YRealTimeClock FirstRealTimeClockInContext(YAPIContext yctx)
yctx - : a YAPI context.Copyright © 2026. All rights reserved.