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-2 of 2 total  RSS 

Python - SendSMS over BT and AT

// Send SMS over Bluetooth (AT Command)

import bluetooth

sockfd = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sockfd.connect(('00:00:00:00:00:00', 1)) # BT Address
sockfd.send('ATZ\r')
sockfd.send('AT+CMGF=1\r')
sockfd.send('AT+CSCA="+393359609600"\r') # Client TIM ITA
sockfd.send('AT+CMGS="+39xxxxxxxxxx"\r') # TO PhoneNumber
sockfd.send('Messaggio da mandare...\n')
sockfd.send(chr(26)) # CTRL+Z
sockfd.close()

PyS60 - SendFile

// Send File over Bluetooth

from appuifw import *
from e32socket import *

try:
    phone = bt_obex_discover()
    file = query(u'File Selection', 'text')
    bt_obex_send_file(phone[0], phone[1].values()[0], file)
    note(u'File Sent')
except Exception, error:
    note(unicode(error), 'error')
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS