Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / resource / csdk / stack / include / ocstackconfig.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 #ifndef OCSTACK_CONFIG_H_
22 #define OCSTACK_CONFIG_H_
23
24 // This file contains all the variables which can be configured/modified as
25 // per platform or specific product usage scenarios.
26
27 /** This would need to be updated in future as we move to support IPv6 and other
28  *  technologies.
29  */
30 #define DEV_ADDR_SIZE_MAX (16)
31
32 /**
33  * Maximum length of the response supported by Server for any REST request.
34  * The actual repsonse length is 256 for Arduino and 1024 for other platforms.
35  * Note that the stack will add a prefix and suffix to the payload.
36  * Prefix : {"oic":[
37  * Suffix : ]}
38  * They have a combined size of 10 bytes.
39  */
40 #ifdef WITH_ARDUINO
41 #define MAX_RESPONSE_LENGTH (256)
42 #else
43 #define MAX_RESPONSE_LENGTH (1024)
44 #endif
45
46 /**
47  * Maximum length of the request supported by Client/Server for any REST request.
48  */
49 #ifdef WITH_ARDUINO
50 #define MAX_REQUEST_LENGTH (256)
51 #else
52 #define MAX_REQUEST_LENGTH (1024)
53 #endif
54
55 /**
56  * Maximum length of the URI supported by client/server while processing
57  * REST requests/responses.
58  */
59 #define MAX_URI_LENGTH (64)
60
61 /**
62  * Maximum length of the query supported by client/server while processing
63  * REST requests/responses.
64  */
65 #define MAX_QUERY_LENGTH (64)
66
67 /**
68  * Maximum length of the Manufacturer name supported by the server
69  * for manufacturer name
70  */
71 #define MAX_MANUFACTURER_NAME_LENGTH (16)
72
73 /**
74  * Maximum length of the URL to the Manufacturer details supported by
75  * the server.
76  */
77 #define MAX_MANUFACTURER_URL_LENGTH (32)
78
79 /**
80  * Maximum number of resources which can be contained inside collection
81  * resource.
82  */
83 #define MAX_CONTAINED_RESOURCES  (5)
84
85 /**
86  *  Maximum number of vendor specific header options an application can set or receive in pdu
87  */
88 #define MAX_HEADER_OPTIONS (2)
89
90 /**
91  *  Maximum Length of the vendor specific header option
92  */
93 #define MAX_HEADER_OPTION_DATA_LENGTH (16)
94
95 /*
96  * Sets the time to live (TTL) for response callbacks.
97  * The callbacks will be up for deletion after such time but are not guaranteed
98  * to be deleted immediately and you may get responses even after timeout.
99  * This timeout will NOT apply to OBSERVE requests. OBSERVE needs an explicit cancel using OCCancel().
100  * NOTE: Changing the setting to a very long duration may lead to unsupported and untested
101  * operation. Setting this to as small a value as reasonable will reclaim memory faster.
102  */
103 #define MAX_CB_TIMEOUT_SECONDS   (2 * 60 * 60)  // 2 hours = 7200 seconds.
104
105 #endif //OCSTACK_CONFIG_H_