diff --git a/zh_network.c b/zh_network.c index c12033b..5c8bef4 100644 --- a/zh_network.c +++ b/zh_network.c @@ -209,7 +209,7 @@ esp_err_t zh_network_send(const uint8_t *target, const uint8_t *data, const uint } if (xQueueSend(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); return ESP_FAIL; } return ESP_OK; @@ -283,7 +283,7 @@ static void _recv_cb(const esp_now_recv_info_t *esp_now_info, const uint8_t *dat #endif if (xQueueSendToFront(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } } else @@ -356,7 +356,7 @@ static void _processing(void *pvParameter) queue.time = esp_timer_get_time() / 1000; if (xQueueSend(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } ESP_LOGI(TAG, "System message for routing request from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X added to queue.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); queue.id = TO_SEND; @@ -368,7 +368,7 @@ static void _processing(void *pvParameter) ESP_LOGI(TAG, "Outgoing ESP-NOW data from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X processed success.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); if (xQueueSendToFront(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } heap_caps_free(peer); break; @@ -392,7 +392,7 @@ static void _processing(void *pvParameter) memcpy(on_send->mac_addr, queue.data.original_target_mac, 6); if (esp_now_send((uint8_t *)peer->peer_addr, (uint8_t *)&queue.data, sizeof(_queue_t) - 12) != ESP_OK) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); heap_caps_free(peer); heap_caps_free(on_send); break; @@ -409,7 +409,7 @@ static void _processing(void *pvParameter) ESP_LOGI(TAG, "Outgoing ESP-NOW data from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X processed success.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); if (esp_event_post(ZH_NETWORK, ZH_NETWORK_ON_SEND_EVENT, on_send, sizeof(zh_network_event_on_send_t), portTICK_PERIOD_MS) != ESP_OK) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } } if (queue.data.message_type == SEARCH_REQUEST) @@ -436,7 +436,7 @@ static void _processing(void *pvParameter) queue.time = esp_timer_get_time() / 1000; if (xQueueSend(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } } } @@ -494,7 +494,7 @@ static void _processing(void *pvParameter) queue.time = esp_timer_get_time() / 1000; if (xQueueSend(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } ESP_LOGI(TAG, "System message for routing request to MAC %02X:%02X:%02X:%02X:%02X:%02X added to queue.", MAC2STR(queue.data.original_target_mac)); queue.id = TO_SEND; @@ -506,7 +506,7 @@ static void _processing(void *pvParameter) ESP_LOGI(TAG, "Outgoing ESP-NOW data from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X processed success.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); if (xQueueSendToFront(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } } } @@ -523,7 +523,7 @@ static void _processing(void *pvParameter) zh_network_event_on_recv_t *on_recv = heap_caps_malloc(sizeof(zh_network_event_on_recv_t), MALLOC_CAP_8BIT); if (on_recv == NULL) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); heap_caps_free(on_recv); break; } @@ -533,7 +533,7 @@ static void _processing(void *pvParameter) on_recv->data = heap_caps_malloc(queue.data.payload_len, MALLOC_CAP_8BIT); if (on_recv->data == NULL) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); heap_caps_free(on_recv); heap_caps_free(on_recv->data); break; @@ -544,13 +544,13 @@ static void _processing(void *pvParameter) ESP_LOGI(TAG, "Incoming ESP-NOW data from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X processed success.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); if (esp_event_post(ZH_NETWORK, ZH_NETWORK_ON_RECV_EVENT, on_recv, sizeof(zh_network_event_on_recv_t) + on_recv->data_len + sizeof(on_recv->data_len), portTICK_PERIOD_MS) != ESP_OK) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } heap_caps_free(on_recv); queue.id = TO_SEND; if (xQueueSend(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } break; case UNICAST: @@ -560,7 +560,7 @@ static void _processing(void *pvParameter) zh_network_event_on_recv_t *on_recv = heap_caps_malloc(sizeof(zh_network_event_on_recv_t), MALLOC_CAP_8BIT); if (on_recv == NULL) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); heap_caps_free(on_recv); break; } @@ -570,7 +570,7 @@ static void _processing(void *pvParameter) on_recv->data = heap_caps_malloc(queue.data.payload_len, MALLOC_CAP_8BIT); if (on_recv->data == NULL) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); heap_caps_free(on_recv); heap_caps_free(on_recv->data); break; @@ -580,7 +580,7 @@ static void _processing(void *pvParameter) ESP_LOGI(TAG, "Incoming ESP-NOW data from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X processed success.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); if (esp_event_post(ZH_NETWORK, ZH_NETWORK_ON_RECV_EVENT, on_recv, sizeof(zh_network_event_on_recv_t) + on_recv->data_len + sizeof(on_recv->data_len), portTICK_PERIOD_MS) != ESP_OK) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } heap_caps_free(on_recv); queue.id = TO_SEND; @@ -593,7 +593,7 @@ static void _processing(void *pvParameter) queue.data.message_id = abs(esp_random()); // It is not clear why esp_random() sometimes gives negative values. if (xQueueSendToFront(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } break; } @@ -602,7 +602,7 @@ static void _processing(void *pvParameter) queue.id = TO_SEND; if (xQueueSendToFront(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } break; case DELIVERY_CONFIRM: @@ -622,7 +622,7 @@ static void _processing(void *pvParameter) queue.id = TO_SEND; if (xQueueSendToFront(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } break; case SEARCH_REQUEST: @@ -658,7 +658,7 @@ static void _processing(void *pvParameter) ESP_LOGI(TAG, "Incoming ESP-NOW data from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X processed success.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); if (xQueueSendToFront(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } break; } @@ -667,7 +667,7 @@ static void _processing(void *pvParameter) queue.id = TO_SEND; if (xQueueSendToFront(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } break; case SEARCH_RESPONSE: @@ -697,7 +697,7 @@ static void _processing(void *pvParameter) queue.id = TO_SEND; if (xQueueSendToFront(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } break; } @@ -717,7 +717,7 @@ static void _processing(void *pvParameter) zh_network_event_on_send_t *on_send = heap_caps_malloc(sizeof(zh_network_event_on_send_t), MALLOC_CAP_8BIT); if (on_send == NULL) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); heap_caps_free(on_send); break; } @@ -728,7 +728,7 @@ static void _processing(void *pvParameter) ESP_LOGI(TAG, "Unicast message from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X removed from confirmation message waiting list.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); if (esp_event_post(ZH_NETWORK, ZH_NETWORK_ON_SEND_EVENT, on_send, sizeof(zh_network_event_on_send_t), portTICK_PERIOD_MS) != ESP_OK) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } heap_caps_free(on_send); flag = true; @@ -745,7 +745,7 @@ static void _processing(void *pvParameter) zh_network_event_on_send_t *on_send = heap_caps_malloc(sizeof(zh_network_event_on_send_t), MALLOC_CAP_8BIT); if (on_send == NULL) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); heap_caps_free(on_send); break; } @@ -756,7 +756,7 @@ static void _processing(void *pvParameter) ESP_LOGI(TAG, "Unicast message from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X removed from confirmation message waiting list.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); if (esp_event_post(ZH_NETWORK, ZH_NETWORK_ON_SEND_EVENT, on_send, sizeof(zh_network_event_on_send_t), portTICK_PERIOD_MS) != ESP_OK) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } heap_caps_free(on_send); } @@ -764,7 +764,7 @@ static void _processing(void *pvParameter) } if (xQueueSend(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } } break; @@ -786,7 +786,7 @@ static void _processing(void *pvParameter) queue.id = TO_SEND; if (xQueueSend(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } flag = true; break; @@ -802,7 +802,7 @@ static void _processing(void *pvParameter) zh_network_event_on_send_t *on_send = heap_caps_malloc(sizeof(zh_network_event_on_send_t), MALLOC_CAP_8BIT); if (on_send == NULL) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); heap_caps_free(on_send); break; } @@ -813,7 +813,7 @@ static void _processing(void *pvParameter) ESP_LOGI(TAG, "Unicast message from MAC %02X:%02X:%02X:%02X:%02X:%02X to MAC %02X:%02X:%02X:%02X:%02X:%02X removed from routing waiting list.", MAC2STR(queue.data.original_sender_mac), MAC2STR(queue.data.original_target_mac)); if (esp_event_post(ZH_NETWORK, ZH_NETWORK_ON_SEND_EVENT, on_send, sizeof(zh_network_event_on_send_t), portTICK_PERIOD_MS) != ESP_OK) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } heap_caps_free(on_send); } @@ -832,7 +832,7 @@ static void _processing(void *pvParameter) } if (xQueueSend(_queue_handle, &queue, portTICK_PERIOD_MS) != pdTRUE) { - ESP_LOGE(TAG, "ESP-NOW message processing task internal error."); + ESP_LOGE(TAG, "ESP-NOW message processing task internal error at line %d.", __LINE__); } } break;