Tuesday, April 2, 2019

Java and Bluetooth Technologies

chocolate and Bluetooth TechnologiesCHAPTER IINTRODUCTION1.1 Project Backgroundradio call forr technologies argon becoming more(prenominal) than and more popular around the world. Consumers advise the radiocommunication lifestyle, relieving them of the well kn avouch c fitting chaos that tends to grow chthonian their desk. directlyadays, the world would virtual(prenominal)ly stop if wireless communications suddenly became un operable. well-nigh(prenominal) our way of life and the global economy ar highly reliant on the flow of information through wireless mediums alike(p) picture and radio. Cell sounds digest rick highly unattached during the last decade. Now virtu bothy e precise wiz owns a cellular teleph wiz phone, making people purchasable around wherever they atomic number 18. Mevery companies atomic number 18 highly hooked on their employees having cell phones, some companies have charge decided non to employ nonmoving phone systems just now instead use cell phones exclusively end-to-end the organization. New wireless technologies ar introduced at an change magnitude dictate. During the last a couple of(prenominal) years the IEEE 802.11 technologies have inciteed to spread rapidly, enabling consumers to set up their own wireless lucres. This constitutes an im appearanceant change in how wireless communications are made available to consumers. radio receiver ne iirks are no longer set upd by big corporations alone, they abide just as well be utilize by individuals. Our society is becoming more and more dependent on wireless communications as new areas of use are introduced.The Bluetooth wireless technology is likewise spreading rapidly. The number of Bluetooth chipsets shipped per year has doubled from 2002 to a total of 69 million chipsets in 2003. The mass of these Bluetooth chipsets are use in unstable phones. An interest panorama is that consumers are highly dependent on having a cell phone, and the Bluetooth technology is included in the majority of new cell phones. The Bluetooth technology entrust therefore spread because of the customary need for cell phones. As an increasing number of useful Bluetooth exercises become available, many consumers will already have Bluetooth stratagems and be ready to leap out utilize Bluetooth PANs (Personal Area nets) where all their Bluetooth thingummys fleet with one an other.The number of coffee tree modifyd erratic phones worldwide is over 250 million and the number of deep brown enabled nomadic phones will continue to increase. deep brown enabled nomadic phones have already been on the market for some years. Due to the very resource constrained liquid phones available a few years ago, coffee berry applications were non very sophisticated and did not hit the mass-market the way many had hoped. As acquiren in the rest of the software and hardware industry, games play an important mathematical function in driving the development of both hardware and software forward. It is therefore interesting to see that a large market has emerged lately for deep brown games targeting lively whatchamacallits. Processing power, available memory, screen size, and screen resolution are increasing as new Java enabled mobile crafts enter the market. Newly released Java applications are accordingly sophisticated, and will help to spread the Java technology rule even further.The Java APIs for Bluetooth Wireless Technology (JABWT) ties the Java technology and the Bluetooth technology in concert. JABWT is made available in some of the latest smart phones and will probably be available excessively in low-end cell phones in the future. One tail end easily imagine diametric scenarios where JABWT would be useful, e.g. the functionality of breathing Java games is extended to support multi-player games victimization Bluetooth connectivity. opposite interesting scenarios emerge as well, such as a consumer employ a Java Bluet ooth enabled mobile phone to pay for a restorative by connecting to a Bluetooth enabled soda vending-machine. A good prediction is that JABWT will firstly play its use in multi-player Java games, making the Java and Bluetooth technologies well- have it offn to consumers. Thereafter we will probably see other types of Java Bluetooth applications, such as small-amount payment applications.This thesis gives a broad overview of Java and Bluetooth technologies, and a mobile peer-to-peer application that allows users to manage their records such as text, images medicament within a small Bluetooth electronic network in a synchronized way.1.2 Aim of the ProjectThis regorge is designed to develop a personalised mobile file communion system that allow users to role their resources without the tutelage of any central innkeeper.1.3 Motivation of the ProjectWith the availability of peer-to-peer mobile run operating on depicted object sets, the need for a personalized file sharing Application rises. This project overcomes the requirements specified above by scheming a personalized file sharing system that not alone allows people to share files to the strangers in a mobile peer-to-peer mobile network, nevertheless in addition identifies the seize mobile gimmicks in an ad-hoc mobile social network which allows people to share and personalize the file sharing experience with the strangers in the network.1.4 Expected outcome of the projectThe Outcome of this project is to design a system that contributes regularitys to share their files within the users in an adhoc network by identifying the secure mobile devices. The user not merely shares there files with known entities but also has provisions to share the image, text and music files with unknown entities.1.5. grounding to BluetoothBluetooth is a wireless communication communications protocol. Bluetooth is an always-on, unawares-range radio hookup that resides on a microchip. We preserve use Bluet ooth to communicate to other Bluetooth-enabled devices. It was initially positive by Swedish mobile phone springr Ericsson in 1994 as a way to let laptop computers make calls over a mobile phone. Since then, several(prenominal) thousand companies have signed on to make Bluetooth the low-power short-range wireless standard for a wide range of devices. application observers expect Bluetooth to be installed in billions of devices by 2005.The concept behind Bluetooth is to provide a universal short-range wireless talent. Using the 2.4 GHz band, available globally for unlicensed low-power uses, two Bluetooth devices within 10 m of individually other squirt share up to 720 Kbps of capacity. Bluetooth is intended to support an unrestricted mention of applications, including data (such as schedules and telephone numbers), audio, graphics, and even video. For example, audio devices female genital organ include headsets, cordless and standard phones, sign stereos, and nipital MP3 players. pastime are some examples of the capabilities that Bluetooth feces provide consumersMake calls from a wireless headset machine-accessible impertinently to a cell phoneEliminate cables linking computers to printers, unhorse uponboards, and the mouse abduct up MP3 players wirelessly to other machines to spateload musicSet up home networks so that a couch potato can remotely monitor spread conditioning, the oven, and childrens Internet surfingCall home from a remote location to turn appliances on and off, set the alarm, and monitor activity.1.5.1 Applications of BluetoothBluetooth is designed to occupy in an environs of many users. Up to eight devices can communicate in a small network called a piconet. Ten of these piconets can coexist in the same coverage range of the Bluetooth radio. To provide protection, individually link is encoded and protected against eavesdropping and interference.Bluetooth provides support for three general application areas using shor t-range wireless connectivityData and translator access points Bluetooth facilitates real-time office and data transmissions by providing effortless wireless connectedness of portable and stationary communications devicesCable replacement Bluetooth eliminates the need for numerous, often proprietary cable attachments for connection of practically any kind of communications device. companionships are clamorous and are maintained even when devices are not within plication of sight. The range of separately radio is approximately 10 m, but can be extended to 100 m with an optional amplifierAd hoc networking A device equipped with a Bluetooth radio can establish gross connection to another Bluetooth radio as soon as it comes into range.1.5.2 protocol ArchitectureBluetooth is delimit as a layered protocol computer architecture consisting of aggregate protocols, cable replacement and telephony manipulate protocols, and adopted protocols.The core protocols form a five-layer hoi polloi consisting of the following elementsRadio Specifies details of the air interface, including frequency, the use of frequency hopping, modulation scheme, and transmit power.Baseband Concerned with connection organization within a piconet, addressing, bundle format, timing, and power control.Link manager protocol (LMP) Responsible for link setup mingled with Bluetooth devices and ongoing link management. This includes earnest aspects such as authentication and encryption, plus the control and negotiation of baseband packet sizes.Logical link control and adaptation protocol (L2CAP) Adapts upper-layer protocols to the baseband layer. L2CAP provides both connectionless and connection-oriented table help. emolument denudation protocol (SDP) Device information, run, and the characteristics of the helps can be queried to enable the establishment of a connection between two or more Bluetooth devices.RFCOMM is the cable replacement protocol included in the Bluetooth sp ecification. RFCOMM presents a virtual serial port that is designed to make replacement of cable technologies as transparent as possible. Serial ports are one of the more or less ballpark types of communications interfaces employ with computing and communications devices. Hence, RFCOMM enables the replacement of serial port cables with the minimum of modification of existing devices. RFCOMM provides for binary data transport and emulates EIA-232 control signals over the Bluetooth base band layer. EIA-232 (formerly known as RS-232) is a widely used serial port interface standard.The adopted protocols are defined in specifications issued by other standards-making organizations and incorporated into the overall Bluetooth architecture. The Bluetooth strategy is to expose only necessary protocols and use existing standards whenever possible. These are the adopted protocols palatopharyngoplasty The point-to-point protocol is an Internet standard protocol for transporting IP datagram s over a point-to-point linkTCP/UDP/IP These are the foundation protocols of the TCP/IP protocol suiteOBEX The object exchange protocol is a session-level protocol positive by the Infrared Data Association (IrDA) for the exchange of objects. OBEX provides functionality equivalent to that of HTTP, but in a simpler fashion. It also provides a baby-sit for representing objects and operations. Examples of content formats transferred by OBEX are vCard and vCalendar, which provide the format of an electronic business control panel and personal calendar entries and scheduling information, respectivelyWAE/WAP Bluetooth incorporates the wireless application environment and the wireless application protocol into its architecture.1.5.3 Bluetooth Usage posesA number of example lays are defined in Bluetooth profile documents. In essence, a role model is a set of protocols that implement a particular Bluetooth- ground application. severally profile defines the protocols and protocol f eatures supporting a particular usage model. Following are the highest-priority usage modelsFile transfer The file transfer usage model supports the transfer of directories, files, documents, images, and streaming media formats. This usage model also includes the capability to browse folders on a remote deviceInternet twosome With this usage model, a PC is wirelessly connected to a mobile phone or cordless modem to provide dial-up networking and facsimile capabilities. For dial-up networking, AT postulates are used to control the mobile phone or modem, and another protocol stack (such as PPP over RFCOMM) is used for data transfer. For fax transfer, the fax software operates directly over RFCOMMLAN access This usage model enables devices on a piconet to access a LAN. Once connected, a device functions as if it were directly connected (wired) to the LANSynchronization This model provides a device-to-device synchronization of PIM (personal information management) information, su ch as phone book, calendar, capacity, and note information. IrMC (Ir mobile communications) is an IrDA protocol that provides client/server capability for transferring updated PIM information from one device to anotherThree-in-one phone Telephone handsets that implement this usage model may act as a cordless phone connecting to a voice base station, as an intercom device for connecting to other telephones, and as a cellular phoneHeadset The headset can act as a remote devices audio input and product interface.1.5.4 AdvantagesBluetooth has a lot to offer with an progressively difficult market place. Bluetooth helps to bring with it the promise of freedom from the cables and simplicity in networking that has yet to be matched by LAN (Local Area Network).In the nominate marketplace, of wireless and handheld devices, the closest competitor to Bluetooth is infrared. Infrared holds many key features, although the line of sight it provides doesnt go through walls or through obstacle s like that of the Bluetooth technology.Unlike infrared, Bluetooth isnt a line of sight and it provides ranges of up to 100 meters. Bluetooth is also low power and low visible processing with an overhead protocol. What this means, is that its ideal for integrating into small battery powered devices. To put it short, the applications with Bluetooth are virtually endless.DisadvantagesBluetooth has several positive features and one would be extremely hard pressed to insure downsides when given the current competition. The only real downsides are the data rate and security. Infrared can have data rates of up to 4 MBps, which provides very fast rates for data transfer, while Bluetooth only offers 1 MBps.For this very reason, infrared has yet to be dispensed with completely and is considered by many to be the complimentary technology to that of Bluetooth. Infrared has inherent security due to its line of sight.The greater range and radio frequency (RF) of Bluetooth makAe it lots more open to interception and attack. For this reason, security is a very key aspect to the Bluetooth specification. Although there are very few disadvantages, Bluetooth still remains the opera hat for short range wireless technology. Those who have tried it love it, and they know for a fact that Bluetooth will be around for years to come.1.5.5 dish the dirtIn a Bluetooth prattle application, well develop a JABWT-based take to task style application, called bawl out, for mobile devices that moldiness(prenominal) support the J2ME MIDP 1.0 profile. users who have a JABWT-capable device can use this application to rebuke with their nigh friends in an IRC fashion. It take carees and marrys any existing gibber manner within the Bluetooth useful range, or get tos a new chat inhabit in the nearby Bluetooth range. We use the manner of speaking chat mode to represent a virtual chat room thats formed by a network of confabulate applications. Users can start messaging with all( prenominal) other within the same virtual chat room when theres more than one party connected to for each one other. If one user sends a message over the air, all parties of the chat room will receive the message. Users can join and leave the chat room at anytime. For our convenience we assumes likeTheres only one chat room that exists within effective Bluetooth range.There is no security imposed when join a chat room.Users run one instance of Chat on a device at any given time.Before we dig into the source code, lets look at some of the Bluetooth application design issues. JABWT does a good job of providing a familiar API to J2ME developers for accessing Bluetooth facilities. JABWT is integrated with the J2ME Generic Connection Framework. As a result, Bluetooth network programming is very similar to a stream-based connection model.Like many other network protocols, the Bluetooth connection model employs a client/server architecture. Our Chat application, on the other hand, operat es in a peer-to-peer manner. individually running instance of Chat (or a node) can serve as a client and a server at the same time. It behaves as a client when Chat starts up it searches and connects to existing running Chat devices. Once connected, it makes itself available for future clients to connect to. In such cases, it serves as a server for future client connections. To logically represent an active Chat node, we use the concept of expiry to capsule all the connectivity attributes of a node. An endpoint represents a alone(predicate) message sales talk destination and source regardless of whether it is a server or a client.A Bluetooth connection differs from a regular socket connection by its unique device and service discovery processes. Bluetooth applications typically start the device discovery process to identify connectable devices, which is followed by a service discovery process to obtain a reference (URL) to suitable services. To hide these complexities from the Graphical User Interface (GUI) elements, a network layer is introduced to serve as a faade to the Bluetooth API. This design is comparable to the Model-Viewer-Cont sports stadiumer model where the Viewer component is decoupled from the Model component. The GUI can access Bluetooth connectivity via a simplified interface, which does all the discovery and connection establishment behind the scenes. This network layer also provides the functionality to send messages to and receive messages from other endpoints. A call back interface is in place to report any network activity back to the GUI. The Bluetooth Network is explain below.The communication channel between each connected Chat endpoint is a structured data stream connection. We put together a simple protocol to coordinate the activity between each endpoint. This protocol includes the following featuresInitial handshake Each point moldiness(prenominal) handshake with each other when the connection is first established. This ensur es that the connecting device is a Chat node rather than a mis takenly connected application. During the handshake, we also exchange the screen names of the usersDelivery of text message Each sent text message is delivered to all endpoints connected to the Chat network. issue handshake If the user quits the chat room gracefully, a de bourne token is sent to all the other endpoints to indicate its intention. We can fairish up the necessary network and runtime resources associated with the leaving endpoint upon receiving this token. However, if the user walks onward from effective range and becomes inaccessible, a line token is not sent. separate active endpoints will discover the leaving party is inaccessible when the connections are lost, and they will clean up the resources.1.5.5.1 Implementation ConsiderationThe NetLayer tell apart, which implements the Chat networking layer, does most of the Bluetooth-related work and provides the following functionalityInitializes the Blue tooth stackRegisters Chat services to the Bluetooth deviceSearches for nearby devicesSearches for Chat services on nearby devicesEstablishes endpoint connectivity for found Chat servicesManages the life cycle of all endpointsThe Bluetooth stack can be initialized by calling LocalDevice. getLocalDevice(). LocalDevice is a singleton that uniquely represents the underlying Bluetooth device implementation. You can use the LocalDevice instance to gain access to other Bluetooth features includingDiscovery promoter (via getDiscoveryAgent())Bluetooth physical network address (via getBluetoothAddress())SDDB (via getRecord() and updateRecord())The Chat NetLayers initial work is to create and register a Chat service to a local device. A Bluetooth service is an entry point for other Bluetooth clients to access available functionalities. Since each Chat endpoint can serve as a server, it must register its service in order to make this server available to other Chat clients. JABWT utilizes the MIDP Generic Connection Framework to instantiate a server connection. A Chat application needs to instantiate a Serial Port Profile connection, basically a stream-based connection that allows two Chat applications to exchange data using Java input and output streams. A Chat server connection is created.After a server connection is created, the service is not yet available to external clients (it is not discoverable). What has happened is that JABWT created a corresponding ServiceRecord for this service. A ServiceRecord is a collection of attributes that describes our service, and these attributes are searchable by clients. We can use localDevice.getRecord( server ) to find the newly created ServiceRecord. You may reflection that the ServiceRecord is not empty at this point it is already populated with some default values that are assigned by the JABWT implementation based on the connection string and the implementation configuration when we get along Connector.open().The server.a cceptAndOpen() method notifies the Bluetooth implementation that the application is ready to accept incoming connections and make the service available. This also instructs the underlying implementation to store the ServiceRecord object in the SDDB, which occurs when server.acceptAndOpen() is first invoked. Notice that only the attributes stored in the SDDB can be seen and queried by other Bluetooth clients. Any subsequent change to the ServiceRecord must be reflected in the SDDB by using localDevice.updateRecord().Now our Chat application is ready to accept a connection. But what if your friends are already chatting prior to the start of your Chat? If there is an existing chat room available, Chat should join the existing network by searching for other Chat services on each individual device and connecting to their services. Three steps must be taken to perform this action.Search for an available device.For each available device, search for available and matching services.For each available and matching service, connect to the service and perform the initial handshake.DiscoveryAgent, another singleton in JABWT, can help us find other devices and services. There are two other options for retrieving connectable devices, a cached devices list and a pre known devices list. Cached devices are remote devices that have been discovered in a previous inquiry. Pre known are remote devices that are preconfigured in BCC. In our example, we choose to ignore both cached and pre known devices. We want to retrieve the most up-to-date list of active Chat devices at the secondment Chat is launched. Therefore, our Chat application always grows a new search for all surrounding devices.Devices can be searchable in two modes, planetary Inquiry Access tag (GIAC) and Limited Inquiry Access Code (LIAC). When a device is set to GIAC, it basically means I want to be discovered all the time. Devices that provide public and permanent services fall into this category. Printers and fa x machines are examples of GIAC devices. On the other hand, LIAC discovery mode means I want to be discovered for a short period of time, as requested by my user. Devices that provide on-demand connectivity will fall into this category. Examples are multiple player game consoles, mobile modems, and our Chat program.The device discovery and service discovery processes are performed in an asynchronous manner. A Bluetooth application must provide a callback object for the JABWT implementation to notify when devices or services are found. This callback object implements the DiscoveryListener interface. When a device is found, the deviceDiscovered() method is invoked. We do some basic filtering to narrow down the candidate devices for our Chat application and ignore other unrelated devices.When all candidate devices are discovered, the device search is completed and the searchCompleted() method is invoked. We initiate the service discovery process using DiscoveryAgent .searchServices(). This is where the ServiceRecord attributes become useful. ServiceRecord is not only a description of the services, but also a query of constraints during service discovery. The second parameter of searchServices() allows us to specify which attributes and values the services must have in order for us to discover them. We can provide the UUID for the service that we registered earlier and it narrows down the exact matching candidate services on a remote device. This mechanism not only improves the surgery of the discovery process, but also reduces the possibility of conflict. Once the desired service (Chat service) is found, we can retrieve the corresponding connection URL and establish the physical connection.To further validate that the connected service is indeed a Chat service, we immediately perform a handshake with the other party by sending a handshake signal (SIGNAL_HANDSHAKE) and exchanging the user screen name. Receiving parties must respond with an acknowledgment (SIGNAL_ HANDSHAKE_ACK) to confirm the request..To logically represent all the parties in the chat room, we introduce class EndPoint. From the application-level perspective, an endpoint encapsulates information for each actively connected Chat user and device. Chat uses EndPoint to identify which user to send a message to, and from which user a message is authoritative. This outline allows us to hide the JABWT complexity from the GUI application. Endpoints are created when a connection is established between two Chat devices. Once created, we attach a reading thread and sending thread to the endpoint to manage the job between two endpoints. From this point on, two endpoints exchange user-entered messages (using SIGNAL_MESSAGE) until a termination signal is received. Implementation of this protocol can be found in the Reader and Sender classes.When a user exits Chat, the application sends the last message a termination token (SIGNAL_TERMINATE) to all connected parties. This token signals that the endpoint is no longer active. All receiving parties must return an acknowledgment (SIGNAL_TERMINATE_ACK) and subvert the leaving endpoint from the active endpoint list. An endpoint can also be removed when the connectivity is dropped, which suggests the user has left the chat room without an uttered exit command (possibly due to a users walking away from the Bluetooth effective range).Our GUI, based on the MIDP LCDUI API, provides a simple interface to send and receive messages. All received messages from all connected users are displayed sequentially on the screen, which creates a virtual chat room environment. When there are more messages to display than can fit onto one screen, older messages will roll off the upper edge. In this example application, users are not able to scroll back to see the past messages. Pressing the Write command takes users to a message-editing mode. Pressing the Send command sends the currently entered message to the chat room all other connect ed users are able to see the message. To quit the chat room, pressing the Exit command sends a termination token to all other parties.1.5 Literature SurveyThere are a number of related research projects related to the music sharing. Their similarities and differences from our project are described as follows. tunny TUNA, 2004, researched by Media Lab europium is probably the closest relative of our system. It explored the possibilities of a system which enables people to share their music and to communicate with others nearby while they are on the go. tunA focuses on synchronized music sharing while our system focuses on personalized music sharing.Soundpryer SOUNDPRYER, 2002, made by the Mobility Studio of the Interactive build in Sweden which focuses on a shared music experience between nearby cars and focuses on personal mobile music uses in urban settings. Unlike our system, Soundpryer does not include tight synchronization of that shared audio as part of their concept and impl ementation, and users do not choose which cars they are connected to.Sotto Voce SottoVoice, 2002, a Xerox PARC project, is an electronic guidebook which attempts to promote a shared activity between museum visitors by allowing them to eavesdrop on the descriptive audio passages that another is listening to. The system is a hack in that no content is streamed all devices have identical local content.Bubbles Bubbles, 2003, a Telenor RD project, is a mobile audio player that allows users to exchange audio files with nearby peers. It functions much like a mobile file trading application Users swap files over HTTP but there is no infrastructure to join the audio experience among those users.Pushmusic PUSH, 2005, a software developed on PDAs, which focuses on the concept of media ecology, using agents to make songs migrate from one device to another in accordance to users music consumption habits.The methodological analysis in A peer to peer network file sharing system in mobile phones i s going to focus on mobile file sharing system. The mobile file sharing system allows users to share their resources like images, text, audio files without any aid of the central server. This system not only allows people to share their files to stranger but also set the mobile devices in the mobile social network.CHAPTER IIOVERVIEW OF THE SYSTEM2.1 placement Preliminary DesignThe Wireless Service subsystem will let mobile phones communicate with each other when they are in range. Since the devices use Bluetooth protocol which is a radio communications system, so they do not have to be in line of sight of each other, and can even be in other rooms, as long as the received transmission is powerful enough. There are three types of power class dependent with different ranges 1 metre, 10 metres, 100 metres. The model that the Wireless Service subsystem uses for communication is a Client- soldiers architecture illustrated in figure. The role of a horde can communicate with up to 7 de vices playing the role of a Client using Wireless Service Subsystem. TheHost refers to Tune-in Host subsystem and Client refers to Tune-in Client subsystem.This network with a group of up to 8 devices (1 Host + 7 Clients) is called a piconet. A piconet is an ad-hoc computer network of devices using Bluetooth technology protocols to allow one host device to interconnect with up to seven active client devices (because a three-bit MAC address is used). Up to 255 further Client devices can be deactivated, or parked, which the Host device can bring into active status at any time. At any given time, data can be transferred between the Host and one Client, but the Host switches rapidly from Client to Client in a round-robin fashion.To set up a connection, a Client can would perform an inquiry to find any available device

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.