如何使用 python 发送 AT GSM 命令?
我能够使用 Delphi 和一些 comport 组件(TComport)很容易地做到这一点,但是我如何使用 python 与我的调制解调器对话?
Gath
我用 pyserial 这样做:
import serial
serialPort = serial.Serial(port=1,baudrate=115200,timeout=0,rtscts=0,xonxoff=0)
def sendatcmd(cmd):
serialPort.write('at'+cmd+'\r')
print 'Loading profile...',
sendatcmd('+npsda=0,2')
然后我就听听答案……
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)