Skip to content

Commit 4271f16

Browse files
feat: Removed modem idle and activeFilter properties (#5755)
* Removed idle and activeFilter from web2 Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Removed idle and activeFilter messages Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Deprecated idle and activeFilter API; removed implementations Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Removed idle and activeFilter references from web2 Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Fixed tests Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Fixed copyrights Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Fixed copyrights again Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Fixed tests again Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Fixed tests file copyright Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Fixed tests again Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> * Remove useless spaces from copyright Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com> --------- Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com>
1 parent c4e5b25 commit 4271f16

18 files changed

Lines changed: 305 additions & 512 deletions

File tree

kura/org.eclipse.kura.api/src/main/java/org/eclipse/kura/net/modem/ModemConfig.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2022 Eurotech and/or its affiliates and others
2+
* Copyright (c) 2011, 2025 Eurotech and/or its affiliates and others
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -288,7 +288,9 @@ public void setMaxFail(int maxFail) {
288288
* The 'idle' option specifies that pppd should disconnect if the link is idle for n seconds.
289289
*
290290
* @return value of the 'idle' option as {@link int}
291+
* @deprecated since 3.0
291292
*/
293+
@Deprecated
292294
public int getIdle() {
293295
return this.idle;
294296
}
@@ -298,7 +300,9 @@ public int getIdle() {
298300
* The 'idle' option specifies that pppd should disconnect if the link is idle for n seconds.
299301
*
300302
* @param idle
303+
* @deprecated since 3.0
301304
*/
305+
@Deprecated
302306
public void setIdle(int idle) {
303307
this.idle = idle;
304308
}
@@ -308,7 +312,9 @@ public void setIdle(int idle) {
308312
* applied to data packets to determine which packets are to be regarded as link activity.
309313
*
310314
* @return value of the 'active-filter' option as {@link String}
315+
* @deprecated since 3.0
311316
*/
317+
@Deprecated
312318
public String getActiveFilter() {
313319
return this.activeFilter;
314320
}
@@ -319,7 +325,9 @@ public String getActiveFilter() {
319325
*
320326
* @param activeFilter
321327
* - active filter as {@link String}
328+
* @deprecated since 3.0
322329
*/
330+
@Deprecated
323331
public void setActiveFilter(String activeFilter) {
324332
this.activeFilter = activeFilter;
325333
}

kura/org.eclipse.kura.core.net/src/main/java/org/eclipse/kura/core/net/ModemConfigurationInterpreter.java

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2022 Eurotech and/or its affiliates and others
2+
* Copyright (c) 2022, 2025 Eurotech and/or its affiliates and others
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -123,8 +123,6 @@ private static ModemConfig getModemConfig(String prefix, Map<String, Object> pro
123123
modemConfig.setHoldoff(getHoldoff(prefix, properties));
124124
modemConfig.setMaxFail(getMaximumFailures(prefix, properties));
125125
modemConfig.setResetTimeout(getResetTimeout(prefix, properties));
126-
modemConfig.setIdle(getIdle(prefix, properties));
127-
modemConfig.setActiveFilter(getActiveFilter(prefix, properties));
128126
modemConfig.setLcpEchoInterval(getLcpEchoInterval(prefix, properties));
129127
modemConfig.setLcpEchoFailure(getLcpEchoFailure(prefix, properties));
130128
modemConfig.setUsername((String) properties.get(prefix + "username"));
@@ -143,7 +141,8 @@ private static boolean isGpsEnabled(String prefix, Map<String, Object> propertie
143141

144142
private static boolean isDiversityEnabled(String prefix, Map<String, Object> properties) {
145143
String key = prefix + "diversityEnabled";
146-
Object value = properties.getOrDefault(key, NetworkConfigurationConstants.DEFAULT_MODEM_DIVERSITY_ENABLED_VALUE);
144+
Object value = properties.getOrDefault(key,
145+
NetworkConfigurationConstants.DEFAULT_MODEM_DIVERSITY_ENABLED_VALUE);
147146
return value != null ? (Boolean) value : NetworkConfigurationConstants.DEFAULT_MODEM_DIVERSITY_ENABLED_VALUE;
148147
}
149148

@@ -161,22 +160,11 @@ private static int getLcpEchoFailure(String prefix, Map<String, Object> properti
161160

162161
private static int getLcpEchoInterval(String prefix, Map<String, Object> properties) {
163162
String key = prefix + "lcpEchoInterval";
164-
Object value = properties.getOrDefault(key, NetworkConfigurationConstants.DEFAULT_MODEM_LCP_ECHO_INTERVAL_VALUE);
163+
Object value = properties.getOrDefault(key,
164+
NetworkConfigurationConstants.DEFAULT_MODEM_LCP_ECHO_INTERVAL_VALUE);
165165
return value != null ? (Integer) value : NetworkConfigurationConstants.DEFAULT_MODEM_LCP_ECHO_INTERVAL_VALUE;
166166
}
167167

168-
private static String getActiveFilter(String prefix, Map<String, Object> properties) {
169-
String key = prefix + "activeFilter";
170-
Object value = properties.getOrDefault(key, NetworkConfigurationConstants.DEFAULT_MODEM_ACTIVE_FILTER_VALUE);
171-
return value != null ? (String) value : NetworkConfigurationConstants.DEFAULT_MODEM_ACTIVE_FILTER_VALUE;
172-
}
173-
174-
private static int getIdle(String prefix, Map<String, Object> properties) {
175-
String key = prefix + "idle";
176-
Object value = properties.getOrDefault(key, NetworkConfigurationConstants.DEFAULT_MODEM_IDLE_VALUE);
177-
return value != null ? (Integer) value : NetworkConfigurationConstants.DEFAULT_MODEM_IDLE_VALUE;
178-
}
179-
180168
private static int getResetTimeout(String prefix, Map<String, Object> properties) {
181169
String key = prefix + "resetTimeout";
182170
Object value = properties.getOrDefault(key, NetworkConfigurationConstants.DEFAULT_MODEM_RESET_TIMEOUT_VALUE);
@@ -210,7 +198,8 @@ private static int getProfileId(String prefix, Map<String, Object> properties) {
210198
private static PdpType getPdpType(String prefix, Map<String, Object> properties) {
211199
String key = prefix + "pdpType";
212200
Object value = properties.getOrDefault(key, NetworkConfigurationConstants.DEFAULT_MODEM_PDP_TYPE_VALUE.name());
213-
return value != null ? parsePdpType((String) value) : NetworkConfigurationConstants.DEFAULT_MODEM_PDP_TYPE_VALUE;
201+
return value != null ? parsePdpType((String) value)
202+
: NetworkConfigurationConstants.DEFAULT_MODEM_PDP_TYPE_VALUE;
214203
}
215204

216205
private static PdpType parsePdpType(String pdpTypeString) {
@@ -262,7 +251,8 @@ private static IPAddress parseIpAddress(String ipAddressString) throws KuraExcep
262251

263252
private static int getHeaderCompression(String prefix, Map<String, Object> properties) {
264253
String key = prefix + "headerCompression";
265-
Object value = properties.getOrDefault(key, NetworkConfigurationConstants.DEFAULT_MODEM_HEADER_COMPRESSION_VALUE);
254+
Object value = properties.getOrDefault(key,
255+
NetworkConfigurationConstants.DEFAULT_MODEM_HEADER_COMPRESSION_VALUE);
266256
return value != null ? (Integer) value : NetworkConfigurationConstants.DEFAULT_MODEM_HEADER_COMPRESSION_VALUE;
267257
}
268258

0 commit comments

Comments
 (0)