1. MTK网络编程时创建socet时需要传入一个AccountID,设置正确的AccountID才能成功连接网络,获取数据。在模拟器上调试MTK网络,这个AccountID无关紧要,只要填0就可以,也可以获取网络数据,在模拟器上调通后,在真机上只需要在create函数中填写正确的AccountID就可以了实现手机联网了。11A上正确的AccountID需要如下几个函数
///* Get account ID by APN */
srv_dtcnt_get_acc_id_by_apn("cmnet", &acc_id_out);//cmnet方式联网
kal_uint8 appid = 14;
cbm_register_app_id(&appid);
cbm_hold_bearer(appid);
acc_id_out = cbm_set_app_id(acc_id_out, appid);
cbm_deregister_app_id(appid);
把accountID 填入create中就可以了。
本文详细介绍了在MTK网络编程中创建socket时如何正确设置AccountID以实现设备联网,包括获取AccountID的方法及在不同环境下的应用。通过实例展示了在模拟器和真机上的调试过程,并说明了在实际设备上应用正确AccountID的重要性。

2162

被折叠的 条评论
为什么被折叠?



