|
virtual int | _invokeValueCallback (string value) |
|
int | baudRate (void) |
|
Y_ENABLED_enum | enabled (void) |
|
int | get_baudRate (void) |
|
Y_ENABLED_enum | get_enabled (void) |
|
Y_PORTSTATE_enum | get_portState (void) |
|
YHubPort * | next (void) |
|
YHubPort * | nextHubPort (void) |
|
Y_PORTSTATE_enum | portState (void) |
|
virtual int | registerValueCallback (YHubPortValueCallback callback) |
|
int | set_enabled (Y_ENABLED_enum newval) |
|
int | setEnabled (Y_ENABLED_enum newval) |
|
| ~YHubPort () |
|
void | _clearDataStreamCache () |
|
string | _decode_json_string (const string &json) |
|
string | _download (const string &url) |
|
YDataStream * | _findDataStream (YDataSet &dataset, const string &def) |
|
string | _get_json_path (const string &json, const string &path) |
|
vector< string > | _json_get_array (const string &json) |
|
string | _json_get_key (const string &json, const string &data) |
|
string | _json_get_string (const string &json) |
|
int | _parseEx (yJsonStateMachine &j) |
|
virtual int | _parserHelper (void) |
|
string | _parseString (yJsonStateMachine &j) |
|
string | _request (const string &request) |
|
string | _requestEx (int tcpchan, const string &request, yapiRequestProgressCallback callback, void *context) |
|
void | _throw (YRETCODE errType, string errMsg) |
|
YRETCODE | _upload (const string &path, const string &content) |
|
YRETCODE | _uploadWithProgress (const string &path, const string &content, yapiRequestProgressCallback callback, void *context) |
|
string | advertisedValue (void) |
|
void | clearCache () |
|
string | describe (void) |
|
string | errMessage (void) |
|
string | errorMessage (void) |
|
YRETCODE | errorType (void) |
|
YRETCODE | errType (void) |
|
YFUN_DESCR | functionDescriptor (void) |
|
string | get_advertisedValue (void) |
|
string | get_errorMessage (void) |
|
YRETCODE | get_errorType (void) |
|
virtual string | get_friendlyName (void) |
|
YFUN_DESCR | get_functionDescriptor (void) |
|
string | get_functionId (void) |
|
string | get_hardwareId (void) |
|
string | get_hubSerial () |
|
string | get_logicalName (void) |
|
YModule * | get_module (void) |
|
void * | get_userData (void) |
|
bool | isOnline (void) |
|
YRETCODE | load (int msValidity) |
|
virtual string | loadAttribute (string attrName) |
|
string | logicalName (void) |
|
YModule * | module (void) |
|
virtual int | muteValueCallbacks (void) |
|
YFunction * | next (void) |
|
YFunction * | nextFunction (void) |
|
virtual int | registerValueCallback (YFunctionValueCallback callback) |
|
int | set_advertisedValue (const string &newval) |
|
int | set_logicalName (const string &newval) |
|
void | set_userData (void *data) |
|
int | setAdvertisedValue (const string &newval) |
|
int | setLogicalName (const string &newval) |
|
void | setUserData (void *data) |
|
virtual int | unmuteValueCallbacks (void) |
|
void * | userData (void) |
|
virtual | ~YFunction () |
|
YHubPort Class: Yocto-hub port interface
YHubPort objects provide control over the power supply for every YoctoHub port and provide information about the device connected to it. The logical name of a YHubPort is always automatically set to the unique serial number of the Yoctopuce device connected to it.
Definition at line 89 of file yocto_hubport.h.
YHubPort * YHubPort::FindHubPort |
( |
string |
func | ) |
|
|
static |
Retrieves a Yocto-hub port for a given identifier. The identifier can be specified using several formats:
-
FunctionLogicalName
-
ModuleSerialNumber.FunctionIdentifier
-
ModuleSerialNumber.FunctionLogicalName
-
ModuleLogicalName.FunctionIdentifier
-
ModuleLogicalName.FunctionLogicalName
This function does not require that the Yocto-hub port is online at the time it is invoked. The returned object is nevertheless valid. Use the method YHubPort.isOnline() to test if the Yocto-hub port is indeed online at a given time. In case of ambiguity when looking for a Yocto-hub port by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
- Parameters
-
func | : a string that uniquely characterizes the Yocto-hub port |
- Returns
- a YHubPort object allowing you to drive the Yocto-hub port.
Definition at line 229 of file yocto_hubport.cpp.
int YHubPort::get_baudRate |
( |
void |
| ) |
|
Returns the current baud rate used by this Yocto-hub port, in kbps. The default value is 1000 kbps, but a slower rate may be used if communication problems are encountered.
- Returns
- an integer corresponding to the current baud rate used by this Yocto-hub port, in kbps
On failure, throws an exception or returns Y_BAUDRATE_INVALID.
Definition at line 180 of file yocto_hubport.cpp.
YHubPort* yFindHubPort |
( |
const string & |
func | ) |
|
|
friend |
Retrieves a Yocto-hub port for a given identifier. The identifier can be specified using several formats:
-
FunctionLogicalName
-
ModuleSerialNumber.FunctionIdentifier
-
ModuleSerialNumber.FunctionLogicalName
-
ModuleLogicalName.FunctionIdentifier
-
ModuleLogicalName.FunctionLogicalName
This function does not require that the Yocto-hub port is online at the time it is invoked. The returned object is nevertheless valid. Use the method YHubPort.isOnline() to test if the Yocto-hub port is indeed online at a given time. In case of ambiguity when looking for a Yocto-hub port by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
- Parameters
-
func | : a string that uniquely characterizes the Yocto-hub port |
- Returns
- a YHubPort object allowing you to drive the Yocto-hub port.
Definition at line 288 of file yocto_hubport.h.