当前位置: 首页>>代码示例>>C++>>正文


C++ ARM_CFSTORE_DRIVER::GetCapabilities方法代码示例

本文整理汇总了C++中ARM_CFSTORE_DRIVER::GetCapabilities方法的典型用法代码示例。如果您正苦于以下问题:C++ ARM_CFSTORE_DRIVER::GetCapabilities方法的具体用法?C++ ARM_CFSTORE_DRIVER::GetCapabilities怎么用?C++ ARM_CFSTORE_DRIVER::GetCapabilities使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ARM_CFSTORE_DRIVER的用法示例。


在下文中一共展示了ARM_CFSTORE_DRIVER::GetCapabilities方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: failed

int32_t cfstore_flush3_start(void)
{
	int32_t status = ARM_DRIVER_OK;
	int32_t cfsStatus;
	ARM_CFSTORE_DRIVER *cfstoreDriver = &cfstore_driver;
	ARM_CFSTORE_CAPABILITIES caps;

	CFSTORE_DBGLOG("%s:IN\n", __func__);

	/* Initialize configuration store */
	cfsStatus = cfstoreDriver->Initialize(NULL, NULL);
    if(cfsStatus < ARM_DRIVER_OK){
        CFSTORE_DBGLOG("CFStore Initialization failed (err %lu)\n", cfsStatus);
        return ARM_DRIVER_ERROR;
    }
	/* Get capabilities */
	memset(&caps, 0, sizeof(caps));
	caps = cfstoreDriver->GetCapabilities();
    if(caps.asynchronous_ops == true){
        CFSTORE_DBGLOG("%s:Please configure CFstore to work in synchronous mode. This can be change in config.json file.\n", __func__);
        status = ARM_DRIVER_ERROR;
        goto out;
    }
	CFSTORE_DBGLOG("%s:OUT: returning ARM_DRIVER_OK\n", __func__);
	return ARM_DRIVER_OK; /* init succeeded */

out:
	/* init failed */
	(void) cfstore_flush3_end();
    CFSTORE_DBGLOG("%s:OUT: status=%d\n", __func__, (int) status);
	return status;
}
开发者ID:MarceloSalazar,项目名称:mbed-os,代码行数:32,代码来源:flush3.cpp

示例2: startup

static control_t cfstore_flush3_test_00(const size_t call_count)
{
    int32_t ret = ARM_DRIVER_ERROR;
    ARM_CFSTORE_CAPABILITIES caps;;
    ARM_CFSTORE_DRIVER* drv = &cfstore_driver;

    (void) call_count;

    /* initialise the context */
    caps = drv->GetCapabilities();
    CFSTORE_LOG("%s:INITIALIZING: caps.asynchronous_ops=%lu\n", __func__, caps.asynchronous_ops);
    if(caps.asynchronous_ops == 1){
        /* This is a sync mode only test. If this test is not built for sync mode, then skip testing return true
         * This means the test will conveniently pass when run in CI as part of async mode testing */
        CFSTORE_LOG("*** Skipping test as binary built for flash journal async mode, and this test is sync-only%s", "\n");
        return CaseNext;
    }
    ret = cfstore_test_startup();
    CFSTORE_TEST_UTEST_MESSAGE(cfstore_flush3_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to perform test startup (ret=%d).\n", __func__, (int) ret);
    TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_flush3_utest_msg_g);
    return CaseNext;
}
开发者ID:MarceloSalazar,项目名称:mbed-os,代码行数:22,代码来源:flush3.cpp


注:本文中的ARM_CFSTORE_DRIVER::GetCapabilities方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。