如何通过AT命令使用串口从手机读取数据 [英] how to read data form cell phone using serial port by AT commands

查看:93
本文介绍了如何通过AT命令使用串口从手机读取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试从连接到gsm调制解调器(诺基亚手机)的串口读取数据。我想读取来电或最近的通话记录带来最多的来电

但代码不能正常工作

i和命令AT并且它回复OK

但是当我发送任何其他命令时它会给出错误

i需要一个从串口读取的代码示例并在标签上显示来电或最近通话记录

我的代码是



如果是SerialPort1.IsOpen那么

尝试



SerialPort1.Write(AT&vbCrLf)'检查AT调制解调器回复确定

SerialPort1.Write(AT + clip = 1 \\\\ n&vbCrLf )'读取来自手机设备的接听电话

SerialPort1.WriteLine(AT + CPBR = 1&vbCrLf)'读取手机电话簿





Catch ex As Exception

MsgBox(read&ex.Message)

结束尝试



结束如果

hi
i am trying to read the data from serial port which is connected to a gsm modem (nokia cell phone). i want to read the incoming call or recent call log that bring the top most incoming call
but code is not working as i wish
i snd the command AT and it reply OK
but when i send any other command it gives error
i need a code sample that is reading from the serial port and display the incoming call or recent calls history on a label
my code is

If SerialPort1.IsOpen Then
Try

SerialPort1.Write("AT " & vbCrLf) ' check the AT modem replying ok
SerialPort1.Write("AT + clip = 1\r\n" & vbCrLf) ' read the incomming call from the cell device
SerialPort1.WriteLine("AT + CPBR = 1" & vbCrLf) 'read the phone book of the cell device


Catch ex As Exception
MsgBox("read" & ex.Message)
End Try

End If

推荐答案

你好b $ b

亲爱的Kamran你可以找到一个关于GSM调制解调器编程的非常好的样本关注链接请在开始之前查看这个样本;)



使用AT命令通过GSM调制解调器发送和读取短信 [ ^ ]

http://www.sourcecodester.com/visual-basic/sending-sms-using-commands-gsm-modemgsm-phone-receiving-sms-updated.html [< a href =http://www.sourcecodester.com/visual-basic/sending-sms-using-commands-gsm-modemgsm-phone-receiving-sms-updated.html\"target =_ b lanktitle =新窗口> ^ ]





最好的问候。
Hi
Dear Kamran you can find a really good sample about GSM modem programming follow of links please review this samples before than start anything ;)

Send and Read SMS through a GSM Modem using AT Commands[^]
http://www.sourcecodester.com/visual-basic/sending-sms-using-commands-gsm-modemgsm-phone-receiving-sms-updated.html[^]


Best Regards.


这篇关于如何通过AT命令使用串口从手机读取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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