DMSS Ui
DMSS Ui
User Guide
80-V0280-1 X4
November 27, 2000
QUALCOMM Incorporated
5775 Morehouse Dr.
San Diego, CA 92121-1714
U.S.A.
QUALCOMM Incorporated
5775 Morehouse Dr.
San Diego, CA 92121-1714
U.S.A.
All data and information contained in or disclosed by this document is confidential and proprietary information of
QUALCOMM Incorporated, and all rights therein are expressly reserved. By accepting this material the recipient agrees
that this material and the information contained therein is held in confidence and in trust and will not be used, copied,
reproduced in whole or in part, nor its contents revealed in any manner to others without the express written permission
of QUALCOMM Incorporated.
Export of this technology may be controlled by the United States Government. Diversion contrary to U.S. law
prohibited.
Restricted Distribution: This document contains critical information about QUALCOMM products and may
not be distributed to anyone that is not an employee of QUALCOMM without the approval of Configuration
Management.
QUALCOMM is a registered trademark and registered service mark of QUALCOMM Incorporated. Other product and
brand names may be trademarks or registered trademarks of their respective owners.
Information in this document is preliminary and subject to change and does not represent a commitment on the part of
QUALCOMM Incorporated.
80-V0280-1 X4
3 Design................................................................................................. 3-1
3.1 Introduction .........................................................................................................3-1
3.2 UI architecture .....................................................................................................3-1
3.3 File organization ..................................................................................................3-3
3.4 UI layers ..............................................................................................................3-6
3.4.1 Dispatcher layer (ui.c).............................................................................3-6
3.4.2 Handler layer ..........................................................................................3-7
3.4.2.1 Signal handler (uihsig.c) .........................................................3-7
3.4.2.2 Key handler (uihkey.c) ...........................................................3-8
3.4.2.3 Callback timer handler (uihcbt.c) ...........................................3-8
3.4.2.4 Command handler (uihcmd.c) ................................................3-9
3.4.3 State machine layer...............................................................................3-11
3.4.4 Events ...................................................................................................3-11
3.4.5 States.....................................................................................................3-13
3.4.5.1 Major states...........................................................................3-14
3.4.5.2 Minor states ..........................................................................3-15
3.4.6 Major state machine..............................................................................3-16
3.4.7 Minor state machines ............................................................................3-18
3.4.7.1 UI_OFF_S state machine (uisoff.c) ......................................3-18
3.4.7.2 UI_LOCKED_S state machine transitions ...........................3-18
3.4.7.3 UI_STARTUP_S state machine (uisstrt.c) ...........................3-18
3.4.7.4 UI_IDLE_S state machine (uisidle.c) ...................................3-19
3.4.7.5 UI_CODE_S state machine (uiscode.c)................................3-19
3.4.7.6 UI_CALL_S state machine (uiscall.c)..................................3-20
3.4.7.7 UI_CLI_S state machine (uiscli.c)........................................3-21
3.4.7.8 UI_MESSAGE_S state machine (uismsg.c).........................3-22
3.4.7.9 UI_INFO_S state machine (uisinfo.c) ..................................3-22
3.4.7.10 UI_RCL_S state machine (uisrcl.c) ....................................3-23
3.4.7.11 UI_STO_S state machine (uissto.c)....................................3-25
3.4.7.12 UI_MENU_S state machine (uismenu.c) ...........................3-26
3.4.7.13 UI_SERVICE_S state machine (uisserv.c).........................3-30
3.4.7.14 UI_MULTIMEDIA_S state machine (uismm.c) ................3-33
3.4.7.15 UI_NUMEDIT_S state machine (uisnum.c).......................3-34
3.4.7.16 UI_ALPHAEDIT_S state machine (uisalpha.c) .................3-34
3.4.7.17 UI_LIST_S state machine...................................................3-35
3.4.7.18 UI_HELP_S state machine (uishelp.c) ...............................3-35
3.4.7.19 UI_SMS_S state machine (uissms.c)..................................3-36
3.4.7.20 UI_HEXEDIT_S state machine (uishexed.c) .....................3-37
3.4.7.21 UI_GPS_S state machine (uisgps.c) ...................................3-38
3.4.7.22 UI_BT_S state machine (uisbt.c)........................................3-39
3.5 UI interface........................................................................................................3-40
3.5.1 UI interface – Input...............................................................................3-40
3.5.1.1 Signal interface module (rex.c).............................................3-40
3.5.1.2 Key interface module (uihkey.c) ..........................................3-40
3.5.2 UI interface – Output ............................................................................3-41
3.5.2.1 Sound interface module (uixsnd.c) .......................................3-41
3.5.2.2 Screen interface module (uixscrn.c) .....................................3-42
Figures
Figure 2–1 UI context diagram....................................................................................... 2-2
Figure 3–1 UI architecture.............................................................................................. 3-1
Figure 3–2 Voice call setup and mobile release ........................................................... 3-60
Figure 3–3 Voice call setup and base station release ................................................... 3-61
Figure 3–4 Failed voice call setup................................................................................ 3-62
Figure 3–5 Incoming voice call .................................................................................... 3-62
Tables
Table 1-1 Revision history ............................................................................................. 1-2
Table 2-1 Tasks and services.......................................................................................... 2-2
Table 2-2 Task priorities................................................................................................. 2-9
Table 3-1 UI architecture................................................................................................ 3-2
Table 3-2 UI software files............................................................................................. 3-4
Table 3-3 Signal handler signals .................................................................................... 3-7
Table 3-4 Callback timers............................................................................................... 3-8
Table 3-5 CM and SMS tasks......................................................................................... 3-9
Table 3-6 Internal events to the UI state machine ........................................................ 3-11
Table 3-7 External events to the UI state machine ....................................................... 3-11
Table 3-8 Major states .................................................................................................. 3-14
Table 3-9 List state minor states................................................................................... 3-15
Table 3-10 Major state machine transitions.................................................................. 3-16
Table 3-11 UI_LOCKED_S state machine transitions................................................. 3-18
Table 3-12 UI_STARTUP_S state machine transitions ............................................... 3-18
Table 3-13 UI_IDLE_S state machine transitions........................................................ 3-19
Table 3-14 UI_CODE_S state machine transitions ...................................................... 3-19
Table 3-15 UI_CALL_S state machine transitions ...................................................... 3-20
Table 3-16 UI_CLI_S state machine transitions .......................................................... 3-21
Table 3-17 UI_MESSAGE_S state machine transitions .............................................. 3-22
Table 3-18 UI_INFO_S state machine transitions........................................................ 3-22
Table 3-19 UI_RCL_S state machine transitions ......................................................... 3-23
Table 3-20 UI_STO_S state machine transitions ......................................................... 3-25
Table 3-21 UI_MENU_S state machine transitions ..................................................... 3-26
Table 3-22 Menu levels 1 and 2 ................................................................................... 3-27
Table 3-23 UI_SERVICE_S state machine transitions ................................................ 3-30
Table 3-24 Service menu options ................................................................................. 3-32
Table 3-25 UI_MULTIMEDIA_S state machine transitions ....................................... 3-33
Table 3-26 UI_SERVICE_S state machine transitions ................................................ 3-34
Table 3-27 UI_ALPHAEDIT_S state machine transitions........................................... 3-34
Table 3-28 UI_LIST_S state machine transitions ........................................................ 3-35
Table 3-29 UI_HELP_S state machine transitions ....................................................... 3-35
Table 3-30 UI_SMS_S state machine transitions ......................................................... 3-36
Table 3-31 UI_GPS_S state machine transitions.......................................................... 3-38
Table 3-32 UI_BT_S state machine transitions............................................................ 3-39
Table 3-33 Signal handler signals ................................................................................ 3-40
Table 3-34 Signal handler signals ................................................................................ 3-40
Table 3-35 Commands used by the state machine........................................................ 3-41
Table 3-36 Screen manager service routines ................................................................ 3-44
Table 3-37 Call Manager service routines.................................................................... 3-45
Table 3-38 NV Manager service routines..................................................................... 3-46
Table 3-39 Database service routines ........................................................................... 3-47
Table 3-40 Database service items read by the UI ....................................................... 3-47
Table 3-41 Database service item modified by the UI ................................................. 3-47
Table 3-42 Sleep task service routines ......................................................................... 3-48
Table 3-43 Watchdog task service routines.................................................................. 3-48
Table 3-44 Clock interface service routines ................................................................. 3-49
Table 3-45 Battery interface service routines ............................................................... 3-49
1 1.1 Purpose
2 The purpose of this document is to describe the design of the DMSS User Interface (UI). This
3 document contains descriptions of how the UI fits into the overall architecture of the phone and its
4 interactions with other parts of the phone. It also includes descriptions of the detailed internal design
5 of the UI software.
6 1.2 Scope
7 This document is limited to a description of the UI and its interaction with other entities of the phone.
8 The main purpose of the document is to highlight the functionality needed from the UI rather than to
9 serve as a tutorial on other phone entities. It is written for engineers who need to understand how the
10 UI works and for those who might be tasked with maintaining the software. This document assumes
11 that the reader has a rudimentary understanding of QUALCOMM CDMA Technologies phone
12 software and is familiar with its general architecture.
13 1.3 Organization
14 This document is organized into the following chapters:
15 ■ Introduction – purpose and scope of the document
16 ■ Overview – description of:
17 ❒ Overall QUALCOMM CDMA Technologies software architecture
18 ❒ UI and other parts of phone with which the UI interfaces
19 ■ Design – description of the UI design to give the reader sufficient understanding of how the UI is
20 put together
21 ■ Modification Examples – examples of how something in the UI can be modified for future
22 improvements
1 1.4 Conventions
2 Function declarations, function names, type declarations, and code samples appear in a different font.
3 For example: #include
4 Shading indicates content that has been added or changed for this revision of the document.
1 2.1 Introduction
2 The overall system architecture from the perspective of the UI is described in this chapter.
3 “UI perspective” refers to a view that is limited to the entities with which the UI interacts; all other
4 entities are excluded. A description is provided of the functionality of each entity that is identified.
5 Also included is a description of how each of those entities interfaces with the UI.
NOTE The following graphic was updated for this revision of the document.
10
USER INTERFACE HS
SND
Services
3 Tasks and services that are described in this chapter include those listed in Table 2-1. Services differ
4 from tasks in that service routines are performed in the UI task context.
1 2.3 Tasks
1 2.3.2.1 Keypad
2 The UI views events as a key that is being pressed. This model allows for the easy addition of other
3 handset features as necessary. This means that in addition to the key code for any event, the UI will
4 want to see a key-released event. Extra “events” that appear as keys include:
5 ■ Power on and off events
6 ■ Power-up-timer on and off events
7 ■ Ignition on and off events
8 ■ Phone-placed-in-cradle and lifted-from-cradle events
9 The UI will register with the handset task using hs_key_init() to inform it that UI_KEY_SIG
10 needs to be set for every incoming character.
11 Note that the action of placing the phone in and lifting it out from the cradle should appear as key
12 events to the UI, each with their appropriate “key-down” and key-up codes. Decoded DTMFs will
13 also appear as “keys” being pressed.
14 The UI expects the handset task to provide the following on every power up with the appropriate key
15 events in the handset buffer:
16 ■ State of the power switch
17 ■ State of the ignition switch
18 ■ Phone in or out of the hands-free cradle
19 2.3.2.2 Screen
20 Whenever the screen needs to be updated, the UI will call the display-screen update function with a
21 pointer to the new screen layout. The UI and the screen handler both need to know the height and
22 width of the screen.
23 The screen handler will compare the incoming screen to the current screen. It will attempt to make the
24 incoming screen look like current screen; however, this is dependent on the hardware and is not
25 within the province of the UI. If a new screen is passed in while a screen refresh is occurring, the
26 current screen refresh should be abandoned, if possible, so that response is as fast as possible.
27 Other features supported are backlight control and setting of annunciators.
11 The EFS task is a consistent, device-independent file management system that provides standard
12 interfaces to any application that needs to access the non-volatile memory. In addition to standard
13 routines for opening, closing, reading, and writing files, EFS also provides a variety of other useful
14 routines for directory and file manipulation.
15 One of the ways the UI uses EFS is for storing of multimedia data, such as MIDI files.
19 The PDSM task provides the interface by which applications/UI can get position location information
20 about their current location. Tasks communicate with the PDSM task by calling PDSM-provided
21 functions. These functions put the commands in the PDSM command queue and set a signal to alert
22 the PDSM task that it has a command that needs to be processed. The PDSM task uses events to
23 return information to the application/UI. The following is an example of the kind of location
24 information that may be returned to the application.
25 ■ Latitude
26 ■ Longitude
27 ■ Position uncertainty in meters
28 ■ Heading
29 ■ Horizontal/vertical velocity
30 ■ Height
4 The BT task provides the interface by which applications/UI can get perform a variety of Bluetooth
5 operations. Tasks communicate with the BT task by calling BT-provided functions. These functions
6 put the commands in the BT command queue and set a signal to alert the BT task that it has a
7 command that needs to be processed. The BT task uses events to return information to the
8 application/UI. The following list is some of the BT interfaces currently used by the UI.
9 The UI sends commands to the BT task to:
10 ■ Enable/Disable network access
11 ■ Enable/Disable audio gateway
12 ■ Query what BT devices are within range
13 ■ Get the name of a BT device that is within range
14 The BT task sends events to the UI when:
15 ■ A BT connection is established
16 ■ A BT connection is lost
17 ■ Device Discovery data is available
1 2.4 Services
30 The devmap service centralizes the logic for device assignments and ensures the proper sequencing of
31 device assignments. Devmap services provide routines to map a selection of physical devices to a
32 selection of applicable services. An example of this may be mapping data services to uart2.
1 3.1 Introduction
2 The UI software design is described in this chapter. Design topics include the UI software
3 architecture, the components of the architecture, and various UI features.
4 3.2 UI architecture
5 The UI architecture is shown in Figure 3–1. The UI communicates to all external entities through a
6 well-defined API. In most cases, there is a module within the UI that clearly defines this API. In some
7 cases, such as database items, the UI uses the API provided by the external entities themselves. This
8 is referred to as “Virtual External Interface” in the diagram below.
Dispatcher
Signal Handler
External Virtual
Legend: Task service Interface Ext. Intf
9
Architecture Description
UI layers
■ Dispatcher layer The top layer of the UI.
■ Handler layer The signals are the primary input to the UI.
❒ Callback timer handler
❒ Key handler
❒ Command handler
■ State machine layer Main processing unit of the UI.
UI interface to other entities
■ Signals Modules for handling input to the UI
■ Screen Modules for handling output from the UI
■ Sound
■ Battery Modules for handling services required by/requested of the UI software
■ Clock
■ CM
■ DB
■ NV
■ Sleep
■ UASMS
■ Watchdog
■ devmap
■ gpsOne
■ Multimedia
■ Bluetooth
■ EFS
2
uih H – Handlers
The UI receives input through signals, queue messages, and keys. Extensive
processing is done on the signals before they can be fed to the state machine.
These “handler” functions transform the command to events that the state machine
can understand.
uis S – State
All state machine processing including state machine and all state transition
actions.
uix X – External (to UI) Interface
All UI files that interface to external entities. These files contain the API to access
an external entity. For example, uixsnd.h and uixsnd.c define the interface and
implementation of sound related API. Similarly, uixscrn.h and uixscrn.c define the
interface and implementation of screen related API.
uiu U – Utility
All the utility functions that do not fall into any of the above categories.
9
1 The following table lists all the files that make up the UI software.
Name Comments
ui.h Interface to UI the task
ui.c Initialization and main command dispatcher
Handler files
uihsig.c Signal handler; feeds signals to appropriate handlers
uihkey.c Key handler; converts keys to state machine events
uihcbt.c Callback timers
uih.h Handler header file
uihcmd.c, uihcmd.h Q commands; converts commands to state machine events
State files
uistate.c, uistate.h State machine event dispatcher
uisalph.c Alpha edit
uisbt.c, uisbt.h Bluetooth
uiscall.c, uiscall.h Call
uiscli.c CLI
uiscode.c Code
uisgps.c, uisgps.h GPS
uishelp.c Help
uishexed.c Hex edit
uisidle.c Idle
uisinfo.c Info
uislist.c List
uislock.c Lock
uislpm.c Low Power Management
uismenu.c, uismenu.h Menu
uismm.c, uismm.h Multimedia
uismsg.c Message
uisnum.c Number Edit
uisoff.c Off
uisrcl.c Recall
uisserv.c Service Menu
uissms.c, uissms.h SMS
uissto.c Store
uisstrt.c Start-up
uisview.c, uisview.h View
Name Comments
Utility files
uiuint.h Internal UI defines
uiudata.c, uiudata.h Data utility file
uiumenu.c, uiumenu.h Menu definitions
uiusmsd.c, uiusmsd.h SMS display functions
uiusmsl.c, uiusmsl.h SMS list functions
uiutstmn.c, uiutstmn.h Test menu
uiutxt.c, uiutxt.h Text definitions
uiutxti.h Internal text defines
External interface files
uixscrn.c, uixscrn.h Interface to the Screen task
uixsnd.c, uixsnd.h Interface to the Sound task
uixnv.c Interface to the NV task
uixcm.c, uixcm.h Interface to the CM task
uixuasms.c, uixuasms.h Interface to the SMS task
1
1 3.4 UI layers
2 The UI software is divided into three major layers – dispatcher, handler, and state machine. The first
3 two layers are responsible for control aspects of the UI. For example, deciphering the meaning of the
4 input and directing the control flow to call the proper processing function. The state machine layer
5 performs all the processing necessary to carry out functions.
42 Refresh screen;
43 }
44 }
7 This module handles most of the signals that are received by the UI task. Where appropriate, the
8 signal handler converts the signals into events and feeds them to the state machine for processing.
9 Signals
10 The UI task receives signals that inform it of various events. The signal wakes up the UI task to let it
11 know that an operation needs to be performed. The signals are listed in Table 3-3.
Name Description
UI specific signals
UI_KEY_SIG Key from HS task; invokes handle_keys().
UI_CMD_Q_SIG Something on the command queue; invokes ui_handle_cmds().
UI_TIMERS_SIG Any of the callback timers; invokes ui_timers().
UI_RPT_TIMER_SIG Time to kick watchdog; invokes ui_kick_dog().
UI_MULTI_STOP_SIG Multitone has ended, alert the state machine.
UI_RING_SIG End of a ring from SND task; count rings and pass it to the state machine.
UI_NV_SIG Return from NV. *** This signal is not handled here.***
It is received and processed when NV read/write is performed. By explicitly
waiting for this signal (in uixnv.c), UI task achieves the synchronous NV
read/write.
Common signals
TASK_START_SIG Start. *** This signal is not handled here.***
During the UI task startup, MC sets this signal for the UI to continue initialization.
This is the only signal Dispatcher layer explicitly handles.
TASK_STOP_SIG Powerdown. It is not all the time that we powerdown when user presses the
power key. Some times (OTASP) the MC task alerts us that we need to power
down; alert the state machine and acknowledge the MC task that we are powered
down.
TASK_OFFLINE_SIG Go offline, alert the state machine and acknowledge the MC task that we are
offline.
13
2 This module handles the key press messages passed from the HS task whenever the user presses a
3 key. The key handler converts these key presses into events. It adds these converted events to the
4 event queue for subsequent processing by the state machine.
5
handle_keys() Converts key press messages into UI events and feeds them to the state machine
6
8 The callback timers are used to get a signal at appropriate intervals to perform useful operations. This
9 module uses a global variable, timeflags, and allocates a bit for each callback timer used. An
10 appropriate bit is set or reset when a callback timer is started or expired. This module converts the
11 signal into an appropriate state machine event.
12
handle_timers() Convert callback timer signal into UI events and feed them to the state machine
13
2 This module converts messages from other tasks into events and feeds them to the state machine for
3 processing.
4
6 Commands
7 The commands are the input to the UI that are placed on the command queue when the UI receives
8 the UI_CMD_Q_SIG. Upon receiving the signal, the UI reads the command queue to determine what
9 its next action should be. The commands are sent to the UI from other tasks to request that the UI
10 perform an operation.
11 Some of the commands are generated internally by the interface modules such as uixcm.c and
12 uixuasms.c. The CM and SMS tasks generate events to these modules, which in turn translate them
13 into commands that the UI task understands.
Name Description
Name Description
UI_CALL_PRIVACY_CHANGED_F The voice privacy is changed
UI_CALL_CALLER_ID_F Caller ID could be call waiting
UI_CALL_FLASHED_F A flash is sent
UI_CALL_SIGNAL_F New for ring event from base station
UI_CALL_ABRV_ALERT_F Generate a CDMA/AMPS abbreviated alert
UI_CALL_ABRV_REORDER_F Generate an AMPS abbreviated reorder
UI_CALL_ABRV_INTERCEPT_F Generate an AMPS abbreviated intercept
UI_CALL_DISPLAY_F Display CDMA information
UI_CALL_CALLED_PARTY_F Called Party information
UI_CALL_CONNECTED_NUM_F Responding party information
UI_CALL_EXT_DISPLAY_F Extended display
UI_CALL_NDSS_START_F NDSS start
UI_CALL_NDSS_CONNECT_F NDSS connect
UI_PH_INUSE_STATE_F IN_USE state is changed
UI_PH_SRV_STATE_F Service state is changed
UI_PH_OPRT_MODE_F Operating mode is changed
UI_PH_CDMA_LOCK_MODE_F CDMA lock mode is changed
UI_PH_MODE_PREF_F Preferred mode is changed
UI_PH_SYS_PREF_F Preferred system is changed
UI_PH_ANSWER_VOICE_F Answer voice as data setting is changed
UI_PH_RES_LEVEL_F Restriction level is changed
UI_PH_CURR_NAM_F Current NAM is changed
UI_PH_NAM_SEL_F NAM selection is changed
UI_PH_ROAM_STATUS_F Roaming status is changed
UI_PH_INFO_AVAIL_F Phone information is now available
UI_PH_MAINTREQ_F CDMA Maintenance Required command
UI_PH_RSSI_F New RSSI value
UI_PH_STANDBY_SLEEP_F Entering powerdown sleep mode
UI_PH_STANDBY_WAKE_F Exiting powerdown sleep mode
UI_SS_SRV_CHANGED_F Serving system parameter changed
UI_INBAND_REV_BURST_DTMF_F Reverse burst DTMF from UI or another application
UI_INBAND_FWD_BURST_DTMF_F Forward burst DTMF from the base station
UI_INBAND_REV_START_CONT_DTMF_F Reverse start cont DTMF from UI or another application
UI_INBAND_FWD_START_CONT_DTMF_F Forward start cont DTMF from the base station
UI_INBAND_REV_STOP_CONT_DTMF_F Reverse stop cont DTMF from UI or another application
UI_INBAND_FWD_STOP_CONT_DTMF_F Forward stop cont DTMF from the base station
1
5 3.4.4 Events
6 In addition to all of the possible keyboard codes, the following events are given to the UI state
7 machine.
8 The events are divided into two categories:
9 ■ External events – events that are converted from UI commands
10 ■ Internal events – events that the UI generates to sync its state machine
11 The internal and external events to the UI state machine are described in the following tables.
2 3.4.5 States
3 The UI state machine consists of many states. These states are termed “major” states. Each major
4 state has substates called “minor” states to carry out its operations.
5 A state stack drives the state machine. Each state returns one of three possible values:
6 ■ Its own state – machine remains in that state
7 ■ Another state – current state is saved on the state stack and the new state is entered
8 ■ POP_STATE – last state is popped off the state stack and becomes the current state
9 A state such as IDLE can invoke the MENU state to display a menu. When the MENU state exits,
10 control will be returned to the IDLE state, which will handle the return information from the MENU
11 state. When the phone is powered up, it begins in the OFF state and goes to the STARTUP state.
12 Thus, eventually the state will return to OFF when the phone is powered down.
2 Each major state has multiple minor states – ENTER, EXIT, and anything in-between. These minor
3 states are defined as necessary to make the control flow as simple as possible. Generally, each major
4 state has one minor state; all other minor states are invoked to handle incoming events as needed. The
5 state will react based upon the incoming event.
6 Whenever a state reaches the EXIT minor state (it is in process of being exited), it should do two
7 things:
8 1. Set its internal state back to ENTER, so that the next time the state in reentered, it does not
9 immediately exit.
10 2. Return with a POP_STATE, so that the state that “called” it can resume control.
11 As an example, the minor states of the List Major State are described in Table 3-9.
3 This state machine handles the OFF state of the UI task. The OFF state is both the default initial state
4 and the termination state of the UI. The UI always starts and ends with this state. At the initial state, if
5 the user powers up the phone, the UI will transition to the STARTUP state. In the case of a phone
6 having an earpiece device that is closed, the UI will transition to the LOCKED state. During phone
7 operation, if the user powers down the phone, the UI will transition back to the OFF state.
8 There are no state transitions.
10 This state machine handles the LOCK state of the UI task. The UI can be in this state only when the
11 phone has an earpiece device. When the user holds the power key while the earpiece is closed, the UI
12 transitions to the state from the OFF state. While in this state, if the user opens the earpiece, the UI
13 will transition to the STARTUP state. If the earpiece is not open within a predefined time, the UI will
14 transition to the OFF state.
15 The state transitions are listed in Table 3-11.
19 This state machine handles the STARTUP state of the UI. It initializes the NV items used by the UI
20 and the MC task, and other variables used by the UI. If the initialization is successful and the power is
21 on at the end of the initialization, the UI will transition to the IDLE state. Otherwise, the UI will
22 transition back to the OFF state.
23 The state transitions are listed in Table 3-12.
2 This state machine handles the IDLE state of the UI task. In this state, the UI waits for events from
3 external devices and other tasks. Based on the incoming events, the UI transitions to other states.
4 The state transitions are listed in Table 3-13.
8 This state machine handles the CODE state of the UI. The UI transitions to this state when the user
9 selects a UI feature that invokes security-code checking. In this state, the UI allows the user to unlock
10 the security code. If a matching code is entered, the UI transitions back to the state that the UI was in
11 prior to the CODE state.
12 The state transitions are listed in Table 3-14.
NOTE Numerous changes were made to this section. It is recommended that it be reviewed in its entirety.
3
4 This state machine handles the CALL state of the UI. The UI transitions to this state when there are
5 call-related activities and/or events such as incoming and outgoing calls. In this state, the UI handles
6 call-related events and other events that may occur during a call.
7 The CALL state is handled differently than other states in that its state machine is implemented
8 differently and the minor states are called modes. In the CALL state, there are many possible modes
9 and each mode contains an entry, event, and exit function.
10 Upon transitioning to a new mode, the entry function is called to set up variables, display, timers and
11 so on for the current mode. Then it will stay in the event function to handle all events during this
12 mode. Depending on the event, the mode could exit and enter another mode, if appropriate, or exit the
13 CALL state, which would take the phone to the previous state in the UI state stack. The exit function
14 of each mode performs clean-ups for that mode, such as deactivating certain display items, stopping
15 timers, and so on.
16 When the call state is entered from a different state, either originated mode or alerted mode is entered.
17 In each mode, UI may exit the Call state completely due to certain events, such as Power-off event.
18 The mode transitions are listed in Table 3-15.
3 This state machine handles the CLI (CALL LINE ID) state of the UI. The UI pushes this state to the
4 state stack so that the UI can display incoming-call information on the screen. The UI exits this state
5 and transitions to the UI_CALL_S state after displaying the CLI information for a time period (such
6 as 6 seconds), after auto-answer is activated, or after the user responds to the incoming call.
7 The state transitions are listed in Table 3-16.
2 This state machine handles the MESSAGE state of the UI. The UI transitions to this state when there
3 is a request to display a message on the screen. In this state, the UI displays the requested message on
4 the screen.
5 The state transitions are listed in Table 3-17.
9 This state machine handles the INFO state of the UI. The UI transitions to this state when there is a
10 request to display information about the phone. Normally, this happens when the user presses the
11 information key on the keypad. In this state, the UI displays the phone information.
12 The state transitions are listed in Table 3-18.
2 This state machine handles the RCL state of the UI. The UI transitions to this state when there is a
3 request to recall a database entry, such as the phone book. In this state, the UI handles the recalled
4 information and any further user requests.
5 The state transitions are listed in Table 3-19.
2 This state machine handles the STO state of the UI. The UI transitions to this state when there is a
3 request to store an entry into the database, such as the phonebook. In this state, the UI handles the
4 store and any related requests.
5 The state transitions are listed in Table 3-20.
2 This state machine handles the MENU state of the UI. The UI transitions to this state when there is a
3 request to view the menu options. The state machine handles the main menu and sub-menu displays
4 and any further related user requests. When entry into the service-programming menu is requested,
5 the UI transitions to the SERVICE state.
6 The state transitions are listed in Table 3-21.
2 Menus are the mechanism for the user to change pre-defined options. Menus are organized in a
3 hierarchical fashion and the user can navigate through the menus using the soft keys and the number
4 keys.
5 Menus are used for:
6 ■ Choosing items to change
7 ■ Actions to take
8 ■ Giving help
9 Menus may be scrolled through with the cursor keys or the menu key. Pressing MENU from
10 anywhere results in the display of a menu.
2 This state machine handles the SERVICE state of the UI. The UI transitions to this state when there is
3 a request to enter the service-programming menu. In this state, the UI displays the service-
4 programming menu options and allows the user to enter new configuration values.
5 The state transitions are listed in Table 3-23.
1 The service menu options are listed in Table 3-24. The phone is re-booted at the end of the service
2 menu. “?” in the table refers to NAM number. The menu goes through the middle section of the menu
3 as many times as there are NAMs.
Option
Security Code [000 000]
ESN
Akey
NAM ? Settings
NAM ? Phone Number
NAM ? Home SID
NAM ? Name
Basic Programming [Exit / More]
Service Security Code <?=1 only>
NAM ? Lock out system
NAM ? PRL Enabled
NAM ? CDMA Phone Number
NAM ? Mobile Country Code
NAM ? Mobile Network Code
NAM ? Mobile Station ID#
NAM ? CDMA Home SID List
NAM ? AMPS Phone Number
NAM ? AMPS Home SID
NAM ?+1 Settings [Edit]
Phone Model
Slot Cycle Index
Exit Service Programming
5
4 This state machine handles the Multimedia state of the UI. The UI transitions to this state when the
5 user picks a multimedia option from the menu. This state machine handles the song selection and
6 playback and other user inputs to control and adjust the playback.
7 The state transitions are listed in Table 3-20.
2 This state machine handles the NUMEDIT state of the UI. In this state, the UI provides a number
3 editor that allows the user to enter and edit a number. The number editor will automatically insert
4 hyphens (if the option is enabled). Pauses and hyphens can be forced. The editor will use the entire
5 display to show the current number. Anything aside from the current number can be viewed by
6 holding down the RCL key.
7 This state has been extended to also handle the editing of an IP address and IP port.
8 The state transitions are listed in Table 3-26. See uisnum.c for details.
12 This state machine handles the ALPHAEDIT state of the UI. In this state, the UI provides an
13 alphanumeric editor that allows the user to enter and edit an alphanumeric string. It allows upper and
14 lower case, and editing with the arrow keys.
15 The state transitions are listed in Table 3-27.
2 This state machine handles the LIST state of the UI. In this state, the UI allows the user to scroll
3 through a list. Lists are used to select between different choices for a single feature, for example,
4 backlight options. One line is used for a description/prompt and the other is used for the choice. The
5 cursor keys are used to make the choice. Pressing the STO key makes the choice, and pressing the
6 RCL key recalls the previous value.
7 The state transitions are listed in Table 3-28.
11 This state machine handles the HELP state of the UI. In this state, the UI displays the help screen of
12 the UI.
13 The state transitions are listed in Table 3-29.
2 This state machine handles the SMS state of the UI. In this state, the UI handles SMS-related events.
3 This state is entered when the user presses the MESSAGE button in Idle state or Call state, and when
4 there is a SMS message or status coming in.
5 In any substate, UI exits the SMS state completely due to certain events, such as Power-off event,
6 Timeout, and so on. The SMS state maintains a substate stack. Sometimes a new substate is pushed
7 into the stack; sometimes the current substate is popped from the SMS state stack and UI goes to the
8 previous substate in the stack.
9 The state transitions are listed in Table 3-30.
5 This state machine handles the HEXEDIT state of the UI. In this state, the UI provides a hexadecimal
6 editor that allows the user to enter and edit a hex numeric string .
7 The state transitions are listed in Table 3-29.
4 This state machine handles the GPS state of the UI. In this state, the UI sets GPS parameters and
5 interfaces to PDSM to get a position location.
6 The state transitions are listed in Table 3-29.
4 This state machine handles the BT state of the UI. In this state, the UI interfaces to BT to do device
5 discovery and other BT specific functions.
6 The state transitions are listed in Table 3-29.
1 3.5 UI interface
4 This is a virtual interface, there is no physical module associated with this interface. The UI utilizes
5 the signaling facilities provided by the operating system. The following signals are accepted by the UI
6 task.
UI specific signals
UI_KEY_SIG Key from HS task
UI_CMD_Q_SIG Something on the command queue
UI_TIMERS_SIG Any of the callback timers
UI_RPT_TIMER_SIG Time to kick watchdog
UI_MULTI_STOP_SIG Multitone has ended
UI_RING_SIG End of a ring from SND task
UI_NV_SIG Return from NV
Common signals
TASK_START_SIG Start
TASK_STOP_SIG Power down
TASK_OFFLINE_SIG Go offline
8
12 This module provides a set of functions to register and process key events from the keypad and to set
13 the keypad backlight level.
Name Description
uikey_init Initialize the key handler to register for key events from HS task
uikey_set_keypad_backlight_level Set the keypad backlight level
15
NOTE Numerous changes were made to this section. It is recommended that it be reviewed in its entirety.
4
5 This module provides a set of service routines for UI to play various types of sounds/tones (message
6 alert, keep beep, ring, multi-tone, and so on) to set the appropriate device (Handset, Headset, TTY,
7 HandsFree, and so on) or audio path (local and/or over-the-air), and to set the volume (message alert,
8 keep beep, multimedia, ring, TTY, voice, and so on).
9 All sound activities of the UI are handled through the sound manager. Whenever anything changes
10 (new sound to generate, old tone has ended, and so on), the sound manager decides what the current
11 volumes, devices and paths should be and makes adjustments if needed.
12 The commands are listed in Table 3-35.
Name Description
uisnd_snd_stop Tell the sound task to stop a sound
uisnd_stereo_mute Mute/Unmute the stereo
uisnd_tone Tell the sound task to play a tone
uisnd_tone_stop Tell the sound task to stop playing a DTMF tone
uisnd_tty_vol Set TTY device volume
uisnd_voice_vol Set the voice volume
1
3 This module provides a set of service routines for the state machine to control the LCD screen
4 display. It handles the screen fields and the list of active fields, and it builds the actual screens from
5 the fields. It also controls LCD and handset backlight options. See uixscrn.c for details.
6 The phone screen is 12 characters wide by 4 lines in length. This may be adapted to the needs of other
7 countries (Korea, Japan, Germany, and so on) in the future. Therefore, all of the actual text is
8 contained in one file, uiutxt.c, which can be easily changed to adapt the needs of different displays
9 and languages. There will be changes to the code because of the differing display sizes, but these
10 changes will be much smaller.
11 The screen handler keeps a special copy of the screen – one array element per character on the screen
12 that consists of a pointer to the position in memory where the character resides. This will point to
13 either a blank area or the text portion of a field. The screen handler also keeps a similar copy of the
14 blink attributes of the screen.
15 Fields constitute the content of the screen. Each field contains the following information:
16 ■ Priority – higher priority fields overwrite lower priority fields
17 ■ Line – the current line location on the screen
18 ■ Column – the current column location on the screen
19 ■ Blink – whether or not the text should be blinking
20 ■ Text – text in the field; this has the ability to wrap
21 The state machine manipulates this information (typically, the information is from the text field).
22 Behind-the-scenes is a linked list (queue) that is sorted in priority order. The state machine may
23 activate or deactivate any field – activating it places it in the list, deactivating it removes it. Only
24 fields in the list are drawn. Activating or deactivating a field will set a flag that indicates that the
25 screen needs to be rebuilt.
26 If only the text of the field has changed, the state machine can call uiscrn_update() that will
27 notify the screen handler that the text of the screen may or may not have been changed.
28 Finally, at the top of its big loop, just before it goes to sleep, the UI will call uiscrn_refresh(),
29 which will update the screen. If nothing has changed, this exits quickly. If only the text has changed,
30 it will rebuild the current display based on the pointers of its internal screen, and send it to the display
31 driver.
1 If a field has been activated or deactivated, the array of pointers needs to be rebuilt from scratch. The
2 screen manager traverses the list from the lowest priority field to the highest (again, the list is already
3 sorted), and for each field, sets the pointers in the array that the field affects. Thus, a higher priority
4 field will later overwrite the pointer of a lower priority field. Finally, the actual text is generated from
5 the pointers and sent to the display driver.
3 The CM requires all of its clients to register themselves and to provide callback functions for different
4 types of events. This module provides all the necessary wrapper functions to interface to the CM,
5 including initialize the interface, register the required functions, as well as functions that the UI
6 module can call to send the commands to the CM and setup the appropriate parameters.
2 This module provides a set of service routines for the state machine to gain access to the NV
3 database. It allows the UI to read and write to NV database fields.
4 This module will intercept any inactive item “errors” that are returned from the non-volatile RAM
5 and will supply default values where an inactive item is possible and not fatal. In other words, if a
6 feature such as “Horn Alert” has never been set, the UI can safely substitute a FALSE value.
7 The UI will channel all of its write and read requests through three procedures,
8 ui_put_nv(),ui_replace_nv(), and ui_get_nv(), which will wait for the NV to return. In
9 essence, for the UI, the response from the NV task is always synchronous, albeit after a long delay.
10 This works because there are no reads or writes to the NV in any time-critical sections.
2 Database services contains data that is shared globally among all tasks. This data is not preserved
3 through power-downs. Each item in Database services is assigned an enumerated type name.
4 Database service access is multithread safe. Each item in Database services can be modified through
5 db_put() or retrieved through db_get().
6 The central information database will be periodically polled by the UI to determine the status of
7 information that does not need to be sent to the UI on the UI command queue. In addition, the UI will
8 maintain its own variables in the database for use in debugging or other tasks.
11 The Database service items read by the UI are described in Table 3-40.
14 The Database service item modified by the UI are described in Table 3-41.
2 When the UI is ready to sleep, it will set the signal for the sleep task. Otherwise, it will clear the
3 signal. The following macros are used to communicate with the sleep task.
7 The UI periodically reports to the watchdog task through a timer that is registered with REX
8 (UI_RPT_TIMER_SIG) during the initialization of the UI task. When this timer expires, the UI task
9 resets the timer and reports to the watchdog task.
NOTE Numerous changes were made to this section. It is recommended that it be reviewed in its entirety.
3
4 The clock routines provide the functions that allow the UI to define and use callback timers, and to
5 retrieve various time-related information. This is a virtual interface module and the UI directly uses
6 the functions provided by clock. On the expiration of a callback timer, the callback routines set the
7 signal to wake up the UI.
11 The battery interface module provides a routine to read the current battery level. The UI main state
12 machine calls the function every second to read the current level of the battery calls a screen interface
13 function to update the display.
NOTE Numerous changes were made to this section. It is recommended that it be reviewed in its entirety.
3
4 This module provides the interface to the SMS task (currently the same as the CM task) for
5 mobile-terminated, mobile-originated, and broadcast SMS. The following functions are included in
6 this module.
4 This module provides a set of service routines that allow the UI to gain access to the embedded file
5 system. The following functions are used by the UI.
4 This module provides a set of service routines that allow the UI to gain access to map a selection of
5 devices to a selection of applicable services The device mapper (devmap) service centralizes the logic
6 for device assignments and ensures the proper sequencing of device assignments.
7 There are two different device mappers. Earlier products will use the serial device mapper (SDM).
8 SDM supports fewer devices and the phone must be reset for the mapping to occur. Recent products
9 will use the runtime device mapper (RDM). RDM is more robust and will map/unmap at runtime.
4 PDSM requires all of its clients to register themselves and to provide callback functions for different
5 types of events. This module provides all the necessary functions to setup the appropriate parameters,
6 register the required functions, as well as functions that the UI module can call to get a position
7 location.
4 CMX requires all of its clients to provide callback functions for different types of events. This module
5 provides all the necessary functions to support standard MIDI functionality.
4 BT requires all of its clients to register themselves and to provide callback functions for different
5 types of events. The Bluetooth task contains the implementation of the Bluetooth protocol stack and
6 provides an interface for applications to do a variety of Bluetooth functions.
1 3.6 Features
2 In the following sections, “Storage” refers to NV storage. Both, Mobile and Portable provide the
3 detail with regard to which system will have the feature.
4 3.6.6 Restrictions
UI CM
IDLE
CM_CALL_CMD_ORIG()
ORIGINATION
UI_CALL_CONNECTED_F
CONVERSATION
CM_CALL_CMD_END
IDLE
UI CM
IDLE
CM_CALL_CMD_ORIG()
ORIGINATION
UI_CALL_CONNECTED_F
CONVERSATION
UI_CALL_RELEASE_F
IDLE
UI CM
ORIGINATION
UI_REORDER_F
or
UI_INTERCEPT_F
or
UI_CALL_FADE_F
IDLE
UI CM
IDLE
UI_INCOMING_CALL_F
INCOMING
CM_CALL_CMD_ANSWER()
UI_CALL_CONNECTED_F
CONVERSATION
2 4.1.1 Purpose
3 A new menu can be added to the main menu for testing various phone functions. Within this new
4 menu there can be several sub-menus, each of which performs a testing function in a specific area,
5 such as SMS.
6 4.1.2 Requirements
7 After the addition of the test menus, the following key sequences can be performed to run the tests:
8 1. Make sure that the main screen is displayed. If not, press “Clear” until the screen reaches the
9 main screen.
10 2. Press the MENU soft key. The screen will show the list of main menu items. Scroll down the
11 menu list to view more items.
12 3. Press the number key (such as “8”) that matches the menu item “Tests.” The following menu
13 appears:
1. SMS
2. BC SMS
3. Call Mngr
4. Sound
5. NV
6. UI
7. Analog HFK
8. Bluetooth
9. Other
14
15 4. Press “1” (SMS) to go to the SMS test menu. The following menu appears:
1. Send Msg
2. Get Status
3. Clear All
4. SMS Call
16
3 6. Press “1” (Send Msg 1). The message “--Msg sent--” is displayed. An SMS message is sent over
4 the access channel if the phone is not in a call, or sent over the traffic channel if the phone is in a
5 call. The screen will return to the previous screen display after 3 seconds.
6 7. Press “Clear” to return to the SMS test menu as in Step 4 above.
7 8. Press “2” (Get Status). The following menu appears:
1. Status 1
2. Status 2
3. Status 3
4. Status 4
5. Status 5
8
9 9. Press “1” (Status 1). The screen will display the status of the message that was just sent. The
10 screen will return to the previous screen display after two seconds.
11 10. Press “Clear” to return to the SMS test menu as in Step 4.
12 11. Press “3” (Clear All). The message “Clearing statuses of all msgs” is displayed. The screen will
13 return to the previous screen display after two seconds.
14 12. Press “4” (SMS Call). The following menu appears:
1. Originate
2. Auto-D ON
3. Auto-D OFF
15
16 13. Press “1” (Originate). The phone will originate an SMS call to the base station. Once the call is
17 connected, the screen will return to the main screen and update the time duration of the call.
18 14. During the call, the user can select the above test menus to perform test functions. For example,
19 the user can send SMS messages over the traffic channel during the SMS call.
20 15. Press “END” to end the call.
21 16. The user can select “Auto-D ON” or “Auto-D OFF” in the “SMS Call” menu as in Step 12 to
22 enable or disable the feature of automatically disconnecting the SMS call if there is no SMS
23 message sent or received within 60 seconds. This menu should be executed before an SMS call is
24 made.
25 Other menu items can be exercised using sequences that are similar to the sequence above.
2 4.1.3.1 uiumenu.c
6 4.1.3.2 uiutstmn.c
7 This is a newly created file that contains all of the menu and function definitions for the test menus. It
8 has the following parts:
9 Message texts
10 All text strings used for displaying messages in the test menus are defined here. For example, the
11 following text string is for showing the status of a message:
12 const char uintstmn_msg_sms_status_ok_txt[] =
13 "*MSG STATUS* - OK - ";
14 Functions
15 All functions that will be called for menu actions are defined here. A typical function performs the
16 action requested by the user (such as sending a message), and displays a message (such as
17 “--Msg sent--“).
18 Menus
19 All menus/sub-menus are defined here. For example, the menu for SMS calls is as follows:
20
1 4.1.3.3 uiutxt.c
6 4.1.3.4 uismenu.c
7 Add a function to display a message on the screen for a period of time and then return to the previous
8 screen.
9
void uinsmenu_display_msg
(
ui_field_item_enum_type msg_id,
byte seconds
)
{
/* Display message for seconds */
ui.msglen = seconds * 1000; // milli-seconds
ui.msg = msg_id;
ret_state = UI_MESSAGE_S;
state = MSGMENU_S ; /* so we will re-display menu */
}
10
11 4.1.3.5 uiutxti.h
12 In ui_field_item_enum_type, add a literal for each of the new messages created, as follows:
13 UI_MSG_SMS_SENT_F, /* SMS msg sent */
15 The following header files may need to be changed to declare the new data and the functions that are
16 introduced:
17 ■ uiumenu.h
18 ■ uiutstmn.h
19 ■ uiutxt.h