From c9b3edcc11aaa2016339b7221b03f94de1fcc5f4 Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Thu, 11 May 2023 21:52:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E4=BB=8E=E6=A1=8C?= =?UTF-8?q?=E9=9D=A2=E7=AB=AF=E6=94=B6=E5=8F=96=E7=94=B5=E8=84=91=E9=9F=B3?= =?UTF-8?q?=E9=87=8F=E5=92=8C=E6=98=BE=E7=A4=BA=E5=99=A8=E4=BA=AE=E5=BA=A6?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/desktop.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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);