⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wap_wta.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 2 页
字号:
    {
        char    szFormat[256];
        size_t  strlength, end = 0;
        const char  *csz;

        strlength = strlen(csz = "WTAIa_phonebookGetFieldValue\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT16 \t index \t %i\n, INT8 \t field \t %i   (");
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;
        switch (field)
        {
            case WTA_PB_GET_NAME:     /*  0 */
                csz = "WTA_PB_GET_NAME";
                break;
            case WTA_PB_GET_NUMBER:   /*  1 */
                csz = "WTA_PB_GET_NUMBER";
                break;
            default:
                csz = "Currently not a supported phone book field.";
                break;
        }
        strlength = strlen(csz);
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;

        szFormat[end] = '\0';
        CLNTa_log(0, 0, szFormat, (int)objectId, channelId, (int)index, (int)field);
    }
#endif

#ifdef USE_WIP_MALLOC
    pWCHAR = wip_malloc(sizeof(WCHAR));
#else
    pWCHAR = malloc(sizeof(WCHAR));
#endif
    *pWCHAR = (WCHAR)'\0';
}


VOID WTAIa_phoneBookChange (UINT8 objectId, const WCHAR *channelId, INT16 index, INT8 field, const WCHAR *newValue)
{

#if     defined LOG_EXTERNAL
    {
        char    szFormat[256];
        size_t  strlength, end = 0;
        const char  *csz;

        strlength = strlen(csz = "WTAIa_changePhonebookEntry\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT16 \t index \t %i\n, INT8 \t field \t %i   (");
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;
        switch (field)
        {
            case WTA_PB_CHANGE_NAME:   /*  1 */
                csz = "WTA_PB_CHANGE_NAME";
                break;
            case WTA_PB_CHANGE_NUMBER: /*  2 */
                csz = "WTA_PB_CHANGE_NUMBER";
                break;
            default:
                csz = "Currently not a supported phone book field.";
                break;
        }
        strlength = strlen(csz);
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;
        strlength = strlen(csz = ")\n, const WCHAR * \t newValue \t %S\n");
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;

        szFormat[end] = '\0';
        CLNTa_log(0, 0, szFormat, (int)objectId, channelId, (int)index, (int)field, newValue);
    }
#endif
}


VOID WTAIa_miscSetIndicator (UINT8 objectId, const WCHAR *channelId, INT8 type, INT8 newState)
{

#if     defined LOG_EXTERNAL
    {
        char    szFormat[256];
        size_t  strlength, end = 0;
        const char  *csz;

        strlength = strlen(csz = "WTAIa_miscIndication\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8 \t type \t %i\nINT8 \t newState \t %i   (");
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;
        switch (type)
        {
            case WTA_MISC_INCOMING_SPEECH:   /*  0 */
                csz = "WTA_MISC_INCOMING_SPEECH";
                break;
            case WTA_MISC_INCOMING_DATA:    /*  1 */
                csz = "WTA_MISC_INCOMING_DATA";
                break;
            case WTA_MISC_INCOMING_FAX:    /*  2 */
                csz = "WTA_MISC_INCOMING_FAX";
                break;
            case WTA_MISC_CALL_WAITING:    /*  3 */
                csz = "WTA_MISC_CALL_WAITING";
                break;
            case WTA_MISC_TEXT_MESSAGE:    /*  4 */
                csz = "WTA_MISC_TEXT_MESSAGE";
                break;
            case WTA_MISC_VOICE_MAIL:    /*  5 */
                csz = "WTA_MISC_VOICE_MAIL";
                break;
            case WTA_MISC_FAX_MESSAGE:    /*  6 */
                csz = "WTA_MISC_FAX_MESSAGE";
                break;
            case WTA_MISC_EMAIL_MESSAGE:    /*  7 */
                csz = "WTA_MISC_EMAIL_MESSAGE";
                break;
            default:
                csz = "Currently not a supported indication.";
                break;
        }
        strlength = strlen(csz);
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;

        szFormat[end] = '\0';
        CLNTa_log(0, 0, szFormat, (int)objectId, channelId, (int)type, (int)newState);
    }
#endif
}


VOID WTAIa_callLogDialled (UINT8 objectId, const WCHAR *channelId, BOOL returnFirst)
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_lstDialledNumber\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nBOOL \t returnFirst \t %u\n",  (int)objectId, channelId, (int)returnFirst);
#endif
}


VOID WTAIa_callLogMissed (UINT8 objectId, const WCHAR *channelId, BOOL returnFirst)
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_missedCalls\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nBOOL \t returnFirst \t %u\n",  (int)objectId, channelId, (int)returnFirst);
#endif
}


VOID WTAIa_callLogReceived (UINT8 objectId, const WCHAR *channelId, BOOL returnFirst)
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_receivedCalls\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nBOOL \t returnFirst \t %u\n",  (int)objectId, channelId, (int)returnFirst);
#endif
}


VOID WTAIa_callLogGetFieldValue (UINT8 objectId, const WCHAR *channelId, INT16 logHandle, INT8 field)
{
    WCHAR   *pWCHAR;
	

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_callLogGetFieldValue\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT16 \t logHandle \t %i\n, INT8 \t field \t %i\n", (int)objectId, channelId, (int)logHandle, (int)field);
#endif

#ifdef USE_WIP_MALLOC
    pWCHAR = wip_malloc(sizeof(WCHAR));
#else
    pWCHAR = malloc(sizeof(WCHAR));
#endif
    *pWCHAR = (WCHAR)'\0';
}


VOID WTAIa_GSMHold (UINT8 objectId, const WCHAR *channelId, INT8 callHandle)
{
#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_GSMcallHold\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8 \t callHandle \t %i\n", (int)objectId, channelId, (int)callHandle);
#endif

#ifndef CBASIC_WITH_NO_CONNECTORS
    WTAIc_callHeld(callHandle);
#endif
}

VOID WTAIa_GSMRetrieve (UINT8 objectId, const WCHAR *channelId, INT8 callHandle)
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_GSMretrieveFromMultiparty\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8 \t callHandle \t %i\n", (int)objectId, channelId, (int)callHandle);
#endif
}


VOID WTAIa_GSMTransfer (UINT8 objectId, const WCHAR *channelId, INT8 callHandleB, INT8 callHandleC)
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_GSMexplicitCallTransfer\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8 \t callHandleB \t %i\n, INT8 \t callHandleC \t %i\n", (int)objectId, channelId, (int)callHandleB, (int)callHandleC);
#endif
}


VOID WTAIa_GSMDeflect (UINT8 objectId, const WCHAR *channelId, INT8 callHandle, const CHAR *number)
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_GSMcallDeflection\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8 \t callHandle \t %i\n, const CHAR * \t number \t %s\n", (int)objectId, channelId, (int)callHandle, number);
#endif
}


VOID WTAIa_GSMMultiparty (UINT8 objectId, const WCHAR *channelId)
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_GSMjoinMultiparty\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\n", (int)objectId, channelId);
#endif
}


VOID WTAIa_GSMSeparate (UINT8 objectId, const WCHAR *channelId, INT8 callHandle)
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_GSMcallReject\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8 \t callHandle \t %i\n", (int)objectId, channelId, (int)callHandle);
#endif
}

VOID WTAIa_GSMSendUSSD (UINT8 objectId, const WCHAR *channelId, const WCHAR *message, const WCHAR *codingScheme, 
						   INT8 type, const CHAR *transactionId)
{

#if     defined LOG_EXTERNAL
    {
        char    szFormat[256];
        size_t  strlength, end = 0;
        const char  *csz;
        const WCHAR *_message = message;
        const WCHAR *_codingScheme = codingScheme;

        if (!_message)
        {
            _message = cwzNULL;
        }
        if (!_codingScheme)
        {
            _codingScheme = cwzNULL;
        }
        strlength = strlen(csz = "WTAIa_sendUSSD\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nconst WCHAR * \t message \t %S\n, const WCHAR * \t codingScheme \t %S\n, INT8 \t type \t %i   (");
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;
        switch (type)
        {
            case WTA_GSM_SEND_REQUEST: /*  0 */
                csz = "WTA_GSM_SEND_REQUEST";
                break;
            case WTA_GSM_SEND_REQUEST_RESULT:     /*  1 */
                csz = "WTA_GSM_SEND_REQUEST_RESULT";
                break;
            case WTA_GSM_SEND_NOTIFY_RESULT:     /*  2 */
                csz = "WTA_GSM_SEND_NOTIFY_RESULT";
                break;
/*
            case WTA_USSD_SEND_PRC_ERR: 

                csz = "WTA_USSD_SEND_PRC_ERR";
                _message = _codingScheme = cwzNULL;
                break;
*/
            default:
                csz = "Currently not a supported USSD operation.";
                break;
        }
        strlength = strlen(csz);
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;
        strlength = strlen(csz = ")\n, const CHAR * \t transactionId \t %s\n");
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;

        szFormat[end] = '\0';
        CLNTa_log(0, 0, szFormat, (int)objectId, channelId, _message, _codingScheme, (int)type, transactionId);
    }
#endif
}




VOID WTAIa_GSMNetinfo (
                       UINT8 objectId, 
                       const WCHAR *channelId, 
                       INT8 type
                      )
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAIa_GSMprovideLocationInformation\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8  \t type \t %i\n", (int)objectId, channelId, (int)type);
#endif
}




/* Services */

VOID WTAa_confirmInstallation (
                               INT8 installId,
                               const WCHAR *wtaChannelId,
                               const WCHAR *title, 
                               const WCHAR *abstract
                              )
{
#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAa_confirmInstallation\nINT8 \t installId \t %i\n, const WCHAR * \t title \t %S\n, const WCHAR * \t abstract \t %S\n", (int)installId, title, abstract);
#endif
}




VOID WTAa_retryGetInstallationResult (INT8 installId)
{
#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAa_retryGetInstallationResult\nINT8 \t installId \t %i\n", (int)installId);
#endif
}




VOID WTAa_showInstallationResult (
                                  INT8 installId, 
                                  const CHAR *url
                                  )
{

#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAa_showInstallationResult\nINT8 \t installId \t %i\n, const CHAR * \t url \t %s\n", (int)installId, url);
#endif
}




VOID WTAa_services (const ServiceType * const *services)
{

#if     defined LOG_EXTERNAL
    {
/* temporarily removed. aspn 001102
        const char  cszServiceType[] = "WTAa_services\nServiceType ** \t services: \t %s\n";
        char    szFormat[256];
        size_t  strlength, end = 0;
        const char  *csz;

        strlength = strlen(csz = cszServiceType);
        strncpy(&szFormat[end], csz, strlength);
        end += strlength;
        if (services)
        {
            #define cFldCnt          (sizeof(ServiceType) / sizeof(WCHAR*))
            const char  cszService[] = "services[%u]:\n";
            const char  cszFldTitle[]    = " \t title:\n%S\n";
            const char  cszFldAbstract[] = " \t abstract:\n%S\n";
            const char  cszFldEventId[]  = " \t eventId:\n%S\n";
            const char  *pcszFld[cFldCnt] = {cszFldTitle, cszFldAbstract, cszFldEventId};
            size_t  i;
            const ServiceType   *pcServiceType;
            const WCHAR *pcTitle, *pcAbstract, *pcEventId;

            CLNTa_log(0, 0, szFormat, "");

            end = 0;
            strlength = strlen(csz = cszService);
            strncpy(&szFormat[end], csz, strlength);
            end += strlength;
            for (i = 0; i < cFldCnt; i++)
            {
                strlength = strlen(csz = pcszFld[i]);
                strncpy(&szFormat[end], csz, strlength);
                end += strlength;
            }
            szFormat[end] = '\0';
            i = 0;
            while (pcServiceType = services[i])
            {
                if (!(pcTitle = pcServiceType->title))
                {
                    pcTitle = cwzNULL;
                }
                if (!(pcAbstract = pcServiceType->abstract))
                {
                    pcAbstract = cwzNULL;
                }
                if (!(pcEventId = pcServiceType->channelid))
                {
                    pcEventId = cwzNULL;
                }

                CLNTa_log(0, 0, szFormat, i++, pcTitle, pcAbstract, pcEventId);
            }
            #undef cFldCnt
        }
        else
        {
            CLNTa_log(0, 0, szFormat, cszNULL);
        }
    }
*/
		CLNTa_log(0, 0, "Logging of WTAa_services is not operational. apiwta.c"); /* to be removed. aspn*/
	}/* to be removed. aspn*/
#endif
}




VOID WTAa_processedByAService (BOOL processed)
{
#if     defined LOG_EXTERNAL
    CLNTa_log(0, 0, "WTAa_processedByAService\nBOOL \t processed \t %u\n", (int)processed);
#endif
}

#endif
VOID	WTAa_serviceDeleted (const WCHAR *wtaChannelId)
{
}

⌨️ 快捷键说明

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