程序自动添加GPRS ACCOUNT_ID

本文介绍了一个用于初始化CMNet数据账户的过程,通过设置GPRS数据账户请求结构来配置网络参数,包括APN模式、账户名称等,并发送消息进行账户设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#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;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值