#define ABS_CMNET_ACCOUNT_NAME "abscmnet"
#define ABS_GPRS_ACCOUNT_NO 10// (10)
#define ABS_GSM_ACCOUNT_NO 10// (10)
#define ABS_NWK_ACCOUNT_CMNET_ID (ABS_GPRS_ACCOUNT_NO+ABS_GSM_ACCOUNT_NO-3)
#if (MTK_VER >= 0x0936)
#define ABS_ACCOUNT_EXTRA myMsgPtr->profile_type = DATA_ACCT_GPRS_PROF;/
myMsgPtr->gprs_account.dcomp_algo = 0x02;/
myMsgPtr->gprs_account.dcomp_algo = 0x02;/
myMsgPtr->gprs_account.hcomp_algo = 0x02;/
myMsgPtr->gprs_account.pdp_type = 0x21;/
myMsgPtr->gprs_account.pdp_addr_len = 0x01;
#else
#define ABS_ACCOUNT_EXTRA
#endif
kal_bool abs_initDataAccount_cmnet(const char *mode)
{
mmi_ps_set_gprs_data_account_req_struct *myMsgPtr;
U8 ref_count;
U16 msg_len;
MYQUEUE Message;
U8 i=0;
const char* apnMode = mode != NULL ? mode : "cmnet";
myMsgPtr = (mmi_ps_set_gprs_data_account_req_struct*) OslConstructDataPtr(sizeof(mmi_ps_set_gprs_data_account_req_struct));
if(myMsgPtr == NULL)
{
return KAL_FALSE;
}
ref_count = myMsgPtr->ref_count;
msg_len = myMsgPtr->msg_len;
memset(myMsgPtr,'/0',sizeof(mmi_ps_set_gprs_data_account_req_struct));
myMsgPtr->ref_count = ref_count;
myMsgPtr->msg_len = msg_len;
myMsgPtr->gprs_account.context_id = ABS_NWK_ACCOUNT_CMNET_ID - ABS_GSM_ACCOUNT_NO+ 1;
myMsgPtr->gprs_account.authentication_type = 0;
myMsgPtr->gprs_account.name_dcs = 0;
myMsgPtr->gprs_account.name_length = strlen(ABS_CMNET_ACCOUNT_NAME);
strcpy ((char*)myMsgPtr->gprs_account.name, ABS_CMNET_ACCOUNT_NAME);
strcpy ((char*)myMsgPtr->gprs_account.apn, apnMode);
myMsgPtr->gprs_account.apn_length = strlen(apnMode);
strcpy ((char*)myMsgPtr->gprs_account.user_name, "");
strcpy ((char*)myMsgPtr->gprs_account.password, "");
for ( i = 0; i < 4; i++)
{
myMsgPtr->gprs_account.dns[i] = 0;
}
ABS_ACCOUNT_EXTRA
Message.oslSrcId=MOD_MMI;
Message.oslDestId=MOD_L4C;
Message.oslMsgId = PRT_MMI_PS_SET_GPRS_DATA_ACCOUNT_REQ;
Message.oslDataPtr = (oslParaType *)myMsgPtr;
Message.oslPeerBuffPtr= NULL;
SetProtocolEventHandler(ABS_GPRSSetAccountRsp_net,PRT_MMI_PS_SET_GPRS_DATA_ACCOUNT_RSP);
OslMsgSendExtQueue(&Message);
return KAL_TRUE;
}