com.yoctopuce.YoctoAPI
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 |
_timeSet |
protected long |
_unixTime |
protected int |
_utcOffset |
protected YRealTimeClock.UpdateCallback |
_valueCallbackRealTimeClock |
static String |
DATETIME_INVALID
invalid dateTime value
|
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, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YRealTimeClock(String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
static YRealTimeClock |
FindRealTimeClock(String func)
Retrieves a clock for a given identifier.
|
static YRealTimeClock |
FirstRealTimeClock()
Starts the enumeration of clocks currently accessible.
|
String |
get_dateTime()
Returns the current time in the form "YYYY/MM/DD hh:mm:ss"
|
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 |
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 clocks started using yFirstRealTimeClock().
|
int |
registerValueCallback(YRealTimeClock.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
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 |
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, _devRequest, _download, _FindFromCache, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, describe, errMessage, errorMessage, errorType, errType, FindFunction, FirstFunction, 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, module, nextFunction, registerValueCallback, set_logicalName, set_userData, setLogicalName, setUserData, toString, userData
public 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
protected long _unixTime
protected String _dateTime
protected int _utcOffset
protected int _timeSet
protected YRealTimeClock.UpdateCallback _valueCallbackRealTimeClock
protected YRealTimeClock(String func)
func
- : functionidprotected void _parseAttr(org.json.JSONObject json_val) throws org.json.JSONException
_parseAttr
in class YFunction
org.json.JSONException
public 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 static YRealTimeClock FindRealTimeClock(String func)
func
- : a string that uniquely characterizes the clockpublic 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 YFunction
public YRealTimeClock nextRealTimeClock()
public static YRealTimeClock FirstRealTimeClock()
Copyright © 2014. All rights reserved.