diff --git a/main/desktop.c b/main/desktop.c index bf75fec..b24897e 100644 --- a/main/desktop.c +++ b/main/desktop.c @@ -126,9 +126,21 @@ static void udp_server_task(void *pvParameters) { (uint8_t *)&(rx_buffer[3]), len - 3); break; - default: + case 3: // computer brightness changed + if (rx_buffer[1] == 1) { + display1_brightness.value = rx_buffer[2]; + } else if (rx_buffer[1] == 2) { + display2_brightness.value = rx_buffer[2]; + } + break; - ESP_LOGI(UDP_SERVER_TAG, "%s", rx_buffer); + case 4: // computer volume changed + computer_volume.value = rx_buffer[1]; + break; + + default: + ESP_LOG_BUFFER_HEXDUMP(UDP_SERVER_TAG, rx_buffer, len, + ESP_LOG_INFO); break; } ESP_LOGD(UDP_SERVER_TAG, "Received %d bytes from %s:", len, addr_str);