You are on page 1of 5

Application Remote Control Using Bluetooth

(ARC)
Mohammed Abdul Qadeer
Department of Computer Engineering Aligarh Muslim University, Aligarh, India maqadeer@gmail.com

Mohammad Sarosh Umar


Department of Computer Engineering Aligarh Muslim University, Aligarh, India sarosh.umar@gmail.com

Rahul Agrawal
Software Development Tata Consultancy Services, Bangalore, India irahulagrawal@yahoo.com

Amit Singhal
Software Development Computer Science Corporation, Hyderabad, India amitsinghal.indya@gmail.com

Abstract-This paper describes an ingenious way of using Bluetooth-Enabled Mobile Phones to control the PC applications with the help of a Software Application, which is based on Client Server architecture. The application "Application Remote Control using Bluetooth" or (ARC) along with the Mobile Phone possess the ability to control various Software Applications such as Windows Media Player and Microsoft PowerPoint Slideshows. It can also control electrical devices such as LEDs, fans using parallel (LPT) port of the PC, and PC monitor. Keywords- Bluetooth; remote control; home networking; PAN; home appliances; wireless networks; J2ME; Java; handheld devices; Nokia 6600

should have the Bluetooth Dongle or any other Bluetooth hardware installed. Once the basic hardware setup is done a client side application is deployed over the Mobile Phone and server side application is deployed over Personal Computer. The Client application searches for the Personal Computer and after the Connection establishment and Authorization, application on Mobile Phone starts controlling the applications on the Personal Computer.
III.
PROBLEM AND SOLUTION

I.

INTRODUCTION

Wireless technologies are bringing future to present. Bluetooth is a one such wireless technology which is reshaping the way we live and work. It is an implementation of a protocol defined by the IEEE 802.15 standard. The protocol operates in the unlicensed industrial, scientific and medical (ISM) band at 2.4 to 2.485 GHz, using a spread spectrum, frequency hopping, full-duplex signal at a nominal rate of 1600 hops/sec. The 2.4 GHz ISM band is available and unlicensed in most countries [1]. About 13 percent of Mobile Phones shipped in the United States in 2004 had Bluetooth, according to IDC research. The number will grow to about 53 percent globally and 65 percent in the United States alone by 2008 [2]. The current work envisages the utilization of these Mobile Phones as remote controls to Personal Computers.
II.
PRIMARY OBJECTIVE

While developing the solution for the application we divided the problem at hand into two parts: 1. Connection between Personal Computer and Mobile Phone. 2. Operations in the Personal Computer once a connection is established.

A. Problem one: Connection between Personal Computer and Mobile Phone


This problem can be solved in two ways 1) COM based solution: The COM-based solution is based on virtual COM ports created by both communicating devices. From the programmer's point of view, using a virtual COM port is similar to using a normal COM port [3].

The primary objective of the application ARC is to manage the computer applications executing in the Personal Computer or Laptop using a Mobile Phone. This Mobile Phone should be Bluetooth enabled and the Personal Computer or Laptop*

978-1-4244-2283-8/08/$25.00 2008 IEEE

2) JSR-82 based solution: This solution is based on JSR82, which is the Java API defined for using Bluetooth in Java ME devices. J2SETM used in Personal Computers does not support the JSR-82 API by default. There are third-party implementations for the JSR-82 API to be used with J2SE. These third party JSR-82 implementations are based on existing Bluetooth stacks in computers and usually only implement the API over Bluetooth stacks services. One example of JSR-82 implementation for J2SE is BlueCove (http://bluecove.sourceforge.net/). BlueCove works with the Windows XP Service Pack 2 Bluetooth stack (and all Bluetooth devices it supports). The COM-based solution is not Bluetooth stack specific and hence could be used on a variety of Bluetooth stacks such as IVT Bluesoleil, Microsoft Bluetooth Stack (Windows XP Service Pack 2 Bluetooth stack), and Widcomm Bluetooth Stack etc. This was the reason for choosing it as the solution to problem one. B. Problem two: Operations in PC once a connection is established When the commands are received from the user's Mobile Phone the server accepts and produces the desired operation on the Personal Computer. The server has been implemented in J2SE and operations are produced in a variety of ways such as by producing virtual key presses, calling different executable files. The details of how this has been done will be discussed later in this paper.

Computer
\l1rwofCOM ST $cltMT~
Oth'bJdfNflf

devices appear on the mobile screen. This operation takes 20 to 40 seconds under normal circumstances. This time for searching can be eradicated if the same Personal Computer is used again and again by storing the serial port service URL and using it directly to open connection. b) Interface Two When the list of available devices is displayed, user can select the appropriate device (Personal Computer on which ARC Server Program is installed). Then pairing of the devices occur and using the 48 bit Bluetooth address of the Personal Computer a serial port connection is established between the Personal Computer and the Mobile Phone. c) Interface Three After this a list of programs and devices appear on the screen. The list follows Windows Media Player MS Office PowerPoint VLC Player Mplayer System Shutdown System Restart System Logoff General Keys Hardware d) Interface Four On selecting "Windows Media Player" the program displays the following list Play/Pause Stop Volume Up Volume Down Mute Previous Next Forward Backward Full Screen Full mode Skin mode Exit

Figure 1. Data Flow Diagram.

IV.

SYSTEM COMPONENTS

The "Application Remote Control using Bluetooth" has two components, namely 1. ARC Client Program 2. ARC Server Program

Figure 2. Interface Windows Media Player.

A.

Problem two: Operations in PC once a connection is establish The "ARC Client Program" has been implemented in J2ME [4]. The jar file has to be transferred and installed on the Mobile Phone. 1) InterfacesofARC Client Program The following interfaces have been designed and implemented to facilitate user. a) Interface One After opening the application the user has to select "Search" from the menu so that all the nearby Bluetooth

e) Interface Microsoft PowerPoint On selecting Microsoft PowerPoint the following menu appears View Show Next Previous Exit j) Interface General Keys On selecting General Keys the following menu appears Enter Alt+Tab Tab Up Arrow Down Arrow Left Arrow Right Arrow Alt+F4 FlO Space

Escape g) Interface Hardware On selecting Hardware the following menu appears Datapin 1 on Datapin 1 off Datapin 2 on Datapin 2 off Pattern 1 Pattern 2 Pattern 3

B.

ARC Server Program

The "ARC Server Program" has been implemented using J2SE.

1) Interfaces ofARC Server Program The server has only one interface which is to be used by the user to select the virtual COM port where the Bluetooth serial port server is running.
The interface is shown below.

2) Operations In this section we discuss the internal operations which are perfonned by the "ARC Client Program". Firstly the program discovers all the nearby devices using startlnquiry( ) [6].

Figure 4. ARC Server

As soon as the user selects a COM port and presses the Open Port button the ARC server will start and will run in the system tray hereafter. The system tray interface of ARC server is shown below.
Figure 3. Inquiry Flow. Adapted from Sun Website.

Once the device is discovered a RFCOMM Stream connection or a virtual serial port connection is established with the Personal Computer and the Interface three is displayed to the user. On the selection of an option from a sub menu a command is sent to the "ARC Server Program". This command is actually a 5 character code.

XXXXX
43210
Figure 5. ARC in Windows tray.

Character 4,3,2,1 defines the application on which the operation has to be done. Character 0 defines the operation which has to be done on the application specified by the character 4,3,2,1. E.g. If the user selects Previous from the Interface Microsoft PowerPoint then the following code is generated.

43210

a a abc

Here aaab is for Microsoft PowerPoint and c stands for Previous.

2) Operations The commands received from the client will be decoded and the corresponding action will be performed by the ARC server.The ARC server has four classes namely Blue, TrayInterface, W32 Uti!, AlertDialog. Blue class is the main class of ARC server. This class uses driver "com.sun.comm.Win32Driver" to access various functionalities of the Virtual serial ports. The available COM port list is then read using a separate module of the Blue class. To open a port for reading, on selected COM port an independent module is executed. In this module a module is used for reading command on this port. In order to avoid errors exception handling [8] has been very efficiently used. Errors are reported to the user using class AlertDialog.

To start reading commands in a stream an object of InputStream [7] class is build by calling getInpuStream [9] on an object of SerialPort class. The parameters are set on serial port using setSerialPortParams. The string received on serial port will be passed on to decode module of W32Util class. In the decode module of W32Util class, command is decoded and the desired action is perfonned. The characters 4,3,2, I of command are used to set the focus on the specified application window utilizing open source package orgjawin. The character will specify the task to be perfonned on the application window by perfonning virtual key press using Robot [9] class. To open executable file the exec module of Runtime class is used [6]. To map the window handles with their title, the Map data structure ofjava.utillibrary is used [10]. Taking an example of Windows Media Player, when user selects the Windows Media Player in Remote Control (in interface three), the client will send command "aaaaz" through Bluetooth to the ARC server. When the ARC server will receive the command, it will decode it and upon decoding it will open wmplayer.exe using exec command of class Runtime. When the server will receive the command aaaaa it will decode it and recognize that it is the play/pause command for Windows Media Player. The ARC server will activate the window and bring it on top of all other windows. Then it will generate Ctrl+P using keyPress module of Robot class.

v
Figure 7. Simple LED circuit diagram.

VI.

CONCLUSIONS

We have used NOKIA 6600 as the Mobile Phone to run ARC client. The ARC server was tested over IVT Bluesoleil and Microsoft Bluetooth stacks. Both the components of the ARC worked as expected. The operations were executed in real time. All the work was tested on Microsoft Windows 2000 and Microsoft Windows XP SP2 operating systems. The following is list of phones which are expected to support the "ARC" Client Program: Nokia 6600, 6681, 6682, 6680, 9500, 9300, 6620, 7610, 6630, 6260, 6670, 3230, 6230, 6255, Motorola AIOOO, Sendo X2, Siemens SK 65, Siemens S65 / S66, Panasonic X700, Sony Ericsson P900, Sony Ericsson P91 0, BenQ P30, BenQ P31.

V.

HARDWARE INTERFACING

It is also possible to control the devices connected to the LPT parallel port using ARC. The data pins are turned low or high through an application made in Visual Basic. "Inp" and "Out" are used to receive and output signals on the LPT. ARC server calls the executables to send high and low signals to parallel port. Circuit to glow LED is shown in figure 7 [10]. The circuit to control home devices such as fans is shown in figure 6 [12]. The load will be connected to relay.

.. .. 0 .. .. 0
Jl

lU 4.1k
Q1 CZZ3S DB

o o
o

1>1 JoWl

1>2 1114002 diode

:.
o
0

Roe lay Ground

Figure 6. Circuit to control home devices

VII.

FUTURE WORK

In the future, ARC could include the capability to display the Personal Computer screen on the Mobile Phone using object push service. It could also control the serial port and USB of the computer system.
REFERENCES [1] [2] Bluetooth SIG, Inc. (2007), "Bluetooth.com Learn", Last retrieved on May 26,2007, from http://www.bluetooth.com/Bluetooth/Learn. Kim Zetter, "Security Cavities Ail Bluetooth", Modified on August 6, 2004, Retrieved on May 25, 2007 from http://www.wired.com/politics/security/news/2004/08/64463 Nokia Corporation (2006), "PC Connectivity over Bluetooth in Java Applications" Version 1.0; Publication date December 8, 2006, on May 24, 2007 from Retrieved http://forum.nokia.com/info/sw.nokia.com/id/85b9d2ee-83f1-4c7b8e71Ob1e35dOc 1e9/PC_Connectivity_over_BT_in_Java_Apps_with_Exampl e_vl_0_en.zip.html Sun Microsystems, Inc. (2006), java.net: "J2ME Tutorial", Created on February 9, 2005, Retrieved on December 29, 2006 from http://today.java.net/pub/a/today/2005/02/09/j2me l.html C. Enrique Ortiz, "Using the Java APIs for Bluetooth Wireless Technology", Modified on January 17, 2007, retrieved on January 31,

2007, from http://developers.sun.com/techtopics/mobility/apis/articles/bluetoothintr


0/

[6] [7]

Herbert Schildt, "The Complete Reference J2SE 5", Tata McGraw Hill, 2005 Sun Microsystems, Inc., (2003), "InputStream (Java 2 Platform SE v1.4.2)", modified on June 21, 2005, Retrieved on December 26, 2006, from http://java.sun.com/j2se/l.4.2/docs/api/java/io/InputStream.html Sun Microsystems, Inc, "CommPort", Modified on July 02, 2005, Retrieved on December 26, 2006, from http://java.sun.com/products/javacomm/reference/api/javax/comm/Com mPort.html Sun Microsystems, Inc (2003), "Robot (Java 2 Platform SE vl.4.2)", Modified on June 21, 2005, Retrieved on January 10, 2007, from http://java.sun.com/j2se/l.4.2/docs/api/java/awt/Robot.html

[8]

[9]

[3]

[10] Sun Microsystems, Inc (2003), 'java.util(Java 2 Platform SE v1.4.2)", Modified on June 21, 2005, Retrieved on January 10, 2007, from http://java.sun.com/j2se/l.4.2/docs/api/java/utillpackage-summary.html [11] Wikimedia Foundation, Inc., "LED circuit -Wikipedia, the free encyclopedia", Modified on February 8, 2007, Retrieved on March 2, 2007, from http://en.wikipedia.org/wiki/LED_circuit [12] Rui Li <ruili@worldnet.att.net>, "Home- Electrical-Contro1.pdf', Modified on June 10, 2004, Retrieved on March 25, 2007 from http://www.ibiblio.org/pub/Linux/docs/HOWTO/otherformats/pdf/Home-Electrical-Control.pdf

[4]

[5]

You might also like