• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LE_ERROR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LE_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ LE_ERROR函数的具体用法?C++ LE_ERROR怎么用?C++ LE_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: pthread_getspecific

//--------------------------------------------------------------------------------------------------
void StopClient
(
    void
)
{
    _ClientThreadData_t* clientThreadPtr = pthread_getspecific(_ThreadDataKey);

    // If the thread specific data is NULL, then there is no current client session.
    if (clientThreadPtr == NULL)
    {
        LE_ERROR("Trying to stop non-existent client session for '%s' service",
                 GlobalServiceInstanceName);
    }
    else
    {
        le_msg_CloseSession( clientThreadPtr->sessionRef );

        // Need to delete the thread specific data, since it is no longer valid.  If a new
        // client session is started, new thread specific data will be allocated.
        le_mem_Release(clientThreadPtr);
        if (pthread_setspecific(_ThreadDataKey, NULL) != 0)
        {
            LE_FATAL("pthread_setspecific() failed!");
        }

        LE_DEBUG("======= Stopping Client %s ========", GlobalServiceInstanceName);
    }
}
开发者ID:hakanernam,项目名称:legato-af,代码行数:29,代码来源:client.c


示例2: le_msg_GetPayloadPtr

// This function parses the message buffer received from the server, and then calls the user
// registered handler, which is stored in a client data object.
static void _Handle_AddBugTest
(
    void* _reportPtr,
    void* _notUsed
)
{
    le_msg_MessageRef_t _msgRef = _reportPtr;
    _Message_t* _msgPtr = le_msg_GetPayloadPtr(_msgRef);
    uint8_t* _msgBufPtr = _msgPtr->buffer;

    // The clientContextPtr always exists and is always first.
    void* _clientContextPtr;
    _msgBufPtr = UnpackData( _msgBufPtr, &_clientContextPtr, sizeof(void*) );

    // Pull out additional data from the context pointer
    _ClientData_t* _clientDataPtr = _clientContextPtr;
    BugTestFunc_t _handlerRef_AddBugTest = (BugTestFunc_t)_clientDataPtr->handlerPtr;
    void* contextPtr = _clientDataPtr->contextPtr;

    // Unpack the remaining parameters


    // Call the registered handler
    if ( _handlerRef_AddBugTest != NULL )
    {
        _handlerRef_AddBugTest( contextPtr );
    }
    else
    {
        LE_ERROR("ERROR in client _Handle_AddBugTest: no registered handler");
    }

    // Release the message, now that we are finished with it.
    le_msg_ReleaseMsg(_msgRef);
}
开发者ID:hakanernam,项目名称:legato-af,代码行数:37,代码来源:client.c


示例3: LE_DEBUG

//--------------------------------------------------------------------------------------------------
le_result_t pa_audio_SetGain
(
    pa_audio_If_t interface,    ///< [IN] audio interface
    uint32_t      gain          ///< [IN] gain value [0..100] (0 means 'muted', 100 is the
                                ///       maximum gain value)
)
{
    LE_DEBUG("Set gain for [%d] to %d",interface,gain);

    if ((gain < 0) || (gain > 100))
    {
        return LE_OUT_OF_RANGE;
    }

    switch (interface)
    {
        case PA_AUDIO_IF_CODEC_MIC:
        {
            if (gain > 66)
            {
                SetMixerParameter("ADC1 Volume","3");
            }
            else if (gain > 33)
            {
                SetMixerParameter("ADC1 Volume","2");
            }
            else if (gain > 0)
            {
                SetMixerParameter("ADC1 Volume","1");
            }
            else
            {
                SetMixerParameter("ADC1 Volume","0");
            }
            return LE_OK;
        }
        case PA_AUDIO_IF_CODEC_SPEAKER:
        {
            char gainPtr[10];
            sprintf(gainPtr,"%d",(124*gain)/100);
            SetMixerParameter("RX1 Digital Volume", gainPtr);
            return LE_OK;
        }
        case PA_AUDIO_IF_DSP_FRONTEND_USB_RX:
        case PA_AUDIO_IF_DSP_FRONTEND_USB_TX:
        case PA_AUDIO_IF_DSP_BACKEND_MODEM_VOICE_RX:
        case PA_AUDIO_IF_DSP_BACKEND_MODEM_VOICE_TX:
        case PA_AUDIO_IF_DSP_FRONTEND_PCM_RX:
        case PA_AUDIO_IF_DSP_FRONTEND_PCM_TX:
        case PA_AUDIO_IF_FILE_PLAYING:
        case PA_AUDIO_IF_DSP_FRONTEND_I2S_RX:
        case PA_AUDIO_IF_DSP_FRONTEND_I2S_TX:
        case PA_AUDIO_IF_END:
        {
            break;
        }
    }
    LE_ERROR("This interface (%d) is not supported",interface);
    return LE_FAULT;
}
开发者ID:hakanernam,项目名称:legato-af,代码行数:61,代码来源:pa_audio_ar7.c


示例4: LE_INFO

//--------------------------------------------------------------------------------------------------
static void SigHandler
(
    int sigNum
)
{
    le_result_t res;
    bool statusPassed = true;

    LE_INFO("Deactivated SMS CB");

    if (GsmTest)
    {
        res = le_sms_DeactivateCellBroadcast();
        if (res != LE_OK)
        {
            LE_ERROR("le_sms_DeactivateCellBroadcast FAILED");
            statusPassed = false;
        }
        else
        {
            LE_INFO("le_sms_DeactivateCellBroadcast PASSED");
        }
    }

    if (CdmaTest)
    {
        res = le_sms_DeactivateCdmaCellBroadcast();
        if (res != LE_OK)
        {
            LE_ERROR("le_sms_DeactivateCdmaCellBroadcast FAILED");
            statusPassed = false;
        }
        else
        {
            LE_INFO("le_sms_DeactivateCdmaCellBroadcast PASSED");
        }
    }

    if (statusPassed)
    {
        exit(EXIT_SUCCESS);
    }
    else
    {
        exit(EXIT_FAILURE);
    }
}
开发者ID:H-H-bin,项目名称:legato-af,代码行数:48,代码来源:smsCBTest.c


示例5: LE_ERROR

//--------------------------------------------------------------------------------------------------
static void ConnectAudioToFileRec
(
    void
)
{
    le_result_t res;
    if ((AudioFileFd=open(AudioFileRecPath, O_RDWR | O_CREAT | O_TRUNC)) == -1)
    {
        LE_ERROR("Open file %s failure: errno.%d (%s)",  AudioFileRecPath, errno, strerror(errno));
    }
    else
    {
        LE_INFO("Open file %s with AudioFileFd.%d",  AudioFileRecPath, AudioFileFd);
    }

    // Capture Remote on output connector.
    FileAudioRef = le_audio_OpenRecorder();
    LE_ERROR_IF((FileAudioRef==NULL), "OpenFileRecording returns NULL!");

    if (FileAudioRef && AudioOutputConnectorRef)
    {
        res = le_audio_Connect(AudioOutputConnectorRef, FileAudioRef);
        if(res!=LE_OK)
        {
            LE_ERROR("Failed to connect FileRecording on output connector!");
            return;
        }
        res = le_audio_Connect(AudioInputConnectorRef, FileAudioRef);
        if(res!=LE_OK)
        {
            LE_ERROR("Failed to connect FileRecording on input connector!");
            return;
        }

        LE_INFO("Recorder is now connected.");
        res = le_audio_RecordFile(FileAudioRef, AudioFileFd);

        if(res!=LE_OK)
        {
            LE_ERROR("Failed to record the file");
        }
        else
        {
            LE_INFO("File is now recording.");
        }
    }
}
开发者ID:H-H-bin,项目名称:legato-af,代码行数:48,代码来源:audioCallPbRecApp.c


示例6: OpenCgrpFile

//--------------------------------------------------------------------------------------------------
static le_result_t GetValue
(
    cgrp_SubSys_t subsystem,        ///< [IN] Sub-system of the cgroup.
    const char* cgroupNamePtr,      ///< [IN] Name of the cgroup.
    const char* fileNamePtr,        ///< [IN] File name to read from.
    char* bufPtr,                   ///< [OUT] Buffer to store the value in.
    size_t bufSize                  ///< [IN] Size of the buffer.
)
{
    // Open the file.
    int fd = OpenCgrpFile(subsystem, cgroupNamePtr, fileNamePtr, O_RDONLY);

    if (fd < 0)
    {
        return LE_FAULT;
    }

    // Read the value from the file.
    ssize_t numBytesRead;

    do
    {
        numBytesRead = read(fd, bufPtr, bufSize);
    }
    while ( (numBytesRead == -1) && (errno == EINTR) );

    // Check if the read value is valid.
    le_result_t result;

    if (numBytesRead == -1)
    {
        LE_ERROR("Could not read file '%s' in cgroup '%s'.  %m.", fileNamePtr, cgroupNamePtr);
        result = LE_FAULT;
    }
    else if (numBytesRead == bufSize)
    {
        // The value in the file is larger than the provided buffer.  Truncate the buffer.
        bufPtr[bufSize-1] = '\0';
        result = LE_OVERFLOW;
    }
    else
    {
        // Null-terminate the string.
        bufPtr[numBytesRead] = '\0';

        // Remove trailing newline characters.
        while ((numBytesRead > 0) && (bufPtr[numBytesRead - 1] == '\n'))
        {
            numBytesRead--;
            bufPtr[numBytesRead] = '\0';
        }

        result = LE_OK;
    }

    fd_Close(fd);

    return result;
}
开发者ID:H-H-bin,项目名称:legato-af,代码行数:60,代码来源:cgroups.c


示例7: LE_ERROR

//--------------------------------------------------------------------------------------------------
le_result_t pa_mdc_GetDefaultProfileIndex
(
    uint32_t* profileIndexPtr
)
{
    LE_ERROR("Unsupported function called");
    return LE_FAULT;
}
开发者ID:ekral85,项目名称:legato-af,代码行数:9,代码来源:pa_mdc_default.c


示例8: switch

//--------------------------------------------------------------------------------------------------
le_result_t le_gnss_Disable
(
    void
)
{
    le_result_t result = LE_FAULT;

    // Check the GNSS device state
    switch (GnssState)
    {
        case LE_GNSS_STATE_READY:
        {
            // Disable GNSS device
            result = pa_gnss_Disable();
            // Update GNSS device state
            if(result == LE_OK)
            {
                GnssState = LE_GNSS_STATE_DISABLED;
            }
        }
        break;
        case LE_GNSS_STATE_UNINITIALIZED:
        case LE_GNSS_STATE_ACTIVE:
        {
                        LE_ERROR("Bad state for that request [%d]", GnssState);

            result = LE_NOT_PERMITTED;
        }
        break;
        case LE_GNSS_STATE_DISABLED:
        {
                        LE_ERROR("Bad state for that request [%d]", GnssState);

            result = LE_DUPLICATE;
        }
        break;
        default:
        {
            LE_ERROR("Unknown GNSS state %d", GnssState);
            result = LE_FAULT;
        }
        break;
    }

    return result;
}
开发者ID:mbaglin,项目名称:legato-af,代码行数:47,代码来源:le_gnss.c


示例9: LE_ERROR

//--------------------------------------------------------------------------------------------------
le_result_t pa_audio_SetPcmCompanding
(
    le_audio_Companding_t companding   ///< [IN] Companding.
)
{
    LE_ERROR("Unsupported function called");
    return LE_FAULT;
}
开发者ID:legatoproject,项目名称:legato-af,代码行数:9,代码来源:pa_audio_default.c


示例10: LE_ERROR

//--------------------------------------------------------------------------------------------------
le_result_t pa_temp_ResetHandle
(
    const char*         sensorPtr  ///< [IN] Name of the temperature sensor.
)
{
    LE_ERROR("Unsupported function called");
    return LE_UNSUPPORTED;
}
开发者ID:legatoproject,项目名称:legato-af,代码行数:9,代码来源:pa_temp_default.c


示例11: LE_ERROR

//--------------------------------------------------------------------------------------------------
void le_avdata_Delete
(
    le_avdata_AssetInstanceRef_t instRef
        ///< [IN]
)
{
    LE_ERROR("Not implemented yet");
}
开发者ID:legatoproject,项目名称:legato-af,代码行数:9,代码来源:avData.c


示例12: LE_ERROR

//--------------------------------------------------------------------------------------------------
static void CleanUp
(
    void *contextPtr
)
{
    ServerData_t *serverDataPtr = (ServerData_t *)contextPtr;

    if (close(serverDataPtr->connFd) == -1)
    {
        LE_ERROR("close failed %s", strerror(errno));
    }

    if (close(serverDataPtr->socketFd) == -1)
    {
        LE_ERROR("close failed %s", strerror(errno));
    }
}
开发者ID:legatoproject,项目名称:legato-af,代码行数:18,代码来源:server.c


示例13: le_cfg_CreateReadTxn

//--------------------------------------------------------------------------------------------------
static le_result_t GetEnvironmentVariables
(
    proc_Ref_t procRef,     ///< [IN] The process to get the environment variables for.
    EnvVar_t envVars[],     ///< [IN] The list of environment variables.
    size_t maxNumEnvVars    ///< [IN] The maximum number of items envVars can hold.
)
{
    le_cfg_IteratorRef_t procCfg = le_cfg_CreateReadTxn(procRef->cfgPathRoot);
    le_cfg_GoToNode(procCfg, CFG_NODE_ENV_VARS);

    if (le_cfg_GoToFirstChild(procCfg) != LE_OK)
    {
        LE_WARN("No environment variables for process '%s'.", procRef->name);

        le_cfg_CancelTxn(procCfg);
        return LE_NOT_FOUND;
    }

    int i;
    for (i = 0; i < maxNumEnvVars; i++)
    {
        if ( (le_cfg_GetNodeName(procCfg, "", envVars[i].name, LIMIT_MAX_ENV_VAR_NAME_BYTES) != LE_OK) ||
             (le_cfg_GetString(procCfg, "", envVars[i].value, LIMIT_MAX_PATH_BYTES, "") != LE_OK) )
        {
            LE_ERROR("Error reading environment variables for process '%s'.", procRef->name);

            le_cfg_CancelTxn(procCfg);
            return LE_FAULT;
        }

        if (le_cfg_GoToNextSibling(procCfg) != LE_OK)
        {
            break;
        }
        else if (i >= maxNumEnvVars-1)
        {
            LE_ERROR("There were too many environment variables for process '%s'.", procRef->name);

            le_cfg_CancelTxn(procCfg);
            return LE_FAULT;
        }
    }

    le_cfg_CancelTxn(procCfg);
    return i + 1;
}
开发者ID:tegoo,项目名称:legato-af,代码行数:47,代码来源:proc.c


示例14: resolution

//--------------------------------------------------------------------------------------------------
le_result_t pa_audio_SetPcmSamplingResolution
(
    uint32_t  bitsPerSample   ///< [IN] Sampling resolution (bits/sample).
)
{
    LE_ERROR("Unsupported function called");
    return LE_FAULT;
}
开发者ID:legatoproject,项目名称:legato-af,代码行数:9,代码来源:pa_audio_default.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LE_FAILURE函数代码示例发布时间:2022-05-30
下一篇:
C++ LE_DEBUG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap