在pdu模式下发送消息 [英] send msg in pdu mode

查看:118
本文介绍了在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

推荐答案

好,您从哪里获得代码?如果您是从CodeProject上的一篇文章中获得的,那么您必须将该问题发布到该文章的论坛中.
Well, where did you get the code? If you got it from an article here on CodeProject, then you have to post the question in the forum for that article.


这篇关于在pdu模式下发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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