Skip to content

Commit

Permalink
SUKU boolian suppart added to lua print and package send methods
Browse files Browse the repository at this point in the history
  • Loading branch information
SukuWc committed Aug 28, 2024
1 parent a613636 commit c0ff22e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions grid_common/grid_lua_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c0ff22e

Please sign in to comment.