|
在6223上做SOCKET连接,与PC机通信,但是服务端死活收不到信息。SIM卡是开了GPRS包月服务的。代码如下:
sockaddr_struct server_ip_addr;
kal_uint8 addr[4] = {220,160,172,200};
kal_uint8 val = 1;
kal_int8 socketId=-4;
kal_int8 val2;
U8 emSocketAccountId1=10 ;
socketId = soc_create(PF_INET, SOCK_STREAM, 0, MOD_MMI, emSocketAccountId1);
if(socketId<0)return;
server_ip_addr.addr_len=4;
memcpy(server_ip_addr.addr, addr, 4);
server_ip_addr.port = 2000;
soc_connect(socketId,&server_ip_addr);
运行时的LOG如下:
"SOC: enter socreate(type=SOCK_STREAM)"
"SOC: enter soc_activate_sspdu(s=2)"
"SOC: socket 2 sends REQ to TCPIP and wait for SOC_EVT_ATTACH"
“TCPIP_SOC_SAP MSG_ID_SOC_TCPIP_ATTACH_REQ
"TCPIP: got message from MOD_MMI"
"TCPIP: tcpip_main()"
"TCPIP: tcpip_attach()"
"TCPIP: tcp_usr_attach()"
"TCPIP: tcp_attach()"
"TCPIP: in_pcballoc()"
"TCPIP: soreserve(), num_socket=1"
"TCPIP: tcp_newtcpcb()"
”TCPIP_SOC_SAP MSG_ID_SOC_TCPIP_ATTACH_CNF
"SOC: socket=2 exp_state=2, waiting_event=SOC_EVT_ATTACH, result=0"
"SOC: waits SOC_EVT_ATTACH: socket id=2"
"SOC: received SOC_EVT_ATTACH: socket id=2"
"SOC: enter soc_connect(s=2, faddr=220.160.172.200:2000)"
"SOC: enter soc_activate_nwk_account(10)"
"SOC: config bearer set=1, bearer=TCP_OVER_GPRS, bearer_map=1"
"[FLC]Config Bearer:SPDU_DATA, dir:1, set_bearer:1, type:TCP_OVER_GPRS,"
大家帮我看看这流程有没问题,是不是在这之前要先拨号进行GPRS连接?搞了几天,郁闷死了,请大家指点一二。
也可以加我QQ:17988731 交流。 |
|