📄 smsal_defs.h
字号:
* Information Element Identifier
*------------------------------------*/
#define SMSAL_CONC8_MSG_IEI (0x00)
#define SMSAL_CONC16_MSG_IEI (0x08)
#define SMSAL_SPECIAL_MSG_IND_IEI (0x01)
/* EMS */
#define SMSAL_EMS_TEXT_FORMAT_IEI (0x0a) /* Text Formating */
#define SMSAL_EMS_PREDEF_SND_IEI (0x0b) /* Predefined Sound */
#define SMSAL_EMS_USER_DEF_SND_IEI (0x0c) /* User Defined Sound */
#define SMSAL_EMS_PREDEF_ANM_IEI (0x0d) /* Predefined Animation */
#define SMSAL_EMS_LARGE_ANM_IEI (0x0e) /* Large Animation */
#define SMSAL_EMS_SMALL_ANM_IEI (0x0f) /* Small Animation */
#define SMSAL_EMS_LARGE_PIC_IEI (0x10) /* Large Picture */
#define SMSAL_EMS_SMALL_PIC_IEI (0x11) /* Small Picture */
#define SMSAL_EMS_VAR_PIC_IEI (0x12) /* Variable Picture */
/* MISC */
#define SMSAL_APP_PORT8_IEI (0x04) /* application port - 8 bit */
#define SMSAL_APP_PORT16_IEI (0x05) /* application port - 16 bit */
/*--------------------------------------------
* Length of SMS peer message header (part)
*--------------------------------------------*/
/* fo(1), pid(1), dcs(1), scts(7), udl(1), oa_len(1), oa_type(1) */
#define PART_OF_DELIVER_HEADER_LEN (13)
/* fo(1), mr(1), pid(1), dcs(1), udl(1), da_len(1), da_type(1) */
#define PART_OF_SUBMIT_HEADER_LEN (7)
/* fo(1), mr(1), ra_len(1), ra_type(1), scts(7), dt(7) */
#define PART_OF_REPORT_HEADER_LEN (18)
/*---------------------------------------------------
* Internal STATUS representation,
* bitwise-OR is allowed
*
* the lower 4 bits indicate read/unread/sent/unsent
* the higher 4 bits for other information,
* eg. status report request or not
*---------------------------------------------------*/
#define SMSAL_STATUS_UNREAD (0x01) /* received unread */
#define SMSAL_STATUS_READ (0x02) /* received read */
#define SMSAL_STATUS_UNSENT (0x04) /* stored unsent */
#define SMSAL_STATUS_SENT (0x08) /* stored sent */
#define SMSAL_STATUS_INBOX (0x03) /* inbox */
#define SMSAL_STATUS_OUTBOX (0x0c) /* outbox */
#define SMSAL_STATUS_ALL (0x0f) /* all */
#define SMSAL_STATUS_SRR_NOT_RECV (0x10) /* status report request,
not (yet) receive */
#define SMSAL_STATUS_SRR_RECV_NOT_STO (0x20) /* status report request,
received, but not stored */
#define SMSAL_STATUS_SRR_RECV_STO (0x30) /* status report request,
received, and stored */
#define SMSAL_MTI_BITS (0x03)
/* Information in NMI table */
/* table 1 : store and CNMA */
#define SMSAL_MSG_STORE_BITS (0x01)
#define SMSAL_MSG_CNMA_BITS (0x02)
/* table 2 : LMI indication */
/* table 3 : RMI indication */
#define SMSAL_INDEX_NMI_BITS (0x01)
#define SMSAL_MSG_NMI_BITS (0x02)
#define SMSAL_MSG_WAIT_BITS (0x04)
#define SMSAL_SMSP_DA_BITS (0xfe)
#define SMSAL_SMSP_SCA_BITS (0xfd)
#define SMSAL_SMSP_PID_BITS (0xfb)
#define SMSAL_SMSP_DCS_BITS (0xf7)
#define SMSAL_SMSP_VP_BITS (0xef)
#if defined (__CPHS__) /* NEW */
/*-------------------------------------
* For CPHS Voice Mail Indication
*-------------------------------------*/
#define SMSAL_CPHS_VM_ADDR_TYPE (0xd0)
#define SMSAL_CPHS_VM_SET_BITS (0x01)
#define SMSAL_CPHS_VM_IND_BITS (0x0e)
#define SMSAL_CPHS_VM_LINE_BITS (0x01)
#endif
/*-------------------------------------
* Timers
*-------------------------------------*/
#if defined(__CB__)
#define SMSAL_CB_TIMER_ITEM SMSAL_CB_MAX_SESSION
#else
#define SMSAL_CB_TIMER_ITEM 0
#endif
#define SMSAL_MAX_TIMER_ITEM (2+SMSAL_CB_TIMER_ITEM) /* 2 for cnma timer */
#define SMSAL_CNMA_TIMEOUT_TICK (KAL_TICKS_5_SEC+KAL_TICKS_5_SEC)/* 10 secs */
#define SMSAL_CB_TIMEOUT_TICK (KAL_TICKS_1_MIN ) /* 1 mins */
/*-------------------------------
* mem exceed flag values
*-------------------------------*/
#define SMSAL_MEM_EXCEED (0xfe)
#define SMSAL_MEM_AVAILABLE (0xff)
/*---------------------------------------
* For extracting fields from NVRAM data
*---------------------------------------*/
#define SMSAL_NVM_MEM1_BITS (0x07)
#define SMSAL_NVM_MEM2_BITS (0x38)
#define SMSAL_NVM_BEARER_BITS (0x03)
#define SMSAL_NVM_CONC_BITS (0x04)
#define SMSAL_NVM_DISPLAY_BITS (0x08)
#define SMSAL_NVM_SR_BITS (0x10)
#define SMSAL_NVM_RP_BITS (0x20)
#define SMSAL_NVM_CB_BITS (0x40)
#define SMSAL_NVM_CB_ALL_LANG_BITS (0x80)
#define SMSAL_NVM_RMI_PFILE_ID_BITS (0x18)
#define TP_ADDR2_L4_ADDR_LEN(x) (((x+1)/2)+1)
#define SMSAL_INVALID_PORT_NUM (-1)
#define SMSAL_MAX_REG_PORT_NUM (5)
#if defined(__SMS_ME_STORAGE__)
#define SMSAL_MAX_CONCAT_MSG_SAVE (4)
#endif
#ifdef __MCD__
/*=====================================
* MCD pack/uppack/alloc/dealloc
*=====================================*/
#define SMSAL_P(MSG_PTR, FIELD, SUBFIELD) (MSG_PTR->FIELD->SUBFIELD)
#define SMSAL_R(VAR) (VAR)
#define SMSAL_ASN_ALLOC(ALLOC_FUNC, STRUCT, MSG_PTR)
#define SMSAL_ALLOC(ALLOC_FUNC, STRUCTID, STRUCT, MSG_PTR) {\
MSG_PTR = (STRUCT*)l4_pun_src_buff; \
mcd_pseudo_alloc(STRUCTID, l4_pun_src_buff ,sizeof(l4_pun_src_buff)); }
#define SMSAL_DEALLOC(DEALLOC_FUNC, MSG_PTR)
#define SMSAL_PACK(PACK_FUNC, BITS_FUNC, STRUCTID, MSG_PTR, PEER_BUFF, HDR_SIZE, TLR_SIZE) \
smsal_mcd_pack(STRUCTID, \
(kal_uint8*)MSG_PTR, \
PEER_BUFF, \
HDR_SIZE, \
TLR_SIZE);
#define SMSAL_UNPACK(UNPACK_FUNC, STRUCTID, STRUCT, MSG_PTR, PEER_BUFF,RET_VAL) { \
MSG_PTR = (STRUCT*)l4_pun_dest_buff; \
RET_VAL = smsal_mcd_unpack(STRUCTID, PEER_BUFF); }
#else
/*=====================================
* ASN pack/uppack/alloc/dealloc
*=====================================*/
typedef unsigned int (*smsal_pack_func_t)(kal_uint8 *,
void *,
unsigned int);
typedef unsigned int (smsal_unpack_func_t)(void *,
kal_uint8 *,
unsigned int,
unsigned int,
void *);
#define SMSAL_P(MSG_PTR, FIELD, SUBFIELD) (MSG_PTR->FIELD.SUBFIELD)
#define SMSAL_R(VAR) (&VAR)
#define SMSAL_ASN_ALLOC(ALLOC_FUNC, STRUCT, MSG_PTR) {\
MSG_PTR = get_ctrl_buffer(sizeof(STRUCT)); \
ALLOC_FUNC(MSG_PTR); }
#define SMSAL_ALLOC(ALLOC_FUNC, STRUCTID, STRUCT, MSG_PTR) { \
MSG_PTR = get_ctrl_buffer(sizeof(STRUCT)); \
ALLOC_FUNC((STRUCT*)MSG_PTR); }
#define SMSAL_DEALLOC(DEALLOC_FUNC, MSG_PTR) { \
DEALLOC_FUNC(MSG_PTR); \
free_ctrl_buffer(MSG_PTR); }
#define SMSAL_PACK(PACK_FUNC, BITS_FUNC, STRUCTID, MSG_PTR, PEER_BUFF, HDR_SIZE, TLR_SIZE) \
smsal_asn_pack(PACK_FUNC, \
MSG_PTR, \
(kal_uint16)((BITS_FUNC(MSG_PTR)+7)/8), \
PEER_BUFF, \
HDR_SIZE, \
TLR_SIZE);
#define SMSAL_UNPACK(UNPACK_FUNC, STRUCTID, STRUCT, MSG_PTR, PEER_BUFF) \
smsal_asn_unpack(UNPACK_FUNC, MSG_PTR, PEER_BUFF)
#endif /* __MCD__ */
#endif /* _SMSAL_DEFS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -