From c0ff22eb1a7d1bd8541d077c95226559c1f781b3 Mon Sep 17 00:00:00 2001 From: suku Date: Wed, 28 Aug 2024 15:29:18 +0200 Subject: [PATCH] SUKU boolian suppart added to lua print and package send methods --- grid_common/grid_lua_api.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/grid_common/grid_lua_api.c b/grid_common/grid_lua_api.c index 4a5b18f6..7d478e0a 100644 --- a/grid_common/grid_lua_api.c +++ b/grid_common/grid_lua_api.c @@ -18,6 +18,8 @@ grid_port_debug_printf("%s", lua_tostring(L, i)); // grid_platform_printf(" str: %s ", lua_tostring(L, i)); + } else if (lua_type(L, i) == LUA_TBOOLEAN) { + lua_toboolean(L, i) ? grid_port_debug_printf("true") : grid_port_debug_printf("false"); } else if (lua_type(L, i) == LUA_TNUMBER) { lua_Number lnum = lua_tonumber(L, i); @@ -124,6 +126,19 @@ strcat(message, lua_tostring(L, i)); strcat(message, "\""); // grid_platform_printf(" str: %s ", lua_tostring(L, i)); + } else if (lua_type(L, i) == LUA_TBOOLEAN) { + bool b = lua_toboolean(L, i); + if (strlen(message) > 0) { + + strcat(message, ","); + } + if (b) { + + strcat(message, "true"); + } else { + + strcat(message, "false"); + } } else if (lua_type(L, i) == LUA_TNUMBER) { if (strlen(message) > 0) {