error.c

来自「蓝牙HANDFREE软件源代码」· C语言 代码 · 共 81 行

C
81
字号
#include "handsfree_private.h"
#include "handsfree.h"

#include <message.h>
#include <print.h>
#include <stdlib.h>



/*
    hfErrorInd

    Indication that an error has occurred. Look at the reson code to
    find out exactly what the error is.
*/
void hfErrorInd(const HS_ERROR_IND_T *ind)
{
    /* Add code to handle different error types here */
    switch(ind->reason)
    {
        case CmErrorConnectRequestWhenNotIdle:
            handleErrorInd(HfErrorConnectRequestWhenNotIdle); 
            break;
          
        case CmErrorPairRequestWhenNotIdle:
            handleErrorInd(HfErrorPairRequestWhenNotIdle);
            break;

        case CmErrorCancelWhenIdle:
            handleErrorInd(HfErrorCancelWhenIdle);
            break;

        case CmErrorDataRequestWhenNotConnected:
            handleErrorInd(HfErrorDataRequestWhenNotConnected);
            break;

        case CmErrorInquiryRequestWhenNotIdle:
            handleErrorInd(HfErrorInquiryRequestWhenNotIdle);
            break;

        case CmErrorScoRequestWhenScoConnected:
            handleErrorInd(HfErrorScoRequestWhenSCOConnected);
            break;

        case CmErrorDisconnectRequestWhenNotConnected:
            handleErrorInd(HfErrorDisconnectRequestWhenNotConnected);
            break;

        case CmErrorSmDeviceDatabaseError:
            handleErrorInd(HfErrorSmDeviceDatabaseError);
            break;

        case CmWarnLocalSniffNotEnabled:
            handleErrorInd(HfWarnLocalSniffNotEnabled);
            break;

        case CmWarnLocalParkNotEnabled:
            handleErrorInd(HfWarnLocalParkNotEnabled);
            break;

        case CmWarnLocalLowPwrModeNotEnabled:
            handleErrorInd(HfWarnLocalLowPwrModeNotEnabled);
            break;

        case CmWarnRemDevDoesNotSupportSniffMode:
            handleErrorInd(HfWarnRemDevDoesNotSupportSniffMode);
            break;

        case CmWarnRemDevDoesNotSupportParkMode:
            handleErrorInd(HfWarnRemDevDoesNotSupportParkMode);
            break;

        case CmWarnRemoteLowPwrModeNotEnabled:
            handleErrorInd(HfWarnRemoteLowPwrModeNotEnabled);
            break;

        default:
            PRINT(("Unknown error type 0x%x\n", ind->reason));
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?