Excercise: Bluetooth conncetion - mobile to PC

Create an application that connects your mobile over bluetooth via the serial port to a hyper terminal on your PC. The app shall let you write text charactes on the phone and receive them on the PC.

 

1. You need to use the socket module:

import socket

1. Do bluetooth scanning to discover the PC's BT address and service, and then conncet to the PC.

2. Create a function that triggers an text input field and sends the result over bluetooth to the terminal.

 

Example file: ex_bluetooth_mobile_to pc.py

Description: ex_bluetooth_mobile_to pc_descr.py

 

Note:
Make sure you have the bluetooth settings of the PC's bluetooth software correctly set:
- right click on bluetooth icon -> choose open bluetooth settings to open them.
- choose Options tab, make sure "Turn discovery on" is selected
- choose COM ports tab, make sure an COM port as "incoming" direction available, if not click add and created an incoming COM port

Create a Hyper terminal:
- got to Accessories -> Communications -> Hyperterminal
- give a name and choose an icon, press ok, then choose in the "connect using" field the COM port of your "incoming port", press ok
- make the Hyper teminal active by clicking the "call" button.
- start now the python script on the phone.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Previous | Next | Menu     Copyright (c) 2006 Jurgen Scheible