comparison src/ui/bmi/mmiHomezone.h @ 111:4d3d71a22b9d

mmiHomezone.h: bogotab fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 09 Nov 2020 01:15:31 +0000
parents c0052fe355d3
children
comparison
equal deleted inserted replaced
110:056d0a19ed5b 111:4d3d71a22b9d
1 #ifndef _DEF_MMI_HOMEZONE_H_ 1 #ifndef _DEF_MMI_HOMEZONE_H_
2 #define _DEF_MMI_HOMEZONE_H_ 2 #define _DEF_MMI_HOMEZONE_H_
3 3
4 /******************************************************************************* 4 /*******************************************************************************
5 5
6 CONDAT (UK) 6 CONDAT (UK)
7 7
8 ******************************************************************************** 8 ********************************************************************************
9 9
10 This software product is the property of Condat (UK) Ltd and may not be 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. 11 disclosed to any third party without the express permission of the owner.
12 12
13 ******************************************************************************** 13 ********************************************************************************
14 14
15 $Project name: Basic MMI 15 $Project name: Basic MMI
16 $Project code: BMI 16 $Project code: BMI
17 $Module: SMS 17 $Module: SMS
18 $File: MmiHomezone.h 18 $File: MmiHomezone.h
19 $Revision: 1.0 19 $Revision: 1.0
20 20
21 $Author: Condat(UK) 21 $Author: Condat(UK)
22 $Date: 25/10/00 22 $Date: 25/10/00
23 23
24 ******************************************************************************** 24 ********************************************************************************
25 25
26 Description: Homezone functionality in MMI 26 Description: Homezone functionality in MMI
27 27
29 29
30 ******************************************************************************** 30 ********************************************************************************
31 31
32 $History: MmiHomezone.h 32 $History: MmiHomezone.h
33 33
34 15/02/02 Original Condat(UK) BMI version. 34 15/02/02 Original Condat(UK) BMI version.
35 35
36 Jun 14, 2005 REF: MMI-FIX-30439 x0018858 36 Jun 14, 2005 REF: MMI-FIX-30439 x0018858
37 Description: The homezone/cityzone tags were not being displayed properly. 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 38 Solution: Modified to save the tags properly in caches and also made the
39 appropriate modifications to update the same properly during mobility. 39 appropriate modifications to update the same properly during mobility.
40 40
41 $End 41 $End
42 42
43 *******************************************************************************/ 43 *******************************************************************************/
44 44
45 /**************************************************************************** 45 /****************************************************************************
46 * * 46 * *
47 * CONSTANTS * 47 * CONSTANTS *
48 * * 48 * *
49 ****************************************************************************/ 49 ****************************************************************************/
50 50
51 #define HZ_ZONES_MAX 4 // Max number of homezones the user can have 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 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 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 54 #define HZ_DISTANCE_MAX 100000 // Maximum distance in metres that user can be from centre of homezone
55 55
56 #define HZ_IDENTIFIER 221 // Message ID that identifies a homezone CB 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 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 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 59 #define HZ_CITYZONE_FLAG 0x02 // If homezone is a cityzone, second bit in byte is set
60 60
61 #define HZ_SIM_PARAMETERS 0x6F60 // Field in SIM storing homezone parameters 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 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 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 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 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) 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 67 #define HZ_NAME_LENGTH 12 // Length of homezone name tag
68 68
69 #define HZ_NOT_IN_ZONE 0xFF // Value for current_zone when we aren't in a homezone 69 #define HZ_NOT_IN_ZONE 0xFF // Value for current_zone when we aren't in a homezone
70 70
71 #define HZ_CB_NAME "Homezone" // Homezone cell broadcast channel name 71 #define HZ_CB_NAME "Homezone" // Homezone cell broadcast channel name
72 72
73 /**************************************************************************** 73 /****************************************************************************
74 * * 74 * *
75 * Permitted Network Names * 75 * Permitted Network Names *
76 * * 76 * *
77 ****************************************************************************/ 77 ****************************************************************************/
78 78
79 #define HZ_PERMITTED_NETWORKS 1 79 #define HZ_PERMITTED_NETWORKS 1
80 80
81 81
82 /**************************************************************************** 82 /****************************************************************************
83 * * 83 * *
84 * Information storage for individual homezone * 84 * Information storage for individual homezone *
85 * T_homezone * 85 * T_homezone *
86 * * 86 * *
87 ****************************************************************************/ 87 ****************************************************************************/
88 88
89 typedef struct 89 typedef struct
90 { 90 {
91 UBYTE zoneID; // The ID of the homezone 91 UBYTE zoneID; // The ID of the homezone
92 BOOL active; // Whether the homezone is activated at the moment 92 BOOL active; // Whether the homezone is activated at the moment
93 BOOL cityzone; // TRUE if the zone is a cityzone 93 BOOL cityzone; // TRUE if the zone is a cityzone
94 U32 X; // The X position of its centre 94 U32 X; // The X position of its centre
95 U32 Y; // The Y position of its centre 95 U32 Y; // The Y position of its centre
96 U32 Rsquared; // The radius of the homezone, squared 96 U32 Rsquared; // The radius of the homezone, squared
97 char Tag[13]; // The text tag to be displayed when in the homezone 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 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 99 USHORT cid[HZ_CACHE_MAX]; // The cache of cell IDs known to be in this homezone
100 } T_homezone; 100 } T_homezone;
101 101
102 102
103 /**************************************************************************** 103 /****************************************************************************
104 * * 104 * *
105 * General homezone information storage * 105 * General homezone information storage *
106 * T_homezone_data * 106 * T_homezone_data *
107 * * 107 * *
108 ****************************************************************************/ 108 ****************************************************************************/
109 109
110 typedef struct 110 typedef struct
111 { 111 {
112 UBYTE current_zone; // Current zone number (1 to HZ_ZONES_MAX). 0 if none. 112 UBYTE current_zone; // Current zone number (1 to HZ_ZONES_MAX). 0 if none.
113 113
114 U32 current_X; // Coordinates (received from CB) of centre of current cell 114 U32 current_X; // Coordinates (received from CB) of centre of current cell
115 U32 current_Y; 115 U32 current_Y;
116 116
117 UBYTE received; // Makes sure we have received all necessary data 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 118 UBYTE new_cell_res; // TRUE if a new cell reselection has just occurred
119 USHORT lac; 119 USHORT lac;
120 USHORT cid; 120 USHORT cid;
121 121
122 UBYTE recent_cell_index; // Location of recent cells that are within one of the user's homezones. 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 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 124 UBYTE recent_cell_zone[HZ_RECENT_MAX]; // The homezone/cityzone of the recent cell
125 125
126 T_homezone homezone[HZ_ZONES_MAX]; // The user's homezones, up to HZ_ZONES_MAX 126 T_homezone homezone[HZ_ZONES_MAX]; // The user's homezones, up to HZ_ZONES_MAX
127 127
128 UBYTE buffer[HZ_SIM_PARAMETERS_SIZE]; // Buffers for reading from or writing to the SIM 128 UBYTE buffer[HZ_SIM_PARAMETERS_SIZE]; // Buffers for reading from or writing to the SIM
129 UBYTE buffer2[HZ_SIM_CELL_CACHE_SIZE]; 129 UBYTE buffer2[HZ_SIM_CELL_CACHE_SIZE];
130 } T_homezone_data; 130 } T_homezone_data;
131 131
132 typedef enum 132 typedef enum
133 { 133 {
134 HZ_RECEIVED_CB = 1, 134 HZ_RECEIVED_CB = 1,
135 HZ_RECEIVED_CELLRES = 2, 135 HZ_RECEIVED_CELLRES = 2,
136 HZ_RECEIVED_SIMDATA = 4, 136 HZ_RECEIVED_SIMDATA = 4,
137 HZ_RECEIVED_ALL = 7, 137 HZ_RECEIVED_ALL = 7,
138 HZ_RECEIVED_HZ_OFF = 128 /* Homezone is switched off */ 138 HZ_RECEIVED_HZ_OFF = 128 /* Homezone is switched off */
139 } HZ_RECEIVED_TYPE; /*a0393213 warnings removal-declaration requires a typedef name*/ 139 } HZ_RECEIVED_TYPE; /*a0393213 warnings removal-declaration requires a typedef name*/
140 140
141 141
142 typedef enum 142 typedef enum
143 { 143 {
144 HZ_READ_ONCE_ONLY = 0, /* Only read SIM first time this function is called */ 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 */ 145 HZ_READ_SIM_AGAIN = 1 /* Read SIM any number of times */
146 } HZ_READ_TYPE;/*a0393213 warnings removal-declaration requires a typedef name*/ 146 } HZ_READ_TYPE;/*a0393213 warnings removal-declaration requires a typedef name*/
147 147
148 /**************************************************************************** 148 /****************************************************************************
149 * * 149 * *
150 * FUNCTION PROTOTYPES * 150 * FUNCTION PROTOTYPES *
151 * * 151 * *
152 ****************************************************************************/ 152 ****************************************************************************/
153 153
154 void homezoneInit(); 154 void homezoneInit();
155 155
156 void homezoneCBData(char *message); 156 void homezoneCBData(char *message);