|
virtual int | _invokeValueCallback (string value) |
|
virtual int | adhocNetwork (string ssid, string securityKey) |
|
int | channel (void) |
|
int | get_channel (void) |
|
virtual vector< YWlanRecord > | get_detectedWlans (void) |
|
int | get_linkQuality (void) |
|
string | get_message (void) |
|
Y_SECURITY_enum | get_security (void) |
|
string | get_ssid (void) |
|
string | get_wlanConfig (void) |
|
Y_WLANSTATE_enum | get_wlanState (void) |
|
virtual int | joinNetwork (string ssid, string securityKey) |
|
int | linkQuality (void) |
|
string | message (void) |
|
YWireless * | next (void) |
|
YWireless * | nextWireless (void) |
|
virtual int | registerValueCallback (YWirelessValueCallback callback) |
|
Y_SECURITY_enum | security (void) |
|
int | set_wlanConfig (const string &newval) |
|
int | setWlanConfig (const string &newval) |
|
virtual int | softAPNetwork (string ssid, string securityKey) |
|
string | ssid (void) |
|
virtual int | startWlanScan (void) |
|
string | wlanConfig (void) |
|
Y_WLANSTATE_enum | wlanState (void) |
|
| ~YWireless () |
|
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 () |
|
|
YRETCODE | _buildSetRequest (const string &changeattr, const string *changeval, string &request, string &errmsg) |
|
string | _escapeAttr (const string &changeval) |
|
YRETCODE | _getDescriptor (YFUN_DESCR &fundescr, string &errMsg) |
|
YRETCODE | _getDevice (YDevice *&dev, string &errMsg) |
|
YRETCODE | _load_unsafe (int msValidity) |
|
YRETCODE | _nextFunction (string &hwId) |
|
int | _parse (YJSONObject *j) |
|
YRETCODE | _setAttr (string attrname, string newvalue) |
|
| YFunction (const string &func) |
|
static void | _AddToCache (const string &classname, const string &func, YFunction *obj) |
|
static YFunction * | _FindFromCache (const string &classname, const string &func) |
|
static void | _UpdateTimedReportCallbackList (YFunction *func, bool add) |
|
static void | _UpdateValueCallbackList (YFunction *func, bool add) |
|
string | _advertisedValue |
|
u64 | _cacheExpiration |
|
string | _className |
|
std::map< string, YDataStream * > | _dataStreams |
|
string | _func |
|
YFUN_DESCR | _fundescr |
|
string | _funId |
|
string | _hwId |
|
string | _lastErrorMsg |
|
YRETCODE | _lastErrorType |
|
string | _logicalName |
|
string | _serial |
|
yCRITICAL_SECTION | _this_cs |
|
void * | _userData |
|
YFunctionValueCallback | _valueCallbackFunction |
|
static std::map< string, YFunction * > | _cache |
|
YWireless Class: Wireless function interface
YWireless functions provides control over wireless network parameters and status for devices that are wireless-enabled.
Definition at line 137 of file yocto_wireless.h.
int YWireless::adhocNetwork |
( |
string |
ssid, |
|
|
string |
securityKey |
|
) |
| |
|
virtual |
Changes the configuration of the wireless lan interface to create an ad-hoc wireless network, without using an access point. On the YoctoHub-Wireless-g, it is best to use softAPNetworkInstead(), which emulates an access point (Soft AP) which is more efficient and more widely supported than ad-hoc networks.
When a security key is specified for an ad-hoc network, the network is protected by a WEP40 key (5 characters or 10 hexadecimal digits) or WEP128 key (13 characters or 26 hexadecimal digits). It is recommended to use a well-randomized WEP128 key using 26 hexadecimal digits to maximize security. Remember to call the saveToFlash() method and then to reboot the module to apply this setting.
- Parameters
-
ssid | : the name of the network to connect to |
securityKey | : the network key, as a character string |
- Returns
- YAPI_SUCCESS when the call succeeds.
On failure, throws an exception or returns a negative error code.
Definition at line 550 of file yocto_wireless.cpp.
YWireless * YWireless::FindWireless |
( |
string |
func | ) |
|
|
static |
Retrieves a wireless lan interface 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 wireless lan interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method YWireless.isOnline() to test if the wireless lan interface is indeed online at a given time. In case of ambiguity when looking for a wireless lan interface 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 wireless lan interface |
- Returns
- a YWireless object allowing you to drive the wireless lan interface.
Definition at line 434 of file yocto_wireless.cpp.
vector< YWlanRecord > YWireless::get_detectedWlans |
( |
void |
| ) |
|
|
virtual |
Returns a list of YWlanRecord objects that describe detected Wireless networks. This list is not updated when the module is already connected to an acces point (infrastructure mode). To force an update of this list, startWlanScan() must be called. Note that an languages without garbage collections, the returned list must be freed by the caller.
- Returns
- a list of YWlanRecord objects, containing the SSID, channel, link quality and the type of security of the wireless network.
On failure, throws an exception or returns an empty list.
Definition at line 589 of file yocto_wireless.cpp.
Returns the current state of the wireless interface. The state Y_WLANSTATE_DOWN means that the network interface is not connected to a network. The state Y_WLANSTATE_SCANNING means that the network interface is scanning available frequencies. During this stage, the device is not reachable, and the network settings are not yet applied. The state Y_WLANSTATE_CONNECTED means that the network settings have been successfully applied ant that the device is reachable from the wireless network. If the device is configured to use ad-hoc or Soft AP mode, it means that the wireless network is up and that other devices can join the network. The state Y_WLANSTATE_REJECTED means that the network interface has not been able to join the requested network. The description of the error can be obtain with the get_message() method.
- Returns
- a value among Y_WLANSTATE_DOWN, Y_WLANSTATE_SCANNING, Y_WLANSTATE_CONNECTED and Y_WLANSTATE_REJECTED corresponding to the current state of the wireless interface
On failure, throws an exception or returns Y_WLANSTATE_INVALID.
Definition at line 385 of file yocto_wireless.cpp.
int YWireless::softAPNetwork |
( |
string |
ssid, |
|
|
string |
securityKey |
|
) |
| |
|
virtual |
Changes the configuration of the wireless lan interface to create a new wireless network by emulating a WiFi access point (Soft AP). This function can only be used with the YoctoHub-Wireless-g.
When a security key is specified for a SoftAP network, the network is protected by a WEP40 key (5 characters or 10 hexadecimal digits) or WEP128 key (13 characters or 26 hexadecimal digits). It is recommended to use a well-randomized WEP128 key using 26 hexadecimal digits to maximize security. Remember to call the saveToFlash() method and then to reboot the module to apply this setting.
- Parameters
-
ssid | : the name of the network to connect to |
securityKey | : the network key, as a character string |
- Returns
- YAPI_SUCCESS when the call succeeds.
On failure, throws an exception or returns a negative error code.
Definition at line 573 of file yocto_wireless.cpp.
int YWireless::startWlanScan |
( |
void |
| ) |
|
|
virtual |
Triggers a scan of the wireless frequency and builds the list of available networks. The scan forces a disconnection from the current network. At then end of the process, the the network interface attempts to reconnect to the previous network. During the scan, the wlanState switches to Y_WLANSTATE_DOWN, then to Y_WLANSTATE_SCANNING. When the scan is completed, get_wlanState() returns either Y_WLANSTATE_DOWN or Y_WLANSTATE_SCANNING. At this point, the list of detected network can be retrieved with the get_detectedWlans() method.
On failure, throws an exception or returns a negative error code.
Definition at line 505 of file yocto_wireless.cpp.
YWireless* yFindWireless |
( |
const string & |
func | ) |
|
|
friend |
Retrieves a wireless lan interface 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 wireless lan interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method YWireless.isOnline() to test if the wireless lan interface is indeed online at a given time. In case of ambiguity when looking for a wireless lan interface 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 wireless lan interface |
- Returns
- a YWireless object allowing you to drive the wireless lan interface.
Definition at line 471 of file yocto_wireless.h.