commit 07/02/2026

This commit is contained in:
2026-02-07 17:23:41 +07:00
parent c8f7f35c79
commit 1790852242
13 changed files with 5223 additions and 1934 deletions

View File

@@ -72,14 +72,13 @@ class TCP_Android_Command_Server {
//println("Received command from $key : $str")
str.split("@").map { it.trim() }.filter { ValidString(it) }
.forEach {
Logger.info{"Receive command from $key : $it"}
process_command(key,it) { reply ->
try {
val cc = String_to_Byte_Android(reply)
if (cc.isNotEmpty()){
dout.write(cc)
dout.flush()
Logger.info{"Sent reply ${cc.size} bytes to $key : $reply"}
//Logger.info{"Sent reply ${cc.size} bytes to $key : $reply"}
} else Logger.error { "Empty reply to send to $key" }
} catch (e: Exception) {
@@ -149,7 +148,7 @@ class TCP_Android_Command_Server {
* @param cb Callback to send reply string
*/
private fun process_command(key: String, cmd: String, cb: Consumer<String>) {
Logger.info { "Command from $key : $cmd" }
if ("PING" != cmd) Logger.info { "Command from $key : $cmd" }
val parts = cmd.split(";").map { it.trim() }.filter { it.isNotBlank() }
when (parts[0]) {
"GETLOGIN" -> {