📄 wap_wta.c
字号:
/*
+-----------------------------------------------------------------------------
| File : wap_wta.c
+-----------------------------------------------------------------------------
| Copyright Condat AG 1999-2001, Berlin
| All rights reserved.
|
| This file is confidential and a trade secret of Condat AG
| The receipt of or possession of this file does not convey
| any rights to reproduce or disclose its contents or to
| manufacture, use, or sell anything it may describe, in
| whole, or in part, without the specific written consent of
| Condat AG.
+-----------------------------------------------------------------------------
| Purpose : callbacks for AUS browser, NULL, NOT IMPLEMENTED YET
|
+-----------------------------------------------------------------------------
*/
#ifndef WAP_WTA_C
#define WAP_WTA_C
#endif
#define ENTITY_WAP
/*==== INCLUDES ===================================================*/
#if defined (NEW_FRAME)
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include "typedefs.h"
#include "pcm.h"
#include "pconst.cdg"
#include "mconst.cdg"
#include "message.h"
#include "ccdapi.h"
#include "vsi.h"
#include "custom.h"
#include "gsm.h"
#include "prim.h"
#include "cnf_wap.h"
#include "mon_wap.h"
#include "pei.h"
#include "tok.h"
#include "dti.h" /* functionality of the dti library */
#else
#include <string.h>
#include "stddefs.h"
#include "pconst.cdg"
#include "message.h"
#include "ccdapi.h"
#include "custom.h"
#include "gsm.h"
#include "cnf_wap.h"
#include "mon_wap.h"
#include "prim.h"
#include "vsi.h"
#include "pei.h"
#include "tok.h"
#endif
#include "wap.h"
#include "cus_wap.h"
#include "wap_examples.h"
#ifndef CBASIC_WITH_NO_CONNECTORS
#include "capiwta.h"
#endif
#ifndef USE_WIP_MALLOC
#define USE_WIP_MALLOC
#endif
/*
* AUS wip malloc
*/
EXTERN VOID* wip_malloc(UINT32 size);
EXTERN VOID wip_free(VOID *mem);
#include "aapiwta.h"
#if defined LOG_EXTERNAL
#include "aapiclnt.h"
#endif
VOID WTAIa_publicMakeCall (
UINT8 objectId,
const CHAR *number
)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_publicMakeCall\nUINT8 \t objectId \t %u\nconst CHAR * \t number \t %s\n",(int)objectId, number);
#endif
}
VOID WTAIa_publicSendDTMF (
UINT8 objectId,
const CHAR *number
)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_publicSendDTMF\nUINT8 \t objectId \t %u\nconst CHAR * \t number \t %s\n",(int)objectId, number);
#endif
}
VOID WTAIa_publicAddPBEntry (
UINT8 objectId,
const CHAR *number,
const WCHAR *name
)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_publicAddPBEntry\nUINT8 \t objectId \t %u\nconst CHAR * \t number \t %s\nconst CHAR * \t name \t %S\n",(int)objectId, number, name);
#endif
}
#ifdef CONFIG_WTA
VOID WTAIa_voiceCallSetup (
UINT8 objectId,
const WCHAR *channelId,
const CHAR *number
)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_setupVoiceCall\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nconst CHAR * \t number \t %s\n",(int)objectId, channelId, number);
#endif
}
VOID WTAIa_voiceCallAccept (
UINT8 objectId,
const WCHAR *channelId,
INT8 callHandle
)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_acceptCall\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_callActive(callHandle);
#endif
}
VOID WTAIa_voiceCallRelease (
UINT8 objectId,
const WCHAR *channelId,
INT8 callHandle
)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_releaseCall\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_callCleared(callHandle, 0); /*GBU the zero shall be an error code!!!!!*/
#endif
}
VOID WTAIa_voiceCallSendDTMF (
UINT8 objectId,
const WCHAR *channelId,
INT8 callHandle,
const CHAR *dtmf
)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_sendDTMFstring\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8 \t callHandle \t %i\nconst CHAR * \t dtmf \t %s\n", (int)objectId, channelId, (int)callHandle, dtmf);
#endif
}
VOID WTAIa_voiceCallCallStatus (UINT8 objectId, const WCHAR *channelId, INT8 callHandle, INT8 field)
{
WCHAR *pWCHAR;
#if defined LOG_EXTERNAL
{
char szFormat[256];
size_t strlength, end = 0;
const char *csz;
strlength = strlen(csz = "WTAIa_callStatus\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8 \t callHandle \t %i\n, INT8 \t field \t %i (");
strncpy(&szFormat[end], csz, strlength);
end += strlength;
switch (field)
{
case WTA_VC_CS_NUMBER: /* 0 */
csz = "WTA_VC_CS_NUMBER";
break;
case WTA_VC_CS_STATUS: /* 1 */
csz = "WTA_VC_CS_STATUS";
break;
case WTA_VC_CS_MODE: /* 2 */
csz = "WTA_VC_CS_MODE";
break;
case WTA_VC_CS_NAME: /* 3 */
csz = "WTA_VC_CS_NAME";
break;
case WTA_VC_CS_DURATION: /* 4 */
csz = "WTA_VC_CS_DURATION";
break;
default:
csz = "Currently not a supported call status.";
break;
}
strlength = strlen(csz);
strncpy(&szFormat[end], csz, strlength);
end += strlength;
szFormat[end] = '\0';
CLNTa_log(0, 0, szFormat, (int)objectId, channelId, (int)callHandle);
}
#endif
#ifdef USE_WIP_MALLOC
pWCHAR = wip_malloc(sizeof(WCHAR));
#else
pWCHAR = malloc(sizeof(WCHAR));
#endif
*pWCHAR = (WCHAR)'\0';
}
VOID WTAIa_voiceCallList (UINT8 objectId, const WCHAR *channelId, BOOL returnFirst)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_listCall\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nBOOL \t returnFirst \t %u\n", (int)objectId, channelId, (int)returnFirst);
#endif
}
VOID WTAIa_netTextSend (UINT8 objectId, const WCHAR *channelId, const CHAR *number, const WCHAR *text)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_sendText\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nconst CHAR * \t number \t %s\n, const WCHAR * \t text \t %S\n", (int)objectId, channelId, number, text);
#endif
}
VOID WTAIa_netTextList (UINT8 objectId, const WCHAR *channelId, BOOL returnFirst, INT8 messageType)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_readText\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nBOOL \t returnFirst \t %u\nINT16 \t messageType \t %i\n", (int)objectId, channelId, (int)returnFirst, (int)messageType);
#endif
}
VOID WTAIa_netTextRemove (UINT8 objectId, const WCHAR *channelId, INT16 msgHandle)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_removeText\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT16 \t msgHandle \t %i\n", (int)objectId, channelId, (int)msgHandle);
#endif
}
VOID WTAIa_netTextGetFieldValue (UINT8 objectId, const WCHAR *channelId, INT16 msgHandle, INT8 field)
{
WCHAR *pWCHAR;
#if defined LOG_EXTERNAL
{
char szFormat[256];
size_t strlength, end = 0;
const char *csz;
strlength = strlen(csz = "WTAIa_textGetFieldValue\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nUINT16 \t msgHandle \t %u\n, INT8 \t field \t %i (");
strncpy(&szFormat[end], csz, strlength);
end += strlength;
switch (field)
{
case WTA_NT_GET_TEXT: /* 0 */
csz = "WTA_NT_GET_TEXT";
break;
case WTA_NT_GET_TSTAMP: /* 1 */
csz = "WTA_NT_GET_TSTAMP";
break;
case WTA_NT_GET_ADDRESS: /* 2 */
csz = "WTA_NT_GET_ADDRESS";
break;
case WTA_NT_GET_STATUS: /* 3 */
csz = "WTA_NT_GET_STATUS";
break;
case WTA_NT_GET_READ: /* 4 */
csz = "WTA_NT_GET_READ";
break;
case WTA_NT_GET_TSTAMP_OFF: /* 5 */
csz = "WTA_NT_GET_TSTAMP_OFF";
break;
case WTA_NT_GET_TSTAMP_DEVICE: /* 6 */
csz = "WTA_NT_GET_TSTAMP_DEVICE";
break;
default:
csz = "Currently not a supported text message.";
break;
}
strlength = strlen(csz);
strncpy(&szFormat[end], csz, strlength);
end += strlength;
szFormat[end] = '\0';
CLNTa_log(0, 0, szFormat, (int)objectId, channelId, (int)msgHandle, (int)field);
}
#endif
#ifdef USE_WIP_MALLOC
pWCHAR = wip_malloc(sizeof(WCHAR));
#else
pWCHAR = malloc(sizeof(WCHAR));
#endif
*pWCHAR = (WCHAR)'\0';
}
VOID WTAIa_netTextMarkAsRead (UINT8 objectId, const WCHAR *channelId, INT16 msgHandle)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_phonebookWrite\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT16 \t msgHandle \t %i", (int)objectId, channelId, (int)msgHandle);
#endif
}
VOID WTAIa_phoneBookWrite (UINT8 objectId, const WCHAR *channelId, INT16 index, const CHAR *number, const WCHAR *name)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_phonebookWrite\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT16 \t index \t %i\n, const WCHAR * \t number \t %S\n, const WCHAR * \t name \t %S\n", (int)objectId, channelId, (int)index, number, name);
#endif
}
VOID WTAIa_phoneBookSearch (UINT8 objectId, const WCHAR *channelId, INT8 field, const WCHAR *value)
{
#if defined LOG_EXTERNAL
{
char szFormat[256];
size_t strlength, end = 0;
const char *csz;
strlength = strlen(csz = "WTAIa_phonebookRead\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT8 \t field \t %i (");
strncpy(&szFormat[end], csz, strlength);
end += strlength;
switch (field)
{
case WTA_PB_SEARCH_CONTINUE: /* 0 */
csz = "WTA_PB_SEARCH_CONTINUE";
break;
case WTA_PB_SEARCH_NAME: /* 1 */
csz = "WTA_PB_SEARCH_NAME";
break;
case WTA_PB_SEARCH_NUMBER: /* 2 */
csz = "WTA_PB_SEARCH_NUMBER";
break;
default:
csz = "Currently not a supported phone book field.";
if (!value)
{
value = cwzNULL;
}
break;
}
strlength = strlen(csz);
strncpy(&szFormat[end], csz, strlength);
end += strlength;
strlength = strlen(csz = ")\n, const WCHAR * \t value \t %S\n");
strncpy(&szFormat[end], csz, strlength);
end += strlength;
szFormat[end] = '\0';
CLNTa_log(0, 0, szFormat, (int)objectId, channelId, (int)field, value);
}
#endif
}
VOID WTAIa_phoneBookRemove (UINT8 objectId, const WCHAR *channelId, INT16 index)
{
#if defined LOG_EXTERNAL
CLNTa_log(0, 0, "WTAIa_phonebookRemove\nUINT8 \t objectId \t %u\nWCHAR * \t channelId \t %s\nINT16 \t index \t %i\n", (int)objectId, channelId, (int)index);
#endif
}
VOID WTAIa_phoneBookGetFieldValue (UINT8 objectId, const WCHAR *channelId, INT16 index, INT8 field)
{
WCHAR *pWCHAR;
#if defined LOG_EXTERNAL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -