From 46393bacdb16f90c6f8cbb242fcaa495566f14e8 Mon Sep 17 00:00:00 2001 From: linuswck Date: Wed, 28 Feb 2024 12:54:21 +0800 Subject: [PATCH] Add comments on TCP client development --- src/net/cmd_handler.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/net/cmd_handler.rs b/src/net/cmd_handler.rs index 9ddec5e..5ade379 100644 --- a/src/net/cmd_handler.rs +++ b/src/net/cmd_handler.rs @@ -163,6 +163,10 @@ pub struct TecSetICmd { json: TecSetICmdJson } +/// Miniconf is very slow in debug builds (~3-4ms of cmd decoding time). +/// Make sure kirdy's firmware is flashed with release builds. +/// The received message must contain only one json cmd. TCP client should set TCP_NODELAY or equivalent flag in its TCP Socket +/// Settings to avoid unwanted buffering on TX Data and minimize TX latency. pub fn execute_cmd(buffer: &mut [u8], buffer_size: usize, mut laser: LdDrive, mut tec: Thermostat, mut device_settings: DeviceSettings)->(LdDrive, Thermostat, bool, DeviceSettings){ let mut should_reset = false;