com.yoctopuce.YoctoAPI
public class YHubPort extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YHubPort.TimedReportCallback
TimedReportCallback for HubPort
|
static interface |
YHubPort.UpdateCallback
Deprecated UpdateCallback for HubPort
|
Modifier and Type | Field and Description |
---|---|
protected int |
_baudRate |
protected int |
_enabled |
protected int |
_portState |
protected YHubPort.UpdateCallback |
_valueCallbackHubPort |
static int |
BAUDRATE_INVALID
invalid baudRate value
|
static int |
ENABLED_FALSE
invalid enabled value
|
static int |
ENABLED_INVALID |
static int |
ENABLED_TRUE |
static int |
PORTSTATE_INVALID |
static int |
PORTSTATE_OFF
invalid portState value
|
static int |
PORTSTATE_ON |
static int |
PORTSTATE_OVRLD |
static int |
PORTSTATE_PROG |
static int |
PORTSTATE_RUN |
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YHubPort(String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
static YHubPort |
FindHubPort(String func)
Retrieves a Yocto-hub port for a given identifier.
|
static YHubPort |
FirstHubPort()
Starts the enumeration of Yocto-hub ports currently accessible.
|
int |
get_baudRate()
Returns the current baud rate used by this Yocto-hub port, in kbps.
|
int |
get_enabled()
Returns true if the Yocto-hub port is powered, false otherwise.
|
int |
get_portState()
Returns the current state of the Yocto-hub port.
|
int |
getBaudRate()
Returns the current baud rate used by this Yocto-hub port, in kbps.
|
int |
getEnabled()
Returns true if the Yocto-hub port is powered, false otherwise.
|
int |
getPortState()
Returns the current state of the Yocto-hub port.
|
YHubPort |
nextHubPort()
Continues the enumeration of Yocto-hub ports started using yFirstHubPort().
|
int |
registerValueCallback(YHubPort.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_enabled(int newval)
Changes the activation of the Yocto-hub port.
|
int |
setEnabled(int newval)
Changes the activation of the Yocto-hub port.
|
_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 int ENABLED_FALSE
public static final int ENABLED_TRUE
public static final int ENABLED_INVALID
public static final int PORTSTATE_OFF
public static final int PORTSTATE_OVRLD
public static final int PORTSTATE_ON
public static final int PORTSTATE_RUN
public static final int PORTSTATE_PROG
public static final int PORTSTATE_INVALID
public static final int BAUDRATE_INVALID
protected int _enabled
protected int _portState
protected int _baudRate
protected YHubPort.UpdateCallback _valueCallbackHubPort
protected YHubPort(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_enabled() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getEnabled() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_enabled(int newval) throws YAPI_Exception
newval
- : either YHubPort.ENABLED_FALSE or YHubPort.ENABLED_TRUE, according to the activation
of the Yocto-hub portYAPI_Exception
- on errorpublic int setEnabled(int newval) throws YAPI_Exception
newval
- : either Y_ENABLED_FALSE or Y_ENABLED_TRUE, according to the activation of the Yocto-hub portYAPI_Exception
- on errorpublic int get_portState() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getPortState() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_baudRate() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBaudRate() throws YAPI_Exception
YAPI_Exception
- on errorpublic static YHubPort FindHubPort(String func)
func
- : a string that uniquely characterizes the Yocto-hub portpublic int registerValueCallback(YHubPort.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 YHubPort nextHubPort()
public static YHubPort FirstHubPort()
Copyright © 2014. All rights reserved.