Code: Select all
while (1) {
//int err = bind(sock, (struct sockaddr *)&tx_addr, sizeof(tx_addr));
if (uxQueueMessagesWaiting(audio_data_queue) > 0){
uint16_t msg[128]; //128
xStatus = xQueueReceive( audio_data_queue, &msg, 1 );
//ESP_LOGI(TAG, "Size of MSG: %d", sizeof(msg));
err = sendto(sock, &msg, sizeof(msg), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
if (err < 0) {
ESP_LOGE(TAG, "Error occurred during sending: errno %d", errno);
// break;
}
}}