Changed some LOG_INFO to LOG_DEBUG
This commit is contained in:
@@ -37,7 +37,7 @@ static const char *TAG = "mug";
|
|||||||
|
|
||||||
static void mqtt_pub_request_cb(void *arg, err_t result) {
|
static void mqtt_pub_request_cb(void *arg, err_t result) {
|
||||||
if(result != ERR_OK) {
|
if(result != ERR_OK) {
|
||||||
LOG_INFO(TAG, "Publish result: %d", result);
|
LOG_DEBUG(TAG, "Publish result: %d", result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ static void publish_data(mqtt_client_t *client, void *arg) {
|
|||||||
}
|
}
|
||||||
err = mqtt_publish(client, "getImageList", pub_payload, strlen(pub_payload), qos, retain, mqtt_pub_request_cb, arg);
|
err = mqtt_publish(client, "getImageList", pub_payload, strlen(pub_payload), qos, retain, mqtt_pub_request_cb, arg);
|
||||||
if (err != ERR_OK) {
|
if (err != ERR_OK) {
|
||||||
LOG_INFO(TAG, "Publish err: %d", err);
|
LOG_DEBUG(TAG, "Publish err: %d", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,12 +126,13 @@ static void mqtt_incoming_data_cb(void *arg, const uint8_t *data, uint16_t len,
|
|||||||
//places text on the lcd
|
//places text on the lcd
|
||||||
LOG_INFO(TAG, "incoming data on input/setText: %s.", data_buffer);
|
LOG_INFO(TAG, "incoming data on input/setText: %s.", data_buffer);
|
||||||
lcd_clear_text();
|
lcd_clear_text();
|
||||||
lcd_display_text((const char*)data_buffer, xpos, ypos, color, font);
|
lcd_display_text((const char*)data_buffer, xpos, ypos, color, bgcolor, font);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
//places an image on the lcd
|
//places an image on the lcd
|
||||||
LOG_INFO(TAG, "incoming data on input/setImage: %s.", data_buffer);
|
LOG_INFO(TAG, "incoming data on input/setImage: %s.", data_buffer);
|
||||||
lcd_clear_images();
|
lcd_clear_images();
|
||||||
|
lcd_set_bg_color_layer0(bgcolor);
|
||||||
if(data_buffer[len-3] == 'b') {
|
if(data_buffer[len-3] == 'b') {
|
||||||
lcd_draw_img_from_fs((const char*)data_buffer, xpos, ypos);
|
lcd_draw_img_from_fs((const char*)data_buffer, xpos, ypos);
|
||||||
}
|
}
|
||||||
@@ -161,7 +162,7 @@ static void mqtt_incoming_data_cb(void *arg, const uint8_t *data, uint16_t len,
|
|||||||
* @brief Callback function for outgoing subscribe request
|
* @brief Callback function for outgoing subscribe request
|
||||||
*/
|
*/
|
||||||
static void mqtt_sub_request_cb(void *arg, err_t result) {
|
static void mqtt_sub_request_cb(void *arg, err_t result) {
|
||||||
LOG_INFO(TAG, "Subscribe result: %d", result);
|
LOG_DEBUG(TAG, "Subscribe result: %d", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,9 +173,8 @@ static void mqtt_sub_request_cb(void *arg, err_t result) {
|
|||||||
static void mqtt_connection_cb(mqtt_client_t *client, void *arg, mqtt_connection_status_t status) {
|
static void mqtt_connection_cb(mqtt_client_t *client, void *arg, mqtt_connection_status_t status) {
|
||||||
err_t err;
|
err_t err;
|
||||||
|
|
||||||
LOG_INFO(TAG, "entered connection cb function");
|
|
||||||
if (status == MQTT_CONNECT_ACCEPTED) {
|
if (status == MQTT_CONNECT_ACCEPTED) {
|
||||||
LOG_INFO(TAG, "mqtt_connection_cb: Successfully connected");
|
LOG_INFO(TAG, "Successfully connected");
|
||||||
|
|
||||||
//set up callback function for input
|
//set up callback function for input
|
||||||
mqtt_set_inpub_callback(client, mqtt_incoming_publish_cb, mqtt_incoming_data_cb, arg);
|
mqtt_set_inpub_callback(client, mqtt_incoming_publish_cb, mqtt_incoming_data_cb, arg);
|
||||||
@@ -182,7 +182,7 @@ static void mqtt_connection_cb(mqtt_client_t *client, void *arg, mqtt_connection
|
|||||||
//subscribe to the topics setText, setImage, setColor and setTextcolor
|
//subscribe to the topics setText, setImage, setColor and setTextcolor
|
||||||
err = mqtt_subscribe(client, "input/#", 1, mqtt_sub_request_cb, arg);
|
err = mqtt_subscribe(client, "input/#", 1, mqtt_sub_request_cb, arg);
|
||||||
if (err != ERR_OK) {
|
if (err != ERR_OK) {
|
||||||
LOG_INFO(TAG, "mqtt_subscribe return: %d", err);
|
LOG_DEBUG(TAG, "mqtt_subscribe return: %d", err);
|
||||||
}
|
}
|
||||||
|
|
||||||
//publish list of images here
|
//publish list of images here
|
||||||
@@ -203,20 +203,20 @@ static void mosquitto_connect(mqtt_client_t *client) {
|
|||||||
struct mqtt_connect_client_info_t ci;
|
struct mqtt_connect_client_info_t ci;
|
||||||
err_t err;
|
err_t err;
|
||||||
|
|
||||||
LOG_INFO(TAG, "testing the connection");
|
LOG_INFO(TAG, "Attempting MQTT Connection");
|
||||||
|
|
||||||
memset(&ci, 0, sizeof(ci));
|
memset(&ci, 0, sizeof(ci));
|
||||||
|
|
||||||
ci.client_id = "lwip_test";
|
ci.client_id = "STM32";
|
||||||
ip_addr_t server_ip;
|
ip_addr_t server_ip;
|
||||||
IP4_ADDR(&server_ip, 192,168,69,11);
|
IP4_ADDR(&server_ip, 192,168,69,11);
|
||||||
uint16_t server_port = 1883;
|
uint16_t server_port = 1883;
|
||||||
err = mqtt_client_connect(client, &server_ip, server_port, mqtt_connection_cb, 0, &ci);
|
err = mqtt_client_connect(client, &server_ip, server_port, mqtt_connection_cb, 0, &ci);
|
||||||
if (err != ERR_OK) {
|
if (err != ERR_OK) {
|
||||||
LOG_INFO(TAG, "mqtt_connect return %d", err);
|
LOG_DEBUG(TAG, "mqtt_connect return %d", err);
|
||||||
}
|
}
|
||||||
if (err == ERR_OK) {
|
if (err == ERR_OK) {
|
||||||
LOG_INFO(TAG, "Went into mqtt_client_connect; mqtt_connect return %d", err);
|
LOG_DEBUG(TAG, "Went into mqtt_client_connect; mqtt_connect return %d", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ void mug_init(void) {
|
|||||||
|
|
||||||
mqtt_client_t *client = mqtt_client_new();
|
mqtt_client_t *client = mqtt_client_new();
|
||||||
if (client != NULL) {
|
if (client != NULL) {
|
||||||
LOG_INFO(TAG, "Starting connection test");
|
LOG_DEBUG(TAG, "Starting connection test");
|
||||||
mosquitto_connect(client);
|
mosquitto_connect(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user