@@ -32,20 +32,6 @@ extern const uint8_t mqtt_eclipse_org_pem_start[] asm("_binary_mqtt_eclipse_or
3232#endif
3333extern const uint8_t mqtt_eclipse_org_pem_end [] asm("_binary_mqtt_eclipse_org_pem_end" );
3434
35- //
36- // Note: this function is for testing purposes only publishing the entire active partition
37- // (to be checked against the original binary)
38- //
39- static void send_binary (esp_mqtt_client_handle_t client )
40- {
41- spi_flash_mmap_handle_t out_handle ;
42- const void * binary_address ;
43- const esp_partition_t * partition = esp_ota_get_running_partition ();
44- esp_partition_mmap (partition , 0 , partition -> size , SPI_FLASH_MMAP_DATA , & binary_address , & out_handle );
45- int msg_id = esp_mqtt_client_publish (client , "/topic/binary" , binary_address , partition -> size , 0 , 0 );
46- ESP_LOGI (TAG , "binary sent with msg_id=%d" , msg_id );
47- }
48-
4935static esp_err_t mqtt_event_handler_cb (esp_mqtt_event_handle_t event )
5036{
5137 esp_mqtt_client_handle_t client = event -> client ;
@@ -82,10 +68,6 @@ static esp_err_t mqtt_event_handler_cb(esp_mqtt_event_handle_t event)
8268 ESP_LOGI (TAG , "MQTT_EVENT_DATA" );
8369 printf ("TOPIC=%.*s\r\n" , event -> topic_len , event -> topic );
8470 printf ("DATA=%.*s\r\n" , event -> data_len , event -> data );
85- if (strncmp (event -> data , "send binary please" , event -> data_len ) == 0 ) {
86- ESP_LOGI (TAG , "Sending the binary" );
87- send_binary (client );
88- }
8971 break ;
9072 case MQTT_EVENT_ERROR :
9173 ESP_LOGI (TAG , "MQTT_EVENT_ERROR" );
0 commit comments