Skip to content

Commit

Permalink
removed unnecessary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ellebi2000 committed Jun 2, 2024
1 parent 19e1d19 commit 976f329
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions pico_w/mqtt/mqtt_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ target_link_libraries(mqttApp
pico_cyw43_arch_lwip_threadsafe_background
pico_lwip_mqtt
)
# Initialise pico_sdk from installed location
# (note this can come from environment, CMake cache etc)

set(PICO_BOARD pico_w CACHE STRING "Board type")
# Pull in Raspberry Pi Pico SDK (must be before project)
if (PICO_SDK_VERSION_STRING VERSION_LESS "1.4.0")
message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.4.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
endif()
# Initialise the Raspberry Pi Pico SDK
# Add executable. Default name is the project name, version 0.1

pico_set_program_name(mqttApp "mqttApp")
pico_set_program_version(mqttApp "0.1")
pico_enable_stdio_uart(mqttApp 1)
Expand Down
6 changes: 2 additions & 4 deletions pico_w/mqtt/mqtt_client/mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ static void mqtt_incoming_data_cb(void *arg, const u8_t *data, u16_t len, u8_t f
strncpy(mqtt_client->data, data, len);
mqtt_client->len = len;
mqtt_client->data[len] = '\0';
//Stampo i messaggi e i topic
printf("Topic: %s, Message: %s\n", mqtt_client->topic, mqtt_client->data);

printf("Topic: %s, Message: %s\n", mqtt_client->topic, mqtt_client->data);

if (strcmp(mqtt->topic, "/led") == 0)
{
Expand All @@ -90,7 +89,6 @@ static void mqtt_incoming_data_cb(void *arg, const u8_t *data, u16_t len, u8_t f
else if (strcmp((const char *)mqtt_client->data, "Off") == 0)
control_led(false);
}

}

static void mqtt_incoming_publish_cb(void *arg, const char *topic, u32_t tot_len) {
Expand Down Expand Up @@ -120,7 +118,7 @@ int main() {
}
// MQTT CLIENT INFO
mqtt->mqtt_client_info.client_id = MQTT_CLIENT_ID;
mqtt->mqtt_client_info.keep_alive = 60; // Keep alive in secondi
mqtt->mqtt_client_info.keep_alive = 60; // Keep alive in sec

if (cyw43_arch_init()) {
printf("Failed to inizialize CYW43\n");
Expand Down

0 comments on commit 976f329

Please sign in to comment.