]> git.basschouten.com Git - openhab-addons.git/blob
f42798bbd37e9e3739796ec0046dbf68f80eb216
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.asuswrt.internal.constants;
14
15 import java.util.Set;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18
19 /**
20  * The {@link AsuswrtBindingSettings} class defines common settings constants, which are used across the whole binding.
21  *
22  * @author Christian Wild - Initial contribution
23  */
24 @NonNullByDefault
25 public class AsuswrtBindingSettings {
26
27     // Binding settings
28     public static final Integer HTTP_MAX_CONNECTIONS = 10; // setMaxConnectionsPerDestination for HTTP-Client
29     public static final Integer HTTP_MAX_QUEUED_REQUESTS = 10; // setMaxRequestsQueuedPerDestination for HTTP-Client
30     public static final Integer HTTP_TIMEOUT_MS = 5000; // http request timeout
31     public static final Integer HTTP_QUERY_MIN_GAP_MS = 5000; // http minimun gap between query data requests
32     public static final String HTTP_CONTENT_TYPE = "application/x-www-form-urlencoded";
33     public static final String HTTP_USER_AGENT = "asusrouter-Android-DUTUtil-1.0.0.3.58-163";
34     public static final String HTTP_CONTENT_CHARSET = "utf-8";
35     public static final String HTTP_PROTOCOL = "http://";
36     public static final String HTTPS_PROTOCOL = "https://";
37     public static final Boolean HTTP_SSL_TRUST_ALL = true; // trust all ssl-certs
38
39     public static final Integer COOKIE_LIFETIME_S = 3600; // lifetime of login-cookie
40     public static final Integer POLLING_INTERVAL_S_MIN = 5; // minimum polling interval
41     public static final Integer POLLING_INTERVAL_S_DEFAULT = 20; // default polling interval
42     public static final Integer RECONNECT_INTERVAL_S = 30; // interval trying try to reconnect to router
43     public static final Integer DISCOVERY_TIMEOUT_S = 10; // discovery service timeout in s
44     public static final Integer DISCOVERY_AUTOREMOVE_S = 1800; // discovery service remove things after x seconds
45
46     // List of device commands
47     public static final String CMD_GET_SYSINFO = "nvram_get(productid);nvram_get(firmver);nvram_get(buildno);nvram_get(extendno);nvram_get(lan_hwaddr);";
48     public static final String CMD_GET_LANINFO = "nvram_get(lan_hwaddr);nvram_get(lan_ipaddr);nvram_get(lan_proto);nvram_get(lan_netmask);nvram_get(lan_gateway);";
49     public static final String CMD_GET_WANINFO = "wanlink(status);wanlink(type);wanlink(ipaddr);wanlink(netmask);wanlink(gateway);wanlink(dns);wanlink(lease);wanlink(expires);";
50     public static final String CMD_GET_CLIENTLIST = "get_clientlist();";
51     public static final String CMD_GET_TRAFFIC = "netdev(appobj);";
52     public static final String CMD_GET_UPTIME = "uptime();";
53     public static final String CMD_GET_USAGE = "cpu_usage(appobj);memory_usage(appobj);";
54     public static final String CMD_GET_MEMUSAGE = "memory_usage(appobj);";
55     public static final String CMD_GET_CPUUSAGE = "cpu_usage(appobj);";
56
57     // List of interfaces
58     public static final String INTERFACE_WAN = "wan";
59     public static final String INTERFACE_LAN = "lan";
60     public static final String INTERFACE_WLAN = "wlan";
61     public static final String INTERFACE_CLIENT = "client";
62     public static final Set<String> INTERFACE_LIST = Set.of(INTERFACE_WAN, INTERFACE_LAN);
63 }