7.4. Phone-to-PC Communication

In this section, we describe how to connect your phone to your PC using Bluetooth RFCOMM (Figure 7.3). On the PC side, you can either use a Python script to communicate with the phone or any other application or programming language that can access the serial port. In Example 59, however, we rely on standard terminal emulator software, as described in Appendix B, which provides a convenient way to test the connection.

With the PC as a gateway or middleman, it is possible to control a wide range of applications and devices using a mobile phone, although the applications and devices do not have any native support for Bluetooth or mobile phones. Basically anything that can be controlled by a custom program on a PC, can be controlled by the mobile phone using the Bluetooth link. This way, it is possible to build a PC-based personal video recorder, PowerPoint presentation or printer, which can be operated by a mobile phone interface.

Figure 7-3. Bluetooth from phone to PC

Naturally, this requires that your PC supports Bluetooth communication, either internally or with a USB Bluetooth dongle. We also expect you to have installed Bluetooth drivers correctly; that is, Bluetooth must be fully working on the PC side.

To use Bluetooth for RFCOMM communication, some configuration is needed on the PC side. The process of setting up the RFCOMM serial port on ...

Get Mobile Python: Rapid Prototyping of Applications on the Mobile Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.