config.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Kubos Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
24 #ifndef TELEMETRY_CONFIG_H
25 #define TELEMETRY_CONFIG_H
26 
27 #include <csp/csp_autoconfig.h>
28 
30 #ifndef YOTTA_CFG_TELEMETRY_CSP_ADDRESS
31 #define TELEMETRY_CSP_ADDRESS 1
32 #else
33 #define TELEMETRY_CSP_ADDRESS YOTTA_CFG_TELEMETRY_CSP_ADDRESS
34 #endif
35 
37 #ifndef YOTTA_CFG_TELEMETRY_MESSAGE_QUEUE_SIZE
38 #define MESSAGE_QUEUE_SIZE 10
39 #else
40 #define MESSAGE_QUEUE_SIZE YOTTA_CFG_TELEMETRY_MESSAGE_QUEUE_SIZE
41 #endif
42 
44 #ifndef YOTTA_CFG_TELEMETRY_CSP_PORT
45 #define TELEMETRY_CSP_PORT 20
46 #else
47 #define TELEMETRY_CSP_PORT YOTTA_CFG_TELEMETRY_CSP_PORT
48 #endif
49 
50 
52 #ifndef YOTTA_CFG_TELEMETRY_SUBSCRIBERS_MAX_NUM
53 #define TELEMETRY_SUBSCRIBERS_MAX_NUM ((CSP_CONN_MAX / 2) - 1)
54 #else
55 #define TELEMETRY_SUBSCRIBERS_MAX_NUM YOTTA_CFG_TELEMETRY_SUBSCRIBERS_MAX_NUM
56 #endif
57 
58 /* Check to ensure the configured number of subscribers is even possible
59  based on how many connections CSP has allocated. This should eventually get
60  migrated into a higher level CSP manager.
61 */
62 #if ((TELEMETRY_SUBSCRIBERS_MAX_NUM * 2) + 1) > CSP_CONN_MAX
63 #warning "Number of telemetry subscribers exceeds number of available CSP connections"
64 #endif
65 
67 #ifndef YOTTA_CFG_TELEMETERY_SUBSCRIBERS_READ_ATTEPMTS
68 #define TELEMETRY_SUBSCRIBER_READ_ATTEMPTS 10
69 #else
70 #define TELEMETRY_SUBSCRIBER_READ_ATTEMPTS YOTTA_CFG_TELEMETRY_SUBSCRIBERS_READ_ATTEMPTS
71 #endif
72 
74 #ifndef YOTTA_CFG_TELEMETRY_RX_THREAD_STACK_SIZE
75 #define TELEMETRY_RX_THREAD_STACK_SIZE 1000
76 #else
77 #define TELEMETRY_RX_THREAD_STACK_SIZE YOTTA_CFG_TELEMETRY_RX_THREAD_STACK_SIZE
78 #endif
79 
81 #ifndef YOTTA_CFG_TELEMETRY_RX_THREAD_PRIORITY
82 #define TELEMETRY_RX_THREAD_PRIORITY 2
83 #else
84 #define TELEMETRY_RX_THREAD_PRIORITY YOTTA_CFG_TELEMETRY_RX_THREAD_PRIORITY
85 #endif
86 
87 #endif
88 
89 /* @} */