}
// UsbCommand c = (*data);
- SendCommand(data);
+ SendCommand((UsbCommand* )data);
return 0; // no return values
}
/**
if(WaitForResponseTimeout(cmd, &response, ms_timeout))
{
//Push it as a string
- lua_pushlstring(L,&response,sizeof(UsbCommand));
+ lua_pushlstring(L,(const char *)&response,sizeof(UsbCommand));
return 1;// return 1 to signal one return value
}else{
return 1;// one return value
}
}
-static int l_nonce2key(lua_State *L){ return CmdHF14AMfRdSc(luaL_checkstring(L, 1));}
-static int l_PrintAndLog(lua_State *L){ return CmdHF14AMfDump(luaL_checkstring(L, 1));}
+//static int l_nonce2key(lua_State *L){ return CmdHF14AMfRdSc(luaL_checkstring(L, 1));}
+//static int l_PrintAndLog(lua_State *L){ return CmdHF14AMfDump(luaL_checkstring(L, 1));}
static int l_clearCommandBuffer(lua_State *L){
clearCommandBuffer();
+ return 0;
}
/**
* @brief l_foobar is a dummy function to test lua-integration with
printf("Arguments discarded, stack now contains %d elements", lua_gettop(L));
UsbCommand response = {CMD_MIFARE_READBL, {1337, 1338, 1339}};
printf("Now returning a UsbCommand as a string");
- lua_pushlstring(L,&response,sizeof(UsbCommand));
+ lua_pushlstring(L,(const char *)&response,sizeof(UsbCommand));
return 1;
}
static const luaL_Reg libs[] = {
{"SendCommand", l_SendCommand},
{"WaitForResponseTimeout", l_WaitForResponseTimeout},
- {"nonce2key", l_nonce2key},
- {"PrintAndLog", l_PrintAndLog},
+ //{"nonce2key", l_nonce2key},
+ //{"PrintAndLog", l_PrintAndLog},
{"foobar", l_foobar},
{"ukbhit", l_ukbhit},
{"clearCommandBuffer", l_clearCommandBuffer},