mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-30 02:38:19 +02:00
fix: Minor warning of unused variable
In case of hardcoded id mac array was unused.
This commit is contained in:
@ -22,13 +22,13 @@ static const char *TAG = "platform";
|
|||||||
#endif
|
#endif
|
||||||
char *platform_create_id_string(void)
|
char *platform_create_id_string(void)
|
||||||
{
|
{
|
||||||
uint8_t mac[6];
|
|
||||||
char *id_string = calloc(1, MAX_ID_STRING);
|
char *id_string = calloc(1, MAX_ID_STRING);
|
||||||
ESP_MEM_CHECK(TAG, id_string, return NULL);
|
ESP_MEM_CHECK(TAG, id_string, return NULL);
|
||||||
#ifndef MAC_TYPE
|
#ifndef MAC_TYPE
|
||||||
ESP_LOGW(TAG, "Soc doesn't provide MAC, client could be disconnected in case of device with same name in the broker.");
|
ESP_LOGW(TAG, "Soc doesn't provide MAC, client could be disconnected in case of device with same name in the broker.");
|
||||||
sprintf(id_string, "esp_mqtt_client_id");
|
sprintf(id_string, "esp_mqtt_client_id");
|
||||||
#else
|
#else
|
||||||
|
uint8_t mac[6];
|
||||||
esp_read_mac(mac, MAC_TYPE);
|
esp_read_mac(mac, MAC_TYPE);
|
||||||
sprintf(id_string, "ESP32_%02x%02X%02X", mac[3], mac[4], mac[5]);
|
sprintf(id_string, "ESP32_%02x%02X%02X", mac[3], mac[4], mac[5]);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user