コード例 #1
0
static mcResult_t tlc_initialize(void) {
	mcResult_t mcRet;

	memset(&ctx, 0x00, sizeof(ctx));
	ctx.device_id = MC_DEVICE_ID_DEFAULT;
	ctx.uuid = (mcUuid_t)TL_SECDRM_UUID;
	ctx.initialized = false;

	mcRet = tlc_open(&ctx);
	if (MC_DRV_OK != mcRet) {
		   LOG_E("open TL session failed!");
		   return mcRet;
	}

	ctx.initialized = true;

	return MC_DRV_OK;
}
コード例 #2
0
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;
}