Sie sind auf Seite 1von 27

BLUETOOTH REMOTE CONTROLLER USLNG JAVA

MOHAMMAD NOR IHSAN BIN MD ZIN

This report is submitted in partial fulfillment of the requirements for the Bachelor of Computer Science (Computer Network)

FACULTY OF INFORMATION AND COMMUNICATION TECHNOLOGY WIVERSITI TEKNIKAL MALAYSIA MELAKA 2007

ABSTRACT

Bluetooth Remote Controller Using Java is a project based on Bluetooth application. This Bluetooth innovation will enable user to control their home device using Bluetooth mobile phone. For this project, the device which can control is lamp. The lamp will create as virtual and will be locates in computer system. User need to connect their mobile phone with computer via Bluetooth in order to control the virtual lamp. User can control the lamp whether to switch it ON or OFF.

ABSTRAK

Bluetooth Remote Controller Using Java adalah sebuah projek yang berasaskan aplikasi Bluetooth. Inovasi Bluetooth ini membenarkan pengguna mengawal peralatan di dalam rumahnya menggunakan telefon bimbit yang menyokong Bluetooth. Dalam projek ini, peralatan yang boleh dikawal adalah lampu. Lampu tersebut akan dibangunkan secara maya dan akan diletakkan di dalam sistem komputer. Pengguna perlu menyambung atau menghubungkan telefon bimbitnya dengan komputer melalui Bluetooth untuk membolehkan beliau mengawal lampu maya tersebut. Pengguna boleh mengawal peralatan rumahnya samada ON atau OFF.

CHAPTER I

INTRODUCTION

1.1

Project Background
The project of Bluetooth Remote Controller Using Java will allow people apply

Bluetooth technology to control a lamp via their Bluetooth enabled mobile phone. The lamp which will be controlled will create virtually and will be appear on the monitor screen for both computer and mobile phone. The system in the computer will develop using Java programming language and for mobile phone, Java 2 Micro Edition (J2ME) will be used. User can use their Bluetooth mobile phone to either switch the lamp on or off. The whole application will be build using Java programming language.

1.2

Problem Statements
Suitable with era circulation, the usage of data cable is no longer practical for

devices connection and data transmission. Wireless has replace the cable usage, and give more comfortable to people. Nowadays, people search for something easier and affordable to daily usage. Bluetooth is a technology that allows computer or mobile phone communicates with other devices wirelessly. Today, the usage of Bluetooth technology mostly limited to communication between mobile phones. The popular uses of Bluetooth are transferring data, such as

MP3, games, and other application in mobile phone. Now people can apply this wireless technology as a remote controller. Means, by using Bluetooth enabled mobile phone, people can control other devices like computer, car, or their home devices.

1.3

Objectives The objectives of developing Bluetooth Remote Controller Using Java are: Develop Virtual Lamp application for computer system Develop Virtual Lamp application for mobile phone The Virtual Lamp application is able to control the Virtual Lamp Apply Bluetooth connection to communicate between computer and mobile phone using Bluetooth USB adapter as the medium.

1.4

Scope The project will concerns on developing virtual lamp application using Java

programming language in the computer system and developing virtual lamp application GUI using Java J2ME programming at Bluetooth mobile phone. The virtual lamp application GUI at mobile phone will be simple than the GUI at computer. Besides, the project will use Bluetooth technology to connecting the Bluetooth mobile phone and the computer. At this point, Bluetooth USB adapter will plug-in into the computer to allow communication and data transmission between the two devices. After the connection between devices success, user can control the virtual lamp application either to switch on or off the device. Once the device switched on in the mobile phone's virtual lamp application, the device in computer's virtual lamp application also switched on.

1.5

Project Significance The significance of this project is to ease and accelerate people work in take care

of their home. By using Bluetooth mobile phone, people can easily switch on or off their lamp at home. No need to worry forget to switch off the lights, the controller is at your fmgertips. This will give more convenience and save much time to the user.

1.6

Expected Output The expected output of the project is understands how Bluetooth can be a

connection medium between computer and mobile phone. Beside that, this project hopefully can make people fully implementing Bluetooth technology in their daily habits. Although in this project, the lamp creates as virtual, it is not impossible to make it reality in the future. Furthermore, this technology can be implements in other device system, such as fan and electronic door.

1.7

Conclusion A project success usually begins with a good research about the project domain.

This chapter discusses overview of the project. According to problem statements of network domain and Bluetooth technology, this project may be the solution for it. The early procedure of a project was completed in this chapter. Next chapter will discuses about literature review and project methodology.

CHAPTER I1

LITERATURE REVIEW AND PROJECT METHODOLOGY

2.1

Introduction
After discussing the project preview in previous chapter, this chapter will present

the literature review and project methodology. The literature review focuses on the various theory and basic network knowledge used in the project. Project methodology will discuss detail about type of methodology, techniques, hardware or software requirements and project planning to develop the project, so that the planning for the project proposed to meet project objectives, scopes and requirements.

2.2

Fact And Finding


There is lot of techniques used to gather information that related to the project. It

might be find from the Internet web pages, books that related to project domain, journals or articles from passed research. These initial documents will provide some valuable information to determine the basic view for the project. The theory and concept from the passed research, references, case study and other can be applied in order to understand the project requirements.

2.2.1

Domain This sub-topic explains the domain related to this project which is the Bluetooth.

This will elaborate in details about Bluetooth technology, its operation and Bluetooth network topology. These are the important information about Bluetooth system.

2.2.1.1 Bluetooth Technology Bluetooth technology is a cutting-edge open specification that enables shortrange wireless connections using low-power radio communications between desktop and notebook computers, personal digital assistants, handhelds, mobile phones, camera phones, printers, digital cameras, headsets, keyboards and even a computer mouse. The name "Bluetooth" is borrowed from Harald Bluetooth, a king in Denmark more than 1,000 years ago. Bluetooth wireless technology is intended to replace the cables connecting portable and fixed devices while maintaining high levels of security. This wireless technology uses a globally available frequency band (2.4GHz) for worldwide compatibility. In a nutshell, Bluetooth technology unplugs your digital peripherals and makes cable clutter a thing of the past. Although the Bluetooth standard utilizes the same 2.4 GHz range as 802.1 1b and 802.1 1g, Bluetooth technology is not a suitable Wi-Fi replacement. Compared to Wi-Fi, Bluetooth networking is much slower, a bit more limited in range, and supports many fewer devices Wireless signals transmitted with Bluetooth cover short distances, typically up to 30 feet (10 meters). Bluetooth devices generally communicate at less than 1 Mbps. Bluetooth networks feature a dynamic topology called a piconet or PAN. Piconets contain a minimum of two and a maximum of eight Bluetooth peer devices. Devices communicate using protocols that are part of the Bluetooth Specification.

2.2.1.2 Bluetooth Operation

The Bluetooth core system consists of an RF transceiver, base band, and protocol stack. The system offers services that enable the connection of devices and the exchange of a variety of data classes between these devices. Bluetooth can connect 8 devices at the same time. Although each of those devices on the same radius, it would not interfere with each other. Bluetooth utilizes a technique known as low frequency hopping, which makes it harder for more than one device to transmit on the same frequency at the same time. One of the ways Bluetooth will avoid interfering with other electronic devices is by sending out weak signals of around 1 miliwatt (mw). The low power signals will limit the range of a Bluetooth device to around 10 meters, which cut the chances of interference between your computer and other electronic devices. Even though it has low power, Bluetooth does not require a line of sight between the communicating devices. When the Bluetooth devices come within close range of each other, an electronic conversation will occur to determine whether or not they have data to share or whether one needs to take total control. The user does not have any buttons to press or commands to give, the conversation will occur automatically. Once the conversation has occurred, the devices will form a network. Bluetooth devices will create a PAN (Personal Area Network) or piconet that may fill a room. Once the piconet has been established, the devices will randomly hop in frequencies.

2.2.1.3 Bluetooth Network Topology

Bluetooth-enabled devices are organized in groups Called piconets. A piconet consists of a master and up to seven active slaves. A master with a single slave will use

point-to-point communication to communicate among each other. If there are multiple slaves, point-to-multipoint communication is used. A master unit is the device that initiates the communication. A device in one piconet can communicate to another device in another piconet, forming a scatternet. A Scatternet is a group of linked piconets joined by common members that can either be slaves on both piconets or a master of one piconet and a slave on another. Notice that a master in one piconet may be a slave in another piconet.

Figure 2.1: Piconets and Scatternet

The normal duration of transmission is one slot, and a packet can last up to five time slots in length. In order to support full-duplex communications, Bluetooth uses a time-division multiplexing (TDM) scheme, in which a master device always uses an even-numbered slot when it transmits, and a slave uses an odd-numbered slot.

2.2.2 Existing System

There are some Bluetooth remote controller exists in the market today. Every product has different specification and function. These are several Bluetooth-based systems that already exist:

i. Bluetoot11 PC Dialer

Bluetooth PC Dialer is both a stand-alone application and a Bluetooth Outlook plug in. This means that user can access call directly from within Outlook with a single click. With Bluetooth PC Dialer user have the following call options: Copy a number to clipboard and press the call short key combination. Call any number from the Bluetooth PC Dialer application

In Outlook call from a highlighted email - Bluetooth PC Dialer


finds the Contact that matches the senders e-mail address

In Outlook call from a highlighted Contact


In Outlook call from an opened Contact

In Outlook call any number that you chose


Bluetooth PC Dialer can be operated completely via fast keys without the need of the mice, and it have same call related functionality as the phone. To use Bluetooth PC Dialer user need a Bluetooth enabled mobile phone and a Bluetooth PC solution. Bluetooth PC Dialer accesses Bluetooth stack directly so there is no need for setting up Bluetooth COM ports (Widcomrn and Microsoft stack). The program supports most Bluetooth enabled mobile phones and all PC solutions.

11.

..

Bluetooth Remote Control Version 3 Bluetooth Remote Control is a true universal remote control. It allows the user to modify the current behavior as well as add support for new applications. User can add support by writing Java or VB scripts, defining key maps and file actions. With key maps the user can very easy and fast define application actions and link them to any buttons on the mobile phone. Bluetooth Remote Control is free to try for as long as user wants. The demo version provides a limited number of actions before disconnected and must reconnect. The full version can be purchased and registered securely from within the program.

iii. Device Synchronization Seamless connectivity among Personal Digital Assistant (PDA), computers, and mobile phones allows applications to update information on multiple devices automatically when data on any one device changes.

2.2.3 Technique

The applicable approach that related to this project is using Java MIDlet. A MIDlet is a Java program for embedded devices, more specifically the Java ME virtual machine. Generally, these are games and applications that run on a cell phone. A MIDlet requires a device that implements Java ME, Mobile Information Device Profile (MIDP) to run. The MIDP, when combined with the Connected Limited Device Configuration (CLDC), is the Java runtime environment for today's most popular compact mobile information devices, such as cell phones aid mainstream PDAs. Like other Java programs, MIDlets have a "compile once, run anywhere" potential. To write a

MIDlet, you can get the Sun Java Wireless Toolkit or NetBeans with the NetBeans Mobility Pack from the Java website, which is available on several platforms and is completely free. MIDlet distributions also consist of a .jad file describing the contents of the JAR file.

2.3

Project Methodology
The project will used the Waterfall Model as it methodology to achieve the

objectives. The Waterfall Model will cascade effect from one phase to the other. It simplified the steps or preparation for how to begin or implement a project. The waterfall model tackles complexity in an orderly way and it is easy to understand, with a simple goal which is to complete the required activities. Besides, this model is easy to track the progress of the project using a timeline or gantt chart where the completion of each phase is used as a milestone. For this project methodology, the waterfall model has five phases which are planning phase as the first phase, where all project planning were done. It is followed by analysis phase, which in this phase all exploration and analysis about the project title were done. After analysis phase completed, then the design phase begin. The forth phase is implementation, where the project will be develop. The last phase is installation. Once the project reached the installation phase, it is consider as completed. Figure 2.2 indicates the waterfall model for project methodology.

I
PLANNING
A

IMPLEMENTATION
P

0
INSTALLATION

Figure 2.2: Waterfall Model For Project Methodology

The first phase to start the project is planning phase. In this phase, a plan to complete the project after detailed exploration about concept and system allocation. In this phase, mostly about identifylng project background, problem statement, project scope and objectives, project significant, and also determine project requirement in order to complete the project. Besides, to ensure all activities complete exactly on time, Gantt chart also created in this phase. After planning phase is completed, it is follow by analysis phase which is to identifylng issues regarding on the project title. Besides, all information about the topic also gathered and analyze in this phase. In other hand, project's software and hardware requirement was determined in this phase.

Design is the third phase in project waterfall model. In this phase, project focus on design process. This process include of user interface design for both system in mobile phone and the computer, output and input data of the system and project architecture.

After all design works completed. The next phase is implementation phase. In implementation phase, project running based on design and architecture. The hardware and software that determined are installed and tested. The implementation of the system was done using Java programming language and Java J2ME for mobile phone.

The final phase is installation phase. When all previous phase were done successfully, the system will install and run in computer and mobile phone. The system will tested and if success, the project is completed.

2.4

Project Requirements
Requirement of the project can be divided into two categories, which are

software requirement and hardware requirement. These two requirements play an important role in developing or completing the project. The types of requirements and the details are as list at below.

2.4.1 Software Requirements


There are a few kinds of software tools to be used for the project. The software or tools use to develop the application are NetBeans IDE version 5.5 and Sun Java Wireless Toolkit 2.5 for CLDC. For the Java Development Kits (JDK) and Java Runtime Environment (JRE), developer used JDK version 6 Update 2 and JRE version 6 Update 2. To supports J2ME development, NetBeans Mobility Pack 5.5 was installed for

NetBeans 5.5. The other software are Windows XP Professional Service Pack 2, Microsoft Office Project, Microsoft Office Visio, Microsoft Office Word. All these software used for project's documentation. The JDK used to develop Java application for virtual lamp application in computer system. The Sun Java Wireless Toolkit will be used to develop MIDlet application, which is the virtual lamp application, running and install inside the mobile phone. Besides that, Windows XP Professional Service Pack 2 is the operating system for the computer which will connect with mobile phone via Bluetooth. Microsoft Office Project is used to create the project milestone and Gantt chart that will be used to show the progress of the project. Microsoft Office Visio used to create the network diagram, system layout, flow chart and data flow diagram for the project documentation. Microsoft Office Word is the word processing software that important to create project documentation. All project progress and report will be create using Microsoft Word and will save in .doc file type.

2.4.2 Hardware Requirements


Systems are able to run and perform in a perfect condition if it meets the requirements. The basic requirement required to run the system are like a unit of desktop computer which is where virtual lamp application will placed. The other requirement is USB Bluetooth adapter, which the main hardware to connecting computer and mobile phone via Bluetooth. Mobile phone is the third hardware that required in developing this project. However this mobile phone must have Bluetooth capability to making sure it can connecting with computer.

2.5

Project Schedule And Milestones


Gantt chart is a popular type of bar chart that illustrates a project schedule. Gantt

charts illustrate the start and finish dates of the terminal elements and summary elements of a project. Terminal elements and summary elements comprise the work breakdown structure of the project. Gantt charts can be used to show current schedule status. A Gantt chart provide a standard format for displaying project schedule information by listing project activities and their corresponding start and finish dates in a calendar format. Project milestones are events that signify the accomplishment or completion of major deliverables during a advancement of knowledge in a field such as interface development.

The project Gantt chart is attached in the report attachment. Please refer to the attachment.

2.6 Conclusion

In the chapter of literature review and project methodology, it took more works
on gathering lots of information, facts, related journal and articles in order to find the right approach to manage problems, requirements and preferences of this project. By doing that, we can understand the concept of Bluetooth and it's operation.

Waterfall methodology model are chosen to provide a mechanism for mapping from real world problems to abstractions do that it can be developed effectively.

Project requirements for the project are specified as a scope for project to be implemented successfully. It is to ensure the project can be developed without meeting any problem that can cause by incompatible hardware and software.

A good project planning demonstrates that suitable consideration has been given to management and execution needs for the project. It is important to ensure that a project is completed on time, because deletion of a project can bring about other interfacing problem to cost, time and so on.

1 1 CHAPTER 1

ANALYSIS

3.1

Introduction In order to study, to examine something or to learn what it is made up of,

analysis phase is needed. The analysis is about understanding the design environment. This consists of identifylng the questions and issues to be addressed, identifylng it strength and weakness, gathering and understanding requirements and characteristics. There are few approaches or techniques to gather requirements for the project like asking people that have knowledge about Bluetooth technology and Bluetooth remote controller, to get books related with the project, articles and journals regarding Bluetooth remote controller. Explanation mostly talking about makes comparison between the existing system and the new technology. It is including analyzing in details about the problem of the existence system and trying to find the solution for it. Once the information gathered, it will be organized and presented in certain form. The analysis also consists of identifying software and hardware requirements.

3.2

Problem Analysis
Problem analysis will investigate and identify the existence system situation.

This section will give some brief and general idea what are the pro and con about the current system. In this section also will present the data flow diagram or activity diagram to show how the current system runs.

3.2.1

The Scenario / Situation of Current System


This sub-chapter elaborates the scenario and situation of the existing Bluetooth

system. It consists of Bluetooth technology scenario, Bluetooth security issues and Bluetooth remote controller situation.

3.2.1.1 Bluetooth Technology Scenario


When looking around, most of keyboard, printer, mouse, monitor and scanner are connected to the computer by cables. Cables have become the bane of many offices and lamp applications. Bluetooth essentially aims to fix the problem. It is a cablereplacement technology. Introduced initially by Ericsson, before being developed by a myriad of other companies, Bluetooth is a standard for a small, cheap radio chip to be plugged into computers, printers, mobile phones and other handheld. A Bluetooth chip is designed to replace cables by taking the information normally carried by the cable, and transmitting it at a special frequency to a receiver Bluetooth chip, which will then give the information received to the computer or mobile phone. Nowadays electronic devices like cell phones come equipped with Bluetooth. Whereas Bluetooth technology has certain obvious advantages like low power

consumption and reliable connection but it suffers some inherent problems including low area of operation, limit of 7 slave devices per master device. 802.1 1 technology on the other hand, has a wider area of operation and therefore very usefil as Access points and higher bandwidth in the order of 11 Mbps in 802.1 1b. But 802.1 1 has a higher power consumption than Bluetooth. Cellular networks have a much wider coverage in geographical area than 802.1 1. Complementing Bluetooth with 802.1 1 and cellular network technology like GPRS would solve the shortcomings of these three technologies. Lots of ideas are constantly emerging for innovating Bluetooth technology. Some ideas are practical and feasible. For example, Bluetooth chips in freight containers to identify cargo when a lony drives into a storage depot, or a headset that communicates with a mobile phone in your pocket, or even in the other room. Some ideas are not so feasible, such as refrigerator communicating with your Bluetooth-enabled computer, informing it that foods supply is low, and to inform the retailer over the internet.

3.2.1.2 Bluetooth Security The Bluetooth specification includes security features at the link level. It supports authentication (unidirectional or mutual) and encryption. These features are based on a secret link key that is shared by a pair of devices. To generate this key a pairing procedure is used when the two devices communicate for the first time.

The link level functions are defined in the Bluetooth Baseband and the Link Manager Protocol Specifications. The Bluetooth profiles describe how to use the Bluetooth protocols in an interoperable way. Concerning security this is done in the Generic Access Profile. This profile specifies three security modes for a device: Security mode 1 (non-secure): A device will not initiate any security procedure.

1.

11.

..

Security mode 2 (service-level enforced security): A device does not initiate security procedures before channel establishment at L2CAP level. This mode allows different and flexible access policies for applications, especially running applications with different security requirements in parallel.

iii.

Security modes 3 (link level enforced security): A device initiates security procedures before the link set-up at the LMP level is completed.

For services the requirement for authorization, authentication and encryption are set independently (although some restrictions apply). The access requirements allow defining three security levels: Services that require authorization and authentication. Automatic access is only granted to trusted devices. Other devices need a manual authorization.

1.

11.

..

Services that require authentication only. Authorization is not necessary.

in.

...

Services open to all devices; authentication is not required, no access approval required before service access is granted.

The Bluetooth Security architecture has the following limitations:

1. Support for legacy applications: In all scenarios, the legacy application will
not make calls to the security manager. Instead a Bluetooth-aware "adapter" application is required to make security-related calls to the Bluetooth security manager on behalf of the legacy application.

2. Only a device is authenticated and not its user. If there is a need for
authentication of the user, other means application level security features will be necessary.

3. There is no mechanism defined to preset authorization per service. However,


a more flexible security policy can be implemented with this architecture, without a need to change the Bluetooth protocol stack. Of course, modifications of the security manager and the registration processes would be necessary.
4. The approach only allows access control at connection set-up. The access

check can be asymmetric, but once a connection is established, data flow is in principle bidirectional. It is not possible within the scope of this architecture to enforce unidirectional traffic.

5.

The security architecture is built upon the Bluetooth baseband security procedures that address the BT link security and mutual device authentication at each end of the link. To address the end-to-end security issue, the existence of a "higher-level" end-to-end security solution which may utilize the Bluetooth security architecture presented for accessing devices and services directly present at the two ends of a Bluetooth link.

Figure 3.1 below indicates the architecture of Bluetooth security. This figure may help us to understand how Bluetooth works for its security.

User Interface

~ (or R otherF rnultlplexlng C O ~ ~m


protocol)
-7-7-

B secudv m B

k2
Mgmt Entlty
B ~

Manager

Databas

Servlce

'
L2CAP

a
I

HCI
L l n k M a ~ a g eIr Llnk Controller

1I

Figure 3.1: Bluetooth Security Architecture

3.2.1.3 Bluetooth Remote Controller Situation


Bluetooth Remote Control is a true universal remote control. It allows the user to modify the current behavior as well as add support for new applications. User can add support by writing Java or VB scripts, defining key maps and file actions. With key maps the user can very easy and fast define application actions and link them to any buttons on the mobile phone. Figure 3.2 shows the architecture of Bluetooth remote controller.

Application (Remote Conkof) Transport Layer (TCP)

I P Backbone

(Primary &faster >a)

Local Bluetooth Scattanet (Bluetooth Enabled Environment)

Figure 3.2: The Architecture of Bluetooth Remote Control

3.2.2 Data Flow Diagram or Activity Diagram For Current System Operation

(7
START Searching For Bluetooth Devices
-

(No device found)

I
j

Display Founded ... : : : .devices

Connection Established

.....

Yes

{ZF)
Figure 3.3: Data Flow Diagram For Bluetooth Current System
Figure above shows the data flow diagram for Bluetooth current system. When user starts the system, it will searches for Bluetooth devices in its range of coverage. If there is no device found, the system will end the system. But if the system found any device in its range, it will prompt to make a connection to the device. User needs to validate the connection. If the user does not want to make a connection, the system will find another devices. If the connection accepts, the connection is establish and system

operations was done after this session. When user selects to terminate the connection and the system, he will be asked once again to termination for confirmation. Once user accept the termination, the Bluetooth connection will be disconnected. If not, it will still connected.

3.2.3 Visual of Current System Flow Below is the figure which indicates the visual of current Bluetooth system flow. The main devices to make a Bluetooth connection are Bluetooth USB adapter which used for any USB devices or user also can use Bluetooth PC card for notebook computers. While the Bluetooth is connected, it will find the Bluetooth devices in its range of coverage. The example of Bluetooth devices are Bluetooth access point, Bluetooth handheld, Bluetooth printer, Bluetooth cell phone and Bluetooth notebook.

Blurtooth

Handheld
"'lIh0"l

5ynrSmn-redam
rr (PI

Figure 3.4: Diagram To Visualize Bluetooth System Flow

3.3

Requirement Analysis
Requirement analysis section is divided into data requirement, functional

requirement, software requirement and hardware requirement. All these requirements important to ensure the progress of the project will run smoothly.

3.3.1 Data Requirement Data requirements for this project are more for controlling purpose. When application starts, the mobile phone will send radio signal to computer through Bluetooth USB adapter. The computer then will accept the Bluetooth connection and the mobile phone will received the status of the lamp, whether it is on or off. During this session, data that required are the status of the devices whether it is on or off and the data from mobile phone to switch the device on or off.

3.3.2 Functional Requirement There are three objects in this system which is user, Bluetooth remote controller (mobile phone) and virtual lamp application system (computer). The activity of the system starts when user opens the virtual lamp application at mobile phone. Once the software was open, the Bluetooth remote controller search for Bluetooth device. Once the connection approved, user can control the virtual lamp application. Remote controller will send Bluetooth signal to the computer. Once the computer receives the signal, it will send virtual lamp application status. User will see the devices in the virtual lamp application status, whether it is in the on or off mode. Then, user can control the devices mode via the remote control. Remote control once again send signal (changing of device mode) to the computer, then the computer will change the device mode based on remote controller's signal.

Das könnte Ihnen auch gefallen