comparison src/ui3/bmi/mmiHomezone.h @ 421:6a4d9f47793e

src/ui3/bmi: file renames to make the case consistent
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 Jan 2018 03:28:53 +0000
parents src/ui3/bmi/MmiHomezone.h@e8ddbb0837ed
children
comparison
equal deleted inserted replaced
420:e8ddbb0837ed 421:6a4d9f47793e
1 #ifndef _DEF_MMI_HOMEZONE_H_
2 #define _DEF_MMI_HOMEZONE_H_
3
4 /*******************************************************************************
5
6 CONDAT (UK)
7
8 ********************************************************************************
9
10 This software product is the property of Condat (UK) Ltd and may not be
11 disclosed to any third party without the express permission of the owner.
12
13 ********************************************************************************
14
15 $Project name: Basic MMI
16 $Project code: BMI
17 $Module: SMS
18 $File: MmiHomezone.h
19 $Revision: 1.0
20
21 $Author: Condat(UK)
22 $Date: 25/10/00
23
24 ********************************************************************************
25
26 Description: Homezone functionality in MMI
27
28
29
30 ********************************************************************************
31
32 $History: MmiHomezone.h
33
34 15/02/02 Original Condat(UK) BMI version.
35
36 Jun 14, 2005 REF: MMI-FIX-30439 x0018858
37 Description: The homezone/cityzone tags were not being displayed properly.
38 Solution: Modified to save the tags properly in caches and also made the
39 appropriate modifications to update the same properly during mobility.
40
41 $End
42
43 *******************************************************************************/
44
45 /****************************************************************************
46 * *
47 * CONSTANTS *
48 * *
49 ****************************************************************************/
50
51 #define HZ_ZONES_MAX 4 // Max number of homezones the user can have
52 #define HZ_RECENT_MAX 5 // Number of recent cells to be stored
53 #define HZ_CACHE_MAX 21 // Size of cache for each homezone
54 #define HZ_DISTANCE_MAX 100000 // Maximum distance in metres that user can be from centre of homezone
55
56 #define HZ_IDENTIFIER 221 // Message ID that identifies a homezone CB
57 #define HZ_COORD_DIGITS 6 // Number of digits in coordinates received in CB message
58 #define HZ_ACTIVE_FLAG 0x01 // If homezone is active, first bit in byte is set
59 #define HZ_CITYZONE_FLAG 0x02 // If homezone is a cityzone, second bit in byte is set
60
61 #define HZ_SIM_PARAMETERS 0x6F60 // Field in SIM storing homezone parameters
62 #define HZ_SIM_PARAMETERS_SIZE 123 // Size of this field in bytes
63 #define HZ_SIM_FIRST_ZONE 17 // Offset from start of parameters file that first zone is found
64 #define HZ_SIM_ZONE_SIZE 27 // Size of each zone in bytes
65 #define HZ_SIM_CELL_CACHE 0x6F61 // First of series of caches storing homezone cells
66 #define HZ_SIM_CELL_CACHE_SIZE 4 // Size of each cache entry (there will be HZ_CACHE_MAX of these per zone)
67 #define HZ_NAME_LENGTH 12 // Length of homezone name tag
68
69 #define HZ_NOT_IN_ZONE 0xFF // Value for current_zone when we aren't in a homezone
70
71 #define HZ_CB_NAME "Homezone" // Homezone cell broadcast channel name
72
73 /****************************************************************************
74 * *
75 * Permitted Network Names *
76 * *
77 ****************************************************************************/
78
79 #define HZ_PERMITTED_NETWORKS 1
80
81
82 /****************************************************************************
83 * *
84 * Information storage for individual homezone *
85 * T_homezone *
86 * *
87 ****************************************************************************/
88
89 typedef struct
90 {
91 UBYTE zoneID; // The ID of the homezone
92 BOOL active; // Whether the homezone is activated at the moment
93 BOOL cityzone; // TRUE if the zone is a cityzone
94 U32 X; // The X position of its centre
95 U32 Y; // The Y position of its centre
96 U32 Rsquared; // The radius of the homezone, squared
97 char Tag[13]; // The text tag to be displayed when in the homezone
98 USHORT lac[HZ_CACHE_MAX]; // The cache of location area codes of cells known to be in this homezone
99 USHORT cid[HZ_CACHE_MAX]; // The cache of cell IDs known to be in this homezone
100 } T_homezone;
101
102
103 /****************************************************************************
104 * *
105 * General homezone information storage *
106 * T_homezone_data *
107 * *
108 ****************************************************************************/
109
110 typedef struct
111 {
112 UBYTE current_zone; // Current zone number (1 to HZ_ZONES_MAX). 0 if none.
113
114 U32 current_X; // Coordinates (received from CB) of centre of current cell
115 U32 current_Y;
116
117 UBYTE received; // Makes sure we have received all necessary data
118 UBYTE new_cell_res; // TRUE if a new cell reselection has just occurred
119 USHORT lac;
120 USHORT cid;
121
122 UBYTE recent_cell_index; // Location of recent cells that are within one of the user's homezones.
123 USHORT recent_cell[HZ_RECENT_MAX]; // These are used for quick lookup
124 UBYTE recent_cell_zone[HZ_RECENT_MAX]; // The homezone/cityzone of the recent cell
125
126 T_homezone homezone[HZ_ZONES_MAX]; // The user's homezones, up to HZ_ZONES_MAX
127
128 UBYTE buffer[HZ_SIM_PARAMETERS_SIZE]; // Buffers for reading from or writing to the SIM
129 UBYTE buffer2[HZ_SIM_CELL_CACHE_SIZE];
130 } T_homezone_data;
131
132 typedef enum
133 {
134 HZ_RECEIVED_CB = 1,
135 HZ_RECEIVED_CELLRES = 2,
136 HZ_RECEIVED_SIMDATA = 4,
137 HZ_RECEIVED_ALL = 7,
138 HZ_RECEIVED_HZ_OFF = 128 /* Homezone is switched off */
139 } HZ_RECEIVED_TYPE; /*a0393213 warnings removal-declaration requires a typedef name*/
140
141
142 typedef enum
143 {
144 HZ_READ_ONCE_ONLY = 0, /* Only read SIM first time this function is called */
145 HZ_READ_SIM_AGAIN = 1 /* Read SIM any number of times */
146 } HZ_READ_TYPE;/*a0393213 warnings removal-declaration requires a typedef name*/
147
148 /****************************************************************************
149 * *
150 * FUNCTION PROTOTYPES *
151 * *
152 ****************************************************************************/
153
154 void homezoneInit();
155
156 void homezoneCBData(char *message);
157
158 void homezoneReadSim(UBYTE read_again);
159
160 void homezoneReadSimCb(USHORT field, USHORT record, USHORT result);
161
162 void homezoneWriteSim(USHORT field, USHORT record);
163
164 void homezoneWriteSimCb(USHORT field, USHORT record, USHORT result);
165
166 //Jun 14, 2005 REF: MMI-FIX-30439 x0018858
167 // Added third argument to the function
168 //begin 30439
169 void homezoneUpdate(USHORT lac, USHORT cid, UBYTE keep);
170 //end 30439
171
172 void homezoneUpdateDisplay(void);
173
174 void homezoneActivateCB(void);
175 #endif