void BlueNRGGattClient::terminateServiceDiscovery(void) { _currentState = GATT_DISCOVERY_TERMINATED; if (terminationCallback) { terminationCallback(_connectionHandle); } }
static void luastate_InstructionCallback(lua_State* l, lua_Debug* i) { int (*terminationCallback)(void* stateptr) = 0; // obtain the callback: lua_pushstring(l, "terminationCallback"); lua_gettable(l, LUA_REGISTRYINDEX); terminationCallback = (int (*)(void*))(lua_touserdata(l, -1)); lua_pop(l, 1); // remove from stack again // call it: if (!terminationCallback((void*)l)) { // we shall instruct lua to terminate! lua_pushstring(l, "execution time exceeded"); lua_error(l); } }