No wires! Bluetooth technology. Device discovery service. Features of data transfer

No wires! Bluetooth technology

Can teeth be blue?.. It’s unlikely by nature, but after visiting a dentist’s office it’s possible. But teeth often become darkened. Thus, the Danish Viking king Harald Blutend (in English Bluetooth, and in Russian Blue Tooth) received his nickname because of his darkened front tooth (there are, however, other versions). This king is famous for uniting Denmark and Norway. The technology, originally conceived as a means of connecting a computer and a cell phone or other telecommunications devices, is named in his honor.

This article is of a review nature and does not aim to provide a detailed analysis of the technology of the new standard. I look forward to all your remarks, additions and comments by e-mail.

Story

In early 1998, five large companies: Ericsson, Nokia, IBM, Intel and Toshiba came together to begin work on creating new technology wireless bluetooth connection. On May 20, a special working group (Special Interest Group - SIG) was formed to further promote the new technology in the telecommunications market. Any company that plans to develop Bluetooth devices, can join this group for free. SIG already includes about 2,000 companies.

What is Bluetooth?

Bluetooth is modern technology wireless data transmission, allowing you to connect almost any device with each other: mobile phones, laptops, printers, digital cameras and even refrigerators, microwave ovens, air conditioners. You can connect anything that connects (that is, has a built-in Bluetooth microchip). The technology is standardized, therefore, there should be no problem of incompatibility between devices from competing companies.

Bluetooth is a small chip that is a high-frequency (2.4 - 2.48 MHz) transceiver operating in the ISM (Industry, Science and Medicine; industrial, scientific and medical) band. A license is not required to use these frequencies (exceptions are discussed below). The data transfer rate provided by the standard is about 720 Kbps in asymmetric mode and 420 Kbps in full duplex mode. It provides transmission of three voice channels, but not a video signal. Energy consumption (transmitter power) should not exceed 10 mW. Initially, the technology assumed the possibility of communication at a distance of no more than 10 meters. Today, some companies offer Bluetooth chips that can communicate over a distance of up to 100 meters. As a radio technology, Bluetooth is able to "bypass" obstacles so that connected devices may not be in line of sight. The connection occurs automatically as soon as Bluetooth devices are within range, not only on a point-to-point basis (two devices), but also on a point-to-multipoint basis (one device works with several others). Naturally, to implement Bluetooth technology in practice, a certain amount of software(BY). By the way, Bluetooth support is built into the new version of the MS Windows Whistler operating system.

"Frequency conflict"

The fact that frequency range 2.4 MHz is free of licensing and introduces certain difficulties into the use of Bluetooth devices. Various medical devices, household appliances, cordless phones, IEEE standard wireless local area networks. It is quite logical to assume that they can “conflict” with each other. To avoid interference with other wireless devices, Bluetooth operates on the principle of frequency hopping (1600 hops per second). The transition from one frequency to another occurs according to a pseudo-random algorithm. This allows you to “free up” frequencies needed by other devices.

Competitors

Bluetooth has competitors. One of them is infrared (also wireless) communication technology. However, IrDa provides communication only in the line of sight and only on a point-to-point basis.

Specification HomeRF designed for connecting household audio and video devices and building home radio networks. Data transmission is also carried out at a frequency of 2.4 MHz, but with jumps 50 times per second. HomeRF has more bandwidth than Bluetooth. True, the number of connected devices is limited - 127. The range is up to 50 meters.

In my opinion, the strongest competition for Bluetooth comes from the wireless specifications. local networks IEEE 802.11. Initially, Bluetooth technology was created only for radio communications, and there were no plans to create wireless local networks based on it. But such projects soon appeared, and now there is the concept of a Bluetooth network.

I am confident that Bluetooth will defeat all rivals. There are too many large companies working to create this "all-encompassing" technology. Let's see what Bluetooth can do.

Bluetooth devices.

Probably the most noisy Bluetooth innovation is the handsfree wireless headset set from Ericsson. This new device, called the Headset, consists of an earpiece and a microphone and is capable of operating at a distance of 10 meters from the base. The base is cellular telephone with built-in Bluetooth chip. For some phone models that do not have a built-in Bluetooth card, special adapters are created (for example, for Ericsson T28s. The phone lies in your pocket, and you “pick up” and “hang up” the handset using voice control. Convenient, isn't it?.. Among the phones with a built-in Bluetooth card, we should highlight Ericsson T36s, Siemens S42, Nokia 6310.

Something similar to Ericsson's Headset is offered by Plantronics. Its wireless headset-microphone weighs only 26 grams and is capable of working for three and a half hours without interruption. This Bluetooth device is another useful addition to a Bluetooth cell phone.

The Japanese company Japan Total Design Communication is not far behind these companies. She released the “i2me” headphone model, consisting of a Bluetooth adapter and the headphones themselves. The adapter connects to a cell phone, and the headphones work at a distance of 10 meters from the phone. The adapter weighs 45 grams, the headphones - 35 grams.

Last year, Nokia began developing a Bluetooth Connectivity Kit - a set of batteries and a communication card for the Nokia 6210 phone. The battery has a built-in Bluetooth radio transmitter that interacts at a distance of up to 10 meters with a special communication card installed in the laptop. Thus, Nokia 6210 turns into a wireless modem. You open your laptop and access the Internet without taking your phone out of your pocket...

At the end of last year, at an exhibition in Tokyo, Toshiba presented a prototype laptop based on the Tecra 8110 model with a built-in Bluetooth module. Toshiba also demonstrated how the laptop and inkjet printer from Canon. Both devices are equipped with Bluetooth modules. This made it possible to remotely transfer data from a laptop to a printing device. You enter the office with a Bluetooth laptop in your hands, an automatic connection to the Bluetooth printer occurs - and you immediately print the document!

In January of this year, Sony presented a prototype of a Bluetooth module called Infostick, which looks like a Memory Stick. Inside the module there is a Bluetooth controller, a Memory Stick interface, a flash memory controller, and a processor. Now all Sony devices equipped with a Memory Stick slot will be able to “communicate” with each other at a distance of up to 10 meters.

In March, Sony released another new product - a Bluetooth adapter for the Clie Peg-N700C pocket computer. CLIE can now communicate with your cell phone to provide Internet access.

Hello! The wheel is connected... Bluetooth has also reached car wheels. The Finnish company Nokian Tires, together with some other companies and research centers, has developed a technology that allows you to automatically monitor the condition of the wheel of your favorite car. The chip built into the tire will measure the wheel parameters, and if necessary, the Bluetooth transmitting device will communicate with the driver’s mobile phone. Don’t be surprised if the wheel “calls” you and says: “It’s time to pump me up!”

December boom

December 2000 was rich in announcements of devices with Bluetooth technology. Thus, in mid-December, Axis Communications and Lexmark demonstrated at the Bluetooth Developers Conference a solution for wireless data transfer from a laptop to a printer. The Toshiba laptop was equipped with a Toshiba Bluetooth PC Card, and laser printer Lexmark has integrated a Bluetooth print module from Axis. Everyone could try out the new product in action. However, we described something similar above.

In the same month, TDK introduced another device for wireless communication laptops, pocket computers, printers, cell phones - TDK Bluetooth USB Adapter As the name suggests, the new product has USB interface, or rather USB 1.1.

At the same conference, another company, IBM, presented Bluetooth watches. In addition to the Bluetooth module, this device is equipped with an ARM 7 processor, 8 MB of flash memory, Li-Ion battery and IR port. To work, you will need a special Linux Bluetooth driver called BlueDrek. A Bluetooth watch can be worn on your wrist and used to control a laptop equipped with a Bluetooth chip. The conference showed how letters typed on a laptop keyboard were displayed on the watch screen, and, conversely, how a PowerPoint presentation was started and stopped using a Bluetooth watch. It is unlikely that such a new product will receive everyone's attention. This is in the realm of excess.

Speaking about the same Bluetooth Developers Conference, one cannot fail to mention the Japanese company Yazaki, which presented original solution car control system based on Bluetooth. The Bluetooth device connects to the car’s internal local area network (CAN), and the doors are opened and closed by command from a laptop or mobile phone. A number of companies have already begun developing industrial standards for local vehicle networks, and they have chosen Bluetooth technology for wireless communications over short distances.

An interesting solution was presented by Anoto. Together with Ericsson, it developed the Chatpen pen, which can transfer notes taken to a laptop or mobile phone. This new product, in my opinion, is of interest. You can take notes with a regular fountain pen, but on special mesh paper. A miniature video camera built into the pen distinguishes many small dots printed on special paper and converts the image into digital form. Using the Bluetooth module, your recordings are transferred to a laptop or mobile phone. The pen has 2 MB of memory, which means you don’t need to have a laptop handy: the data stored in the pen can be transferred later.

Use your imagination

Some of the above devices amaze with their originality! But that is not all.

Triple phone. Imagine yourself as the owner of a cell phone with a built-in Bluetooth card. On the road, you use it like a regular cell phone, perhaps with a Bluetooth handsfree headset. At home, your device turns into a radiotelephone, because the Bluetooth base is connected to a regular telephone network. And in the office you can use it for internal communications. Comfortable?..

House of the Future. Imagine the following picture. Home furniture and household appliances are equipped with Bluetooth chips: the front door, light bulbs, TV, refrigerator, air conditioner, microwave oven... And in your pocket you have a Bluetooth remote control that controls all these devices. However, we don’t need a remote control: we’ll control it with our voice! A central computer with a Bluetooth chip will recognize voice commands coming from a Bluetooth watch on your wrist: “Lights, turn on!”, “Air conditioning, full power!”, “TV, I need the first, third, sixth channels” (as in movie "Back to the Future 2"). Yes, now it doesn’t seem fantastic. Do you know what else we forgot?.. The flush barrel in the toilet. You can also give him commands.

Bluetooth opens up enormous opportunities for inventors. For example, a camera with Bluetooth technology connects to a mobile phone - and you send the captured image to a friend. He, having accepted your message, immediately sends it to the laptop. In the office, his laptop automatically connects to a Bluetooth printer - and the image is printed. How do you like the prospect of a wireless mouse? Similar devices already exist, how convenient it is!

Hurry up to invent and patent your Bluetooth innovation!

Will France be left without new technology?

It seems that the French will not soon equip their “homes of the future.” In France, the 2.4 MHz band used by Bluetooth is occupied by the military, which, as is usually the case, does not make concessions. True, a small part of the range (2.4465 - 2.4835 MHz) still remains free. It appears that special Bluetooth devices will be developed for France that are not compatible with devices produced for the rest of the world. SIG is trying to improve the situation by negotiating with the French authorities.

Who makes Bluetooth chips?

Any company can develop Bluetooth modules (above we looked at Bluetooth devices from various manufacturers). Bluetooth “filling” is developed directly by the manufacturers of Bluetooth devices themselves or purchased from other companies. Let's look at a number of companies involved in the production of Bluetooth modules.

Last October, Matsushita-Kotobuki Electronic Industries developed a compact Bluetooth module. It was half the size of other chips on the market at the time. Minimizing dimensions was achieved by placing the passive elements and other components, including the antenna, on a ceramic substrate.

In March of this year, Siemens announced a Bluetooth transceiver with a USB interface capable of operating within a radius of 100 meters. The adapter plugs into the USB port of your desktop or laptop and allows you to connect to any Bluetooth-compatible device. Particularly noteworthy is the fact that data transmission can be carried out over a distance of one hundred meters, and not ten, as was originally intended by the specification.

In the same month, Silicon Wave and Sharp demonstrated a Bluetooth module in the form of a CompactFlash card. The card is inserted into a laptop via a PC Card adapter, and can also be used in conjunction with a PDA. Well, then... any wireless connection is in your hands.

Prospects

What can we say about technology that will undoubtedly bring so much convenience to our lives and at the same time be universally available? What can be said about technology that does not require licensing fees to master? Only one thing: she has great prospects. Will wait…

Bluetooth is a communication technology designed for wireless connection various devices. Typically, information is transmitted over a short distance (10-30 m) at a low speed (720 Kbps), but currently there are devices that cover distances of up to 100 m (in open space), and devices with speeds in excess of 2 Mbit are being developed /With.

Bluetooth technology uses the unlicensed 2.4 GHz radio frequency range, meaning special permission is not required to create and distribute such devices. Bluetooth is not an alternative to radio-ethernet (Wi-Fi), rather they are complementary technologies. Wi-Fi is precisely radio-ethernet, while Bluetooth can connect completely disparate devices: computers, cell phones, keyboards, mice, printers, remote controls and TVs/VCRs. Bluetooth devices can be networked, with each device belonging to multiple networks.

About protocols

In computing, a protocol is a standard that defines how information is exchanged between its various sources and receivers. The protocol allows you to abstract the process of transmitting information from low-level implementation details, as well as from the content of the transmitted information. For example, the HTTP protocol defines the concepts of “resource”, “request”, “response”, request and response syntax, but does not define what information will be transmitted in requests and responses; one program (robot) can save the results of requests (responses) to files or a database, another (browser) displays this information (by interpreting HTML, images and other types of files).

Protocols are grouped into stacks, where one protocol uses another as a transport carrying its high-level information, and there can be quite a few such layers. For example, TCP uses IP as its transport ( TCP protocol) data. The HTTP protocol uses TCP as a transport layer, and the XML-RPC protocol uses HTTP.

Protocol implementations are also arranged in stacks. At the lowest level, access to specific device carried out by the device driver. The operating system kernel provides user programs with standard interface to the drivers. In turn, well-written programs do not implement this access themselves, but use libraries that implement higher-level protocols.

Specifically for Linux, there are 3 Bluetooth protocol stacks, that is, 3 implementations. The main one, Bluez, was developed by Qualcomm and included in the Linux kernel starting with version 2.4.18. Another stack included in the kernel is developed by Axis and is called OpenBT. Both stacks require programs and libraries that can be found on their respective web pages. The third stack, Affix, was developed by Nokia. It is not included in the Linux kernel, so installing it requires downloading and installing a kernel patch, as well as the necessary libraries and programs. The disadvantage of the Affix stack is that it is not integrated into the kernel. On the other hand, it has the virtue of PyAffix. This is a patch to the Python Standard Library socket module that adds Bluetooth to the list of supported protocols.

Bluetooth on Linux

The KDE Bluetooth shell is a set of tools built on top of the BlueZ stack. The developers of MOPSLinux and KDE wanted to make it easy for users to access the most common Bluetooth profiles and make it as easy as possible for their computers to exchange information with Bluetooth-enabled phones and personal digital assistants (PDAs).

The following describes how to configure kdebluetooth as a complete system, and discusses the use and configuration of each utility program.

Components

Kbluetoothd: the heart of the KDE Bluetooth shell

KBluetoothD is the main part of the KDE Bluetooth shell. Typically, the program runs continuously and runs services such as the OBEX server, or services that are paused upon request. The system icon reports current bluetooth connections, and also provides quick access to service configuration, recently used services, various devices etc. Launch kbluetoothd

To launch KbluetoothD, you need to type kbluetoothd at the command line, or select it from the K-Menu (usually System/kbluetoothd).

KBluetoothD is displayed as an icon, but if desired, context menu You can disable the "Always display" option. In this case, the program will work without any visible to the user interface, even if you restart it. To get the icon back, you just need to start kbluetoothd again. If the icon was disabled, it will still appear during the Bluetooth connection.

If the kbluetoothd program is running before the system is shut down, it will automatically start when the user logs back on. To prevent this from happening, you need to close it and specify that you do not need to start kbluetoothd the next time you log in.

Work kbluetoothd

The most important part of the kbluetoothd program is the Bluetooth metaserver. Since kbluetoothd runs constantly, it also scans the Bluetooth adapter, reports when connections are established, and caches name queries. This happens because kbluetoothd is the only bluetooth program that must be running constantly and have access to all active services. Metaserver

The kbluetoothd metaserver functions similarly to the inetd daemon on a Linux system: it waits for connections to be made by real service control devices and launches them when necessary. This way, there is no need for a constantly running obex server (it will start automatically if someone tries to transfer a file to the computer via OBEX).

This principle is used for several reasons:

  1. The amount of memory used is reduced when working with multiple services. The KDE Bluetooth shell currently comes with 4 server programs: obex server, handsfree client, bemused client (a program for controlling WinAmp from a mobile phone) and a serial chat tool. Even if you don't plan to use these applications often, you don't have to disable them, because... no resources will be wasted.
  2. The system tray will not be cluttered with various rarely used shortcuts.
  3. The level of security is increased and access control is simplified. If a connection request is received, the kbluetoothd program will by default display a dialog asking for permission. For each service and device, the user can temporarily allow or deny the connection. Thus, access control for each application managed by the kbluetoothd program is carried out independently.
  4. The reliability of bluetooth services will increase. Each server is started for every new connection, so if a server crashes, you can start over without having to reboot it.

For a web server, managing the inted daemon can be a nuisance, but when working with Bluetooth setup connection takes at least a few seconds, and each action is initiated by the user, which allows you to work stably with the metaserver.

  1. Service registration using an SDP server is very simple. For information about registering applications managed by kbluetoothd using the SDP server, it is recommended that you consult the KDE development literature.
  2. To operate a bluetooth server, you can use simple server programs and even scripts without directly resorting to functions for working with bluetooth.

It is possible to enable/disable the services used by the kbluetoothd program using the central control module in the "Local services" table. Here you can configure individual service options by selecting the service and clicking on the “Configure…” button.

Using the "Confirmation" table, you can set the program's response to requests to establish a connection. Device discovery service

Many applications require information about whether specific device V this moment, and sometimes you need to receive notifications when a device is connected or disconnected. Unlike USB, where the hotplug shell reports new devices, there are no such services for bluetooth connections.

The kbluetoothd program solves this problem using the Device Discovery Service. Periodically, the service checks for nearby devices and compiles a list of those that are available. To access a discovered device, you must right click Click on the kbluetoothd program shortcut and view the “Open recent” menu. This menu contains one section for recently used services (for example, "obex ftp on MyPhone"), as well as, if there are already detected devices, a second section providing a list of these devices. By clicking on one of them, you can see services for of this device.

Using the central control module, you can set the frequency of searching for devices or disable the search (“Periodically update the neighbor list”). It is recommended to use intervals of at least a minute as other applications may have problems finding devices because most devices are not designed to allow other applications to use bluetooth at the same time.

Many devices are undetectable for privacy or security reasons. In this case, they will not be detected when searching for devices. Instead, kbluetoothd will try to access each of these devices. To add a device to the list of non-discoverable devices, you must click on the "Additional search options for non-discoverable devices" option. Please remember that you must either temporarily allow device discovery or find out the address of the equipment to include it in the list.

This will prevent other programs from starting to search for devices or even establishing a connection to another device for about 30 seconds per device if the device is not currently available. Therefore, it is advisable to use a fairly long time interval here (about 10 minutes). It is recommended to try different values ​​and determine the smallest time interval at which operation proceeds normally.

Having just a list of currently available devices is not very useful. You can use the device discovery service to perform checks when a device appears or disappears. These checks are simple scripts. The user can easily write their own script, but it should be noted that kbluetoothd already has some scripts, the main ones are described below:

Discovery protocol

This script creates an HTML page with some technical information for each device when it is first detected. You can use this script if you need to find out who else is using bluetooth nearby. It's okay if this script is activated constantly, because... an attempt to gain access to the device will be made only when it is first detected or after the corresponding HTML page is deleted.

Kopete_AutoAway

This script will set the kopete ready status depending on whether the bluetooth device is within reach.

Screensaver

Starts or cancels the screen saver each time a device appears or disappears.

To work correctly, most scripts must first be configured. By clicking on the "configure" button, you will see a kedit window containing a set of script parameters. Care should be taken in limiting the devices suggested for each job unless the script needs to be executed every time someone with Bluetooth enabled on their phone walks by.

List of "recently used services"

To get quick access to services that have been used before, you need to go to the kbluetoothd submenu “Recently used”. If any files have already been sent via kbtobexclient to a mobile phone with the name "My phone", then the menu item "Obex push client - My phone" will be visible, using which you can run kbtobexclient and a connection with the phone will be immediately established, bypassing the request processing process.

It should be noted that kbluetoothd displays all recently used services, regardless of whether a particular device is currently available.

This property must be supported by the corresponding application.

Checking the connection

By looking at the kbluetoothd program icon, you can determine whether a bluetooth connection is currently established. If there is no connection, the icon is gray. The icon flashes if a connection is being established and turns blue if a connection is already established.

To get more detailed information about the current connection, you need to right-click on the icon and select “Connection details...”.

ACL links are displayed here, not Rfcomm connections. If a connection was established with a separate device by several programs (for example, handsfree and bemused), then this connection will still be displayed as one connection, because Only one ACL relationship can exist at a time.

Configuring the kbluetoothd program

Usually kbluetoothd and the services it manages work perfectly, but it is still possible to change some options. To configure kbluetoothd, you can use the KDE Control Center. To do this, you need to launch the KDE control center and select Internet and Network -> Bluetooth services (Internet&Network -> Bluetooth services) or right-click on the program icon and select Configuration -> Services (Configuration -> Services)...

Confirmation of incoming connections

In this table you can change the confirmation settings for incoming connections. By default, the kbluetoothd program will launch a confirmation dialog before the actual server program (for example, the OBEX transfer server) starts running. It is possible to disable the confirmation dialog for some devices/services or to instruct kbluetoothd to simply reject incoming connections.

Entries for new devices will be added if the "Always accept" option is selected in the confirmation parameters.

Local services

This table allows you to enable or disable individual Bluetooth services managed by the kbluetoothd program. Some services also have some configuration options, such as the bemused server. In this case, the Configure... menu item will be available if the corresponding service is selected.

Since the kbluetoothd program automatically assigns rfcomm channels to services, the channels used by a particular service may change when using other bluetooth servers. If necessary, the program will report which channel is assigned to a specific service. Bluetooth/SDP-kioslaves tools: search for devices and services

The bluetooth- and sdp-kioslaves tools allow you to find other bluetooth devices, put them in a list and use their services using konqueror (or using any other file manager, which can use the KDE File IO shell). Using Bluetooth/SDP-kioslves

To find a new device, you need to enter bluetooth:/ in the konqueror manager. The screen will immediately display an entry for the system, followed by any other devices that can be detected.

You can also click on the Bluetooth icon in the "Services" table in the konqueror panel, and then select LAN and Audio CD browser. If the icons are not visible, you may need to reload the panel by selecting Config-button -> Add new -> Rollback to system default.

For devices to appear, they must not only be turned on, but also made visible. Otherwise, you can try to establish a connection with them only when the address is known, but they will not respond to the request.

After selecting a device, a list of services that correspond to it is displayed. If the service is supported by kdebluetooth, you can click on it and the corresponding application will launch. Until it is disabled, the konqueror manager will display the standard file-open-dialog. If the service is unknown, then another open dialog (open-with-dialog) will be displayed.

For advanced users

If the user is confident in his actions, then he can try to open a certain service (for example, kbthandsfree) using a bluetooth application that was not specifically designed for this profile, for which he must right-click on the service icon and select the application. Each service that works with AT commands on rfcomm connections can be opened, for example, using kbtserialchat.

It is also possible to change the association between applications and (known) profiles in the same way as choosing an application that should open mpeg or pdf files: kio_obex assigns each listed profile a MIME type (mimetype) and each kdebluetooth client application is associated with the profiles it supports. Support for profiles that have not yet been recognized can be added using files in the $pFIX/share/services directory (for example, sdpmime-serial-port-profile.desktop).

OBEX-kioslave tool: Browsing folders via Bluetooth

Brief information

The OBEX puncture was designed for use in mobile devices. Every time data is transmitted (“beamed”) from one mobile device the other uses OBEX. But there are also other applications of the OBEX protocol. It is especially often used to view file systems. If the mobile device understands this protocol, then you can view, download and upload files from its storage device using this client application. Synchronization protocols such as IrMCSync and SyncML are associated with the OBEX protocol and can be accessed using this client if synchronization is not used in a konquerror environment.

OBEX protocols can use different transmission methods. At first IrDA was used, but now there are means of transmission via Bluetooth, serial links and tcp/ip connections.

OBEX supports 2 types of identification. The first, most famous, involves identifying clients on the server. In this way, the server application can change the client's features and vice versa. During identification, an MD5 checksum is used, which ensures that passwords will not be transmitted unencrypted.

URL Format

OBEX resources can be accessed using a URL. The protocol part is directly obex:. The path component stores it on the server. The host part is a little more complicated.

For servers accessed via tcp/ip, the host part is standard. To establish a connection, you can use the host name or IP address of the server host. In addition, if the server uses a non-standard port (standard port is 650), you can specify the port number. Example: OBEX://hostname:port/path).

For IrDA or Bluetooth transmission media, the address can be used hardware in standard notation (separated by colons). Example: obex:///path or obex:///path.

It is possible to define host aliases for use in the OBEX protocol. These aliases are set in the OBEX KControl module. You can specify a person's name, discover the device, and then match the address to that name. Through these aliases you can also access devices using the serial transmission method. For IrDA and Bluetooth there are convenient aliases irda and bluetooth. In both cases, the device is detected and an attempt is made to establish a connection with the first one found. Hints

As with other kioslave tools, it is possible to directly open and save files to bluetooth devices using kio_obex. For example, if you have a shopping list, you can prepare it in the kedit editor and save it to your phone.

You can speed up this procedure by adding a bookmark to the list of bookmarks in the file save dialog.

OBEX Transfer Client: Sending Files

KBTObexClient is a program that allows you to transfer files from a personal computer to any bluetooth device that supports the OBEX (object data exchange) protocol. This protocol is supported by (almost) all bluetooth-enabled cell phones, PDAs, and of course other personal computers with a bluetooth device. This program can be invoked using the Konqueror environment using kio_sdp (type sdp:/ in the panel), or you need to right-click on the file you want to send and select the “Send with Bluetooth” action.

OBEX Transfer Server: Receiving Files

Most personal digital assistants (PDAs) and Bluetooth-enabled cell phones can transfer files to Personal Computer. At the same time, it would be much more convenient to use the OBEX FTP kioslave tool for such a transfer, but not all devices support it. On the other hand, OBEX information transfer is supported by most Bluetooth devices. Using the OBEX Transfer Server

The OBEX transfer server is controlled by the kbluetoothd program and starts automatically if it is activated and someone tries to transfer some files to a personal computer.

If files are transferred from a mobile device to a computer, the kbluetoothd program icon will turn blue and a new window will appear. By default (depending on your settings for incoming connections), you will first need to accept the connection, and then the main OBEX window will appear and begin transferring files.

Incoming files are saved to the /tmp directory and are erased when the OBEX Transfer Server is closed. To save these files, two options are used:

Move one or more files to another location. This option is especially useful if you need to transfer files via e-mail, because You can transfer files directly to the kmail client without storing them temporarily. Service program kbtserialchat: a simple means of communication

The kbtserialchat program is a very simple client-server (client&server) for communication. Its main task is debugging. It can also be used as an example for writing a Bluetooth server controlled by the kbluetoothd program and a client that can be launched via SDP kioslave. Using a communication tool

kbtserialchat uses the Serial Port protocol, so when you run it, all devices that provide a serial port profile will be shown. This includes other computers that have the KDE Bluetooth shell, and phones that support this profile.

When a connection is established with another kbtserialchat server on another system, the kbtserialchat window will appear, after which you can exchange text messages. It is also possible to establish a connection to the serial port of a Bluetooth-enabled phone and send various AT commands. For example, to call a specific number, you must specify ATD<номер>;.

While it may seem pointless to connect a kbtserialchat server to the serial port of a device using it to exchange binary data, it can be used to connect not only to the serial ports of various services, but also to Rfcomm based services (such as a handsfree or headset profile) . These services are not indicated in the initial dialog, so you can do the following: find the device services using kio_sdp (using sdp:/-URL). In this case, you need to right-click on the service and select Open with.... In the dialog, you must specify kbtserialchat and press Enter.

Additional funds

This section describes some of the features and scripts included in the kdebluetooth package. Most of the utilities listed here are used separately, but are called using scripts or other programs. kioclient: access to the KIO shell using scripts

This is a small utility that is used to access kioslaves tools from command line. Thus, in essence kioclient is the main utility.

Using kioclient you can copy, view the contents, delete any files or directories accessible to the KIO shell. Using WebDAV, it is possible to directly copy a file from an FTP server to another server, or via SSH (using kio_fish) to view the contents of a directory. Or you can use kio_obex to access mobile phone files. The kioclient utility is used in the sample script included in the kbluetoothd package (copy_images script).

One thing to remember is that even though kioclient is a command line program, it must be launched from KDE. kbtsearch: searching for devices using scripts

Like kioclient or kdialog of the KDE shell, kbtsearch is a command line program that is used in scripts. It has a command line interface for two standard dialogs of the kdebluetooth system - the device search dialog and the service search dialog.

This program can be used if you need the user to select a bluetooth device or find a specific service among given devices. As always, the service selection dialog remembers the found devices and immediately fills the list of services with records of previously found services, and those currently available are added to the list in a few seconds.

To start searching for a device, you just need to type kbtsearch --device. When the user has found a device or entered an address and clicked OK, kbtsearch will print the device address to stdout and return a status code of 0. If the user clicked Cancel, nothing is printed and a status code of 1 is returned.

Using kbtsearch --uuid You can also search for a device that supports this Bluetooth profile. The kbtsearch program allows you to set aliases for frequently used profiles. To get a list of possible aliases, you need to run kbtsearch --aliases.

If the user selects a service and clicks OK, kbtsearch returns 0 and displays a string like "[address]" (" "). It is clear that this is only suitable for those services that specify an rfcomm channel. For example, there is currently no way to find L2CAP PSM.

For information about additional options you need to contact kbtsearch --help. kbtfax: Send fax using KDE applications

This is a helper script that makes it easy to send a fax from any KDE application. It depends on efax (third system), kdeprintfax and kdesu (part of kdebase) and rfcomm tool (part of bluez).

If you are attempting to send a fax using kdeprintfax, you can specify that the fax backend should be used by the kdeprintfax utility. The "EFax" option will appear, as well as the "Other" option. You need to select "Other", and then find the kbtfax script in the kdebluetooth system. Next, on the command line, you need to enter what is specified in the script itself. Bluetooth Security: Device Pairing What is “pairing”?

Very often, identification (authentication) of a device is required to access the service. In this case, you need to combine the two devices. When two devices are combined, each can be confident that the other is authentic. If you do not resort to merging, you will have to trust the specified address or name of another device, and they can be easily forged.

Typically, two devices are paired once, after which the connection between them will be confirmed automatically.

Most often, the merging process starts automatically when necessary. There is no need to worry that devices will not be combined if you need access to its services. If identification fails, the merging process will start automatically. How does this happen?

The devices are combined to verify the identity of the other party. However, the first step cannot be completed automatically. You need to know who wants to pair with your device. To do this, a PIN code is dialed on both devices. The definition of "PIN" is widely accepted but misleading. This is not the code you have to dial to get money from an ATM, i.e. you don’t have to remember it at all, and after (!) merging you don’t have to keep it secret. The only thing you want to check is that no one else knows this number until it is dialed on both devices.

For added security, not only should you keep your PIN secret during the pairing process, but you should also use a random number that is hard to guess. KDE's Bluetooth tools can help with this by generating a random eight-digit number on its own. The code may use letters, but in this case there may be problems when typing the code on a mobile phone. PIN code

But where to enter the PIN code? As mentioned above, devices themselves request a code when necessary. As for the BlueZ stack, it's a little more complicated. There are several ways to obtain a PIN code from a user.

Typically, the hcid daemon included in the BlueZ package (file /etc/bluetooth/hcid.conf) specifies that you need to use the "PIN helper application" and set the "secure user" (" security user"). This daemon is a small program that only asks the user to enter a number and prints it to stdout. Bluez contains its own helper program "bluepin", which worked quite problematically. It is better to use the program "bluez-pin" or the kdebluetooth system assistant called "kbluepin". Working with federated devices

After combining devices, you can set various issues. For example, which devices are connected and which are not. The user may also want to disconnect the devices. However, not all so simple.

First, no device can know exactly which devices it is paired with. When two devices are paired, they use a secret startup key that was created during the pairing process and is based on a PIN and some other information. Because either party can remove the launch key without notice, having a key for a given device does not guarantee that another device has one. If one of the startup keys is removed, the devices are disconnected. Of course, you can be sure that if this key is not in the computer, then there is no connection with the uniting device.

How to remove the launch key? It depends on the device. Most phones or personal digital assistants (PDAs) have lists of "teamed" or "friendly" devices from which certain entries can be removed. In Bluez version 2.6, launch keys are usually specified in the file /etc/bluetooth/link_key. Since they must be kept secret, access to this file is limited to the root user. You can delete this file, but then absolutely all devices will be disconnected. And since the file is binary, it can only be edited using special means. Currently, the kdebluetooth system does not have such capabilities, because Soon the principles of how the Bluez utility works with keys should change.

There is one caveat when frequently switching between different operating systems, working with bluetooth (usually Linux<->Windows): By combining the phone with a computer running Linux and then loading Windows, Windows will not know the startup keys generated by the Bluez utility. It turns out that the computer has “lost” the startup key and will have to start the merging process again. Depending on the device, it may happen that a new union is not possible until the “old” startup key is deleted. The same problem can occur if the "paring single" option is selected in the /etc/bluetooth/hcid.conf file. To avoid this situation, it is not recommended to use Bluetooth on different OSes or use different bluetooth adapters for different OS.

Program KBluetoothD

This section describes how to use the kbluetoothd program for various applications or access it from scripts to find cached device names.

Name cache

The name cache tracks all incoming name requests and stores the results. With its help, other applications and the kbluetoothd program itself can find the name of another bluetoothd device by its unique address, even if the device is not currently accessible. This scheme is used mostly due to a more user-friendly interface, because... bluetooth addresses like 00:60:AB:13:83:3D are quite difficult to remember. However, it may become obsolete once a version of BlueZ comes out with its own persistent name cache.

You can access the name cache using dcop. To find the address in it, from the command line you need to type dcop kbluetoothd DeviceNameCache getCachedDeviceName

. To determine the last used device name, you can specify dcop kbluetoothd DeviceNameCache resolveCachedDeviceName . This command does not pay attention to letter case. It should be noted that multiple devices can use the same name.

Meta server

If you need to use a server application with the new bluetooth protocol, then it can be easily combined with the kbluetoothd program, and the server will start automatically.

Must have XML file, describing SDP records, and the corresponding desktop file. In this case, the kbluetoothd program will automatically create an SDP record, assign an rfcomm channel and start listening to the selected channel. If someone makes a connection to this service, the kbluetoothd program will start it (the service) and pass it a socket for the already accepted connection. The number of identifiers is passed as a command line argument.

The kdebluetooth package contains the kbtserialchat utility, which (apart from its use for debugging and communication) is a fairly simple sample program for integrating an application into the kdebluetooth shell. Since kbtserialchat is both a client and a server, you don't have to consider all the command line arguments.

The SDP/XML file format should be self-describing if the user has an understanding of how SDP records are structured. It is important to note how the parameter for selected rfcomm channels finds the path to the SDP record for the server. Since the channel is selected automatically by the kbluetoothd program, there is no way to add it to the SDP registration file. Instead, you can use the structure zero as . The rfcomm channels used are specified in the corresponding desktop file.

Device discovery service

The kbluetoothd program can search for other devices and execute commands as soon as the device appears or disappears. This service can be configured in the control center module (table “Device Discovery”).

List active work by discovery, as shown in the control center module, is simply a list of executable files found in the $HOME/.kde/share/apps/kbluetoothd/discovery_jobs/ directory. It is also possible to add new scripts to the global template directory in $pFIX/share/apps/kdebluetooth/job-templates/. Scripts in this directory that end in ".template" will be displayed when the user selects "Add new job..." and will then be copied to the active directory of the user's home directory.

The scripts included in the program are divided into two to make it easier to update them (without reinstallation). The ".template" part contains only those settings that are copied to the home directory and that the user can change. This script then calls the ".real" part, which remains in the temporary directory.

To write your own search job, you need to select “Add new job...”, and then select Custom_Job. The Custom_Job.template script will be copied to the working directory. Then click "Configure..." to change the script. This script displays all command line options and environment variables that you have access to.

It should be noted that by deleting the script from the list of active tasks, all these changes will disappear. If you need to distribute it, it is recommended to split it into two parts: template for settings and real for doing the actual work.

To be able to transfer files, receive or delete them from such a job, you can use kioclient.

How bluetooth works when using computers, entertainment systems or phones equipped with this universal wireless connection.

The use of bluetooth occurs when devices need to interact with each other without the use of various wires, cables, radio signals, infrared rays, and light. With this connection, various connectors, plugs and installation of pairing protocols are not required.

There are many in various ways with which electronic devices can connect to each other and this is becoming more and more complex every day as they develop. But the connection via Bluetooth is the simplest in terms of operation.

How bluetooth works

Connection via bluetooth is wireless and automatic, and has a number of interesting features that can make using this type of connection easier. When any two devices need to exchange information with each other, they must agree on a number of points before the exchange can begin. The first point of agreement is physical: will they "talk" over wires or through some form of wireless signals? If they use wires, how many are required - one, two, eight, 25? Once the physical attributes are resolved, a few more questions arise:

  • how much data will be sent at one time? For example, serial ports send data 1 bit at a time, while parallel ports send multiple bits at once;
  • how will they exchange with each other? All parties in an electronic discussion need to know what the bits mean and the message they are receiving is the message that was sent. This means the development and collection of commands and responses known as an interaction protocol.

Bluetooth connectivity is essentially a networking standard that operates on two levels:

  • provides transmission at the physical level via radio frequency;
  • provides agreement at the protocol level.

The Bluetooth connection is wireless, inexpensive and automatic. There are other ways to bypass wires, such as infrared communication. Infrared (IR) refers to light waves at a lower frequency than the human eye can receive and interpret. IR is used in most TV remote control systems remote control. Infrared communications are quite reliable and not expensive, but there are two disadvantages. First, IR is a “line-of-sight” technology. The second disadvantage is speed restrictions. As an advantage, interference between devices is rare.

Transfer via bluetooth

Transfer via bluetooth does not have the problems that IR systems have: only line of sight and speed limitation.

The older the standard, the higher the maximum speed that can be transmitted. The 1.0 standard has a maximum data transfer rate of 1 megabits per second (Mbps), while 2.0 can handle up to 3 Mbps. (2.0 and older are backward compatible with 1.0 devices), Bluetooth 3.0 up to 24 Mbps, Bluetooth 4.0. speed – up to 30 Mbit/s, Bluetooth 5.0. speed – up to 60 Mbit/s

These wireless communications networks transmit data via low-power radio waves at a frequency of 2.45 gigahertz (actually between 2.402 GHz and 2.480 GHz).

This frequency band is allocated based on an international agreement for the use of industrial, scientific and medical (ISM) devices. One method of not interfering with other systems is to emit weak signals and do not clog - about 1 mW.

For comparison, the most powerful mobile phones can transmit a signal of up to 3 W.

Low power limits the range of devices with this system to 10 meters, so the chances of interference between the computer system and the phone or TV are low. Even at low power, the use of Bluetooth does not require direct visibility between interacting devices. Walls in the home do not interfere with the signal, making the standard useful for controlling multiple devices in different rooms. With this system you can connect up to eight devices simultaneously.

The standard uses a technology called spread spectrum frequency hopping, which makes it immune to interference.

In this technology, transmitters change frequency 1600 times per second, which means that a large number of devices can make full use of the limited bandwidth of the radio spectrum.

Since every Bluetooth connection automatically uses spread spectrum, it is unlikely that two transmitters will be on the same frequency at the same time. The same algorithm minimizes the risk of phones or headphones interfering with the devices, since any interference at a certain frequency will only last a tiny fraction of a second. When Bluetooth-compatible devices are connected to each other, the user does not need to press a button or give a command - electronic docking occurs automatically. Once the connection of devices has occurred, part of the computer system forms a network. P transmission via bluetooth creates a personal area network (PAN), or public network, that can fill a room or cover a short distance, like a cell phone on your belt and a headset on your head.

On basic devices such as phones, speakers, headsets, laptops, it covers a distance of about 10 meters.

Wifi and bluetooth difference

Wi-Fi and Bluetooth have many differences besides the principle of interaction with each other:

  • different frequency range and pairing protocols
  • Bluetooth communication range is shorter
  • the speed of information transfer, due to the operating principle, is lower for Bluetooth
  • different number of simultaneously operating devices
  • lower power consumption and cost, better noise immunity of Bluetooth devices.

How to transfer via bluetooth safely

How to transmit via bluetooth Taking into account the various security modes, device manufacturers determine which mode to enable to support the gadget. In almost all cases, it is possible to install “trusted devices” that can communicate without asking permission. Security measures include authorization and identification procedures that limit the use of services to the registered user and require users to make a decision about opening a file or transferring data. Transmission via Bluetooth in these modes eliminates or makes unauthorized access unlikely. The user can also simply switch to "stealth" mode and avoid connecting with other devices entirely. Computer security and the use of Bluetooth and Wi-Fi are an inevitable result of technological innovation and device manufacturers are constantly releasing new firmware to address new issues as they arise.

Bluetooth allows you to use a variety of telecommunications and computer devices without the use of cables.

A little history


Literal translation Bluetooth from English - “blue teeth”. However, Bluetooth technology owes its name not to dentists, but to a historical misunderstanding. This is how English chroniclers “called” the Danish Viking king, who lived in 910-940. King Harald Bluetooth went down in history as the collector of Scandinavian lands. In particular, he is credited with uniting Denmark and Norway (and Bluetooth technology should unite the telecommunications and computer industries). Probably similar to this, Bluetooth technology is also intended to unite the world of mobile electronics.

There are two versions of the origin of the “blue-toothed” royal nickname. First— he really had pathologically colored teeth. But it looks most plausible another version: Bluetooth is a distorted English nickname for the king in the Viking language: the king, “by the will of nature,” had dark skin and dark hair, which is not typical for the Viking race (white-skinned and fair-haired). For this “genetic somersault”, Harald was nicknamed Blackie (or something like that, in the Scandinavian original - Bletand). Probably, the English chroniclers did not break their tongues and came up with a simpler “nickname” for the king...

The company began developing Bluetooth ERICSSON back in 1994. The original goal was obtaining a new radio interface with low power consumption and low cost, which would allow communication between cell phones and wireless headsets. Moreover, according to the ERICSSON concept, new interface intended for data and voice transmission, and from anywhere in the world. To ensure wider support for the young technology in market sectors such as desktop systems, PDAs and mobile phones, ERICSSON in February 1998 organized a consortium to develop and promote the new technology called Bluetooth SIG (Special Interest Group). Nowadays it includes more than 2,000 different companies, including such large ones as 3COM, NOKIA, INTEL, NATIONAL SEMICONDACTOR and so on.

What is Bluetooth?

Bluetooth technology is a type wireless technology communication that eliminates the need for cables and related devices. Thus, Bluetooth technology eliminates all kinds of connection inconveniences associated with the use of:
- computer equipment;
- cell phones;
- digital cameras and other digital devices.

Bluetooth allows without cables use a variety of telecommunications and computer devices.

The technology makes it possible to establish an automatic connection between two or more devices. Bluetooth also allows you to use data in various applications.

Bluetooth does a great job of providing wireless connectivity between devices within your office or home. The technology is based on radio communication, so the connection between devices is completely invisible and instantaneous.

Thanks to Bluetooth technology, you can send a document from your laptop to be printed through a printer that may be located in the next room. In general, Bluetooth is a standard for wireless communication between devices located within a short distance of each other. The technology works perfectly in the so-called personal network, the operating principle of which is based on radio frequencies.

Any devices that support the Bluetooth communication standard can be connected. Multiple Bluetooth enabled devices - e.g. digital camera, cell phone and pocket computer will allow you to create a network. You will be able to send messages from your laptop to your cell phone without having to resort to any means of wired connection between the laptop and the cell phone.

Features of Bluetooth technology:
- Bluetooth technology is based on radio waves with a value of 2.4 GHz;
- simultaneous communication between several objects is supported (not just two);
- Bluetooth technology is designed to operate at a short distance of 10-15 meters (with an increase in power to 100 mW, Bluetooth devices will become more “long-range” (up to 100 m));
- Bluetooth has a data transfer speed of 1-2 megabytes per second;
- Bluetooth chips are relatively inexpensive (although more expensive than infrared connection devices).

How does Bluetooth technology work?

Bluetooth is high-speed communication based on radio waves. The technology is designed to establish communication between mobile phones, laptops and other portable devices. Unlike devices based on infrared technology, Bluetooth does not require devices to be connected to be in the path of the beam. Bluetooth technology, in a sense, is a modified version of existing local network technology. On the other side, Bluetooth is more convenient due to its small size and low cost.

Currently, the Bluetooth chip is a chip measuring 0.9 square centimeters. Development of a new, even smaller chip is underway, the production of which will begin soon. Prices for Bluetooth devices are expected to drop significantly. Bluetooth chips are now embedded in many devices. Inexpensive miniature transmitters are housed in digital devices. Devices using Bluetooth technology operate at a frequency of 2.45 Hz when connecting.

Bluetooth technology Supports fairly high data transfer rates and multiple voice channels. The Bluetooth chip is either directly built into the device or used as an adapter. In the case of a computer, it can be used with USB port. Each USB device has a 48-bit address from IEEE 802 standards. A connection can be established with one device or with several devices simultaneously. The standard Bluetooth operating range does not exceed 10 meters, but if you increase the power, the operating range can increase to 100 meters.

Bluetooth devices are reliably protected from external interference due to the fact that their frequency changes up to 1600 times per second. Bluetooth technology is a bridge between existing networks data . The technology guarantees security at the bit level, authentication is controlled by the user using a 128-bit key. An important characteristic of Bluetooth technology is that it allows you to instantly create a network between devices located at some distance from each other.

Channel types

The Bluetooth system defines five types of logical channels:
- LC (Link Control)- a control channel through which physical communication is maintained between the devices that form the piconet. At this level, synchronous (SCO, Synchronous Connection-Oriented) and asynchronous (ACL, Asynchronous Connectionless) connections of physical channels are used;
- LM (Link Manager)- control channel, which is responsible for establishing connections between master and slave devices, ensuring security and cryptographic protection;
- UA (User Asynchronous)- asynchronous channel (used in the ACL line);
- UI (User Isochronous)- an isochronous channel, in which only the middle frequencies of the reference oscillators of the master and slave devices are identical (used in the ACL line);
- US (User Synchronous)- synchronous data exchange channel (used in the SCO line).

Piconets

Bluetooth subscriber devices are combined into groups (piconet), collectively using the same radio channel. Each piconet consists of one master transceiver(with a reference oscillator that synchronizes internal network traffic) and up to seven slaves (synchronized). All reference oscillators in the network have a fixed setting. The slave device calculates the difference between the frequencies of its own and master oscillators, and in the process of entering synchronism, this error is taken into account, which ensures an exact match of the emitted frequency of this and the master devices.

The type of pseudo-random sequence uniquely identifies the master transceiver, and its phase (pseudo-random shift) is the address characteristic of the slave device. The repetition period of the sequence that determines the frequency tuning law is quite long (over 23 hours). Each piconet uses its own pseudo-random sequence, which allows multiple piconets to operate simultaneously on the same communication channel without causing mutual interference.

All devices in the piconet are equal and have the same capabilities(unlike cellular networks, where the base station is fundamentally different from the subscriber station both in capacity and composition technical means). The only difference is the status of the devices (master and slaves).

The master device controls all traffic in the piconet and distributes throughput SCO lines between slave transceivers. In an ACL line, slave devices operate alternately; they are allowed to transmit information only in specially designated windows, which are indicated in service messages. The introduction of a centralized polling mode allows you to avoid conflicts.

Prospects for the development of Bluetooth


This technology is expected to be compatible with a wide variety of protocols and systems. Low cost, high degree of protection, convenience and ease of use- very significant advantages of the standard. Using 2.4 GHz frequency does not require licensing, and the distribution of other licenses for working with Bluetooth is carried out for a nominal fee. In addition to public availability, this technology promises to become generally accepted, since in the near future the global industrial community will accept the technology as a global standard. This unity is due to the fact that it is much easier and cheaper to supply all devices with standard chips rather than to develop computers for different interface cards. Cheapness network adapters will allow them to be built into literally all means of communication, household appliances, computers and other office equipment.

The user benefits that technology brings to the table are extremely tempting and are sure to be extremely popular. Let's say, when you come to the office, your pocket computer is immediately automatically synchronized with your desktop PC, and new contacts are transferred to your mobile phone. The technology will allow you to combine any electronic devices, right down to refrigerators, washing machines, microwave ovens and door locks. Just imagine how your refrigerator transmits information to your mobile phone that it is out of certain types of products, and it, in turn, replenishes the list of necessary purchases on your PDA.