1. Trang chủ
  2. » Công Nghệ Thông Tin

BeremoTe bluetooth project

89 168 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

BeremoTe – A Bluetooth Project Steffen Larsen (zool@diku.dk) Jesper Hansson (hansson@diku.dk) 15th December 2004 An electronic museum guide. Abstract This project concerns building an electronic museums guide, having BlueTooth as the primary network source. Our primary goal was to study Bluetooth and to develop a small application showing the advantages and disadvantages of BlueTooth in a location and context-based environment like this. Another other goal was to research and test the different stacks implementations and supported Bluetooth hardware, which we had available. As a result we developed the museum application using BlueZ for Linux, as the server part and using a Nokia 3650 Series 60 cell phone with Symbian OS for the client side. Our application seems to fit our needs for location based services pretty well, and even increases the context awareness as well. But we also uncovered some disadvantages, as the re-connect time seems high and through-put at the other end, not very high i Preface This report is written by Jesper Hansson and Steffen Larsen as a graduate project at DIKU, fall 2004. Supervisor for the project is Associate Professor Klaus Hansen. The name of the project is “BeremoTe” and is as the name refers to: A project concerning Bluetooth and being remote. The source code for the project can be found on the included CD-ROM. This report itself can also be found on the CDROM in different formats. Our CDROM contains: source Contains the source code for the server and client. report Contains this report in different formats. report/litterature Contains the external litterature we had available electronically. Like small reports, larger references etc. test Contains images, screendumps and videos etc. from our test scenario. ii Contents Introduction 1.1 Motivation . . . . . . . . . . 1.2 The Structure of the Report 1.3 Prerequisites of the Reader 1.4 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Application Idea 2.1 Presentation of the Application . . . . 2.2 Outlines of the Application . . . . . . 2.2.1 Advantages of the Application . 2.2.2 The Application scenario . . . 2.2.3 System Description . . . . . . . 2.3 Limitations . . . . . . . . . . . . . . . 2.4 Why use Bluetooth? . . . . . . . . . . The 3.1 3.2 3.3 3.4 3.5 3.6 3.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bluetooth Architecture Bluetooth Introduction . . . . . . . . . . . . . . . . Bluetooth network topology . . . . . . . . . . . . . Bluetooth Protocols . . . . . . . . . . . . . . . . . 3.3.1 Bluetooth Radio (RF) . . . . . . . . . . . . 3.3.2 The Baseband . . . . . . . . . . . . . . . . . 3.3.3 The Link Manager Protocol (LMP) . . . . . 3.3.4 HCI interface . . . . . . . . . . . . . . . . . 3.3.5 Logical Link Control and Adaption Protocol 3.3.6 RFCOMM . . . . . . . . . . . . . . . . . . . 3.3.7 Service Discovery Protocol (SDP) . . . . . . 3.3.8 OBEX - FTP - PAN . . . . . . . . . . . . . 3.3.9 Audio . . . . . . . . . . . . . . . . . . . . . Throughput . . . . . . . . . . . . . . . . . . . . . . Bluetooth profiles . . . . . . . . . . . . . . . . . . . Low power operation . . . . . . . . . . . . . . . . . Security . . . . . . . . . . . . . . . . . . . . . . . . 3.7.1 Frequency hopping . . . . . . . . . . . . . . 3.7.2 Authentication . . . . . . . . . . . . . . . . 3.7.3 Authorization . . . . . . . . . . . . . . . . . 3.7.4 Encryption . . . . . . . . . . . . . . . . . . 3.7.5 Pairing . . . . . . . . . . . . . . . . . . . . 3.7.6 The device database . . . . . . . . . . . . . 3.7.7 Device address filtering . . . . . . . . . . . iii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (L2CAP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 . . . . . . . 3 4 7 . . . . . . . . . . . . . . . . . . . . . . . 9 10 11 12 13 14 15 15 16 16 19 19 20 21 21 22 23 23 23 23 23 24 24 Platform – System Engineering 4.1 BlueTooth Server . . . . . . . . . . . . . . . . . . . . 4.1.1 Bluetooth stack implementations . . . . . . . 4.1.2 Stacks on Linux . . . . . . . . . . . . . . . . . 4.1.3 Stacks on FreeBSD . . . . . . . . . . . . . . . 4.1.4 Stacks on Windows . . . . . . . . . . . . . . . 4.2 BlueTooth Client . . . . . . . . . . . . . . . . . . . . 4.2.1 Symbian OS . . . . . . . . . . . . . . . . . . . 4.2.2 Java . . . . . . . . . . . . . . . . . . . . . . . 4.2.3 Sony Ericsson T610 . . . . . . . . . . . . . . 4.2.4 Nokia 3650 . . . . . . . . . . . . . . . . . . . 4.2.5 Compaq iPAQ h3670 running Familiar Linux 4.2.6 HP iPAQ h1940 running MS Windows Pocket fessional . . . . . . . . . . . . . . . . . . . . . 4.3 Choosing platform . . . . . . . . . . . . . . . . . . . 4.3.1 Bluetooth Server . . . . . . . . . . . . . . . . 4.3.2 Client . . . . . . . . . . . . . . . . . . . . . . System Design 5.1 Connections . . . . . . . . . . . . . . . . 5.2 Positioning . . . . . . . . . . . . . . . . 5.3 Network Topology . . . . . . . . . . . . 5.3.1 Server/Exhibition Item setup . . 5.3.2 Choice of Power Class . . . . . . 5.3.3 Piconet - Scatternet . . . . . . . 5.3.4 Bluetooth server device bundling 5.4 SDP . . . . . . . . . . . . . . . . . . . . 5.4.1 The museum service record . . . 5.4.2 Handling of several clients . . . . 5.5 Security level . . . . . . . . . . . . . . . 5.6 The actual connection . . . . . . . . . . 5.6.1 Simple text . . . . . . . . . . . . 5.6.2 Data as files . . . . . . . . . . . . 5.6.3 Audio . . . . . . . . . . . . . . . 5.6.4 Video . . . . . . . . . . . . . . . 5.6.5 Miniprotocol over L2CAP . . . . 5.6.6 Establishing the connection . . . 5.6.7 Data transfer . . . . . . . . . . . iv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PC 2003 Pro. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 25 25 26 28 28 28 29 29 30 30 31 31 31 31 32 33 33 34 35 35 37 37 37 37 38 38 39 40 40 41 41 42 42 42 42 Program Description 6.1 The BlueTooth server . . . . . . . . . . . . . 6.1.1 Bluetooth applications development on 6.1.2 Server Design . . . . . . . . . . . . . . 6.1.3 Implementation description . . . . . . 6.1.4 Problems arose during implementation 6.1.5 Server user guide . . . . . . . . . . . . 6.2 The Bluetooth client . . . . . . . . . . . . . . 6.2.1 Symbian Programming . . . . . . . . . 6.2.2 Bluetooth applications development on 6.2.3 Client Design . . . . . . . . . . . . . . 6.2.4 Implementation description . . . . . . 6.2.5 Problems arose during implementation 6.2.6 Users guide - Testing BeremoTe on the System assessments and test 7.1 Testing the client (Nokia 3650) . . . . . . 7.1.1 Testing a connection . . . . . . . . 7.1.2 Testing disconnect and reconnect . 7.1.3 Conclusion about the client test . . 7.2 Testing the server (Linux PC with BlueZ) 7.2.1 Testing the HCI layer . . . . . . . 7.2.2 Testing our advertising . . . . . . . 7.2.3 Authentication . . . . . . . . . . . 7.2.4 Connection test . . . . . . . . . . . 7.2.5 Conclusion on the server test . . . 7.3 Other tests . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . BlueZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . the Nokia . . . . . . . . . . . . . . . . . . mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3650 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 44 44 45 45 50 50 51 51 53 54 56 58 59 . . . . . . . . . . . 61 61 62 62 63 64 64 64 64 65 67 67 68 Future Work 69 9.1 Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 9.2 Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 A Setting up the environments 75 A.1 Installation of bluetooth on Windows XP . . . . . . . . . . . . . . . 75 A.2 Installation of BlueZ with Familiar Linux on an iPAQ . . . . . . . . 75 A.3 Getting started with programming the Nokia 3650 with Symbian OS 76 A.4 Getting started with Bluez on Linux . . . . . . . . . . . . . . . . . . 78 A.4.1 Upgrading the kernel . . . . . . . . . . . . . . . . . . . . . . . 79 A.4.2 Upgrade the distribution to unstable . . . . . . . . . . . . . . 79 A.4.3 Loading the drivers and starting the BT stack . . . . . . . . . 80 v A.5 Setting up BT on FreeBSD . . . . . . . . . . . . . . . . . . . . . . . A.5.1 Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 80 B Test results 81 B.1 Server output in syslog . . . . . . . . . . . . . . . . . . . . . . . . . . 81 B.2 SDPd output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 B.3 pstree -H beremote output . . . . . . . . . . . . . . . . . . . . . . . . 82 vi Introduction This report is written in English to reach a broader audience and because it could interest a lot of developers who wish to start out developing new Bluetooth applications based on the BlueZ stack or Symbian 60 Operating system for cell phones. The appendices A.3 and A.4 could be especially interesting for new developers showing how to install and how to build on a Bluetooth environment. 1.1 Motivation Our motivation arose back in 2003, when we took part in a robot competition called Robocup (http://www.robocup.dtu.dk/). We build a rather embedded and complicated robot which we had trouble debugging[8]. Our main computer was a Compaq iPAQ, which could only be accessed by a USB port and a BlueTooth network. Since our focus at the time was on the robot competition, we did not have any time to implement and use the Bluetooth stack on the iPAQ, and therefore we used the more primitive USB port to get our debug from the robot. As the competition began to take place, we realized that our debug method was quite a hazle. Every time our robot had completed a lap, we had to "catch" it and place it in front of our laptop and connect it to the USB and "download" the debug information we had recorded during a lap. This really motivated us to take a closer look at bluetooth and its capabilities, so that we could improve the annoying factor of catching the robot and use a "real" network instead. Thereby we could also make a real-time debugging a possibility. All this fuss about the robot increased our interest and attention towards BlueTooth. It gave us a lot of other great ideas like: remote controlling the robot, streaming the images from the robot etc. We had to investigate what kind of possibilities BlueTooth offered. During our early research (early 2004) we investigated different types of BlueTooth devices and what can and what can not be done with these devices. One of the great advantages in BlueTooth lies in the huge support in all kind of devices. It is supported in USB dongles to ordinary PCs, PDAs like the iPAQ, cellphones and other embedded devices. During our research Steffen was on a small summer vacation to Spain (more precisely Malaga) and visited the Pablo Picasso1 Museum. While Steffen wandered about in the museum it began to irritate him, that a lot of the explaining text to the specific art was in Spanish and not in English. With this in mind and the ongoing BlueTooth research, he came up with an idea. Why not use our BlueTooth knowledge to develop some kind of software to get the text in a Localized language (in Steffen’s case: English or Danish) and get it presented to him in a nice and easy way. We talked about the idea for some time The famous painter from Spain, who painted abstract and surrealistic art. Lived from 1881 to 1973. and thought it would be a nice application to have and a really great scenario to show the possibilities and limitations of Bluetooth in general. 1.2 The Structure of the Report We have structured this report, so that in the next chapter (chapter two) we will introduce the idea behind the application. In chapter three we will try to explain the theory and go through the architecture behind Bluetooth and what kind of possibilities it has. The focus will be put on the parts of the Bluetooth stack, which are relevant for developing the chosen application. The more hardware specific details and the lowest levels of the protocol will be only shortly introduced. We have dedicated chapter four for concerns about choosing the platform and the BlueTooth stack. We have done this because, we had not yet decided which platform to implement the software on, when we started the project. In the few last chapters we will present a system design, discuss problems concerning the design, make a program description and test the developed application. We will end up this report by evaluating and come up with a conclusion, which wraps up the hole project. 1.3 Prerequisites of the Reader The reader should have some basic knowledge about: networking, operating systems, programming and embedded systems. The reader does not have to know anything about bluetooth in advance although it would be a small advantage. Our audience is targeted towards our fellow students taking Computer Science courses or other developers just interested in Bluetooth. 1.4 Goals Our concise goals about this project can be summoned up as follows: 1. To learn something about Bluetooth. Its advantages and limitations. 2. To test different Bluetooth devices and stacks. 3. To implement a small application which show these advantages/limitations. The Application Idea In this section we will outline the ideas behind our museum application. This is only a presentation of the ideas, as it is beyond the scope of this report to implement it all2 . In the limitations section 2.3 we will specify, what we will and will not dig into in the rest of the report, and what we will and will not try to implement. 2.1 Presentation of the Application Our idea about the museum and localized languages of course evolved into a greater aspect. We developed our idea further and decided to make an electronic and remote museum guide, which could provide information to a visitor at a museum, through his or hers handheld device. In this way we would be able to stream out context and location-based information to the visitor. To begin with the museum application should of course be thought of as a service to a hypothetical museum that provides the means of a client/server solution with the Bluetooth as a network connecting them. The guest should plot in his age, language, different kind of art taste, knowledge level and other personalized information into his or hers handheld device (the client). This would allow the museum server to refine the information presented and targeted to the user as detailed as possible. The visitor will then get the information about the art artifact in his language, at his level of knowledge and in his taste. The handheld device would receive the stream from the server and explain by a text message (or audio) what kind of exhibit he or she is standing in front of in the given museum. It would also show images of other art artifacts related to the room or exhibit where the guest is located. By handheld device we mean a cell phone, PDA or any other small personal computer. All this dynamic information has enormous potential and could easily be extended to a lot more features such as: the visitor could get an appointment about the start of special events at his handheld, bargain souvenirs, announcements (the museum is closing etc.) or paging a human guide etc. Guided services could also be offered, so that the handheld could show a specific way around in the museum. All this user involvement which takes the user based information into account, i.e. the context, will improve the visitors experience in the museum and the locationbased service will only strengthen the context-awareness. As we can see it, an end developed and complete context-aware system like the, will have endless possibilities to be implanted in real Museums and have many future extensions. One could imagine a nice scenario at a real museum like "Arken" or even better "The Danish Museum of Art" (Statens Museum for Kunst). . . Actually we could as well have designed and implemented some other kind of We find that these ideas needs to be mentioned to justify the need of the application KIOSK system3 using Bluetooth as network transport, but we really liked this idea of the museum and it gave us a good scenario for implementing our pilot-project in a "real-world" scenario in our context. All of these wild ideas of cause spawns of problems. They will involve a discussion of the many aspects and problems of using Bluetooth as a network. The objective for the project (goal 3) as defined in 1.4) will therefore be to develop and implement a pilot project of the museum guide, which shows the limitations and advantages for a Bluetooth application. 2.2 Outlines of the Application Now we will summon up the advantages of this kind of application, and later the state more exactly the setup of our system and application. 2.2.1 Advantages of the Application We have written down some advantages about this application. They can also be seen as reasons for this application to be realized. We have categorized the advantages for them into two groups, to show that it is a mutual benefit for the visitor and the museum. Advantages for the visitors In many museums cassette players delivers audio content in a linear way. You have to follow a special route to follow the discripton, which makes it very in-flexible. Our solution could provide customization what audio to be played could be chosen by the visitor. The visitor could have his own "electronic attendant"4 with him all the way. The visitor could chose among the data available, and thereby the information particularly interesting to him. He could choose between different presentations: text, audio, video, pictures etc. when he wanted to. Langague both in audio and text settings could be implemented to suit tourists’ needs. The visitor could also choose to save some of the data presented to him for later use, e.g. in a school project or to show to his family - instead of having a lot of brochures with data irrelevant to him. The visitor could get the data presented to him in a personal way, if he entered data about himself, preferences etc (a visitor profile). A tour could be generated for him based on this (profile). This is the classic attendant tour, but suit to the single visitor’s needs. Imagine the possibilities e.g. in "kids profiles". A KIOSK system – A stall set up in a public place where one can obtain information, e.g. tourist information. The information may be provided by a human or by a computer. In the latter case, the data may be stored locally (e.g. on CD-ROM) or accessed via a network using some kind of distributed information retrieval system. kustode in Danish. Conclusion We will base our conclusion on the goals set in 1.4. Did we then achieve our goals? a) To learn something about Bluetooth. Its advantages and limitations. When we first started on the project, our basic skills and knowledge about Bluetooth was very limited. After this project we have become very familiar with many parts of the Bluetooth stack. This of cause, meant a lot of research, but it really paid off. We have learned that Bluetooth has some limitations, e.g. in the network topology, as well as we have seen that it seems promising in ad-hoc based networking. b) To test different BT devices and stacks. We have taken a look at some of the Bluetooth stacks currently available. We have taken a deeper look into especially two implementations, namely BlueZ, the official Bluetooth stack for Linux, and the Symbian OS 6.0 Bluetooth stack. Though the implementations are good and well working, a great deal could be done on the documentation side of them - especially BlueZ. Some functionality is also missed once in a while. Setting up the phone environment have been time consuming hard work, because of the lack of good and organized information. Programming in general have often been trial and error coding. In Symbian programming has been very inconvenient, because of the lack of debug facilities. We have seen different devices work together: Windows PC with USB-dongle, Linux PC with USB-dongle, iPAQ with Windows CE, Ericsson T610 with Mophun OS and Nokia 3650 phone with Symbian OS. We would like to have tried Java on the client, but we did not have the hardware to so. c) To make a small application which show these advantages/limitations. Our tests of the chosen museum pilot project have not been as extensive as we hoped for, i.e. we still need some large scale testing to say that the concept could work in full. But except for the large scale testing we have achieved the basic functionality that we had hoped for (see test conclusions in 7.1.3 and 7.2.5). It is though worth mentioning that the reconnection waiting time seems some what high, though managable (see section 7.1.3). Also limited throughput could give a problem (see 7.2.5). Unfortunately we have not had time to implement some of the more advanced features like transport of pictures and streaming of audio and video or power consumption modes, but as far as we have read about it, it seems very possible. All in all it looks very promising, and the Bluetooth technology actually seems to fit well into context and location-based applications like this, as we see it right now. It has been an interesting and fun project to work with Bluetooth and to build 68 up a small application like we did. Although it was quite time-consuming. Future Work Because our project is a pilot application, improvements can still be made. Eg. we need a better error handling, and perhaps making it a try/catch model instead of the current return staments, we could easily propagate our errors and handle it some where we see fit. This is a bit more messy in the default way in ansi c. What we really would like to implement is the image/audio streaming, as we stated earlier in the report. It could be very interesting to see how we could get our clients (the cell phones) to stream these codecs and show/play them in a nice way. We would also like to make a more real life scenario, where we could have a big setup with a lot of servers and several clients connecting. Thus also making the backend database server for fetching the text, video and audio. In this case it could be very interesting to investigate how this would effect our throughput. Especially now where Bluetooth have come in a version 2.0 (released 9’th november 2004). Maybe we could draw the advantage of the newly updated version of Bluetooth which has a lot of advantages: • Three times faster transmission speed (sometimes up to 10 in certain cases) • Lower power consumption through reduced duty cycle • Further improved BER (Bit Error Rate) performance • Simplification of multi-link scenarios due to more available bandwith 9.1 Server For the server point of view, it could be interesting to see if we could make a better object oriented design as we discussed. Right now it is a little bit messy. We could make somekind of "interface", which would make it possible to implement other protocols easily and new method to these . A java implementation of the server could also be of interest. This of cause should only be done if the client also is developed using java. This would then increase the consistency and make the design a lot clearer. This however whould be somewhat more tricky. As for now we have only found one API for the BlueZ stack in Java (avetana bluetooth), which really not yet have a fulfilling stack API. Therefore if we want to implement the server in java, we have to implement some JNI/BlueZ our self, which will be time-consuming. An option we also discussed was to load balancing on the Bluetooth server. It could be interesting to examine if we could improve the throughput, if we had a lot 69 of bluetooth devices plugged into the server. And thereby distribute the incoming client connection on the different server devices. 9.2 Client In our implemented version of the client, we have only made a very limited GUI for the user. This of cause should be enhanced to be more intuitive. This however would require a lot of really advanced development skills in Series 60 programming and other GUIs. Of cause when we are involved with embedded devices, like our client is, some interesting aspects arises: • How can we present the text/audio and GUI in a smart way? • How can we detect the type of Bluetooth device the user have and present the data in a proper manner considering the device’s properties? • How we make our museum application portable? As many different types of handheld devices exist, all with different technology and features, our client should be able to detect the type of device and present the information adapted to the technical capabilities of that specific device. E.g. minimize the graphical performance and battery life time for smaller devices like cell phones, and make better use of the audio/graphical system if it is provided. E.g. a Handheld or Laptop has a more powerful graphical subsystem than a cell phone. For example if the visitor have a iPAQ, we should be able to stream out the information in a really advanced way, with a lot of graphics. To solve this we could implement the client in Java instead. Java Midlet has some interesting features like determining the type of a device, it limitations and such. We could also implement it directly in our application, such that a visitor has to fill in some kind of device type, when he/she is checking into our museum. Thereby the client could tell our server which type it is, and get the information presented in a different way, depending on the device type. Also it would probaly make our application more portable. It is very exiting to see what the future will bring in handheld/mobile Bluetooth applications area. There is alot of different platforms out there, like: Symbian, Java Midlets, Windows CE or smartphones. All of them having the potential to be a standard in the future. This of cause is a area that interests us a lot and we really like to research it further. 70 References [1] Bray, Jennifer and Sturman, Charles F. ”Bluetooth 1.1 - Connect Without Cables” second edition Prentice Hall, 2002. ISBN: 0-13-066106-6 [2] Harrison, Richards. Symbian OS C++ for Mobile Phones Wiley, 2003. ISBM: 0-470-85611-4 [3] Reference manual for Symbian OS. Series 60 SDK for Symbian OS Nokia 2003. [4] Savitch, Walter ”Problem Solving with C++, the object of programming (3rd ed.)” Addison Wesley 2001. ISBN: 0-201-70390-4 [5] Tanenbaum, Andrew S. “Computer Networks”(Third edition) Prentice Hall International Editions, 1996. ISBN 0-13-394248-1. [6] Sechrest, Stuart. “An Inroductory 4.3BSD, Interprocess Communication Tutorial (socket documentation)” [7] Fowler, Martin “UML distilled second edition” Addison Wesley 2000. ISBN: 020165783x Reports and articles [8] Larsen, Steffen et. al “Real-time image processing on an iPAQ based robot(iBOT)” DIKU, March 2002. [9] Blum, Troels & Nimb, Ole “TCP/IP over Bluetooth” DIKU, 2002. [10] Ian Mullins, Philip Garner and Reuben Edwards article: Novel Peer to Peer Payment Mechanism for Personal Area Network Mobile Gaming Department of Communications Systems, Lancaster University [11] Hopkins, Bruce and Antony, Ranjith Bluetooth for Java 2003. 71 [12] Jeremy Kong Win Chang An Interaction of Bluetooth Technology for Zero Interaction Authentication School of Computer Science, Carleton University, 10 April 2003 [13] Marcel Holtmann, Andreas Vedral Article: "Bluetooth Programming for Linuz" Wireless Technologies Congress 2003, Sindelfingen, Germany Links and articles29 [14] www.google.com Everythins starts here. . . General Bluetooth information [15] http://www.bluetooth.org The official Bluetooth membership site. [16] Article: “Protocol Architecture” [17] Article: “Bluetooth Core Specification v1.2” [18] https://www.bluetooth.org/foundry/assignnumb/document/service_discovery Bluetooth assigned numbers specification [19] http://forum.nokia.com and http://www.forum.nokia.com/main/1,6566,1_43,00.html Provides a lot of help and the following articles: [20] Article: “Designing Bluetooth apps for series 60.pdf v1.4” [21] Article: “Setting Up and Using Bluetooth Test Environment v1.2” [22] Article: “Bluetooth Technology overview v1.0” [23] Article: “Games over Bluetooth: Recommendations to the programmer v1.0” [24] http://www.benhui.net/modules.php?name=Bluetooth The harmony of mobile development. Lots of Bluetooth stuff. [25] http://www.palowireless.com A very well organized web page about Wireless Product. It contains a lot of helpful information about Bluetooth. [26] http://developer.sonyericsson.com/site/global/home/p_home.jsp The developer site for Sony Ericsson Programmers [27] http://www.symbian.com The home of Symbian OS [28] Article: “Symbian os: Designing Bluetooth Applications in C++” 29 Articles are mentioned after the address where they can be found. 72 [29] http://series60.com The home of Series 60 devices [30] http://www.csrsupport.com/ The leading manufacturer of Bluetooth chips. [31] http://www.embedded.com/2000/0007/0007ia1.htm Some general information about Bluetooth [32] http://www.bluetags.dk This site has closed due to liquidation. It once was a Danish Bluetooth development company. Installation [33] http://www.debianguiden.dk/ Help on how to install Debian Linux - in Danish. [34] http://www.debian.org/ Debian Linux home [35] http://www.bluez.org BlueZ: The official Bluetooth protocol stack. [36] http://web.inter.nl.net/users/hanscees/bluezhowto.html#links Another BlueZ Howto [37] http://www.frasunek.com/HOWTO-Nokia7650-Bluetooth.txt Another Bluez HowTo [38] http://www.geocities.com/m_evmenkin/ Maksim Yevmenkins site with Bluetooth drivers for FreeBSD. [39] http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ Platform SDK for Windows XP download page Programming hints and examples [40] http://cvs.sourceforge.net/viewcvs.py/bluez/utils/test/l2test.c?view=markup BlueZ utils l2test.c sourcecode [41] http://www.compsoc.man.ac.uk/ ashley/bemused/ The great Bemused Windows Remote for UIQ and Series 60. [42] http://www.forum.nokia.com/main.html Good Bluetooth example for Series 60 phones. [43] http://devzone.possio.com/Examples/BluetoothStarter.html J2ME Bluetooth implementation example for Possio JSR-82 implementation. 73 [44] http://www.lowtek.com/sockets/select.html A short explanation of the idea "select()" Newsgroups / forums [45] http://www.lenholgate.com/archives/000102.html [46] http://www.lenholgate.com/archives/000104.html Bluetooth sockets on Windows XP SP1 and hardware compatibility. [47] http://forums.devshed.com/ C++ newsgroup we attended. [48] http://discussion.forum.nokia.com/. . . forum/forumdisplay.php?s=9327fc6c339dbab5dc82233b8a2c3b0c&forumid=38 Forum Nokias Bluetooth discussion forum Bluetooth with Java and J2ME [49] http://www.jcp.org/en/jsr/detail?id=82 [50] http://www.jcp.org/aboutJava/communityprocess/review/jsr082/ The JAVA JSR-82 specifications. [51] http://www.microjava.com/ J2ME stuff [52] http://sourceforge.net/projects/javabluetooth/ Applications on sourceforge in category Java and Bluetooth Links sites [53] http://ttt.upv.es/pmanzoni/jinx/b_programming.html HandOn Bluetooth useful links. [54] http://www.mulliner.org/bluetooth/ Mulliner’s personal projects and links to Bluetooth [55] http://www.holtmann.org/linux/bluetooth/ Many good and usefull links - but also some old and obsolete ones. Max Holtmann is the main developer of Bluez. 74 A A.1 Setting up the environments Installation of bluetooth on Windows XP Install windows XP (home or professional) Patch with SP1 Patch with ’Q323183_WXP_SP2_X86_ENU.EXE’ from the archive ’bt_stack_rtm.exe’ Install the Microsoft Platform SDK (only core needed for BT support) Install the MS VC++ Plug in your ’designed for Windows XP’ Bluetooth hardware A.2 Installation of BlueZ with Familiar Linux on an iPAQ Establish serial connection to iPaq: Connect via minicom/hyperterminal with the following configuration: -baudrate: 115200 -databit: -par: none stop bit: flowctrl: hardware Install bluez on the iPaq: download bluetooth-modules-kernelversion-rmk3_ type in: ipkg install bluetooth-modules . (modules og stack) (ipkg install task-bluetooth (dbt suite)) ipkg install bluez-lib ipkg install bluez-utils ipkg install bluez-hcidump ipkg install bluez-sdp ipkg install bluez-pan ipkg install pskey ipkg install rfcommd Make a shell script for startup of bluetooth (/etc/init.d) It is important to use the CSR chipset which is embedded into the iPaq. 75 Edit /etc/modules.conf to add the appopriate modules to the kernel at startup. make a link in rc2.d for automatic startup of bluetooth. modprobe hci_uart /etc/init.d/bluez.sh start sdpd has to be started to register services commands: Inquire BT devices: hcitool -i hci0 inq BT navn: hcitool -i hci0 name A.3 Getting started with programming the Nokia 3650 with Symbian OS This describes What software we had to install to get the development environment up and running on Windows. This is for C++ programming only (not Java). We were not able to make it work on Win98SE. Win2000 requires service pack 4. WinXP requires service pack 1. Internet Explorer should be version 5.5 or higher. We use IE 6.0 SP1. Installation HOWTO 1. Install MS Visual C++ 6.0 (Higher version or .net version will probably work to) Not for free download 2. Install SUN JAVA SDK 1.3.1 (1.4.2.01 ??????) http://www.sun.com/ 3. Install Active Perl 5.8.0. build 806 http://www.activestate.com/ 4. Install Series 60 SDK For Symbian OS, Nokia Edition (Developer platform 1.0 and 2.0) http://www.forum.nokia.com/ Setting up EPOC utilities in MSVC++ • copy AvkonAppWiz.awx + AvkonAppWiz.hlp to MSVS template dir. (default C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Template) 76 • Install the EPOC bar. Copy the EpocTools.dll to the Add-ins directory. Check the "EPOC Toolbar Add-in" in the "Add-ins and Macro Files" menu. For detailed info see the README file. . . \Series60Tools\epoctoolbar\readme.txt Setting up the Example HelloWorld From the command prompt the following: (there can be some problems with the mix of forward- and backslashes) 1. type cd \epoc32ex\HelloWorld (the symbianpath defaults to \Symbian\6.1\Series60) 2. copy the folder to your favorite "myfolder" 3. type: cd \HelloWorld\group 4. type: bldmake bldfiles 5. type: abld makefile vc6 (builds the workspace MS Visual C++) This creates a workspace file in this (very long) path: /epoc32/build/"myfolderpath"/HelloWorld/wins/HelloWorld.dsw fx our path is: "C:\Symbian\6.1\Series60\Epoc32\BUILD\BT\OPGAVE\SOURCE. . . \SYMBIAN\FSTEST\GROUP\FSTEST\WINS\HelloWorld.dsw" 6. Open MSVC++. 7. Open the created workspace. Using the application guide framework This approach gives you the a minimal application that will run on the phone. This is very usefull when you want to start a new application from scrath. As you will experience the framework is quite big and you will probably need some time to browse trough this minimal code for a while before your are ready to begin the actual coding. To this just open MSVC++, press File→New→Projects→"Series 60 AppWizard v 1.9" and follow the guide. Compiling and executing your code on the emulator • F7 saves all files and builds the project. • CTRL+F5 starts the emulator. First time the emulator is used in the project you will be prompted for the path. The path is /epoc32/release/wins/udeb/epoc.exe Compiling and executing your code on the phone This is a actually easier and more robust using the commandprompt than using the EPOC toolbar build utility. 77 1. Save all your files in MSVC++. 2. Open a commandprompt. 3. Go to the directory with the .pkg file. Usesually in the SIS or group directory. 4. Make sure that the paths in the .pkg are correct. If not you need to correct them (They will not be if you have copied the files from another directory. 5. type: abld build thumb urel 6. Create a .SIS package from the commandline. type: makesis -v HelloWorld.pkg hello.sis 7. Use "send to" (via bluetooth ir IrDa) to send it on the phone. 8. Go through the installation procedure on the phone. Hint! You can’t copy the .sis file to the phone if it already exists there in the first place. So it’s clever to delete the .sis file after each install if you plan to test with new versions of your program. Some problems we stumbled over when coding Adding libraries . The framework . If you get this error: * RCOMP failed - deleting output files NMAKE : fatal error U1077: ’perl’ : return code ’0x1’ Stop. It probably because you have edited the resource files without closing the emulator. If You edit the resource files you will need to close the emulator to compile your project. If you add some new libraries it sometimes help to recompile the workspace to make it compile in MS VC++. If your project compiles in the commandline, and not in MS VC++ this is probably the case. A.4 Getting started with Bluez on Linux In this hole project we have used Debian GNU/Linux. This Linux distribution set was chosen because of the nice and easy-to-use package system and its proven stability of released source code. We downloaded the Debian Woody 3.0 release CDROM image from the Debian website: www.debian.org and installed it. Good information about installing Debian can also be found on the page. Besides http://www.debianguiden.dk/ was of great help. Here after we had a complete operating system with kernel, standard drivers, shell and of course gcc on it. We start 78 out by upgrading the Linux kernel and patch it with some code by Holtmann (the author of much of the bluez code). This was done because of Linux’ incompability with bluez in the 2.2.x kernels (which ships with Debian). We choose to use the 2.4.18 kernel because of the stability. We tried out some newer kernels in the 2.6.x codebase, but they did not prove to be stable enough or even work. A.4.1 Upgrading the kernel • cd /usr/src • apt-get install kernel-source-2.4.18 • bunzip2 kernel-source-2.4.18.tar.bz2 • tar xf kernel-source-2.4.18.tar • mv kernel-source-2.4.18 kernel-source-2.4.18-mh12 • cd kernel-source-2.4.18-mh12 • download patch-2.4.18-mh12 from http://www.holtmann.org/linux/kernel • cd kernel-source-2.4.18-mh13 • zcat /usr/src/patch-2.4.18-mh12.gz | patch -p1 • answer: [No, Yes] • make menuconfig (include bluetooth stuff as modules and remember to include usb-support) • Check the .config file to see everything is right (so we don’t need to re-compile again) • make oldconfig • make-kpkg kernel-image (kernel-package package needed) • cd • dpkg -i kernel-image-2.4.18_10.00.Custom_i386.deb • answer: [No, Yes] • reboot • Pray and hope for the best :o) A.4.2 Upgrade the distribution to unstable This we have to in order go get the proper bluez code which don’t ship with the Debian stable distribution. • use apt-setup and edit /etc/apt/sources.list to get an stable internet path. • edit ’stable’ to ’unstable’ . make a copy of the line 79 • apt-get update (apt-get upgrade might be nessary) Install bluez stack • apt-cache search bluez • apt-cache search sdp • install the listed packages found in the search with the command: apt-get install A.4.3 Loading the drivers and starting the BT stack modprobe hci_usb install the HCI usb bluez driver in the kernel. sdpd start up the SDP daemon. A.5 Setting up BT on FreeBSD Basically the Bluetooth stack handles the same way as the bluez stack on Linux. That is when you installs it, it’ll behave like a NIC (network interface) where you have tools like ifconfig, ping etc. available. Also bridging are available A.5.1 Installing Because the Bluetooth stack is quite new it is only available in the FreeBSD 5CURRENT branch and is therefore not included in the standard kernel (which is the stable FreeBSD 4.xx-RELEASE). Also some of the userland applications (a lot of tools) in the port tree is available only for the UNSTABLE kernel. But we tried to install it after all and it worked like a charm!. To be sure to have the latest branch of the stack and userland applications you have to download them for your self, by getting a snapshot from Maksim Yevmenkins site [38]. The the basic BSD make steps to build the libraries and ports by: 1. cd to snapshot/src/sysmodules/netgraph/bluetooth 2. make 3. make install 4. make cleandir A small HOWTO can also be found on the official FreeBSD page at: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-bluetooth.html Developing. When you have installed your BT stack and all your additional tools, you are now able to develop BT applications for your self. All you need to is to add a bluetooth.h header in your C/C++ file (#include ). 80 B Test results B.1 Server output in syslog Our output from our server in the syslog, when two clients are connecting. Of cause the log is snipped, so only the interesting part is there. Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec Dec 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 B.2 15:34:11 15:34:13 15:34:13 15:36:20 15:36:20 15:36:20 15:36:20 15:36:20 15:36:20 15:36:20 15:36:20 15:40:32 15:40:32 15:40:32 15:40:32 15:40:32 15:40:32 15:40:32 15:40:32 fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck fsck sdpd[615]: Bluetooth SDP daemon beremote: Waiting for connect . beremote: accept called! beremote: child spawning beremote: Connect from 00:60:57:3D:67:95 beremote: local address 00:40:05:60:41:0D beremote: Accept ok. beremote: Connected with [imtu 672, omtu 0, flush_to 65535] beremote: starting to receive data beremote: parent process returning 622 beremote: accept called! 622 beremote: child spawning beremote: Connect from 00:01:53:00:0D:B5 beremote: local address 00:40:05:60:41:0D beremote: Accept ok. beremote: Connected with [imtu 672, omtu 0, flush_to 65535] beremote: starting to receive data beremote: parent process returning 625 beremote: accept called! 625 SDPd output Here is what our SDP daemon replies back, when we uses sdptool to search our service. Our service class list is set to 0x1FFF. Browsing 00:01:53:00:14:EE . Service Name: SDP Server Service Description: Bluetooth service discovery server Service Provider: BlueZ Service RecHandle: 0x0 Service Class ID List: "SDP Server" (0x1000) Protocol Descriptor List: "L2CAP" (0x0100) PSM: Version: 0x0001 81 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Service Name: Public Browse Group Root Service Description: Root of public browse hierarchy Service Provider: BlueZ Service RecHandle: 0x804d050 Service Class ID List: "Browse Group Descriptor" (0x1001) Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Service Name: Museum Service Service Description: Electronic Museum guide service Service Provider: BeremoTe Service RecHandle: 0x804d6d0 Service Class ID List: "" (0x1fff) Protocol Descriptor List: "L2CAP" (0x0100) PSM: B.3 pstree -H beremote output Output from a pstree -H beremote command, showing our child spawning of our parent process of beremote. Thus showing a incoming connection. [init[-+-atd |-bash---pstree |-[bash[---[beremote[---beremote |-bash---tail |-bdflush |-cardmgr |-cron |-dbus-daemon-1 |-dhclient-2.2.x |-3*[getty] 82 |-hcid |-inetd |-keventd |-khubd |-klogd |-krfcommd |-ksoftirqd_CPU0 |-kswapd |-kupdated |-lpd |-portmap |-rpc.statd |-sdpd |-sshd---sshd---sshd-+-bash | ‘-sftp-server |-syslogd ‘-xfs 83 [...]... using our system Bluetooth client A handheld or Bluetooth client device Bluetooth device Any Bluetooth device Bluetooth server device Bluetooth device attached to a Bluetooth server 6 Bluetooth server A server which has a bundle of Bluetooth server devices and is connected (wireless) to the central database server Central database server A server which handles database queries between Bluetooth servers... have found and looked at two: Avetana Bluetooth and Atinav Of cause J2ME can also be used on PDAs if MIDlet 2.0 and JSR-82 is provided on the PDA avetana Bluetooth software is based on the most widely spread bluetooth protocol stacks and does not use special Bluetooth hardware or software It allows programmers to easily use and offer bluetooth services Avetana Bluetooth is a Java JNI13 implementation... some concepts which are needed to get an idea of what Bluetooth is taken as whole The security section is of cause relevant for the application design, but in Bluetooth the security is so integrated, that it is a must to address it, since you can not program for Bluetooth without knowledge of the security functions 3.1 Bluetooth Introduction The Bluetooth technology was originally developed to give... feature of Bluetooth, that is: small in size, minimal power consumption and low price developed for personal Bluetooth usage (people-to-people) Especially cell phones have deeply integrated Bluetooth Among others because it gives easy access to use wireless uplink (bridge) for laptops and because of the possibility of wireless connection to Bluetooth headsets The development of personal Bluetooth units... layers are often referred to as "The Bluetooth Host" (see figure 3) The Bluetooth Module is the "hardware part" and the Bluetooth Host is "software part" of the stack The HCI layer is the driver needed to get the two parts to communicate with each other 11 Figure 3: The Bluetooth protocol 3.3.1 Bluetooth Radio (RF) As explained before, Bluetooth is a wireless technology It uses a radio to transmit the data,... database queries between Bluetooth servers and a database The word "Bluetooth" will sometimes be omitted for shortness E.g "server device" instead of "Bluetooth server device" 2.3 Limitations This project should be seen as a pilot project That is, we will not implement the entire idea as it was just presented We will focus on the parts concerning Bluetooth For example considerations regarding GUI (Graphics... (access points) 3.2 Bluetooth network topology The topology of the bluetooth network is a little different from the "normal" topology of a computer network, because of its ad-hoc nature Thus the "normal" distinction between clients and base stations can not be made This approach is chosen because Bluetooth devices are often on the move, and they often only need a small network In a Bluetooth network a... it to do it 3.3 Bluetooth Protocols We will now go through the central layers of the Bluetooth stack Since we can not cover everything, we will try to focus on the parts that are important to the development of our application The layers above the Host Controller Interface (HCI) are often referred to as the "The Bluetooth Module", and the lower layers are often referred to as "The Bluetooth Host" (see... collection of Bluetooth devices each in some way relating to one or more art artifacts or pictures Each of these devices are interconnected to a bluetooth server which again is connected to a database server (see figure 1) In this way we should be able to fetch data from the database and send it to the bluetooth server which again streams it to a handheld (the client) The connection between the Bluetooth. .. standards for the Bluetooth Host to communicate with the Bluetooth module An application can access various functions in the Bluetooth module through this interface We will not go into details with the interface Examples are power control, role switch, connection, security parameters, connection modes etc The available HCI functions depend on what has been included in the stack API The Bluetooth transport . using our system Bluetooth client A handheld or Bluetooth client device Bluetooth device Any Bluetooth device Bluetooth server device Bluetooth device attached to a Bluetooth server 6 Bluetooth server. 6 2.3 Limitations 7 2.4 WhyuseBluetooth? 7 3 The Bluetooth Architecture 9 3.1 BluetoothIntroduction 9 3.2 Bluetoothnetworktopology 10 3.3 BluetoothProtocols 11 3.3.1 BluetoothRadio(RF) 12 3.3.2. graduate project at DIKU, fall 2004. Supervisor for the project is Associate Professor Klaus Hansen. The name of the project is BeremoTe and is as the name refers to: A project concerning Bluetooth

Ngày đăng: 14/09/2015, 10:29

TỪ KHÓA LIÊN QUAN

w