Mistake on this page? Email us
MbedCloudClientConfigCheck.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // Copyright 2016-2017 ARM Ltd.
3 //
4 // SPDX-License-Identifier: Apache-2.0
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 //
10 // http://www.apache.org/licenses/LICENSE-2.0
11 //
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
17 // ----------------------------------------------------------------------------
18 
19 
20 #ifndef MBED_CLOUD_CONFIG_CHECK_H
21 #define MBED_CLOUD_CONFIG_CHECK_H
22 
30 #ifndef MBED_CLOUD_CLIENT_ENDPOINT_TYPE
31 #error "MBED_CLOUD_CLIENT_ENDPOINT_TYPE must be defined with valid endpoint type"
32 #endif
33 
34 #ifndef MBED_CLOUD_CLIENT_LIFETIME
35 #error "MBED_CLOUD_CLIENT_LIFETIME must be defined with valid non-zero lifetime value in seconds, default is 3600"
36 #endif
37 
38 #ifndef MBED_CLOUD_CLIENT_LISTEN_PORT
39 #error "MBED_CLOUD_CLIENT_LISTEN_PORT must be defined with valid non-zero port number, default is 0"
40 #endif
41 
42 #if !defined(SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE) || (SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE < 16) || (SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE > 1024)
43 #error "SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE must be defined with one of the values from this - 16, 32, 64, 128, 256, 512 or 1024"
44 #endif
45 
46 #if defined (MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP_QUEUE)
47 #error "TCP queue mode not supported!"
48 #endif
49 
50 #if defined (MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP) && ( defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP) || \
51 defined (MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE) || defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP_QUEUE))
52 #error "Only one MBED_CLOUD_CLIENT_TRANSPORT_MODE can be defined at a time"
53 #endif
54 
55 #if defined (MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP) && ( defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP) || \
56 defined (MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE) || defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP_QUEUE))
57 #error "Only one MBED_CLOUD_CLIENT_TRANSPORT_MODE can be defined at a time"
58 #endif
59 
60 #if defined (MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE) && ( defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP) || \
61 defined (MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP) || defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP_QUEUE))
62 #error "Only one MBED_CLOUD_CLIENT_TRANSPORT_MODE can be defined at a time"
63 #endif
64 
65 #if defined (MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP_QUEUE) && ( defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP) || \
66 defined (MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE) || defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP))
67 #error "Only one MBED_CLOUD_CLIENT_TRANSPORT_MODE can be defined at a time"
68 #endif
69 
70 #if !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP) && !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP) \
71 && !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE) && !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP_QUEUE)
72 #error "One MBED_CLOUD_CLIENT_TRANSPORT_MODE must be defined at a time"
73 #endif
74 
75 #if !defined(MBED_CLOUD_CLIENT_STL_API)
76 #error "MBED_CLOUD_CLIENT_STL_API must have a value, nonzero enables API with STL"
77 #endif
78 
79 #if !defined(MBED_CLOUD_CLIENT_STD_NAMESPACE_POLLUTION)
80 #error "MBED_CLOUD_CLIENT_STD_NAMESPACE_POLLUTION must have a value, nonzero maintains legacy behavior"
81 #endif
82 
83 #if defined(ARM_UC_PROFILE_MBED_CLIENT_LITE) && (ARM_UC_PROFILE_MBED_CLIENT_LITE==1)
84 #error "Pelion Device Management Client must use ARM_UC_PROFILE_MBED_CLIENT_LITE=0 configuration."
85 #endif
86 
87 #if defined (PAL_MAX_FRAG_LEN) && (PAL_MAX_FRAG_LEN > 4)
88 #error "PAL_MAX_FRAG_LEN must be defined with one of the following values 1, 2, 3 or 4"
89 #endif
90 
91 #if defined (PAL_MAX_FRAG_LEN) && (PAL_MAX_FRAG_LEN == 1) && (SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE > 256)
92 #error "SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE must be 256 or lower."
93 #endif
94 
95 #if defined (PAL_MAX_FRAG_LEN) && (PAL_MAX_FRAG_LEN == 2) && (SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE > 512)
96 #error "SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE must be 512 or lower."
97 #endif
98 
99 #ifndef MBED_CLIENT_EVENT_LOOP_SIZE
100 #error "MBED_CLIENT_EVENT_LOOP_SIZE is mandatory parameter which should be defined always."
101 #endif
102 
103 #endif // MBED_CLOUD_CONFIG_CHECK_H