免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1237 | 回复: 0
打印 上一主题 下一主题

使用sim300进行udp连接 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-21 23:00 |只看该作者 |倒序浏览
现在我有simcom公司的sim300一块,并配有开通gprs业务中国移动sim卡一张。嵌入式系统是s3c2410,基本的sms业务已经实现了。接下来想通过gprs建立和服务器的通信,所使用的协议是sim300内置的tcp、ip协议栈。

因为UDP比较简单,故采用之。
我的过程如下:

记录一:
Client====please input gprs test AT Cmd or "exit":   #系统提示
at+cipcsgp=1,"cmnet"
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+clport="udp","8888"    #设定传输模式和端口号
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cstt
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+ciicr
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cifsr
                                                                                
10.192.37.195
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cipstart="udp","219.245.106.114","4567"  #设置服务器参数,即将开始传送数据了
                                                                                
CONNECT OK
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cifsr
                                                                                
10.192.37.195
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cipstatus
                                                                                
OK
                                                                                
STATE: CONNECT OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cipsend
No data
                                                                                
>
Input data to send to server!(end with "Enter")
23455
No data            
#发送失败,在服务器端监听的套接字没有接受到数据
###########################################################

记录二:
Client====please input gprs test AT Cmd or "exit":    #系统提示
at+cipcsgp=1,"cmnet"
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+clport="udp","8888"
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cstt
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+ciicr
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cifsr
                                                                                
10.196.101.96
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cipstart="udp","219.245.106.114","4567"    #告诉服务器,即将开始发送数据
                                                                                
CONNECT OK
                                                                                
OK
                                                                                
Client====please input gprs test AT Cmd or "exit":
at+cipsend
return with No Data
Input data to send to server!(end with "Enter")
abcdef
return with No Data
Client====please input gprs test AT Cmd or "exit":
at
return with No Data
########################################################
at+cipsend后,始终没有出现期待的send ok

两次尝试均告失败,估计是客户端程序中,数据发送格式有问题,明天期待进一步完善。
~~~

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/104050/showart_2057150.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP