WAP之家:为您提供最全最新的WAP技术,CP.SP.3G等行业资讯。 WAP之家交流论坛全新开放 点击进入>>
WAP资讯 | 3G动态 | SP动态 | 运营商动态 | 内容商动态 | 制造商动态 | 论坛讨论>> 每次自动访问
WAP技术 | WAP源码 | 手机编程 | 手机源码 | 无线技术 | J2ME技术 | 手机软件 添加到收藏夹
IVR技术 | SP资料 | SMS MMS技术 | 商业方案 | IVR下载 | 书籍教程 | 工具软件 语言:繁體中文

WAP之家技术文章SMS MMSSMS技术SMS开发-终端发送

SMS开发-终端发送
作者:不详  来源:转载  发布时间:2005-8-11 8:40:00
从终端设备向蜂窝电话发送短消息文本是十分简单的。以下的代码片段就演示了这个过程。所使用的电话是Nokia 7100系列,并且ME (mobile equipment)是连接在计算的#1号通信端口上。

注意到Ctrl-Z是用来表示终结发送到移动设备的文本输入。

使用Visual Basic来发送SMS文本到Nokia电话:

	' Set up the communications port
	MSComm1.CommPort = 1 ' Com Port 1

	' Set for 9600 baud, no parity, 8 data, and 1 stop bit.
	MSComm1.Settings = "9600,N,8,1"

	' Tell the control to read entire buffer when Input is used
	MSComm1.InputLen = 0

	' Open the port
	MSComm1.PortOpen = True

	' Send an 'AT' command to the phone
	MSComm1.Output = "AT" & Chr$(13) & Chr(10)
	' The phone will respond with an 'OK'

	' Set up the phone for a text message
	MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10)
	' The phone will respond with an 'OK'

	' Prep for SMS, give destination type and destination address.
	' Enter the destination type and destination address to prep for SMS
	' e.g. AT+CMGS="+2145551212",129
	MSComm1.Output = "AT+CMGS= " & Chr(34) & "+2145551212" & Chr(34) & ",129" & Chr$(13) & Chr(10) 
	' The phone will return a'>' prompt, and await entry of the SMS message text.

	' Now send the text to the phone and terminate with (Ctrl-Z)
	MSComm1.Output = "This is a test. WOW! "
	' The phone will respond with a conformation containing the 'message reference number' eg. +CMGS: 

	' Close the port
	MSComm1.PortOpen = False

在终端,看起来就象下面:

	AT
	OK
	AT+CMGF=1
	OK
	AT+CMGS="+15127752607",129
	>This is a test. WOW!
	+CMGS: 49

	OK

想了解更多的有关发送SMS文本信息的内容,请参考GSM 07.05白皮书在ETSI Web site。想了解更多Nokia关于SMS的信息,请去http://www.forum.nokia.com,并登陆到Smart Messaging forum。

[] [返回上一页] [打 印]
文章评论

用户名: 查看更多评论

分 值:100分 85分 70分 55分 40分 25分 10分 0分

内 容:

         (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码