Skip to content

Commit 6ba33dd

Browse files
woody-applebukepo
andauthored
A number of unused preprocessor definitions proliferate the tree. Resolves project-chip#525 (project-chip#774)
* Cleaning out dead code, and renaming * Cleaning up more constants * More cleanup * Fixing build * Updating end periods * Update src/lib/core/CHIPError.h Co-authored-by: Yakun Xu <xyk@google.com> Co-authored-by: Yakun Xu <xyk@google.com>
1 parent 1dc5183 commit 6ba33dd

20 files changed

+43
-466
lines changed

config/esp32/components/chip/Kconfig

-64
Original file line numberDiff line numberDiff line change
@@ -305,70 +305,6 @@ menu "CHIP Core"
305305

306306
endmenu # "Security Options"
307307

308-
menu "CHIP Data Management Options"
309-
310-
config MAX_WDM_SUBSCRIPTION_CLIENTS
311-
int "Max WDM Subscription Clients"
312-
default 2
313-
help
314-
Specifies the maximum number of WDM subscription client objects that can be active simultaneously.
315-
One client object is required for each outbound subscription from the device to a peer node, including
316-
the subscription the device establishes to the CHIP service, if enabled.
317-
318-
config MAX_WDM_SUBSCRIPTION_HANDLERS
319-
int "Max WDM Subscription Handlers"
320-
default 2
321-
help
322-
Specifies the maximum number of WDM subscription handlers objects that can be active simultaneously.
323-
One handler object is required for each inbound subscription to the device from a peer node. This
324-
includes the counter-subscription from the CHIP service to the device, if enabled.
325-
326-
config MAX_WDM_NOTIFIES_IN_FLIGHT
327-
int "Maximum In-flight WDM Notify Messages"
328-
default 2
329-
help
330-
Specifies the maximum number of WDM notify messages that can be in-flight at any given time, across
331-
all active inbound subscriptions. Any changes to trait data that occur while this limit is reached
332-
will be queued locally until an in-flight completes.
333-
334-
config MAX_WDM_NOTIFY_SIZE
335-
int "Maximum WDM Notify Message Size"
336-
default 2048
337-
help
338-
Specifies the maximum size (in bytes) of a WDM notify message that will be generated while servicing
339-
an inbound subscription to the device. The limit governs both notify messages that are generated
340-
as part of the subscription establishment process, as well as those generated when data changes
341-
occur.
342-
343-
Note that other limits, such as UDP MTU size limits, or limits on available packet buffers may mean
344-
that notify messages smaller than this limit are generated.
345-
346-
config MIN_WDM_NOTIFY_BUFFER_SIZE
347-
int "Minimum WDM Notify Buffer Size"
348-
default 1024
349-
help
350-
When allocating a packet buffer in preparation for generating a WDM notify message, defer sending
351-
the notify message if a buffer of at least this size is unavailable.
352-
353-
Note that, because the WDM protocol requires that the static properties of a trait, and any
354-
events emited by a trait, fit within a single notify message, this value should be set *larger*
355-
than the larges of these limits for any trait published by the device.
356-
357-
config MAX_WDM_RESUBSCRIBE_INTERVAL
358-
int "Maximum WDM Resubscribe Interval (ms)"
359-
default 5538000
360-
help
361-
When the default fibonacci-based resubscription back-off policy is in effect, this value specifies the
362-
maximum time (in ms) between any two resubscription attempts.
363-
364-
config WDM_ENABLE_SCHEMA_CHECK
365-
bool "Enable WDM Message Schema Checking"
366-
default y
367-
help
368-
Enables pre-flight schema validation for protocol messages used in CHIP Data Management profile.
369-
370-
endmenu
371-
372308
endmenu # "CHIP"
373309

374310

config/ios/CHIPProjectConfig.h

-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
// Uncomment this for a large Tunnel MTU.
4141
//#define CHIP_CONFIG_TUNNEL_INTERFACE_MTU (9000)
4242

43-
// Max number of Bindings per CHIPExchangeManager
44-
#define CHIP_CONFIG_MAX_BINDINGS 8
45-
4643
#define CHIP_CONFIG_LEGACY_CASE_AUTH_DELEGATE 0
4744

4845
#define CHIP_CONFIG_LEGACY_KEY_EXPORT_DELEGATE 0

config/standalone/CHIPProjectConfig.h

+1-7
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626

2727
#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1
2828

29-
// Configure WDM for event offload
30-
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1
31-
3229
#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1
3330

3431
#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2
@@ -38,9 +35,6 @@
3835
// Uncomment this for a large Tunnel MTU.
3936
//#define CHIP_CONFIG_TUNNEL_INTERFACE_MTU (9000)
4037

41-
// Max number of Bindings per CHIPExchangeManager
42-
#define CHIP_CONFIG_MAX_BINDINGS 8
43-
4438
// Enable support functions for parsing command-line arguments
4539
#define CHIP_CONFIG_ENABLE_ARG_PARSER 1
4640

@@ -54,7 +48,7 @@
5448
// Increase session idle timeout in stand-alone builds for the convenience of developers.
5549
#define CHIP_CONFIG_DEFAULT_SECURITY_SESSION_IDLE_TIMEOUT 120000
5650

57-
#define CHIP_CONFIG_ENABLE_WDM_UPDATE 1
51+
#define CHIP_CONFIG_ENABLE_UPDATE 1
5852

5953
#define CHIP_CONFIG_LEGACY_CASE_AUTH_DELEGATE 0
6054

configure.ac

-1
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,6 @@ AC_MSG_NOTICE([
21352135
Build long running tests : ${nl_cv_build_long_tests}
21362136
Build tools : ${build_tools}
21372137
Tunnel Failover support : ${build_tunnel_failover}
2138-
Build legacy WDM profile : ${build_legacy_wdm}
21392138
Prefix : ${prefix}
21402139
Shadow directory program : ${LNDIR}
21412140
Cocoa support : ${enable_cocoa}

docs/Doxyfile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,7 @@ INCLUDE_FILE_PATTERNS =
19891989
# recursively expanded use the := operator instead of the = operator.
19901990
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
19911991

1992-
PREDEFINED = CHIP_SYSTEM_CONFIG_USE_SOCKETS=1 CHIP_SYSTEM_CONFIG_USE_LWIP=1 INET_CONFIG_ENABLE_IPV4=1 CHIP_CONFIG_SECURITY_TEST_MODE=1 CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING=1 DEPRECATED_MSG_ATTRIBUTE(x)=
1992+
PREDEFINED = CHIP_SYSTEM_CONFIG_USE_SOCKETS=1 CHIP_SYSTEM_CONFIG_USE_LWIP=1 INET_CONFIG_ENABLE_IPV4=1 CHIP_CONFIG_SECURITY_TEST_MODE=1 DEPRECATED_MSG_ATTRIBUTE(x)=
19931993

19941994
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
19951995
# tag can be used to specify a list of macro names that should be expanded. The

examples/lock-app/efr32/include/CHIPProjectConfig.h

-16
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,6 @@
108108
*/
109109
#define CHIP_DEVICE_CONFIG_USE_TEST_SERIAL_NUMBER "DUMMY_SN"
110110

111-
/**
112-
* CHIP_CONFIG_MAX_BINDINGS
113-
*
114-
* Maximum number of simultaneously active bindings per ChipExchangeManager
115-
* 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4
116-
* in the worst case. Keeping another 4 as buffer.
117-
*/
118-
#define CHIP_CONFIG_MAX_BINDINGS 8
119-
120-
/**
121-
* CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD
122-
*
123-
* Select the ability to offload event logs to any interested subscribers using WDM.
124-
*/
125-
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1
126-
127111
/**
128112
* CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS
129113
*

examples/lock-app/nrf5/main/include/CHIPProjectConfig.h

-16
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,6 @@
116116
*/
117117
//#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1
118118

119-
/**
120-
* CHIP_CONFIG_MAX_BINDINGS
121-
*
122-
* Maximum number of simultaneously active bindings per CHIPExchangeManager
123-
* 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4
124-
* in the worst case. Keeping another 4 as buffer.
125-
*/
126-
#define CHIP_CONFIG_MAX_BINDINGS 8
127-
128-
/**
129-
* CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD
130-
*
131-
* Select the ability to offload event logs to any interested subscribers using WDM.
132-
*/
133-
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1
134-
135119
/**
136120
* CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS
137121
*

src/include/platform/CHIPDeviceEvent.h

-7
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@ enum PublicEventTypes
137137
*/
138138
kServiceConnectivityChange,
139139

140-
/**
141-
* Service Subscription State Change
142-
*
143-
* Signals a change in the device's WDM subscription state with a chip-enabled service.
144-
*/
145-
kServiceSubscriptionStateChange,
146-
147140
/**
148141
* Fabric Membership Change
149142
*

src/lib/core/CHIPConfig.h

-27
Original file line numberDiff line numberDiff line change
@@ -1267,20 +1267,6 @@
12671267
#define CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS 16
12681268
#endif // CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS
12691269

1270-
/**
1271-
* @def CHIP_CONFIG_MAX_BINDINGS
1272-
*
1273-
* @brief
1274-
* Maximum number of simultaneously active bindings per chipExchangeManager
1275-
* The new single source TimeSync client takes one binding.
1276-
* Every WDM one-way subscription takes one binding. Mutual subscription counts as two one-way subscriptions.
1277-
* A reserved slot is needed to take an incoming subscription request.
1278-
* For a device with 2 mutual subscriptions, and one single source time sync client, it needs 2 x 2 + 1 = 5 bindings at least.
1279-
* At least six is needed if it still wants to take new WDM subscriptions under this load.
1280-
*/
1281-
#ifndef CHIP_CONFIG_MAX_BINDINGS
1282-
#define CHIP_CONFIG_MAX_BINDINGS 6
1283-
#endif // CHIP_CONFIG_MAX_BINDINGS
12841270

12851271
/**
12861272
* @def CHIP_CONFIG_CONNECT_IP_ADDRS
@@ -2137,19 +2123,6 @@
21372123
#define CHIP_CONFIG_SERIALIZATION_DEBUG_LOGGING 0
21382124
#endif
21392125

2140-
/**
2141-
* @def CHIP_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
2142-
*
2143-
* @brief Enable deserialization as well as serialization APIs. We
2144-
* make deserialization configurable because it requires some extra
2145-
* memory that a highly resource-constrained platform could preserve
2146-
* if it doesn't consume WDM events or otherwise has no need to
2147-
* deserialize.
2148-
*/
2149-
#ifndef CHIP_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
2150-
#define CHIP_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION 1
2151-
#endif
2152-
21532126
/**
21542127
* @def CHIP_CONFIG_SERIALIZATION_LOG_FLOATS
21552128
*

src/lib/core/CHIPError.cpp

+18-33
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, int32_t err)
421421
desc = "Shortcut Tunnel peer entry not found";
422422
break;
423423
case CHIP_ERROR_TUNNEL_FORCE_ABORT:
424-
desc = "Forced Tunnel Abort.";
424+
desc = "Forced Tunnel Abort";
425425
break;
426426
case CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED:
427427
desc = "DRBG entropy source failed to generate entropy data";
@@ -478,43 +478,43 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, int32_t err)
478478
desc = "Failure to lock/unlock OS-provided lock";
479479
break;
480480
case CHIP_ERROR_UNSUPPORTED_PASSCODE_CONFIG:
481-
desc = "Unsupported passcode encryption configuration.";
481+
desc = "Unsupported passcode encryption configuration";
482482
break;
483483
case CHIP_ERROR_PASSCODE_AUTHENTICATION_FAILED:
484-
desc = "Passcode authentication failed.";
484+
desc = "Passcode authentication failed";
485485
break;
486486
case CHIP_ERROR_PASSCODE_FINGERPRINT_FAILED:
487-
desc = "Passcode fingerprint failed.";
487+
desc = "Passcode fingerprint failed";
488488
break;
489489
case CHIP_ERROR_SERIALIZATION_ELEMENT_NULL:
490-
desc = "Element requested is null.";
490+
desc = "Element requested is null";
491491
break;
492492
case CHIP_ERROR_WRONG_CERT_SIGNATURE_ALGORITHM:
493493
desc = "Certificate not signed with required signature algorithm";
494494
break;
495495
case CHIP_ERROR_WRONG_CHIP_SIGNATURE_ALGORITHM:
496496
desc = "CHIP signature not signed with required signature algorithm";
497497
break;
498-
case CHIP_ERROR_WDM_SCHEMA_MISMATCH:
499-
desc = "Schema mismatch in WDM.";
498+
case CHIP_ERROR_SCHEMA_MISMATCH:
499+
desc = "Schema mismatch";
500500
break;
501501
case CHIP_ERROR_INVALID_INTEGER_VALUE:
502-
desc = "Invalid integer value.";
502+
desc = "Invalid integer value";
503503
break;
504504
case CHIP_ERROR_CASE_RECONFIG_REQUIRED:
505505
desc = "CASE reconfiguration required";
506506
break;
507507
case CHIP_ERROR_TOO_MANY_CASE_RECONFIGURATIONS:
508-
desc = "Too many CASE reconfigurations were received.";
508+
desc = "Too many CASE reconfigurations were received";
509509
break;
510510
case CHIP_ERROR_BAD_REQUEST:
511-
desc = "Request cannot be processed or fulfilled.";
511+
desc = "Request cannot be processed or fulfilled";
512512
break;
513513
case CHIP_ERROR_INVALID_MESSAGE_FLAG:
514-
desc = "Invalid message flag.";
514+
desc = "Invalid message flag";
515515
break;
516516
case CHIP_ERROR_KEY_EXPORT_RECONFIGURE_REQUIRED:
517-
desc = "Key export protocol required to reconfigure.";
517+
desc = "Key export protocol required to reconfigure";
518518
break;
519519
case CHIP_ERROR_NO_COMMON_KEY_EXPORT_CONFIGURATIONS:
520520
desc = "No supported key export protocol configurations in common";
@@ -537,8 +537,8 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, int32_t err)
537537
case CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES:
538538
desc = "Too many shared session end nodes";
539539
break;
540-
case CHIP_ERROR_WDM_MALFORMED_DATA_ELEMENT:
541-
desc = "Malformed WDM DataElement";
540+
case CHIP_ERROR_MALFORMED_DATA_ELEMENT:
541+
desc = "Malformed DataElement";
542542
break;
543543
case CHIP_ERROR_WRONG_CERT_TYPE:
544544
desc = "Wrong certificate type";
@@ -570,39 +570,24 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, int32_t err)
570570
case CHIP_ERROR_MISMATCH_UPDATE_REQUIRED_VERSION:
571571
desc = "Update Required Version mismatch";
572572
break;
573-
case CHIP_ERROR_WDM_MALFORMED_STATUS_ELEMENT:
574-
desc = "Status Element in WDM update is malformed";
575-
break;
576-
case CHIP_ERROR_WDM_SUBSCRIPTIONLESS_NOTIFY_PARTIAL:
577-
desc = "The WDM Subscriptionless Notify is partial";
578-
break;
579573
case CHIP_ERROR_ACCESS_DENIED:
580574
desc = "The CHIP message is not granted access";
581575
break;
582576
case CHIP_ERROR_UNKNOWN_RESOURCE_ID:
583577
desc = "Unknown resource ID";
584578
break;
585-
case CHIP_ERROR_WDM_MALFORMED_UPDATE_RESPONSE:
586-
desc = "Malformed WDM Update response";
587-
break;
588-
case CHIP_ERROR_WDM_VERSION_MISMATCH:
589-
desc = "The conditional update of a WDM path failed for a version mismatch";
590-
break;
591-
case CHIP_ERROR_WDM_POTENTIAL_DATA_LOSS:
592-
desc = "A potential data loss was detected in a WDM Trait Instance";
579+
case CHIP_ERROR_VERSION_MISMATCH:
580+
desc = "Version mismatch";
593581
break;
594582
case CHIP_ERROR_UNSUPPORTED_THREAD_NETWORK_CREATE:
595583
desc = "Legacy device doesn't support standalone Thread network creation";
596584
break;
597-
case CHIP_ERROR_WDM_INCONSISTENT_CONDITIONALITY:
585+
case CHIP_ERROR_INCONSISTENT_CONDITIONALITY:
598586
desc = "The Trait Instance is already being updated with a different conditionality";
599587
break;
600-
case CHIP_ERROR_WDM_LOCAL_DATA_INCONSISTENT:
588+
case CHIP_ERROR_LOCAL_DATA_INCONSISTENT:
601589
desc = "The local data does not match any known version of the Trait Instance";
602590
break;
603-
case CHIP_ERROR_WDM_PATH_STORE_FULL:
604-
desc = "A WDM TraitPath store is full";
605-
break;
606591
case CHIP_EVENT_ID_FOUND:
607592
desc = "Event ID matching criteria was found";
608593
break;

0 commit comments

Comments
 (0)