本文介绍了在pdu模式下发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我接受此代码并将其更改为以pdu模式发送味精,但无法发送plz帮帮我吗?
i take this code and change this code to send msg in pdu mode but can not send plz help me?
Dim recievedData As String = ExecCommand(port, "AT", 300, "No phone connected")
recievedData = ExecCommand(port, "AT+CMGF=0", 300, "Failed to set message format.")
' تابع رمز کردن پیام
PDUCodes = GetPDU("+9891100500", PhoneNo, 8, 255, "0", "true", Message)
Message = String.Empty
'Add PDU Codes to Text
For Each ch In PDUCodes
Message = Message + ch
Next
Dim command As [String] = "AT+CMGS=" + Message.Length.ToString() + vbCrLf '+ "<CR>" + "<" + Message + ">" + "<ctrl-Z>" '+ "<CR>" + Message + vbCrLf
recievedData = ExecCommand(port, command, 300, "Failed to set lenght")
command = Message + "<ctrl-Z>" + vbCrLf
' command = Message + vbCrLf
recievedData = ExecCommand(port, command, 30000, "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
推荐答案
这篇关于在pdu模式下发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!