在命令处:从手机获取收件箱

编程入门 行业动态 更新时间:2024-10-26 12:32:25
本文介绍了在命令处:从手机获取收件箱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好,我试图使用AT命令从gsm调制解调器的收件箱中读取内容.当我运行此代码时,我得到的唯一响应是确定".但我应该从收件箱中收到消息.我的代码在下面:

私有Sub viewInBox_Load(ByVal发送者为System.Object,ByVal e为System.EventArgs)将MyBase.Load 处理为新的System.IO.Ports.SerialPort .PortName = QUOT; COM5"结果,.BaudRate = QUOT; 9600"结果,.StopBits = IO.Ports.StopBits.One结果.DataBits = 8结果,.Parity = IO.Ports.Parity.无的.ReadBufferSize = 10000 <.

.Open() .DiscardOutBuffer()读取短信

.DtrEnable = True

.Write("AT" + vbCr)在缓冲区上执行命令. ALL" + vbCr)

昏暗的传入字符串= .ReadExisting()

MsgBox(传入) .Close()

结尾为

作为例外捕获 MsgBox(ex.Message)结束尝试

结束子

我唯一的猜测是,它只会写出字符串的最后一部分.如果是这样,我如何将所有的弦乐部分合而为一?

解决方案

感谢您的发帖!我建议在一个MS论坛中发布您的问题,

MSDN论坛 » » Windows窗体常规
位于此处:forums.microsoft/msdn/ShowForum.aspx?ForumID=8&SiteID=1. 祝您度过愉快的一天!

hi all,im trying to read from a gsm modem's inbox using AT commands.  when i run this code, the only response i get is "OK"  but i should be getting the message from the inbox.  my code is bellow:

Private Sub viewInBox_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        Dim comSerial As New System.IO.Ports.SerialPort        Try            With comSerial                .PortName = "COM5"                .BaudRate = "9600"                .StopBits = IO.Ports.StopBits.One                .DataBits = 8                .Parity = IO.Ports.Parity.None                .ReadBufferSize = 10000                .ReadTimeout = 1000                .WriteBufferSize = 10000                .WriteTimeout = 10000                .RtsEnable = True

                .Open()                .DiscardOutBuffer()                'for reading sms                .DtrEnable = True

                .Write("AT" + vbCr)     'execute command on buffer                .Write("AT+CMGF=1" + vbCr)                .Write("AT+CMGL=ALL" + vbCr)

                Dim Incoming As String = .ReadExisting()

                MsgBox(Incoming)                                .Close()

            End With

        Catch ex As Exception            MsgBox(ex.Message)        End Try

    End Sub

my only guess would be that its only writting out the last part of the string.  if so, how would i concat all the string parts into one? if thats not the problem, what is?

解决方案

Hi,

 

Thank you for your post!  I would suggest posting your question in one of the MS forums,

MSDN Forums » Windows Forms » Windows Forms General
located here:  forums.microsoft/msdn/ShowForum.aspx?ForumID=8&SiteID=1.Have a great day!

更多推荐

在命令处:从手机获取收件箱

本文发布于:2023-10-25 18:34:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1527754.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:收件箱   命令   手机

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!