📄 cfw.h
字号:
/******************************************************************************/
/* */
/* Copyright (C) 2005, Coolsand Technologies, Inc. */
/* All Rights Reserved */
/* */
/******************************************************************************/
/* */
/* This source code is property of Coolsand. The information contained in */
/* this file is confidential. Distribution, reproduction, as well as */
/* exploitation,or transmisison of any content of this file is not */
/* allowed except if expressly permitted. */
/* Infringements result in damage claims! */
/* */
/* FILE NAME */
/* cfw.h */
/* */
/* DESCRIPTION */
/* Communication Framework constant definitions and macros. */
/* See CSW developement Manual for more. */
/* */
/******************************************************************************/
#ifndef _CFW_H_
#define _CFW_H_
//#define CFW_PBK_SYNC_VER
//
// the necessary header and pragma defines.
//
#include <cswtype.h>
#include <errorcode.h>
#include <event.h>
#include <tm.h>
#include <csw_mem_prv.h> //shawn
#include <pm.h>
#if defined(CFW_SERVICE_DEV_SINGLE_DEMO) //CT_PLATFORM!=CT_JADE
#pragma comment (lib,"cfw_shell.lib")
#pragma message ("Linking with cfw_sim.lib")
#endif
#define CFW_CC_IND_UTI 0x01
#define CFW_SS_IND_UTI 0x02
#define CFW_NW_IND_UTI 0x03
#define CFW_SIM_IND_UTI 0x04
#define CFW_PBK_IND_UTI 0x05
typedef struct _CFW_EVENT {
UINT32 nEventId;
UINT32 nParam1;
UINT32 nParam2;
UINT16 nUTI;
UINT8 nType;
UINT8 nFlag;
} CFW_EVENT;
typedef UINT32 (*PFN_CFW_EV_PORC)(CFW_EVENT* pEvent, VOID* pUserData);
#define CFW_NW_SRV_ID 0 // Indicate the network management Service
#define CFW_SIM_SRV_ID 1 // Indicate the SIM management Service
#define CFW_CC_SRV_ID 2 // Indicate the Call management Service
#define CFW_SS_SRV_ID 3 // Indicate the SS Service
#define CFW_SMS_MO_SRV_ID 4 // Indicate the SMS MO management Service
#define CFW_SMS_MT_SRV_ID 5 // Indicate the SMS MT management Service
#define CFW_SMS_CB_ID 6 // Indicate the SMS CB management Service
#define CFW_GPRS_SRV_ID 7
#define CFW_PDP_SRV_ID 7
#define CFW_PSD_SRV_ID 7
#define CFW_CSD_SRV_ID 8
#define CFW_EMOD_SRV_ID 9 // Engineering Mode
#define CFW_APP_SRV_ID 10
#define CFW_TIMER_SRV_ID 11
#define CFW_MAX_SRV_ID 11
#define CFW_PBK_SRV_ID CFW_APP_SRV_ID
#define CFW_SRV_NW_EV_RSP (0)
#define CFW_SRV_CC_EV_RSP (1)
#define CFW_SRV_SS_EV_RSP (2)
#define CFW_SRV_SIM_EV_RSP (3)
#define CFW_SRV_SMS_EV_RSP (4)
#define CFW_SRV_PBK_EV_RSP (5)
#define CFW_SRV_GPRS_EV_RSP (6)
#define CFW_SRV_FAX_EV_RSP (7)
#define CFW_SRV_EV_IND (8)
#define CFW_SRV_EV_MAX (8)
#define CFW_SRV_EV_UNKNOW (0xFF)
#define CFW_TELNUMBER_TYPE_INTERNATIONAL 145 //International number
#define CFW_TELNUMBER_TYPE_NATIONAL 161 //National number.
#define CFW_TELNUMBER_TYPE_UNKNOWN 129 //Unknown number type (default)
//
// Basic Utility Macros
//
#define CFW_SET_BIT(val, n) ((val)|=(1<<n))
#define CFW_CLR_BIT(val, n) ((val)&=~(1<<n))
#define CFW_IS_BIT_SET(val, n) ((val) & (1<<n))
#define CFW_IS_BIT_CLR(val, n) (~((val) & (1<<n)))
#define CFW_SWITCH_BIT(val, n) ((val)^=(1<<n))
#define CFW_GET_BIT(val, n) (((val) >> n) & 1)
#define CFW_CFG_RECEIVE_STORAGE(sms, bm, sr) ((sms)|(bm)|(sr))
#define CFW_CFG_SET_ALARM_RECUR(mon, tue, wed, thu, fri, sta, sun ) ((1<<mon|1<<tue|1<<wed|1<<thu|1<<fri|1<<sta|1<<sun)&0xFE)
#define CFW_CFG_CMER(mode,keyp,disp,ind,bfr) ((mode)|((keyp)<<2)|((disp)<<4)|((ind)<<6)|((bfr)<<8))
#define CFW_CFG_CMER_MODE(cmer) (cmer&0x03)
#define CFW_CFG_CMER_KEYP(cmer) (cmer>>2&0x03)
#define CFW_CFG_CMER_DISP(cmer) (cmer>>4&0x03)
#define CFW_CFG_CMER_IND(cmer) (cmer>>6&0x03)
#define CFW_CFG_CMER_BFR(cmer) (cmer>>8&0x03)
#define TEL_NUMBER_MAX_LEN 21
typedef struct _CFW_DIALNUMBER {
UINT8* pDialNumber;
UINT8 nDialNumberSize;
UINT8 nType;
UINT8 nClir;
UINT8 padding[1];
} CFW_DIALNUMBER;
typedef struct _CFW_TELNUMBER {
UINT8 nTelNumber[TEL_NUMBER_MAX_LEN];
UINT8 nType;
UINT8 nSize;
UINT8 padding[1];
} CFW_TELNUMBER;
UINT32 SRVAPI CFW_SetEventProc (
UINT8 nServiceId,
PVOID pUserData,
PFN_CFW_EV_PORC pfnRspEvProc
);
#define BAL_PROC_DEFAULT 0
#define BAL_PROC_COMPLETE 1
#define BAL_PROC_CONTINUE 2
#define BAL_PROC_NOT_CONSUME 4
#define BAL_PROC_DONT_FREE_MEM 8 // Tell CFW don't free the EVETN struct.
#define BAL_PROC_UNKOWN_ERR 0
UINT32 SRVAPI CFW_BalInit (
VOID
);
UINT32 SRVAPI CFW_BalSetEventPorc (
PVOID pUserData,
PFN_CFW_EV_PORC pfnProc
);
UINT32 SRVAPI CFW_IsFreeUTI (
UINT16 nUTI,
UINT32 nServiceId
);
UINT32 SRVAPI CFW_GetFreeUTI (
UINT32 nServiceId,
UINT8* pUTI
);
BOOL SRVAPI CFW_BlockEvent (
UINT32 event
);
BOOL SRVAPI CFW_UnBlockEvent (
UINT32 event
);
UINT32 SRVAPI CFW_IsServiceAvailable (
UINT32 nServiceId,
UINT8* pAvailable
);
UINT32 SRVAPI CFW_SendReqEvent (
UINT32 nEventId,
UINT32 nParam1,
UINT32 nParam2,
UINT8 nUTI
);
#define CFW_CONTROL_CMD_POWER_ON 0
#define CFW_CONTROL_CMD_POWER_OFF 1
#define CFW_CONTROL_CMD_RESTART 2
#define CFW_CONTROL_CMD_RESET 3
UINT32 SRVAPI CFW_ShellControl (
UINT8 nCommand
);
//
// Configuration(CFG) Management
//
// General Configuration
UINT32 SRVAPI CFW_CfgSetPhoneFunctionality(
UINT8 nLevel,
UINT8 nRst
);
UINT32 SRVAPI CFW_CfgGetPhoneFunctionality(
UINT8* pLevel
);
UINT32 SRVAPI CFW_CfgStoreUserProfile (
VOID
);
UINT32 SRVAPI CFW_CfgRestoreFactoryProfile (
VOID
);
UINT32 SRVAPI CFW_CfgGetUserProfile (VOID);
#define CFW_CHSET_UCS2 0
#define CFW_CHSET_GSM 1
UINT32 SRVAPI CFW_CfgGetCharacterSet (
UINT8* chset
);
UINT32 SRVAPI CFW_CfgSetCharacterSet (
UINT8 chset
);
#define CFW_CFG_IND_BC_EVENT (1<<0)
#define CFW_CFG_IND_SQ_EVENT (1<<1)
#define CFW_CFG_IND_NW_EVENT (1<<2)
#define CFW_CFG_IND_SOUNDER_EVENT (1<<3)
#define CFW_CFG_IND_SMS_RECEIVE_EVENT (1<<4)
#define CFW_CFG_IND_CALL_EVENT (1<<5)
#define CFW_CFG_IND_VOX_EVENT (1<<6)
#define CFW_CFG_IND_ROAM_EVENT (1<<7)
#define CFW_CFG_IND_SMS_FULL_EVENT (1<<8)
#define CFW_CFG_IND_BIT_ERR_EVENT (1<<9)
#define CFW_CFG_IND_USER_SQ_EVENT (1<<10)
#define CFW_CFG_IND_EVENT(bc,sq,nw,sounder,sms_receive, call, vox, roam, sms_full, biterr) \
((bc)|((sq)<<1)|((nw)<<2)|((sounder)<<3)|((sms_receive)<<4)|((call)<<5)|((vox)<<6)|((roam)<<7)|((sms_full)<<8|biterr<<9)
#define IS_CFG_IND_BC_EVENT(ind) (ind>>0&1)
#define IS_CFG_IND_SQ_EVENT(ind) (ind>>1&1)
#define IS_CFG_IND_NW_EVENT(ind) (ind>>2&1)
#define IS_CFG_IND_SOUNDER_EVENT(ind) (ind>>3&1)
#define IS_CFG_IND_SMS_RECEIVE_EVENT(ind) (ind>>4&1)
#define IS_CFG_IND_CALL_EVENT(ind) (ind>>5&1)
#define IS_CFG_IND_VOX_EVENT(ind) (ind>>6&1)
#define IS_CFG_IND_ROAM_EVENT(ind) (ind>>7&1)
#define IS_CFG_IND_SMS_FULL_EVENT(ind) (ind>>8&1)
#define IS_CFG_IND_BIT_ERR_EVENT(ind) (ind>>9&1)
#ifdef _WIN32
#pragma warning(disable: 4214) // local variable *may* be used without init
#endif
typedef struct _CFW_IND_EVENT_INFO {
UINT32 bc:3;
UINT32 sq:3;
UINT32 nw_srv:1;
UINT32 sms_receive:1;
UINT32 call:1;
UINT32 roam:1;
UINT32 sms_full:1;
UINT32 sounder :1;
UINT32 bit_err:8;
} CFW_IND_EVENT_INFO;
UINT32 SRVAPI CFW_CfgSetIndicatorEvent (
UINT16 ind
);
UINT32 SRVAPI CFW_CfgGetIndicatorEvent (
UINT16* ind
);
UINT32 SRVAPI CFW_CfgSetIndicatorEventInfo (
CFW_IND_EVENT_INFO* pIndInfo
);
UINT32 SRVAPI CFW_CfgGetIndicatorEventInfo (
CFW_IND_EVENT_INFO* pIndInfo
);
UINT32 SRVAPI CFW_CfgGetEventReport(
UINT16* pMer
);
UINT32 SRVAPI CFW_CfgSetEventReport(
UINT16 pMer
);
UINT32 SRVAPI CFW_CfgSetResultCodePresentMode(
UINT8 nMode
);
UINT32 SRVAPI CFW_CfgSetResultCodeFormatMode(
UINT8 nMode
);
UINT32 SRVAPI CFW_CfgGetResultCodePresentMode(
UINT8* pMode
);
UINT32 SRVAPI CFW_CfgGetResultCodeFormatMode(
UINT8* pMode
);
UINT32 SRVAPI CFW_CfgGetProductIdentification(
UINT8* pIdText
);
UINT32 SRVAPI CFW_CfgGetExtendedErrorV0 (
PSTR* pErrReport
);
UINT32 SRVAPI CFW_CfgSetExtendedErrorV0 (
UINT32 nErrorCode
);
UINT32 SRVAPI CFW_CfgSetEchoMode(UINT8 nMode);
UINT32 SRVAPI CFW_CfgGetEchoMode(UINT8 *nMode);
typedef struct _CFW_EXTENDED_ERROR{
UINT8 locationId;
UINT8 reason;
UINT8 ss_reason;
UINT8 padding;
} CFW_EXTENDED_ERROR;
UINT32 SRVAPI CFW_CfgGetExtendedErrorV1 (
CFW_EXTENDED_ERROR* pExtendedError
);
UINT32 SRVAPI CFW_CfgGetErrorReport(
UINT8* pLevel
);
UINT32 SRVAPI CFW_CfgSetErrorReport(
UINT8 nLevel
);
//SMS Configuration
#define CFW_SMS_STORAGE_AUTO 0x00
#define CFW_SMS_STORAGE_ME 0x01
#define CFW_SMS_STORAGE_SM 0x02
#define CFW_SMS_STORAGE_BM 0x04
#define CFW_SMS_STORAGE_SM_SR 0x08
#define CFW_SMS_STORAGE_ME_SR 0x10
#define CFW_SMS_STORAGE_MT 0x20
#define CFW_SMS_STORAGE_SM_ME 0x40
#define CFW_SMS_STORED_STATUS_UNREAD 0x01
#define CFW_SMS_STORED_STATUS_READ 0x02
#define CFW_SMS_STORED_STATUS_UNSENT 0x04
#define CFW_SMS_STORED_STATUS_SENT_NOT_SR_REQ 0x08
#define CFW_SMS_STORED_STATUS_SENT_SR_REQ_NOT_RECV 0x10
#define CFW_SMS_STORED_STATUS_SENT_SR_REQ_NOT_STORE 0x20
#define CFW_SMS_STORED_STATUS_SENT_SR_REQ_RECV_STORE 0x40
#define CFW_SMS_STORED_STATUS_STORED_ALL 0x80
#define CFW_SMS_COPY_ME2SM 0
#define CFW_SMS_COPY_SM2ME 1
UINT32 SRVAPI CFW_CfgSetSmsStorage (
UINT8 nStorage1,
UINT8 nStorage2
);
UINT32 SRVAPI CFW_CfgGetSmsStorage (
UINT8* pStorage1,
UINT8* pStorage2
);
typedef struct _CFW_SMS_STORAGE_INFO {
UINT16 usedSlot;
UINT16 totalSlot;
UINT16 unReadRecords;
UINT16 readRecords;
UINT16 sentRecords;
UINT16 unsentRecords;
UINT16 unknownRecords;
UINT16 storageId;
} CFW_SMS_STORAGE_INFO;
UINT32 SRVAPI CFW_CfgGetSmsStorageInfo (
CFW_SMS_STORAGE_INFO* pStorageInfo,
UINT16 nStorage
);
UINT32 SRVAPI CFW_CfgSetNewSmsOption (
UINT8 nOption,
UINT8 nNewSmsStorage
);
UINT32 SRVAPI CFW_CfgGetNewSmsOption (
UINT8* pOption,
UINT8* pNewSmsStorage
);
UINT32 SRVAPI CFW_CfgSelectSmsService(
UINT8 nService,
UINT8* pSupportedType
);
UINT32 SRVAPI CFW_CfgQuerySmsService (
UINT8* pService
);
UINT32 SRVAPI CFW_CfgSetSmsOverflowInd (
UINT8 nMode
);
UINT32 SRVAPI CFW_CfgGetSmsOverflowInd (
UINT8* pMode
);
UINT32 SRVAPI CFW_CfgSetSmsFormat (
UINT8 nFormat
);
UINT32 SRVAPI CFW_CfgGetSmsFormat (
UINT8* nFormat
);
UINT32 SRVAPI CFW_CfgSetSmsShowTextModeParam (
UINT8 nShow
);
UINT32 SRVAPI CFW_CfgGetSmsShowTextModeParam (
UINT8* pShow
);
UINT32 SRVAPI CFW_CfgSetSmsCB (
UINT8 mode,
UINT8 mids[6],
UINT8 dcss[6]
);
UINT32 SRVAPI CFW_CfgGetSmsCB (
UINT8* pMode,
UINT8 mids[6],
UINT8 dcss[6]
);
typedef struct _CFW_SMS_PARAMETER {
UINT8 vp;
UINT8 pid;
UINT8 dcs;
UINT8 mti;
UINT8 ssr;
UINT8 bearer:1;
UINT8 bSimChange:1;
UINT8 bReserved:5;
UINT8 mr;
UINT8 rp;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -