Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Python - SendSMS over BT and AT

// Send SMS over Bluetooth (AT Command)

   1  
   2  import bluetooth
   3  
   4  sockfd = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
   5  sockfd.connect(('00:00:00:00:00:00', 1)) # BT Address
   6  sockfd.send('ATZ\r')
   7  sockfd.send('AT+CMGF=1\r')
   8  sockfd.send('AT+CSCA="+393359609600"\r') # Client TIM ITA
   9  sockfd.send('AT+CMGS="+39xxxxxxxxxx"\r') # TO PhoneNumber
  10  sockfd.send('Messaggio da mandare...\n')
  11  sockfd.send(chr(26)) # CTRL+Z
  12  sockfd.close()
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS