com.yoctopuce.YoctoAPI
public class YOsControl extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YOsControl.TimedReportCallback
TimedReportCallback for OsControl
|
static interface |
YOsControl.UpdateCallback
Deprecated UpdateCallback for OsControl
|
Modifier and Type | Field and Description |
---|---|
protected int |
_shutdownCountdown |
protected YOsControl.UpdateCallback |
_valueCallbackOsControl |
static int |
SHUTDOWNCOUNTDOWN_INVALID
invalid shutdownCountdown 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 |
YOsControl(String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
static YOsControl |
FindOsControl(String func)
Retrieves OS control for a given identifier.
|
static YOsControl |
FirstOsControl()
Starts the enumeration of OS control currently accessible.
|
int |
get_shutdownCountdown()
Returns the remaining number of seconds before the OS shutdown, or zero when no
shutdown has been scheduled.
|
int |
getShutdownCountdown()
Returns the remaining number of seconds before the OS shutdown, or zero when no
shutdown has been scheduled.
|
YOsControl |
nextOsControl()
Continues the enumeration of OS control started using yFirstOsControl().
|
int |
registerValueCallback(YOsControl.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_shutdownCountdown(int newval) |
int |
setShutdownCountdown(int newval) |
int |
shutdown(int secBeforeShutDown)
Schedules an OS shutdown after a given number of seconds.
|
_AddToCache, _devRequest, _download, _escapeAttr, _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 int SHUTDOWNCOUNTDOWN_INVALID
protected int _shutdownCountdown
protected YOsControl.UpdateCallback _valueCallbackOsControl
protected YOsControl(String func)
func
- : functionidprotected void _parseAttr(org.json.JSONObject json_val) throws org.json.JSONException
_parseAttr
in class YFunction
org.json.JSONException
public int get_shutdownCountdown() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getShutdownCountdown() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_shutdownCountdown(int newval) throws YAPI_Exception
YAPI_Exception
public int setShutdownCountdown(int newval) throws YAPI_Exception
YAPI_Exception
public static YOsControl FindOsControl(String func)
func
- : a string that uniquely characterizes the OS controlpublic int registerValueCallback(YOsControl.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 shutdown(int secBeforeShutDown) throws YAPI_Exception
secBeforeShutDown
- : number of seconds before shutdownYAPI_Exception
- on errorpublic YOsControl nextOsControl()
public static YOsControl FirstOsControl()
Copyright © 2014. All rights reserved.