Skip to content

logging: backend: mqtt: Fixed MQTT compiler warning #93293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions subsys/logging/backends/log_backend_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LOG_MODULE_REGISTER(log_backend_mqtt, CONFIG_LOG_DEFAULT_LEVEL);
#include <errno.h>

static bool panic;
static char *mqtt_topic = CONFIG_LOG_BACKEND_MQTT_TOPIC_DEFAULT;
static const char *mqtt_topic = CONFIG_LOG_BACKEND_MQTT_TOPIC_DEFAULT;
static uint8_t log_buf[CONFIG_LOG_BACKEND_MQTT_MAX_MSG_SIZE];
static uint32_t log_format_current = CONFIG_LOG_BACKEND_MQTT_OUTPUT_DEFAULT;

Expand All @@ -33,7 +33,7 @@ static int log_output_func(uint8_t *data, size_t length, void *output_ctx)
struct mqtt_client *client = (struct mqtt_client *)output_ctx;
struct mqtt_publish_param param = {0};

param.message.topic.topic.utf8 = (uint8_t *)mqtt_topic;
param.message.topic.topic.utf8 = (const uint8_t *)mqtt_topic;
param.message.topic.topic.size = strlen(mqtt_topic);
param.message.topic.qos = CONFIG_LOG_BACKEND_MQTT_QOS;
param.message.payload.data = data;
Expand Down