|
这个经过真机显示gprs是激活成功的,connect时提示sci_sock_errno(sock);返回19错误,不知是什么原因?
//连接测试
PUBLIC void connect_test(void)
{
struct sci_sockaddr him;
int sock= -1;
int temp=0;
char APN[DN_MAX_APN_LEN + 1];
char temp_apn[DN_MAX_APN_LEN + 1]={0};
MN_DUAL_SYS_E e_dual_sys = MN_DUAL_SYS_1;
int32 etype = 0;
SCI_MEMSET(APN, 0, sizeof(APN));
strcpy(temp_apn, "cmnet");
MMI_MEMCPY(APN,sizeof(APN),
temp_apn,strlen(temp_apn),
strlen(temp_apn));
#ifdef MMI_DUALMODE_ENABLE
if(ERR_MNGPRS_NO_ERR != MNGPRS_SetAndActivePdpContextEx(e_dual_sys,(uint8*)APN,BROWSER_E))
#else
if(ERR_MNGPRS_NO_ERR != MNGPRS_SetAndActivePdpContextEx(e_dual_sys,(uint8*)APN))
#endif
{
SCI_TRACE_LOW("deng_open GPRS FAILED1");
busline_gprs_state = BUSLINE_GPRS_ACEIVE_FAILED;
}
else
{
SCI_TRACE_LOW("deng_open GPRS OK1");
}
SCI_Sleep(500);
sock = sci_sock_socket(AF_INET, SOCK_STREAM,0);
if(sock == -1)
{
SCI_TRACE_LOW("deng_build error\\n");
}
else
{
him.family = AF_INET;
him.ip_addr = (10<<24)+172;
him.port = htons(80);
MMK_PostMsg(BUSLINE_BUFFER_WIN_ID, MSG_CMSBRW_TCPCONNECT, (DPARAM)&etype, sizeof(int32));
MMK_PostMsg(BUSLINE_BUFFER_WIN_ID, MSG_CMSBRW_OPENNET, (DPARAM)&etype, sizeof(int32));
temp = sci_sock_connect(sock, &him,sizeof(struct sci_sockaddr));
if(temp<0)
{
int test1;
SCI_TRACE_LOW("deng_false1\\n");
test1 = sci_sock_errno(sock);
busline_recv_erro=test1;
SCI_TRACE_LOW("deng_1errorno:%d",test1);
him.ip_addr = (172<<24)+10;
MMK_PostMsg(BUSLINE_BUFFER_WIN_ID, MSG_CMSBRW_TCPCONNECT, (DPARAM)&etype, sizeof(int32));
MMK_PostMsg(BUSLINE_BUFFER_WIN_ID, MSG_CMSBRW_OPENNET, (DPARAM)&etype, sizeof(int32));
temp = sci_sock_connect(sock, &him,sizeof(struct sci_sockaddr));
if(temp<0)
{
int test2;
SCI_TRACE_LOW("deng_false2\\n");
test2 = sci_sock_errno(sock);
busline_error_no=test2;
SCI_TRACE_LOW("deng_2errorno:%d",test2);
}
else
{
SCI_TRACE_LOW("deng_good1\\n");
}
}
}
} |
|