commit 07/02/2026
This commit is contained in:
@@ -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" -> {
|
||||
|
||||
Reference in New Issue
Block a user