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

Function luaActionFire

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

* @brief Lua C closure for actionFire(actionId) returning {ok, error?}. */

Source from the content-addressed store, hash-verified

280 * @brief Lua C closure for actionFire(actionId) returning {ok, error?}.
281 */
282static int luaActionFire(lua_State* L)
283{
284 if (!lua_isnumber(L, 1)) {
285 pushLuaResult(L, false, QStringLiteral("actionFire: actionId must be a number"));
286 return 1;
287 }
288
289 const int actionId = static_cast<int>(lua_tointeger(L, 1));
290 QString errorMsg;
291 const bool ok = fireActionByPublicId(actionId, errorMsg);
292 pushLuaResult(L, ok, errorMsg);
293 return 1;
294}
295
296/**
297 * @brief Installs actionFire() as a Lua global.

Callers

nothing calls this directly

Calls 3

lua_isnumberFunction · 0.85
fireActionByPublicIdFunction · 0.85
pushLuaResultFunction · 0.70

Tested by

no test coverage detected