Bluetooth and General Packet Radio Service (GPRS) are usedwidely today to make devices on the move Internet accessible. Bluetoothis a low-range wireless technology that can be made a part of almost any devicedue to its low cost and power consumption, GPRS offers always-onconnectivity to the Internet.
Bluetooth and GPRS can provide standalone network connectivityto your PDA or laptop. Bluetooth roaming enables continuousconnectivity when you move your device from one floor of your buildingto another, and GPRS roaming preserves your Internet connection whenyou are on the road and move from one service provider's area toanother. Figure 1 describes some of these scenarios.
Download File ✪✪✪ https://www.google.com/url?hl=en&q=https://mciun.com/2yM7bI&source=gmail&ust=1719713433006000&usg=AOvVaw0NWGFJ2tstCKBwaoNB7pJJ
Because Linux runs on a variety of embedded devices includingBluetooth-aware consumer electronics devices, GPRS cell phones andwireless-enabled PDAs, a discussion on how Linux works with Bluetoothand GPRS can be helpful in using and designing such devices.
Bluetooth is a protocol for wireless communication using radiofrequency and was conceived as a replacement for cables. It supportsspeeds of 723 kbps(asymmetric) and 432 kbps (symmetric) and it can beused to transfer both data and voice. Bluetooth devices have a rangeof about 10 meters (30 feet).
BlueZ supports the core Bluetooth protocols, including host controlinterface (HCI), logical link control and adaptation protocol (L2CAP),personal area networking (PAN), service discovery protocol (SDP),synchronous connection oriented (SCO) audio and serial port emulation(RFCOMM). It also comes bundled with a bunch of user space dmons andconfiguration tools.
BlueZ supports the different user profiles described by the Bluetoothspecification. BlueZ BNEP (Bluetooth Network Encapsulation Protocol)implements Ethernet emulation, which lets TCP/IP run directly overBluetooth. The BNEP module, together with a user mode dmon calledpand implements Bluetooth PAN. BlueZ RFCOMM allows serial portapplications, such as terminal emulators, and protocols, such as point-to-pointprotocol (PPP), to run unchanged over Bluetooth. The RFCOMM module,along with a user mode dmon called dund implements Bluetoothdial-up networking.
The Bluetooth specification defines the use of UART and USB transportmechanisms to transfer HCI packets between a Bluetooth device and ahost system. For UART interfaces, the main protocols available to encapsulate HCI packets are H4/UART and Blue Core SerialProtocol (BCSP). Whereas H4 serves as the standard method fortransmitting Bluetooth data over a UART interface, BCSP is aproprietary protocol from CSR that supports error checking andretransmission. BlueZ supports both H4 and BCSP. If the Bluetooth chipused on your board has a UART interface to the host processor and isprogrammed to encapsulate HCI packets using BCSP, you need toinform the BlueZ stack of this. Do so using hciattach: hciattach ttySxbcsp, where x is the UART channel number connected to theBluetooth chip. The BlueZ UART link driver hci_uart now talks to thechip using BCSP and passes the Bluetooth data to and from the BlueZstack.
BlueZ also supports the transfer of audio data to devices such asBluetooth headsets. An application on the host Bluetooth device usesBlueZ SCO APIs to send audio data to the headset. The audio datapumped through the SCO APIs has to be in a format understood bythe headset, for example, A-law pulse code modulation (PCM) formatis used for the Sony Ericsson HBH-30 Bluetooth headset. If the Bluetoothchipset on your host device has a PCM interface connected toanother audio source, you might have to configure the chipset toreceive the SCO audio over its HCI interface rather than over its PCMinterface.
BlueZ utilities can be used to set up Bluetooth connections. Forexample, the hcitool utility can be used to initiate an inquiryprocess and discover the names and Bluetooth addresses of units within range. You then can set up a PAN or a dial-up connection toa discovered Bluetooth device using pand or dund. The sdptoolprogram can be used to register or search for a service, say, printingor networking. The important BlueZ user space dmons,utilities and kernel modules, along with a brief description of each, arelisted below:
The Sharp Bluetooth CF card uses a UART transport to transfer HCIpackets. serial_cs, the generic card service driver used foraccessing PCMCIA serial devices, emulates a serial port over the SharpCF card. The first unused serial device (/dev/ttySx) is allotted tothe card. When the Sharp Bluetooth CF card is inserted, the kernelPCMCIA card services module parses the card information structure(CIS) tuples resident in the card's attribute memory and passes themup to the user mode cardmgr dmon.
Because the manufacturer IDtuple in the card's CIS matches an entry in the PCMCIA configurationfile, /etc/pcmcia/config as shown in Listing 1, cardmgr binds the cardto the serial_cs device. Card services then invokes the serial_csmodule's PCMCIA event handler and signals a card insertion event,which configures the socket and makes the card available to thesystem. Also, because the device is of class Bluetooth, cardmgrexecutes the script /etc/pcmcia/bluetooth while starting and stopping thedevice; the exact location of allconfiguration files depend on the Linux distribution used. This script can, among other things,load the BlueZ kernel modules listed above and attach the BlueZstack to the virtual serial port allotted to the card.
Some PCMCIA/CF Bluetooth cards, such as the Socket Bluetooth CF card, havespecific BlueZ card service device drivers that directly control theUART in the card and transport the data to the HCI layer. For example,the Socket Bluetooth card, built around a Nokia Bluetooth chipset, usesthe dtl1_cs card service driver. In this case, the data flow doesnot pass through the legacy serial driver or through the N_HCI linediscipline. Instead, the PCMCIA interrupt handler that is part ofdtl1_cs allocates skbuffs and populates them with the receivedBluetooth data. The rest of the code flow through the BlueZ stack issimilar to that described for the Sharp card. Another example of adevice that has a specific BlueZ card service driver is the PretecCompactBT Bluetooth card, which has a driver called bt950_cs.
When Bluetooth is used in tandem with GPRS to network-enable a dumbdevice, a Bluetooth-aware GPRS cell phone usually acts as the gatewayto the network. However, when Bluetooth is being used as a means forstandalone Internet connectivity, network traffic is routed by way of aBluetooth access point.
An access point is a Bluetooth gateway and usually supports additionalnetwork interfaces, such as Ethernet or DSL. Typically, an access pointalso can act as a DHCP server and dole out IP addresses on theBluetooth side.
When you walk around a building with your Bluetooth device, you couldmove out of range of one access point and enter the range ofanother. Depending on the link quality, which can be queried using aHCI command, your mobile device can maintain constant connectivity toa computer on a fixed network by switching to a new access point. Tomaintain seamless roaming for different higher layer networkingprotocols, you might need to implement extra software layers on yourdevice. However, continuous Web browsing capability can be maintainedby sending out a fresh DHCP request when your device switches to a newaccess point.
GPRS is a packet service for carrying data over GSM, the prominentdigital cellular standard. Data over GPRS is an always-connected,packet-switched data stream where users pay according to usage. GPRScan run at speeds of 56 kbps to 170 kbps. The GPRS network connects tothe Internet through a GGSN (gateway GPRS support node), as shown inFigure 1.
GPRS devices usually have a UART interface to the host system. Forexample, some cell phones have a Siemens MC-45 chipset connected to anon-board UART channel. The legacy serial device driver then can beused to talk to the GPRS device. For a GPRS card with a PCMCIA/CF formfactor (an Options GPRS card, for example), the generic serial cardservice driver discussed earlier can be used to let the kernel see thecard as a serial device. For USB GPRS modems, a USB-to-serialconverter typically converts the USB port into a virtual serial port,so the rest of the system sees it as a serial device.
where 1 stands for the context number, IP is the packet type,internet2.voicestream.com is an access point name (APN) string specific to the GPRS service provider and 0.0.0.0 implies thatthe service provider assigns your IP address. The remaining parameterspertain to header and data compression. A user name and password usually are not needed. The APN string depends on the kind of service is desired. You would need to use one APN for Internet-over-GPRS,but a different one to browse dedicated wireless application protocol(WAP) content.
where ttySx is the physical or virtual serial device over which PPPruns and connection-script is a file in the /etc/ppp/peers/directory that contains the AT command sequences exchanged betweenpppd and the service provider in order to establish a link. Afterestablishing the link connection and completing authentication, PPPstarts a network control protocol (NCP). Internet protocol controlprotocol (IPCP) is the NCP used for running IP. Once IPCP successfullynegotiates IP addresses, PPP starts talking with the TCP/IP stack.Your device now is ready to run TCP/IP applications over the GPRSlink.Listing 2 is an example PPP connection script for connecting yourdevice to a GPRS service provider.
To get a list of service providers in your current location, you canissue the AT+COPS=? command to the GPRS module. Tomaintain continuous connectivity, a Linux application can monitor theavailable service providers in the current area and restart the PPPsession using the connection-script for the new service provider, if aswitch is deemed necessary.
The cell phone talks with Bluetooth devices over a Bluetooth dial-up(RFCOMM) connection and pipes data between the RFCOMM connection andits GPRS interface. The Bluetooth devices directly establish a PPPconnection to the GPRS service provider by sending GPRS commands overthe RFCOMM link.
7fc3f7cf58