ubuntu,debian,redhat,fedora,centos
« »

Python:通过蓝牙发送短信

  1. import bluetooth
  2.    
  3.     sockfd = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
  4.     sockfd.connect(('00:00:00:00:00:00', 1)) # 蓝牙硬件设备地址
  5.     sockfd.send('ATZ\r')
  6.     sockfd.send('AT+CMGF=1\r')
  7.     sockfd.send('AT+CSCA="+13535007000"\r') # 客户端 TIM ITA
  8.     sockfd.send('AT+CMGS="+13866668888"\r') # 手机号码
  9.     sockfd.send('This message send by bluetooth...\n') # 短信内容
  10.     sockfd.send(chr(26)) # CTRL+Z,结束发送
  11.     sockfd.close()

您还可能感兴趣的内容

日志信息 »

该日志于2008-12-21 19:19由 admin 发表在Python分类下, 你可以发表评论。除了可以将这个日志以保留源地址及作者的情况下引用到你的网站或博客,还可以通过RSS 2.0订阅这个日志的所有评论。

没有评论

发表评论 »

返回顶部