1 /* 2 * Copyright (c) 2017 Intel Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __CONFIG_H__ 8 #define __CONFIG_H__ 9 10 #ifdef CONFIG_NET_CONFIG_SETTINGS 11 #ifdef CONFIG_NET_IPV6 12 #define ZEPHYR_ADDR CONFIG_NET_CONFIG_MY_IPV6_ADDR 13 #define SERVER_ADDR CONFIG_NET_CONFIG_PEER_IPV6_ADDR 14 #else 15 #define ZEPHYR_ADDR CONFIG_NET_CONFIG_MY_IPV4_ADDR 16 #define SERVER_ADDR CONFIG_NET_CONFIG_PEER_IPV4_ADDR 17 #endif 18 #else 19 #ifdef CONFIG_NET_IPV6 20 #define ZEPHYR_ADDR "2001:db8::1" 21 #define SERVER_ADDR "2001:db8::2" 22 #else 23 #define ZEPHYR_ADDR "192.168.1.101" 24 #define SERVER_ADDR "192.168.1.10" 25 #endif 26 #endif 27 28 #if defined(CONFIG_SOCKS) 29 #define SOCKS5_PROXY_ADDR SERVER_ADDR 30 #define SOCKS5_PROXY_PORT 1080 31 #endif 32 33 #ifdef CONFIG_MQTT_LIB_TLS 34 #ifdef CONFIG_MQTT_LIB_WEBSOCKET 35 #define SERVER_PORT 9001 36 #else 37 #define SERVER_PORT 8883 38 #endif /* CONFIG_MQTT_LIB_WEBSOCKET */ 39 #else 40 #ifdef CONFIG_MQTT_LIB_WEBSOCKET 41 #define SERVER_PORT 9001 42 #else 43 #define SERVER_PORT 1883 44 #endif /* CONFIG_MQTT_LIB_WEBSOCKET */ 45 #endif 46 47 #define APP_CONNECT_TIMEOUT_MS 2000 48 #define APP_SLEEP_MSECS 500 49 50 #define APP_CONNECT_TRIES 10 51 52 #define APP_MQTT_BUFFER_SIZE 128 53 54 #define MQTT_CLIENTID "zephyr_publisher" 55 56 /* Set the following to 1 to enable the Bluemix topic format */ 57 #define APP_BLUEMIX_TOPIC 0 58 59 /* These are the parameters for the Bluemix topic format */ 60 #if APP_BLUEMIX_TOPIC 61 #define BLUEMIX_DEVTYPE "sensor" 62 #define BLUEMIX_DEVID "carbon" 63 #define BLUEMIX_EVENT "status" 64 #define BLUEMIX_FORMAT "json" 65 #endif 66 67 #endif 68