MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / installLua

Method installLua

app/src/DataModel/Scripting/DeviceWriteApi.cpp:193–200  ·  view source on GitHub ↗

* @brief Installs deviceWrite() as a Lua global with @p defaultSourceId in its upvalue. */

Source from the content-addressed store, hash-verified

191 * @brief Installs deviceWrite() as a Lua global with @p defaultSourceId in its upvalue.
192 */
193void DataModel::DeviceWriteApi::installLua(lua_State* L, int defaultSourceId)
194{
195 Q_ASSERT(L);
196
197 lua_pushinteger(L, defaultSourceId);
198 lua_pushcclosure(L, luaDeviceWrite, 1);
199 lua_setglobal(L, "deviceWrite");
200}
201
202/**
203 * @brief Installs deviceWrite() into a QJSEngine, reusing the bridge if already attached.

Callers

nothing calls this directly

Calls 3

lua_pushintegerFunction · 0.85
lua_pushcclosureFunction · 0.85
lua_setglobalFunction · 0.85

Tested by

no test coverage detected