#include <yocto_network.h>
Public Member Functions | |
virtual int | _invokeValueCallback (string value) |
string | adminPassword (void) |
string | callbackCredentials (void) |
Y_CALLBACKENCODING_enum | callbackEncoding (void) |
int | callbackInitialDelay (void) |
int | callbackLogin (string username, string password) |
int | callbackMaxDelay (void) |
Y_CALLBACKMETHOD_enum | callbackMethod (void) |
int | callbackMinDelay (void) |
string | callbackSchedule (void) |
string | callbackUrl (void) |
string | defaultPage (void) |
Y_DISCOVERABLE_enum | discoverable (void) |
string | get_adminPassword (void) |
string | get_callbackCredentials (void) |
Y_CALLBACKENCODING_enum | get_callbackEncoding (void) |
int | get_callbackInitialDelay (void) |
int | get_callbackMaxDelay (void) |
Y_CALLBACKMETHOD_enum | get_callbackMethod (void) |
int | get_callbackMinDelay (void) |
string | get_callbackSchedule (void) |
string | get_callbackUrl (void) |
string | get_defaultPage (void) |
Y_DISCOVERABLE_enum | get_discoverable (void) |
int | get_httpPort (void) |
string | get_ipAddress (void) |
string | get_ipConfig (void) |
string | get_macAddress (void) |
string | get_ntpServer (void) |
int | get_poeCurrent (void) |
string | get_primaryDNS (void) |
Y_READINESS_enum | get_readiness (void) |
string | get_router (void) |
string | get_secondaryDNS (void) |
string | get_subnetMask (void) |
string | get_userPassword (void) |
int | get_wwwWatchdogDelay (void) |
int | httpPort (void) |
string | ipAddress (void) |
string | ipConfig (void) |
string | macAddress (void) |
YNetwork * | next (void) |
YNetwork * | nextNetwork (void) |
string | ntpServer (void) |
virtual string | ping (string host) |
int | poeCurrent (void) |
string | primaryDNS (void) |
Y_READINESS_enum | readiness (void) |
virtual int | registerValueCallback (YNetworkValueCallback callback) |
string | router (void) |
string | secondaryDNS (void) |
int | set_adminPassword (const string &newval) |
int | set_callbackCredentials (const string &newval) |
int | set_callbackEncoding (Y_CALLBACKENCODING_enum newval) |
int | set_callbackInitialDelay (int newval) |
int | set_callbackMaxDelay (int newval) |
int | set_callbackMethod (Y_CALLBACKMETHOD_enum newval) |
int | set_callbackMinDelay (int newval) |
int | set_callbackSchedule (const string &newval) |
int | set_callbackUrl (const string &newval) |
int | set_defaultPage (const string &newval) |
int | set_discoverable (Y_DISCOVERABLE_enum newval) |
int | set_httpPort (int newval) |
int | set_ipConfig (const string &newval) |
int | set_ntpServer (const string &newval) |
virtual int | set_periodicCallbackSchedule (string interval, int offset) |
int | set_primaryDNS (const string &newval) |
int | set_secondaryDNS (const string &newval) |
int | set_userPassword (const string &newval) |
int | set_wwwWatchdogDelay (int newval) |
int | setAdminPassword (const string &newval) |
int | setCallbackCredentials (const string &newval) |
int | setCallbackEncoding (Y_CALLBACKENCODING_enum newval) |
int | setCallbackInitialDelay (int newval) |
int | setCallbackMaxDelay (int newval) |
int | setCallbackMethod (Y_CALLBACKMETHOD_enum newval) |
int | setCallbackMinDelay (int newval) |
int | setCallbackSchedule (const string &newval) |
int | setCallbackUrl (const string &newval) |
int | setDefaultPage (const string &newval) |
int | setDiscoverable (Y_DISCOVERABLE_enum newval) |
int | setHttpPort (int newval) |
int | setIpConfig (const string &newval) |
int | setNtpServer (const string &newval) |
int | setPrimaryDNS (const string &newval) |
int | setSecondaryDNS (const string &newval) |
int | setUserPassword (const string &newval) |
int | setWwwWatchdogDelay (int newval) |
string | subnetMask (void) |
virtual int | triggerCallback (void) |
virtual int | useDHCP (string fallbackIpAddr, int fallbackSubnetMaskLen, string fallbackRouter) |
virtual int | useDHCPauto (void) |
string | userPassword (void) |
virtual int | useStaticIP (string ipAddress, int subnetMaskLen, string router) |
int | wwwWatchdogDelay (void) |
~YNetwork () | |
Public Member Functions inherited from YFunction | |
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 () |
Static Public Member Functions | |
static YNetwork * | Find (string func) |
static YNetwork * | FindNetwork (string func) |
static YNetwork * | First (void) |
static YNetwork * | FirstNetwork (void) |
Static Public Member Functions inherited from YFunction | |
static void | _ClearCache (void) |
static YFunction * | Find (string func) |
static YFunction * | FindFunction (string func) |
static YFunction * | First (void) |
static YFunction * | FirstFunction (void) |
Protected Member Functions | |
virtual int | _parseAttr (YJSONObject *json_val) |
YNetwork (const string &func) | |
Protected Member Functions inherited from 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) | |
Protected Attributes | |
string | _adminPassword |
string | _callbackCredentials |
Y_CALLBACKENCODING_enum | _callbackEncoding |
int | _callbackInitialDelay |
int | _callbackMaxDelay |
Y_CALLBACKMETHOD_enum | _callbackMethod |
int | _callbackMinDelay |
string | _callbackSchedule |
string | _callbackUrl |
string | _defaultPage |
Y_DISCOVERABLE_enum | _discoverable |
int | _httpPort |
string | _ipAddress |
string | _ipConfig |
string | _macAddress |
string | _ntpServer |
int | _poeCurrent |
string | _primaryDNS |
Y_READINESS_enum | _readiness |
string | _router |
string | _secondaryDNS |
string | _subnetMask |
string | _userPassword |
YNetworkValueCallback | _valueCallbackNetwork |
int | _wwwWatchdogDelay |
Protected Attributes inherited from YFunction | |
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 |
Friends | |
YNetwork * | yFindNetwork (const string &func) |
YNetwork * | yFirstNetwork (void) |
Additional Inherited Members | |
Static Protected Member Functions inherited from YFunction | |
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) |
Static Protected Attributes inherited from YFunction | |
static std::map< string, YFunction * > | _cache |
YNetwork Class: Network function interface
YNetwork objects provide access to TCP/IP parameters of Yoctopuce modules that include a built-in network interface.
Definition at line 129 of file yocto_network.h.
|
protected |
Definition at line 51 of file yocto_network.cpp.
YNetwork::~YNetwork | ( | ) |
Definition at line 83 of file yocto_network.cpp.
|
virtual |
Reimplemented from YFunction.
Definition at line 1516 of file yocto_network.cpp.
|
protectedvirtual |
Reimplemented from YFunction.
Definition at line 105 of file yocto_network.cpp.
|
inline |
Definition at line 449 of file yocto_network.h.
|
inline |
Definition at line 685 of file yocto_network.h.
|
inline |
Definition at line 654 of file yocto_network.h.
|
inline |
Definition at line 733 of file yocto_network.h.
int YNetwork::callbackLogin | ( | string | username, |
string | password | ||
) |
Connects to the notification callback and saves the credentials required to log into it. The password is not stored into the module, only a hashed copy of the credentials are saved. Remember to call the saveToFlash() method of the module if the modification must be kept.
username | : username required to log to the callback |
password | : password required to log to the callback |
On failure, throws an exception or returns a negative error code.
Definition at line 1181 of file yocto_network.cpp.
|
inline |
Definition at line 809 of file yocto_network.h.
|
inline |
Definition at line 624 of file yocto_network.h.
|
inline |
Definition at line 784 of file yocto_network.h.
|
inline |
Definition at line 759 of file yocto_network.h.
|
inline |
Definition at line 597 of file yocto_network.h.
|
inline |
Definition at line 505 of file yocto_network.h.
|
inline |
Definition at line 535 of file yocto_network.h.
|
inlinestatic |
Definition at line 968 of file yocto_network.h.
|
static |
Retrieves a network interface for a given identifier. The identifier can be specified using several formats:
This function does not require that the network interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method YNetwork.isOnline() to test if the network interface is indeed online at a given time. In case of ambiguity when looking for a network 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.
func | : a string that uniquely characterizes the network interface |
Definition at line 1465 of file yocto_network.cpp.
|
inlinestatic |
Definition at line 992 of file yocto_network.h.
|
static |
Starts the enumeration of network interfaces currently accessible. Use the method YNetwork.nextNetwork() to iterate on next network interfaces.
Definition at line 1638 of file yocto_network.cpp.
string YNetwork::get_adminPassword | ( | void | ) |
Returns a hash string if a password has been set for user "admin", or an empty string otherwise.
On failure, throws an exception or returns Y_ADMINPASSWORD_INVALID.
Definition at line 641 of file yocto_network.cpp.
string YNetwork::get_callbackCredentials | ( | void | ) |
Returns a hashed version of the notification callback credentials if set, or an empty string otherwise.
On failure, throws an exception or returns Y_CALLBACKCREDENTIALS_INVALID.
Definition at line 1113 of file yocto_network.cpp.
Y_CALLBACKENCODING_enum YNetwork::get_callbackEncoding | ( | void | ) |
Returns the encoding standard to use for representing notification values.
On failure, throws an exception or returns Y_CALLBACKENCODING_INVALID.
Definition at line 1053 of file yocto_network.cpp.
int YNetwork::get_callbackInitialDelay | ( | void | ) |
Returns the initial waiting time before first callback notifications, in seconds.
On failure, throws an exception or returns Y_CALLBACKINITIALDELAY_INVALID.
Definition at line 1195 of file yocto_network.cpp.
int YNetwork::get_callbackMaxDelay | ( | void | ) |
Returns the waiting time between two HTTP callbacks when there is nothing new.
On failure, throws an exception or returns Y_CALLBACKMAXDELAY_INVALID.
Definition at line 1358 of file yocto_network.cpp.
Y_CALLBACKMETHOD_enum YNetwork::get_callbackMethod | ( | void | ) |
Returns the HTTP method used to notify callbacks for significant state changes.
On failure, throws an exception or returns Y_CALLBACKMETHOD_INVALID.
Definition at line 994 of file yocto_network.cpp.
int YNetwork::get_callbackMinDelay | ( | void | ) |
Returns the minimum waiting time between two HTTP callbacks, in seconds.
On failure, throws an exception or returns Y_CALLBACKMINDELAY_INVALID.
Definition at line 1304 of file yocto_network.cpp.
string YNetwork::get_callbackSchedule | ( | void | ) |
Returns the HTTP callback schedule strategy, as a text string.
On failure, throws an exception or returns Y_CALLBACKSCHEDULE_INVALID.
Definition at line 1250 of file yocto_network.cpp.
string YNetwork::get_callbackUrl | ( | void | ) |
Returns the callback URL to notify of significant state changes.
On failure, throws an exception or returns Y_CALLBACKURL_INVALID.
Definition at line 938 of file yocto_network.cpp.
string YNetwork::get_defaultPage | ( | void | ) |
Returns the HTML page to serve for the URL "/"" of the hub.
On failure, throws an exception or returns Y_DEFAULTPAGE_INVALID.
Definition at line 759 of file yocto_network.cpp.
Y_DISCOVERABLE_enum YNetwork::get_discoverable | ( | void | ) |
Returns the activation state of the multicast announce protocols to allow easy discovery of the module in the network neighborhood (uPnP/Bonjour protocol).
On failure, throws an exception or returns Y_DISCOVERABLE_INVALID.
Definition at line 818 of file yocto_network.cpp.
int YNetwork::get_httpPort | ( | void | ) |
Returns the HTML page to serve for the URL "/"" of the hub.
On failure, throws an exception or returns Y_HTTPPORT_INVALID.
Definition at line 703 of file yocto_network.cpp.
string YNetwork::get_ipAddress | ( | void | ) |
Returns the IP address currently in use by the device. The address may have been configured statically, or provided by a DHCP server.
On failure, throws an exception or returns Y_IPADDRESS_INVALID.
Definition at line 264 of file yocto_network.cpp.
string YNetwork::get_ipConfig | ( | void | ) |
Returns the IP configuration of the network interface.
If the network interface is setup to use a static IP address, the string starts with "STATIC:" and is followed by three parameters, separated by "/". The first is the device IP address, followed by the subnet mask length, and finally the router IP address (default gateway). For instance: "STATIC:192.168.1.14/16/192.168.1.1"
If the network interface is configured to receive its IP from a DHCP server, the string start with "DHCP:" and is followed by three parameters separated by "/". The first is the fallback IP address, then the fallback subnet mask length and finally the fallback router IP address. These three parameters are used when no DHCP reply is received.
On failure, throws an exception or returns Y_IPCONFIG_INVALID.
Definition at line 363 of file yocto_network.cpp.
string YNetwork::get_macAddress | ( | void | ) |
Returns the MAC address of the network interface. The MAC address is also available on a sticker on the module, in both numeric and barcode forms.
On failure, throws an exception or returns Y_MACADDRESS_INVALID.
Definition at line 234 of file yocto_network.cpp.
string YNetwork::get_ntpServer | ( | void | ) |
Returns the IP address of the NTP server to be used by the device.
On failure, throws an exception or returns Y_NTPSERVER_INVALID.
Definition at line 520 of file yocto_network.cpp.
int YNetwork::get_poeCurrent | ( | void | ) |
Returns the current consumed by the module from Power-over-Ethernet (PoE), in milli-amps. The current consumption is measured after converting PoE source to 5 Volt, and should never exceed 1800 mA.
On failure, throws an exception or returns Y_POECURRENT_INVALID.
Definition at line 1416 of file yocto_network.cpp.
string YNetwork::get_primaryDNS | ( | void | ) |
Returns the IP address of the primary name server to be used by the module.
On failure, throws an exception or returns Y_PRIMARYDNS_INVALID.
Definition at line 408 of file yocto_network.cpp.
Y_READINESS_enum YNetwork::get_readiness | ( | void | ) |
Returns the current established working mode of the network interface. Level zero (DOWN_0) means that no hardware link has been detected. Either there is no signal on the network cable, or the selected wireless access point cannot be detected. Level 1 (LIVE_1) is reached when the network is detected, but is not yet connected. For a wireless network, this shows that the requested SSID is present. Level 2 (LINK_2) is reached when the hardware connection is established. For a wired network connection, level 2 means that the cable is attached at both ends. For a connection to a wireless access point, it shows that the security parameters are properly configured. For an ad-hoc wireless connection, it means that there is at least one other device connected on the ad-hoc network. Level 3 (DHCP_3) is reached when an IP address has been obtained using DHCP. Level 4 (DNS_4) is reached when the DNS server is reachable on the network. Level 5 (WWW_5) is reached when global connectivity is demonstrated by properly loading the current time from an NTP server.
On failure, throws an exception or returns Y_READINESS_INVALID.
Definition at line 204 of file yocto_network.cpp.
string YNetwork::get_router | ( | void | ) |
Returns the IP address of the router on the device subnet (default gateway).
On failure, throws an exception or returns Y_ROUTER_INVALID.
Definition at line 322 of file yocto_network.cpp.
string YNetwork::get_secondaryDNS | ( | void | ) |
Returns the IP address of the secondary name server to be used by the module.
On failure, throws an exception or returns Y_SECONDARYDNS_INVALID.
Definition at line 464 of file yocto_network.cpp.
string YNetwork::get_subnetMask | ( | void | ) |
Returns the subnet mask currently used by the device.
On failure, throws an exception or returns Y_SUBNETMASK_INVALID.
Definition at line 293 of file yocto_network.cpp.
string YNetwork::get_userPassword | ( | void | ) |
Returns a hash string if a password has been set for "user" user, or an empty string otherwise.
On failure, throws an exception or returns Y_USERPASSWORD_INVALID.
Definition at line 577 of file yocto_network.cpp.
int YNetwork::get_wwwWatchdogDelay | ( | void | ) |
Returns the allowed downtime of the WWW link (in seconds) before triggering an automated reboot to try to recover Internet connectivity. A zero value disables automated reboot in case of Internet connectivity loss.
On failure, throws an exception or returns Y_WWWWATCHDOGDELAY_INVALID.
Definition at line 879 of file yocto_network.cpp.
|
inline |
Definition at line 478 of file yocto_network.h.
|
inline |
Definition at line 272 of file yocto_network.h.
|
inline |
Definition at line 320 of file yocto_network.h.
|
inline |
Definition at line 259 of file yocto_network.h.
|
inline |
Definition at line 979 of file yocto_network.h.
YNetwork * YNetwork::nextNetwork | ( | void | ) |
Continues the enumeration of network interfaces started using yFirstNetwork().
Definition at line 1628 of file yocto_network.cpp.
|
inline |
Definition at line 390 of file yocto_network.h.
|
virtual |
Pings host to test the network connectivity. Sends four ICMP ECHO_REQUEST requests from the module to the target host. This method returns a string with the result of the 4 ICMP ECHO_REQUEST requests.
host | : the hostname or the IP address of the target |
Definition at line 1587 of file yocto_network.cpp.
|
inline |
Definition at line 838 of file yocto_network.h.
|
inline |
Definition at line 336 of file yocto_network.h.
|
inline |
Definition at line 246 of file yocto_network.h.
|
virtual |
Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of ySleep or yHandleEvents. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a NULL pointer as argument.
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. |
Definition at line 1497 of file yocto_network.cpp.
|
inline |
Definition at line 296 of file yocto_network.h.
|
inline |
Definition at line 363 of file yocto_network.h.
int YNetwork::set_adminPassword | ( | const string & | newval | ) |
Changes the password for the "admin" user. This password becomes instantly required to perform any change of the module state. If the specified value is an empty string, a password is not required anymore. Remember to call the saveToFlash() method of the module if the modification must be kept.
newval | : a string corresponding to the password for the "admin" user |
On failure, throws an exception or returns a negative error code.
Definition at line 676 of file yocto_network.cpp.
int YNetwork::set_callbackCredentials | ( | const string & | newval | ) |
Changes the credentials required to connect to the callback address. The credentials must be provided as returned by function get_callbackCredentials, in the form username:hash. The method used to compute the hash varies according to the the authentication scheme implemented by the callback, For Basic authentication, the hash is the MD5 of the string username:password. For Digest authentication, the hash is the MD5 of the string username:realm:password. For a simpler way to configure callback credentials, use function callbackLogin instead. Remember to call the saveToFlash() method of the module if the modification must be kept.
newval | : a string corresponding to the credentials required to connect to the callback address |
On failure, throws an exception or returns a negative error code.
Definition at line 1152 of file yocto_network.cpp.
int YNetwork::set_callbackEncoding | ( | Y_CALLBACKENCODING_enum | newval | ) |
Changes the encoding standard to use for representing notification values.
newval | : a value among Y_CALLBACKENCODING_FORM, Y_CALLBACKENCODING_JSON, Y_CALLBACKENCODING_JSON_ARRAY, Y_CALLBACKENCODING_CSV, Y_CALLBACKENCODING_YOCTO_API, Y_CALLBACKENCODING_JSON_NUM, Y_CALLBACKENCODING_EMONCMS, Y_CALLBACKENCODING_AZURE, Y_CALLBACKENCODING_INFLUXDB, Y_CALLBACKENCODING_MQTT and Y_CALLBACKENCODING_YOCTO_API_JZON corresponding to the encoding standard to use for representing notification values |
On failure, throws an exception or returns a negative error code.
Definition at line 1088 of file yocto_network.cpp.
int YNetwork::set_callbackInitialDelay | ( | int | newval | ) |
Changes the initial waiting time before first callback notifications, in seconds.
newval | : an integer corresponding to the initial waiting time before first callback notifications, in seconds |
On failure, throws an exception or returns a negative error code.
Definition at line 1227 of file yocto_network.cpp.
int YNetwork::set_callbackMaxDelay | ( | int | newval | ) |
Changes the waiting time between two HTTP callbacks when there is nothing new.
newval | : an integer corresponding to the waiting time between two HTTP callbacks when there is nothing new |
On failure, throws an exception or returns a negative error code.
Definition at line 1390 of file yocto_network.cpp.
int YNetwork::set_callbackMethod | ( | Y_CALLBACKMETHOD_enum | newval | ) |
Changes the HTTP method used to notify callbacks for significant state changes.
newval | : a value among Y_CALLBACKMETHOD_POST, Y_CALLBACKMETHOD_GET and Y_CALLBACKMETHOD_PUT corresponding to the HTTP method used to notify callbacks for significant state changes |
On failure, throws an exception or returns a negative error code.
Definition at line 1026 of file yocto_network.cpp.
int YNetwork::set_callbackMinDelay | ( | int | newval | ) |
Changes the minimum waiting time between two HTTP callbacks, in seconds.
newval | : an integer corresponding to the minimum waiting time between two HTTP callbacks, in seconds |
On failure, throws an exception or returns a negative error code.
Definition at line 1335 of file yocto_network.cpp.
int YNetwork::set_callbackSchedule | ( | const string & | newval | ) |
Changes the HTTP callback schedule strategy, as a text string.
newval | : a string corresponding to the HTTP callback schedule strategy, as a text string |
On failure, throws an exception or returns a negative error code.
Definition at line 1281 of file yocto_network.cpp.
int YNetwork::set_callbackUrl | ( | const string & | newval | ) |
Changes the callback URL to notify significant state changes. Remember to call the saveToFlash() method of the module if the modification must be kept.
newval | : a string corresponding to the callback URL to notify significant state changes |
On failure, throws an exception or returns a negative error code.
Definition at line 970 of file yocto_network.cpp.
int YNetwork::set_defaultPage | ( | const string & | newval | ) |
Changes the default HTML page returned by the hub. If not value are set the hub return "index.html" which is the web interface of the hub. It is possible de change this page for file that has been uploaded on the hub.
newval | : a string corresponding to the default HTML page returned by the hub |
On failure, throws an exception or returns a negative error code.
Definition at line 792 of file yocto_network.cpp.
int YNetwork::set_discoverable | ( | Y_DISCOVERABLE_enum | newval | ) |
Changes the activation state of the multicast announce protocols to allow easy discovery of the module in the network neighborhood (uPnP/Bonjour protocol).
newval | : either Y_DISCOVERABLE_FALSE or Y_DISCOVERABLE_TRUE, according to the activation state of the multicast announce protocols to allow easy discovery of the module in the network neighborhood (uPnP/Bonjour protocol) |
On failure, throws an exception or returns a negative error code.
Definition at line 852 of file yocto_network.cpp.
int YNetwork::set_httpPort | ( | int | newval | ) |
Changes the default HTML page returned by the hub. If not value are set the hub return "index.html" which is the web interface of the hub. It is possible de change this page for file that has been uploaded on the hub.
newval | : an integer corresponding to the default HTML page returned by the hub |
On failure, throws an exception or returns a negative error code.
Definition at line 736 of file yocto_network.cpp.
int YNetwork::set_ipConfig | ( | const string & | newval | ) |
Definition at line 385 of file yocto_network.cpp.
int YNetwork::set_ntpServer | ( | const string & | newval | ) |
Changes the IP address of the NTP server to be used by the module. Remember to call the saveToFlash() method and then to reboot the module to apply this setting.
newval | : a string corresponding to the IP address of the NTP server to be used by the module |
On failure, throws an exception or returns a negative error code.
Definition at line 552 of file yocto_network.cpp.
|
virtual |
Setup periodic HTTP callbacks (simplifed function).
interval | : a string representing the callback periodicity, expressed in seconds, minutes or hours, eg. "60s", "5m", "1h", "48h". |
offset | : an integer representing the time offset relative to the period when the callback should occur. For instance, if the periodicity is 24h, an offset of 7 will make the callback occur each day at 7AM. |
On failure, throws an exception or returns a negative error code.
Definition at line 1623 of file yocto_network.cpp.
int YNetwork::set_primaryDNS | ( | const string & | newval | ) |
Changes the IP address of the primary name server to be used by the module. When using DHCP, if a value is specified, it overrides the value received from the DHCP server. Remember to call the saveToFlash() method and then to reboot the module to apply this setting.
newval | : a string corresponding to the IP address of the primary name server to be used by the module |
On failure, throws an exception or returns a negative error code.
Definition at line 441 of file yocto_network.cpp.
int YNetwork::set_secondaryDNS | ( | const string & | newval | ) |
Changes the IP address of the secondary name server to be used by the module. When using DHCP, if a value is specified, it overrides the value received from the DHCP server. Remember to call the saveToFlash() method and then to reboot the module to apply this setting.
newval | : a string corresponding to the IP address of the secondary name server to be used by the module |
On failure, throws an exception or returns a negative error code.
Definition at line 497 of file yocto_network.cpp.
int YNetwork::set_userPassword | ( | const string & | newval | ) |
Changes the password for the "user" user. This password becomes instantly required to perform any use of the module. If the specified value is an empty string, a password is not required anymore. Remember to call the saveToFlash() method of the module if the modification must be kept.
newval | : a string corresponding to the password for the "user" user |
On failure, throws an exception or returns a negative error code.
Definition at line 612 of file yocto_network.cpp.
int YNetwork::set_wwwWatchdogDelay | ( | int | newval | ) |
Changes the allowed downtime of the WWW link (in seconds) before triggering an automated reboot to try to recover Internet connectivity. A zero value disables automated reboot in case of Internet connectivity loss. The smallest valid non-zero timeout is 90 seconds.
newval | : an integer corresponding to the allowed downtime of the WWW link (in seconds) before triggering an automated reboot to try to recover Internet connectivity |
On failure, throws an exception or returns a negative error code.
Definition at line 915 of file yocto_network.cpp.
|
inline |
Definition at line 466 of file yocto_network.h.
|
inline |
Definition at line 706 of file yocto_network.h.
|
inline |
Definition at line 671 of file yocto_network.h.
|
inline |
Definition at line 747 of file yocto_network.h.
|
inline |
Definition at line 823 of file yocto_network.h.
|
inline |
Definition at line 638 of file yocto_network.h.
|
inline |
Definition at line 797 of file yocto_network.h.
|
inline |
Definition at line 772 of file yocto_network.h.
|
inline |
Definition at line 611 of file yocto_network.h.
|
inline |
Definition at line 520 of file yocto_network.h.
|
inline |
Definition at line 551 of file yocto_network.h.
|
inline |
Definition at line 493 of file yocto_network.h.
|
inline |
Definition at line 324 of file yocto_network.h.
|
inline |
Definition at line 404 of file yocto_network.h.
|
inline |
Definition at line 351 of file yocto_network.h.
|
inline |
Definition at line 378 of file yocto_network.h.
|
inline |
Definition at line 435 of file yocto_network.h.
|
inline |
Definition at line 585 of file yocto_network.h.
|
inline |
Definition at line 284 of file yocto_network.h.
|
virtual |
Trigger an HTTP callback quickly. This function can even be called within an HTTP callback, in which case the next callback will be triggered 5 seconds after the end of the current callback, regardless if the minimum time between callbacks configured in the device.
On failure, throws an exception or returns a negative error code.
Definition at line 1605 of file yocto_network.cpp.
|
virtual |
Changes the configuration of the network interface to enable the use of an IP address received from a DHCP server. Until an address is received from a DHCP server, the module uses the IP parameters specified to this function. Remember to call the saveToFlash() method and then to reboot the module to apply this setting.
fallbackIpAddr | : fallback IP address, to be used when no DHCP reply is received |
fallbackSubnetMaskLen | : fallback subnet mask length when no DHCP reply is received, as an integer (eg. 24 means 255.255.255.0) |
fallbackRouter | : fallback router IP address, to be used when no DHCP reply is received |
On failure, throws an exception or returns a negative error code.
Definition at line 1541 of file yocto_network.cpp.
|
virtual |
Changes the configuration of the network interface to enable the use of an IP address received from a DHCP server. Until an address is received from a DHCP server, the module uses an IP of the network 169.254.0.0/16 (APIPA). Remember to call the saveToFlash() method and then to reboot the module to apply this setting.
On failure, throws an exception or returns a negative error code.
Definition at line 1556 of file yocto_network.cpp.
|
inline |
Definition at line 418 of file yocto_network.h.
|
virtual |
Changes the configuration of the network interface to use a static IP address. Remember to call the saveToFlash() method and then to reboot the module to apply this setting.
ipAddress | : device IP address |
subnetMaskLen | : subnet mask length, as an integer (eg. 24 means 255.255.255.0) |
router | : router IP address (default gateway) |
On failure, throws an exception or returns a negative error code.
Definition at line 1573 of file yocto_network.cpp.
|
inline |
Definition at line 567 of file yocto_network.h.
|
friend |
Retrieves a network interface for a given identifier. The identifier can be specified using several formats:
This function does not require that the network interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method YNetwork.isOnline() to test if the network interface is indeed online at a given time. In case of ambiguity when looking for a network 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.
func | : a string that uniquely characterizes the network interface |
Definition at line 1029 of file yocto_network.h.
|
friend |
Starts the enumeration of network interfaces currently accessible. Use the method YNetwork.nextNetwork() to iterate on next network interfaces.
Definition at line 1040 of file yocto_network.h.
|
protected |
Definition at line 147 of file yocto_network.h.
|
protected |
Definition at line 155 of file yocto_network.h.
|
protected |
Definition at line 154 of file yocto_network.h.
|
protected |
Definition at line 156 of file yocto_network.h.
|
protected |
Definition at line 159 of file yocto_network.h.
|
protected |
Definition at line 153 of file yocto_network.h.
|
protected |
Definition at line 158 of file yocto_network.h.
|
protected |
Definition at line 157 of file yocto_network.h.
|
protected |
Definition at line 152 of file yocto_network.h.
|
protected |
Definition at line 149 of file yocto_network.h.
|
protected |
Definition at line 150 of file yocto_network.h.
|
protected |
Definition at line 148 of file yocto_network.h.
|
protected |
Definition at line 139 of file yocto_network.h.
|
protected |
Definition at line 142 of file yocto_network.h.
|
protected |
Definition at line 138 of file yocto_network.h.
|
protected |
Definition at line 145 of file yocto_network.h.
|
protected |
Definition at line 160 of file yocto_network.h.
|
protected |
Definition at line 143 of file yocto_network.h.
|
protected |
Definition at line 137 of file yocto_network.h.
|
protected |
Definition at line 141 of file yocto_network.h.
|
protected |
Definition at line 144 of file yocto_network.h.
|
protected |
Definition at line 140 of file yocto_network.h.
|
protected |
Definition at line 146 of file yocto_network.h.
|
protected |
Definition at line 161 of file yocto_network.h.
|
protected |
Definition at line 151 of file yocto_network.h.
|
static |
Definition at line 192 of file yocto_network.h.
|
static |
Definition at line 216 of file yocto_network.h.
|
static |
Definition at line 211 of file yocto_network.h.
|
static |
Definition at line 207 of file yocto_network.h.
|
static |
Definition at line 210 of file yocto_network.h.
|
static |
Definition at line 204 of file yocto_network.h.
|
static |
Definition at line 212 of file yocto_network.h.
|
static |
Definition at line 215 of file yocto_network.h.
|
static |
Definition at line 205 of file yocto_network.h.
|
static |
Definition at line 206 of file yocto_network.h.
|
static |
Definition at line 209 of file yocto_network.h.
|
static |
Definition at line 213 of file yocto_network.h.
|
static |
Definition at line 208 of file yocto_network.h.
|
static |
Definition at line 214 of file yocto_network.h.
|
static |
Definition at line 217 of file yocto_network.h.
|
static |
Definition at line 220 of file yocto_network.h.
|
static |
Definition at line 201 of file yocto_network.h.
|
static |
Definition at line 203 of file yocto_network.h.
|
static |
Definition at line 200 of file yocto_network.h.
|
static |
Definition at line 202 of file yocto_network.h.
|
static |
Definition at line 219 of file yocto_network.h.
|
static |
Definition at line 218 of file yocto_network.h.
|
static |
Definition at line 199 of file yocto_network.h.
|
static |
Definition at line 194 of file yocto_network.h.
|
static |
Definition at line 195 of file yocto_network.h.
|
static |
Definition at line 197 of file yocto_network.h.
|
static |
Definition at line 196 of file yocto_network.h.
|
static |
Definition at line 193 of file yocto_network.h.
|
static |
Definition at line 184 of file yocto_network.h.
|
static |
Definition at line 187 of file yocto_network.h.
|
static |
Definition at line 183 of file yocto_network.h.
|
static |
Definition at line 190 of file yocto_network.h.
|
static |
Definition at line 221 of file yocto_network.h.
|
static |
Definition at line 188 of file yocto_network.h.
|
static |
Definition at line 177 of file yocto_network.h.
|
static |
Definition at line 178 of file yocto_network.h.
|
static |
Definition at line 182 of file yocto_network.h.
|
static |
Definition at line 180 of file yocto_network.h.
|
static |
Definition at line 179 of file yocto_network.h.
|
static |
Definition at line 181 of file yocto_network.h.
|
static |
Definition at line 186 of file yocto_network.h.
|
static |
Definition at line 189 of file yocto_network.h.
|
static |
Definition at line 185 of file yocto_network.h.
|
static |
Definition at line 191 of file yocto_network.h.
|
static |
Definition at line 198 of file yocto_network.h.