static mcResult_t tlc_terminate(void) { mcResult_t mcRet; if (ctx.initialized == true) { mcRet = tlc_close(&ctx); if (MC_DRV_OK != mcRet) { LOG_E("close TL session failed!"); return mcRet; } memset(&ctx, 0x00, sizeof(ctx)); ctx.initialized = false; } return MC_DRV_OK; }
int main_thread(void *uarg) { pr_debug("main_thread: TlcTui start!\n"); /* Open session on the driver */ if (!tlc_open()) { pr_debug("ERROR main_thread: open driver failed!\n"); return 1; } /* TlcTui main thread loop */ for (;;) { /* Wait for a command from the DrTui on DCI*/ tlc_wait_cmd_from_driver(); /* Something has been received, process it. */ tlc_process_cmd(); } /* Close tlc. Note that this frees the DCI pointer. * Do not use this pointer after tlc_close().*/ tlc_close(); return 0; }