Skip to content
Snippets Groups Projects
Commit 8dd0b291 authored by Zbigniew Bodek's avatar Zbigniew Bodek
Browse files

main: Remove WEBSOCKET-related code


Simplify the app by removing MQTT_LIB_WEBSOCKET code.
Not intended to be used on Nitrogen.

Signed-off-by: default avatarZbigniew Bodek <zbigniew.bodek@huawei.com>
parent 12ad6e2e
No related branches found
No related tags found
No related merge requests found
......@@ -31,17 +31,9 @@
#endif
#ifdef CONFIG_MQTT_LIB_TLS
#ifdef CONFIG_MQTT_LIB_WEBSOCKET
#define SERVER_PORT 9001
#else
#define SERVER_PORT 8883
#endif /* CONFIG_MQTT_LIB_WEBSOCKET */
#else
#ifdef CONFIG_MQTT_LIB_WEBSOCKET
#define SERVER_PORT 9001
#else
#define SERVER_PORT 1883
#endif /* CONFIG_MQTT_LIB_WEBSOCKET */
#endif
#define APP_CONNECT_TIMEOUT_MS 2000
......
......@@ -32,14 +32,6 @@ struct k_mem_domain app_domain;
static APP_BMEM uint8_t rx_buffer[APP_MQTT_BUFFER_SIZE];
static APP_BMEM uint8_t tx_buffer[APP_MQTT_BUFFER_SIZE];
#if defined(CONFIG_MQTT_LIB_WEBSOCKET)
/* Making RX buffer large enough that the full IPv6 packet can fit into it */
#define MQTT_LIB_WEBSOCKET_RECV_BUF_LEN 1280
/* Websocket needs temporary buffer to store partial packets */
static APP_BMEM uint8_t temp_ws_rx_buf[MQTT_LIB_WEBSOCKET_RECV_BUF_LEN];
#endif
/* The mqtt client struct */
static APP_BMEM struct mqtt_client client_ctx;
......@@ -386,11 +378,7 @@ static void client_init(struct mqtt_client *client)
/* MQTT transport configuration */
#if defined(CONFIG_MQTT_LIB_TLS)
#if defined(CONFIG_MQTT_LIB_WEBSOCKET)
client->transport.type = MQTT_TRANSPORT_SECURE_WEBSOCKET;
#else
client->transport.type = MQTT_TRANSPORT_SECURE;
#endif
struct mqtt_sec_config *tls_config = &client->transport.tls.config;
......@@ -403,23 +391,9 @@ static void client_init(struct mqtt_client *client)
#else
tls_config->hostname = NULL;
#endif
#else
#if defined(CONFIG_MQTT_LIB_WEBSOCKET)
client->transport.type = MQTT_TRANSPORT_NON_SECURE_WEBSOCKET;
#else
client->transport.type = MQTT_TRANSPORT_NON_SECURE;
#endif
#endif
#if defined(CONFIG_MQTT_LIB_WEBSOCKET)
client->transport.websocket.config.host = SERVER_ADDR;
client->transport.websocket.config.url = "/mqtt";
client->transport.websocket.config.tmp_buf = temp_ws_rx_buf;
client->transport.websocket.config.tmp_buf_len =
sizeof(temp_ws_rx_buf);
client->transport.websocket.timeout = 5 * MSEC_PER_SEC;
#endif
#if defined(CONFIG_SOCKS)
mqtt_client_set_proxy(client, &socks5_proxy,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment