remove MIX bindings in lua

This commit is contained in:
iceman1001 committed 2026-08-29 16:33:16 +02:00
1 parent bd20f7cc81
commit 094bed1176
1 file changed
+1 -50
+1 -50
View File
@@ -98,55 +98,7 @@ static int l_fast_push_mode(lua_State *L) {
/**
* The following params expected:
* @brief l_SendCommandMIX
* @param L - a lua string with the following five params.
* @param cmd must be hexstring, max u64
* @param arg0 must be hexstring, max u64
* @param arg1 must be hexstring, max u64
* @param arg2 must be hexstring, max u64
* @param data must be hexstring less than 1024 chars(512bytes)
* @return
*/
static int l_SendCommandMIX(lua_State *L) {
uint64_t cmd, arg0, arg1, arg2;
uint8_t data[PM3_CMD_DATA_SIZE] = {0};
size_t len = 0, size;
// check number of arguments
int n = lua_gettop(L);
if (n != 5) {
return returnToLuaWithError(L, "You need to supply five parameters");
}
// parse input
cmd = luaL_checknumber(L, 1);
arg0 = luaL_checknumber(L, 2);
arg1 = luaL_checknumber(L, 3);
arg2 = luaL_checknumber(L, 4);
// data
const char *p_data = luaL_checklstring(L, 5, &size);
if (size) {
if (size > 1024)
size = 1024;
uint32_t tmp;
for (int i = 0; i < size; i += 2) {
sscanf(&p_data[i], "%02x", &tmp);
data[i >> 1] = tmp & 0xFF;
len++;
}
}
clearCommandBuffer();
SendCommandMIX(cmd, arg0, arg1, arg2, data, len);
lua_pushboolean(L, true);
return 1;
}
/**
* The following params expected:
* @brief l_SendCommandMIX
* @brief l_SendCommandNG
* @param L - a lua string with the following two params.
* @param cmd must be hexstring, max u64
* @param data must be hexstring less than 1024 chars(512bytes)
@@ -1403,7 +1355,6 @@ static int setLuaPath(lua_State *L, const char *path) {
int set_pm3_libraries(lua_State *L) {
static const luaL_Reg libs[] = {
{"SendCommandMIX", l_SendCommandMIX},
{"SendCommandNG", l_SendCommandNG},
{"GetFromBigBuf", l_GetFromBigBuf},
{"GetFromFlashMem", l_GetFromFlashMem},