Skip to content

Commit d9cbf24

Browse files
committed
Allow target-specific overrides for default client transport-mode
Application can override the default client transport-mode from mbed_app.json via definition: "target.macros_add": ["MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP"], If UDP or UDP_QUEUE is more suitable as default transport-mode. For example cellular targets most likely should be UDP_QUEUE.
1 parent 46c8b0a commit d9cbf24

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mbed_cloud_client_user_config.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
#define MBED_CLOUD_CLIENT_USER_CONFIG_H
2121

2222
#define MBED_CLOUD_CLIENT_ENDPOINT_TYPE "default"
23-
#define MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP
2423
#define MBED_CLOUD_CLIENT_LIFETIME 3600
2524

25+
// Application can override the default transport mode via `target.macros_add` definition in mbed_app.json.
26+
#if !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP) && !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP) && !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE)
27+
#define MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP
28+
#endif
29+
2630
#ifdef MBED_CONF_MBED_CLIENT_SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
2731
#define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE MBED_CONF_MBED_CLIENT_SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
2832
#else

0 commit comments

Comments
 (0)