feat: 支持从桌面端收取电脑音量和显示器亮度。
This commit is contained in:
parent
7c9c016aef
commit
7a0d5d7fcd
@ -126,9 +126,21 @@ static void udp_server_task(void *pvParameters) {
|
|||||||
(uint8_t *)&(rx_buffer[3]), len - 3);
|
(uint8_t *)&(rx_buffer[3]), len - 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
case 3: // computer brightness changed
|
||||||
|
if (rx_buffer[1] == 0) {
|
||||||
|
display1_brightness.value = rx_buffer[2];
|
||||||
|
} else if (rx_buffer[1] == 1) {
|
||||||
|
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;
|
break;
|
||||||
}
|
}
|
||||||
ESP_LOGD(UDP_SERVER_TAG, "Received %d bytes from %s:", len, addr_str);
|
ESP_LOGD(UDP_SERVER_TAG, "Received %d bytes from %s:", len, addr_str);
|
||||||
|
Loading…
Reference in New Issue
Block a user