如何使用AT命令发送超过160个字符的长短信 [英] how do i send a long sms exceeding 160 characters using AT command

查看:379
本文介绍了如何使用AT命令发送超过160个字符的长短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用AT命令发送超过160个字符的长短信

这是我的代码:

how do i send a long sms exceeding 160 characters using AT command
this is my code:

Dim isSend As Boolean = False
Try
    Dim recievedData As String = ExecCommand(port, "AT", 300, "No phone connected")
    recievedData = ExecCommand(port, "AT+CMGF=1", 300, "Failed to set message format.")
    Dim command As [String] = "AT+CMGS=""" & PhoneNo & """"
    recievedData = ExecCommand(port, command, 300, "Failed to accept phoneNo")
    command = Message & Char.ConvertFromUtf32(26) & vbCr
    recievedData = ExecCommand(port, command, 3000, "Failed to send message")
    '3 seconds
    If recievedData.EndsWith(vbCr & vbLf & "OK" & vbCr & vbLf) Then
	isSend = True
    ElseIf recievedData.Contains("ERROR") Then
	isSend = False
    End If
    Return isSend
Catch ex As Exception
    Throw ex
End Try

推荐答案

使用AT命令(GSM设备或移动设备连接PC) )

可能是您的设备只允许在一条消息中 128 字符。



您可以拆分长消息两个或多个短信。 因为在这种情况下(对于AT命令),如果您的设备每个sms仅支持128个字符,则没有额外的设置可用于将当前设备中的限制从128个扩展到160个字符。



您也可以使用第三方批量短信服务...



Happy Coding!

:)
using AT-commands (GSM-device or mobile attached with PC)
May be your device allowing 128 chars only in a single message.

you can split long message in two or more sms. because in this case(for AT-commands), if your device support only 128 chars per sms then there are no extra settings available to extend the limit from 128 to 160 chars in your current device.

you can also use 3rd party bulk sms service for this...

Happy Coding!
:)


这篇关于如何使用AT命令发送超过160个字符的长短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆