Smartphone Operating System (779883), страница 53
Текст из файла (страница 53)
Find at least three such relationships in the operatingsystem of your choice and report them.3.In a mobile phone call, there are a series of client–server relationshipsthat are established. Identify these and report them.246MODELING COMMUNICATIONS4.Describe how a web page is requested and delivered between a webbrowser and a website.
Identify the client–server relationships in thesequence of events.5.Invent a communications stack for a person who speaks French toget a message (spoken by him in French) to a colleague in Germany.The message must be received the same day and must be in Germanwhen it reaches the colleague.6.In Symbian OS, Bluetooth communications is done primarily throughsockets.
Explain why this is preferred to just opening the Bluetoothdevice and reading from and writing to it.7.An application needs to open a socket to a web server, send a requestand read a web page. Describe the events that would be generatedby that sequence of operations.12TelephonyThe convergence of telephony and handheld computing devices has hada long history. Modems have been available commercially since the1960s and, from that time, telephony services and computers have beenlinked.
As integrated devices were developed, control over telephonyfunctions became a more crucial issue for operating system designers.The support of telephony had to adhere to the communications modelsthat have governed all computer communications. Telephony functionality became an important component of Symbian OS even beforethe first true Symbian OS phones (the Ericsson R380 and Nokia 9210Communicator) shipped, with core functionality to support a ‘two-box’connection (PDA to phone) appearing for the original Psion Series 5range.
These devices demonstrated how telephony communications andcomputing capability – integrating data and voice capability – can bemutually beneficial.This chapter examines how operating systems can support telephony.Symbian OS obviously stands out as a great example of telephonysupport.
A wide variety of telephony functions and uses are providedby the Symbian OS ETel telephony subsystem. This chapter gives anoverview of telephony services and the operating systems componentsthat implement them. We then take a look at the ETel model and itsinterfaces by examining the different situations it was designed to addressand looking at the structure of the APIs. We dig into the details of ETel bylooking at the main aspects in its design.24812.1TELEPHONYModeling Telephony ServicesCommunication using a conventional analog telephone is usually splitinto two forms: data and voice communication.
Data communication overa telephone is handled by a modem, a digital-to-analog converter. Digitalcommunication in the form of binary data is converted to analog audiorepresentation that can be sent between telephones over conventionalphone systems. At the other end, the reverse process takes place.The computer controls the modem by using a set of commands. TheHayes command set, for example, is by far the most widely used setof commands for modems. Hayes-format commands take the form of‘AT’ commands: the character sequence ‘AT’ followed by characters tocommand the modem to do certain tasks. To initialize a modem andcause it to dial a number, for example, we might give it the followingcommand string:ATQ0E1DT555-3454This string tells the modem to send result codes back to the computerin response to commands, echo back the commands sent to the modemand tone-dial the number 555-3454.Voice communication via both the public-switched-telephone network(PSTN) and the mobile phone network (for example, GSM) is effectively apeer-to-peer connection, where the ‘address’ of the remote device is thetelephone number being dialed.
The telephone number is accepted bythe telephone-network-switching infrastructure and a connection is madebetween the local and remote devices, until one or both terminate theconnection by ‘hanging up’. A telephone may be able to handle severaltelephone lines; each line can typically multiplex several phone calls atonce, by working appropriately with the telephone system.Telephone networks can be wired (‘landline’ PSTN networks) or wireless (mobile phone networks).
Of the possible equipment and switchingnetwork combinations, digital choices have emerged as the most promising for the future. Digital switching has replaced more antiquated step andcross-bar exchanges within the PSTN. A GSM phone is a good exampleof digital phone equipment using a digital connection network; GSM isa frame-based protocol that sends data frames of a fixed size for a fixedtime interval, mixing these frames with others.
The phone must also bea digital device to use the digital network, and may offer the capabilityof being controlled by an external computer to turn it into an advancedMODELING TELEPHONY SERVICES249modem capable of using the digital network on behalf of another device.A Nokia E61, for example, has an infrared port that allows it to acceptcommands from an external device.The communications model of an operating system can be extendedto include telephony as a core feature. How well telephony works withan operating system depends on the operating system architecture and itshistory.In a conventional operating system, working with telephony servicesmeans using system calls to interact with a telephony device.
The operating system usually works with a telephony device in either of twoextremes: a very abstract way or methods that are low-level and concrete.For example, Linux treats a telephony device as any other device andallows ioctl() calls – low-level system calls that can manipulate anydevice – to interact with device drivers and control the telephony device.On the other hand, Microsoft Windows Mobile treats the phone portionof handheld computer as an object and provides a way to work with itthrough the object interface. For example, in a Windows Mobile application that implements dialing a phone number, you might find code likethis (written in C#):Phone myPhone = new Microsoft.WindowsMobile.Telephony.Phone();myPhone.Talk("555-7341\0");Whether an interface uses high- or low-level manipulation, the controlof the phone device is direct via a kernel-mode driver.In microkernel architectures, devices are controlled by servers thatprovide a high level of abstraction to multiple clients, forcing manipulation of devices to take place through this abstraction.
Thus, microkernels use telephony servers to provide telephony services throughstandard client–server relationships with other processes. Symbian OS,for example, implements an ETel server that provides access to telephonydevices. Applications interested in making a phone call must connectwith this server and send it requests.By way of understanding telephony communication, we examine theSymbian OS telephony subsystem in more detail. This study serves asan example of a microkernel implementation of telephony as well as ofSymbian OS design.Telephony implementations demonstrate what we have been illustrating all through this book: various operating systems do things at variouslevels of abstraction.
Linux is perhaps the least abstract while Symbian250TELEPHONYOS is perhaps the most abstract. Because these abstraction levels are bydesign, we cannot simply ask which one is best. We have to ask whichone is the best in its area of application and its audience of developers.12.2A Structural OverviewThe communications model Symbian OS uses to implement telephony isabstract enough to provide the application programmer with a consistent,standard interface, no matter what kind of telephony device is being used.The Symbian OS telephony subsystem closely models the real-worlduser experience of using telephones (Figure 12.1).The model characterizes telephony as a collection of phones. Eachphone is an abstraction of a telephony device (e.g., a modem or aGSM phone; usually only one exists per phone, which corresponds tothat particular device’s radio hardware setup such as GSM, UMTS orTelephonyserver...phonephonephone......linesphonelines......lineslinescallscallscallscallsFigure 12.1 The ETel phone modelA STRUCTURAL OVERVIEW251CDMA).
Through this abstraction, we can access a device’s status andcapabilities and be notified if changes occur to a device’s properties. Aphone can have one or more lines. An application can access the statusand capabilities of a line, as it can for a phone, and can be notified of anychanges in these features. Lines usually correspond to specific telephonyservices (e.g. voice, fax, circuit-switched data, etc.).The actual connection of a local endpoint through a circuit-switchednetwork to the phone is designated as a call. A line can have zeroor more active calls.
A call can dial a number, wait on a line for anincoming call and be terminated. As with lines, an application can getstatus and capabilities information for a call and be notified of changesto a call’s state.These abstractions are central to the use of the Symbian OS telephonysubsystem through the ETel APIs.TSY Modules in Symbian OSThe heart of this model’s implementation is in the TSY module.