public class YNetwork extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YNetwork.TimedReportCallback
TimedReportCallback for Network
|
static interface |
YNetwork.UpdateCallback
Deprecated UpdateCallback for Network
|
Modifier and Type | Field and Description |
---|---|
protected String |
_adminPassword |
protected String |
_callbackCredentials |
protected int |
_callbackEncoding |
protected int |
_callbackInitialDelay |
protected int |
_callbackMaxDelay |
protected int |
_callbackMethod |
protected int |
_callbackMinDelay |
protected String |
_callbackSchedule |
protected String |
_callbackUrl |
protected String |
_defaultPage |
protected int |
_discoverable |
protected int |
_httpPort |
protected String |
_ipAddress |
protected String |
_ipConfig |
protected String |
_macAddress |
protected String |
_ntpServer |
protected int |
_poeCurrent |
protected String |
_primaryDNS |
protected int |
_readiness |
protected String |
_router |
protected String |
_secondaryDNS |
protected String |
_subnetMask |
protected String |
_userPassword |
protected YNetwork.UpdateCallback |
_valueCallbackNetwork |
protected int |
_wwwWatchdogDelay |
static String |
ADMINPASSWORD_INVALID
invalid adminPassword value
|
static String |
CALLBACKCREDENTIALS_INVALID
invalid callbackCredentials value
|
static int |
CALLBACKENCODING_AZURE |
static int |
CALLBACKENCODING_CSV |
static int |
CALLBACKENCODING_EMONCMS |
static int |
CALLBACKENCODING_FORM
invalid callbackEncoding value
|
static int |
CALLBACKENCODING_INFLUXDB |
static int |
CALLBACKENCODING_INFLUXDB_V2 |
static int |
CALLBACKENCODING_INVALID |
static int |
CALLBACKENCODING_JSON |
static int |
CALLBACKENCODING_JSON_ARRAY |
static int |
CALLBACKENCODING_JSON_NUM |
static int |
CALLBACKENCODING_MQTT |
static int |
CALLBACKENCODING_PRTG |
static int |
CALLBACKENCODING_YOCTO_API |
static int |
CALLBACKENCODING_YOCTO_API_JZON |
static int |
CALLBACKINITIALDELAY_INVALID
invalid callbackInitialDelay value
|
static int |
CALLBACKMAXDELAY_INVALID
invalid callbackMaxDelay value
|
static int |
CALLBACKMETHOD_GET |
static int |
CALLBACKMETHOD_INVALID |
static int |
CALLBACKMETHOD_POST
invalid callbackMethod value
|
static int |
CALLBACKMETHOD_PUT |
static int |
CALLBACKMINDELAY_INVALID
invalid callbackMinDelay value
|
static String |
CALLBACKSCHEDULE_INVALID
invalid callbackSchedule value
|
static String |
CALLBACKURL_INVALID
invalid callbackUrl value
|
static String |
DEFAULTPAGE_INVALID
invalid defaultPage value
|
static int |
DISCOVERABLE_FALSE
invalid discoverable value
|
static int |
DISCOVERABLE_INVALID |
static int |
DISCOVERABLE_TRUE |
static int |
HTTPPORT_INVALID
invalid httpPort value
|
static String |
IPADDRESS_INVALID
invalid ipAddress value
|
static String |
IPCONFIG_INVALID
invalid ipConfig value
|
static String |
MACADDRESS_INVALID
invalid macAddress value
|
static String |
NTPSERVER_INVALID
invalid ntpServer value
|
static int |
POECURRENT_INVALID
invalid poeCurrent value
|
static String |
PRIMARYDNS_INVALID
invalid primaryDNS value
|
static int |
READINESS_DOWN
invalid readiness value
|
static int |
READINESS_EXISTS |
static int |
READINESS_INVALID |
static int |
READINESS_LAN_OK |
static int |
READINESS_LINKED |
static int |
READINESS_WWW_OK |
static String |
ROUTER_INVALID
invalid router value
|
static String |
SECONDARYDNS_INVALID
invalid secondaryDNS value
|
static String |
SUBNETMASK_INVALID
invalid subnetMask value
|
static String |
USERPASSWORD_INVALID
invalid userPassword value
|
static int |
WWWWATCHDOGDELAY_INVALID
invalid wwwWatchdogDelay value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YNetwork(String func) |
protected |
YNetwork(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
int |
callbackLogin(String username,
String password)
Connects to the notification callback and saves the credentials required to
log into it.
|
static YNetwork |
FindNetwork(String func)
Retrieves a network interface for a given identifier.
|
static YNetwork |
FindNetworkInContext(YAPIContext yctx,
String func)
Retrieves a network interface for a given identifier in a YAPI context.
|
static YNetwork |
FirstNetwork()
Starts the enumeration of network interfaces currently accessible.
|
static YNetwork |
FirstNetworkInContext(YAPIContext yctx)
Starts the enumeration of network interfaces currently accessible.
|
String |
get_adminPassword()
Returns a hash string if a password has been set for user "admin",
or an empty string otherwise.
|
String |
get_callbackCredentials()
Returns a hashed version of the notification callback credentials if set,
or an empty string otherwise.
|
int |
get_callbackEncoding()
Returns the encoding standard to use for representing notification values.
|
int |
get_callbackInitialDelay()
Returns the initial waiting time before first callback notifications, in seconds.
|
int |
get_callbackMaxDelay()
Returns the waiting time between two HTTP callbacks when there is nothing new.
|
int |
get_callbackMethod()
Returns the HTTP method used to notify callbacks for significant state changes.
|
int |
get_callbackMinDelay()
Returns the minimum waiting time between two HTTP callbacks, in seconds.
|
String |
get_callbackSchedule()
Returns the HTTP callback schedule strategy, as a text string.
|
String |
get_callbackUrl()
Returns the callback URL to notify of significant state changes.
|
String |
get_defaultPage()
Returns the HTML page to serve for the URL "/"" of the hub.
|
int |
get_discoverable()
Returns the activation state of the multicast announce protocols to allow easy
discovery of the module in the network neighborhood (uPnP/Bonjour protocol).
|
int |
get_httpPort()
Returns the TCP port used to serve the hub web UI.
|
String |
get_ipAddress()
Returns the IP address currently in use by the device.
|
String |
get_ipConfig()
Returns the IP configuration of the network interface.
|
String |
get_macAddress()
Returns the MAC address of the network interface.
|
String |
get_ntpServer()
Returns the IP address of the NTP server to be used by the device.
|
int |
get_poeCurrent()
Returns the current consumed by the module from Power-over-Ethernet (PoE), in milliamps.
|
String |
get_primaryDNS()
Returns the IP address of the primary name server to be used by the module.
|
int |
get_readiness()
Returns the current established working mode of the network interface.
|
String |
get_router()
Returns the IP address of the router on the device subnet (default gateway).
|
String |
get_secondaryDNS()
Returns the IP address of the secondary name server to be used by the module.
|
String |
get_subnetMask()
Returns the subnet mask currently used by the device.
|
String |
get_userPassword()
Returns a hash string if a password has been set for "user" user,
or an empty string otherwise.
|
int |
get_wwwWatchdogDelay()
Returns the allowed downtime of the WWW link (in seconds) before triggering an automated
reboot to try to recover Internet connectivity.
|
String |
getAdminPassword()
Returns a hash string if a password has been set for user "admin",
or an empty string otherwise.
|
String |
getCallbackCredentials()
Returns a hashed version of the notification callback credentials if set,
or an empty string otherwise.
|
int |
getCallbackEncoding()
Returns the encoding standard to use for representing notification values.
|
int |
getCallbackInitialDelay()
Returns the initial waiting time before first callback notifications, in seconds.
|
int |
getCallbackMaxDelay()
Returns the waiting time between two HTTP callbacks when there is nothing new.
|
int |
getCallbackMethod()
Returns the HTTP method used to notify callbacks for significant state changes.
|
int |
getCallbackMinDelay()
Returns the minimum waiting time between two HTTP callbacks, in seconds.
|
String |
getCallbackSchedule()
Returns the HTTP callback schedule strategy, as a text string.
|
String |
getCallbackUrl()
Returns the callback URL to notify of significant state changes.
|
String |
getDefaultPage()
Returns the HTML page to serve for the URL "/"" of the hub.
|
int |
getDiscoverable()
Returns the activation state of the multicast announce protocols to allow easy
discovery of the module in the network neighborhood (uPnP/Bonjour protocol).
|
int |
getHttpPort()
Returns the TCP port used to serve the hub web UI.
|
String |
getIpAddress()
Returns the IP address currently in use by the device.
|
String |
getIpConfig()
Returns the IP configuration of the network interface.
|
String |
getMacAddress()
Returns the MAC address of the network interface.
|
String |
getNtpServer()
Returns the IP address of the NTP server to be used by the device.
|
int |
getPoeCurrent()
Returns the current consumed by the module from Power-over-Ethernet (PoE), in milliamps.
|
String |
getPrimaryDNS()
Returns the IP address of the primary name server to be used by the module.
|
int |
getReadiness()
Returns the current established working mode of the network interface.
|
String |
getRouter()
Returns the IP address of the router on the device subnet (default gateway).
|
String |
getSecondaryDNS()
Returns the IP address of the secondary name server to be used by the module.
|
String |
getSubnetMask()
Returns the subnet mask currently used by the device.
|
String |
getUserPassword()
Returns a hash string if a password has been set for "user" user,
or an empty string otherwise.
|
int |
getWwwWatchdogDelay()
Returns the allowed downtime of the WWW link (in seconds) before triggering an automated
reboot to try to recover Internet connectivity.
|
YNetwork |
nextNetwork()
Continues the enumeration of network interfaces started using yFirstNetwork().
|
String |
ping(String host)
Pings host to test the network connectivity.
|
int |
registerValueCallback(YNetwork.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_adminPassword(String newval)
Changes the password for the "admin" user.
|
int |
set_callbackCredentials(String newval)
Changes the credentials required to connect to the callback address.
|
int |
set_callbackEncoding(int newval)
Changes the encoding standard to use for representing notification values.
|
int |
set_callbackInitialDelay(int newval)
Changes the initial waiting time before first callback notifications, in seconds.
|
int |
set_callbackMaxDelay(int newval)
Changes the waiting time between two HTTP callbacks when there is nothing new.
|
int |
set_callbackMethod(int newval)
Changes the HTTP method used to notify callbacks for significant state changes.
|
int |
set_callbackMinDelay(int newval)
Changes the minimum waiting time between two HTTP callbacks, in seconds.
|
int |
set_callbackSchedule(String newval)
Changes the HTTP callback schedule strategy, as a text string.
|
int |
set_callbackUrl(String newval)
Changes the callback URL to notify significant state changes.
|
int |
set_defaultPage(String newval)
Changes the default HTML page returned by the hub.
|
int |
set_discoverable(int newval)
Changes the activation state of the multicast announce protocols to allow easy
discovery of the module in the network neighborhood (uPnP/Bonjour protocol).
|
int |
set_httpPort(int newval)
Changes the the TCP port used to serve the hub web UI.
|
int |
set_ipConfig(String newval) |
int |
set_ntpServer(String newval)
Changes the IP address of the NTP server to be used by the module.
|
int |
set_periodicCallbackSchedule(String interval,
int offset)
Setup periodic HTTP callbacks (simplified function).
|
int |
set_primaryDNS(String newval)
Changes the IP address of the primary name server to be used by the module.
|
int |
set_secondaryDNS(String newval)
Changes the IP address of the secondary name server to be used by the module.
|
int |
set_userPassword(String newval)
Changes the password for the "user" user.
|
int |
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.
|
int |
setAdminPassword(String newval)
Changes the password for the "admin" user.
|
int |
setCallbackCredentials(String newval)
Changes the credentials required to connect to the callback address.
|
int |
setCallbackEncoding(int newval)
Changes the encoding standard to use for representing notification values.
|
int |
setCallbackInitialDelay(int newval)
Changes the initial waiting time before first callback notifications, in seconds.
|
int |
setCallbackMaxDelay(int newval)
Changes the waiting time between two HTTP callbacks when there is nothing new.
|
int |
setCallbackMethod(int newval)
Changes the HTTP method used to notify callbacks for significant state changes.
|
int |
setCallbackMinDelay(int newval)
Changes the minimum waiting time between two HTTP callbacks, in seconds.
|
int |
setCallbackSchedule(String newval)
Changes the HTTP callback schedule strategy, as a text string.
|
int |
setCallbackUrl(String newval)
Changes the callback URL to notify significant state changes.
|
int |
setDefaultPage(String newval)
Changes the default HTML page returned by the hub.
|
int |
setDiscoverable(int newval)
Changes the activation state of the multicast announce protocols to allow easy
discovery of the module in the network neighborhood (uPnP/Bonjour protocol).
|
int |
setHttpPort(int newval)
Changes the the TCP port used to serve the hub web UI.
|
int |
setNtpServer(String newval)
Changes the IP address of the NTP server to be used by the module.
|
int |
setPrimaryDNS(String newval)
Changes the IP address of the primary name server to be used by the module.
|
int |
setSecondaryDNS(String newval)
Changes the IP address of the secondary name server to be used by the module.
|
int |
setUserPassword(String newval)
Changes the password for the "user" user.
|
int |
setWwwWatchdogDelay(int newval)
Changes the allowed downtime of the WWW link (in seconds) before triggering an automated
reboot to try to recover Internet connectivity.
|
int |
triggerCallback()
Trigger an HTTP callback quickly.
|
int |
useDHCP(String fallbackIpAddr,
int fallbackSubnetMaskLen,
String fallbackRouter)
Changes the configuration of the network interface to enable the use of an
IP address received from a DHCP server.
|
int |
useDHCPauto()
Changes the configuration of the network interface to enable the use of an
IP address received from a DHCP server.
|
int |
useStaticIP(String ipAddress,
int subnetMaskLen,
String router)
Changes the configuration of the network interface to use a static IP address.
|
_AddToCache, _clearDataStreamCache, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, _uploadEx, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_serialNumber, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, isReadOnly, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final int READINESS_DOWN
public static final int READINESS_EXISTS
public static final int READINESS_LINKED
public static final int READINESS_LAN_OK
public static final int READINESS_WWW_OK
public static final int READINESS_INVALID
public static final String MACADDRESS_INVALID
public static final String IPADDRESS_INVALID
public static final String SUBNETMASK_INVALID
public static final String ROUTER_INVALID
public static final String IPCONFIG_INVALID
public static final String PRIMARYDNS_INVALID
public static final String SECONDARYDNS_INVALID
public static final String NTPSERVER_INVALID
public static final String USERPASSWORD_INVALID
public static final String ADMINPASSWORD_INVALID
public static final int HTTPPORT_INVALID
public static final String DEFAULTPAGE_INVALID
public static final int DISCOVERABLE_FALSE
public static final int DISCOVERABLE_TRUE
public static final int DISCOVERABLE_INVALID
public static final int WWWWATCHDOGDELAY_INVALID
public static final String CALLBACKURL_INVALID
public static final int CALLBACKMETHOD_POST
public static final int CALLBACKMETHOD_GET
public static final int CALLBACKMETHOD_PUT
public static final int CALLBACKMETHOD_INVALID
public static final int CALLBACKENCODING_FORM
public static final int CALLBACKENCODING_JSON
public static final int CALLBACKENCODING_JSON_ARRAY
public static final int CALLBACKENCODING_CSV
public static final int CALLBACKENCODING_YOCTO_API
public static final int CALLBACKENCODING_JSON_NUM
public static final int CALLBACKENCODING_EMONCMS
public static final int CALLBACKENCODING_AZURE
public static final int CALLBACKENCODING_INFLUXDB
public static final int CALLBACKENCODING_MQTT
public static final int CALLBACKENCODING_YOCTO_API_JZON
public static final int CALLBACKENCODING_PRTG
public static final int CALLBACKENCODING_INFLUXDB_V2
public static final int CALLBACKENCODING_INVALID
public static final String CALLBACKCREDENTIALS_INVALID
public static final int CALLBACKINITIALDELAY_INVALID
public static final String CALLBACKSCHEDULE_INVALID
public static final int CALLBACKMINDELAY_INVALID
public static final int CALLBACKMAXDELAY_INVALID
public static final int POECURRENT_INVALID
protected int _readiness
protected String _macAddress
protected String _ipAddress
protected String _subnetMask
protected String _router
protected String _ipConfig
protected String _primaryDNS
protected String _secondaryDNS
protected String _ntpServer
protected String _userPassword
protected String _adminPassword
protected int _httpPort
protected String _defaultPage
protected int _discoverable
protected int _wwwWatchdogDelay
protected String _callbackUrl
protected int _callbackMethod
protected int _callbackEncoding
protected String _callbackCredentials
protected int _callbackInitialDelay
protected String _callbackSchedule
protected int _callbackMinDelay
protected int _callbackMaxDelay
protected int _poeCurrent
protected YNetwork.UpdateCallback _valueCallbackNetwork
protected YNetwork(YAPIContext ctx, String func)
func
- : functionidprotected YNetwork(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int get_readiness() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getReadiness() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_macAddress() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getMacAddress() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_ipAddress() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getIpAddress() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_subnetMask() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getSubnetMask() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_router() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getRouter() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_ipConfig() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getIpConfig() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_ipConfig(String newval) throws YAPI_Exception
YAPI_Exception
public String get_primaryDNS() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getPrimaryDNS() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_primaryDNS(String newval) throws YAPI_Exception
newval
- : a string corresponding to the IP address of the primary name server to be used by the moduleYAPI_Exception
- on errorpublic int setPrimaryDNS(String newval) throws YAPI_Exception
newval
- : a string corresponding to the IP address of the primary name server to be used by the moduleYAPI_Exception
- on errorpublic String get_secondaryDNS() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getSecondaryDNS() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_secondaryDNS(String newval) throws YAPI_Exception
newval
- : a string corresponding to the IP address of the secondary name server to be used by the moduleYAPI_Exception
- on errorpublic int setSecondaryDNS(String newval) throws YAPI_Exception
newval
- : a string corresponding to the IP address of the secondary name server to be used by the moduleYAPI_Exception
- on errorpublic String get_ntpServer() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getNtpServer() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_ntpServer(String newval) throws YAPI_Exception
newval
- : a string corresponding to the IP address of the NTP server to be used by the moduleYAPI_Exception
- on errorpublic int setNtpServer(String newval) throws YAPI_Exception
newval
- : a string corresponding to the IP address of the NTP server to be used by the moduleYAPI_Exception
- on errorpublic String get_userPassword() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getUserPassword() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_userPassword(String newval) throws YAPI_Exception
newval
- : a string corresponding to the password for the "user" userYAPI_Exception
- on errorpublic int setUserPassword(String newval) throws YAPI_Exception
newval
- : a string corresponding to the password for the "user" userYAPI_Exception
- on errorpublic String get_adminPassword() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getAdminPassword() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_adminPassword(String newval) throws YAPI_Exception
newval
- : a string corresponding to the password for the "admin" userYAPI_Exception
- on errorpublic int setAdminPassword(String newval) throws YAPI_Exception
newval
- : a string corresponding to the password for the "admin" userYAPI_Exception
- on errorpublic int get_httpPort() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getHttpPort() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_httpPort(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the the TCP port used to serve the hub web UIYAPI_Exception
- on errorpublic int setHttpPort(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the the TCP port used to serve the hub web UIYAPI_Exception
- on errorpublic String get_defaultPage() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getDefaultPage() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_defaultPage(String newval) throws YAPI_Exception
newval
- : a string corresponding to the default HTML page returned by the hubYAPI_Exception
- on errorpublic int setDefaultPage(String newval) throws YAPI_Exception
newval
- : a string corresponding to the default HTML page returned by the hubYAPI_Exception
- on errorpublic int get_discoverable() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getDiscoverable() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_discoverable(int newval) throws YAPI_Exception
newval
- : either YNetwork.DISCOVERABLE_FALSE or YNetwork.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)YAPI_Exception
- on errorpublic int setDiscoverable(int newval) throws YAPI_Exception
newval
- : either YNetwork.DISCOVERABLE_FALSE or YNetwork.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)YAPI_Exception
- on errorpublic int get_wwwWatchdogDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getWwwWatchdogDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_wwwWatchdogDelay(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the allowed downtime of the WWW link (in seconds)
before triggering an automated
reboot to try to recover Internet connectivityYAPI_Exception
- on errorpublic int setWwwWatchdogDelay(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the allowed downtime of the WWW link (in seconds)
before triggering an automated
reboot to try to recover Internet connectivityYAPI_Exception
- on errorpublic String get_callbackUrl() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getCallbackUrl() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_callbackUrl(String newval) throws YAPI_Exception
newval
- : a string corresponding to the callback URL to notify significant state changesYAPI_Exception
- on errorpublic int setCallbackUrl(String newval) throws YAPI_Exception
newval
- : a string corresponding to the callback URL to notify significant state changesYAPI_Exception
- on errorpublic int get_callbackMethod() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCallbackMethod() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_callbackMethod(int newval) throws YAPI_Exception
newval
- : a value among YNetwork.CALLBACKMETHOD_POST, YNetwork.CALLBACKMETHOD_GET and
YNetwork.CALLBACKMETHOD_PUT corresponding to the HTTP method used to notify callbacks for
significant state changesYAPI_Exception
- on errorpublic int setCallbackMethod(int newval) throws YAPI_Exception
newval
- : a value among YNetwork.CALLBACKMETHOD_POST, YNetwork.CALLBACKMETHOD_GET and
YNetwork.CALLBACKMETHOD_PUT corresponding to the HTTP method used to notify callbacks for
significant state changesYAPI_Exception
- on errorpublic int get_callbackEncoding() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCallbackEncoding() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_callbackEncoding(int newval) throws YAPI_Exception
newval
- : a value among YNetwork.CALLBACKENCODING_FORM, YNetwork.CALLBACKENCODING_JSON,
YNetwork.CALLBACKENCODING_JSON_ARRAY, YNetwork.CALLBACKENCODING_CSV,
YNetwork.CALLBACKENCODING_YOCTO_API, YNetwork.CALLBACKENCODING_JSON_NUM,
YNetwork.CALLBACKENCODING_EMONCMS, YNetwork.CALLBACKENCODING_AZURE,
YNetwork.CALLBACKENCODING_INFLUXDB, YNetwork.CALLBACKENCODING_MQTT,
YNetwork.CALLBACKENCODING_YOCTO_API_JZON, YNetwork.CALLBACKENCODING_PRTG and
YNetwork.CALLBACKENCODING_INFLUXDB_V2 corresponding to the encoding standard to use for
representing notification valuesYAPI_Exception
- on errorpublic int setCallbackEncoding(int newval) throws YAPI_Exception
newval
- : a value among YNetwork.CALLBACKENCODING_FORM, YNetwork.CALLBACKENCODING_JSON,
YNetwork.CALLBACKENCODING_JSON_ARRAY, YNetwork.CALLBACKENCODING_CSV,
YNetwork.CALLBACKENCODING_YOCTO_API, YNetwork.CALLBACKENCODING_JSON_NUM,
YNetwork.CALLBACKENCODING_EMONCMS, YNetwork.CALLBACKENCODING_AZURE,
YNetwork.CALLBACKENCODING_INFLUXDB, YNetwork.CALLBACKENCODING_MQTT,
YNetwork.CALLBACKENCODING_YOCTO_API_JZON, YNetwork.CALLBACKENCODING_PRTG and
YNetwork.CALLBACKENCODING_INFLUXDB_V2 corresponding to the encoding standard to use for
representing notification valuesYAPI_Exception
- on errorpublic String get_callbackCredentials() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getCallbackCredentials() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_callbackCredentials(String newval) throws YAPI_Exception
newval
- : a string corresponding to the credentials required to connect to the callback addressYAPI_Exception
- on errorpublic int setCallbackCredentials(String newval) throws YAPI_Exception
newval
- : a string corresponding to the credentials required to connect to the callback addressYAPI_Exception
- on errorpublic int callbackLogin(String username, String password) throws YAPI_Exception
username
- : username required to log to the callbackpassword
- : password required to log to the callbackYAPI_Exception
- on errorpublic int get_callbackInitialDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCallbackInitialDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_callbackInitialDelay(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the initial waiting time before first callback
notifications, in secondsYAPI_Exception
- on errorpublic int setCallbackInitialDelay(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the initial waiting time before first callback
notifications, in secondsYAPI_Exception
- on errorpublic String get_callbackSchedule() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getCallbackSchedule() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_callbackSchedule(String newval) throws YAPI_Exception
newval
- : a string corresponding to the HTTP callback schedule strategy, as a text stringYAPI_Exception
- on errorpublic int setCallbackSchedule(String newval) throws YAPI_Exception
newval
- : a string corresponding to the HTTP callback schedule strategy, as a text stringYAPI_Exception
- on errorpublic int get_callbackMinDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCallbackMinDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_callbackMinDelay(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the minimum waiting time between two HTTP callbacks, in secondsYAPI_Exception
- on errorpublic int setCallbackMinDelay(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the minimum waiting time between two HTTP callbacks, in secondsYAPI_Exception
- on errorpublic int get_callbackMaxDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCallbackMaxDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_callbackMaxDelay(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the waiting time between two HTTP callbacks when there
is nothing newYAPI_Exception
- on errorpublic int setCallbackMaxDelay(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the waiting time between two HTTP callbacks when there
is nothing newYAPI_Exception
- on errorpublic int get_poeCurrent() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getPoeCurrent() throws YAPI_Exception
YAPI_Exception
- on errorpublic static YNetwork FindNetwork(String func)
func
- : a string that uniquely characterizes the network interface, for instance
YHUBETH1.network.public static YNetwork FindNetworkInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the network interface, for instance
YHUBETH1.network.public int registerValueCallback(YNetwork.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 useDHCP(String fallbackIpAddr, int fallbackSubnetMaskLen, String fallbackRouter) throws YAPI_Exception
fallbackIpAddr
- : fallback IP address, to be used when no DHCP reply is receivedfallbackSubnetMaskLen
- : fallback subnet mask length when no DHCP reply is received, as an
integer (e.g. 24 means 255.255.255.0)fallbackRouter
- : fallback router IP address, to be used when no DHCP reply is receivedYAPI_Exception
- on errorpublic int useDHCPauto() throws YAPI_Exception
YAPI_Exception
- on errorpublic int useStaticIP(String ipAddress, int subnetMaskLen, String router) throws YAPI_Exception
ipAddress
- : device IP addresssubnetMaskLen
- : subnet mask length, as an integer (e.g. 24 means 255.255.255.0)router
- : router IP address (default gateway)YAPI_Exception
- on errorpublic String ping(String host) throws YAPI_Exception
host
- : the hostname or the IP address of the targetYAPI_Exception
public int triggerCallback() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_periodicCallbackSchedule(String interval, int offset) throws YAPI_Exception
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.YAPI_Exception
- on errorpublic YNetwork nextNetwork()
public static YNetwork FirstNetwork()
public static YNetwork FirstNetworkInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2021. All rights reserved.