comparison src/g23m-aci/aci/phb_aci.h @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : MMI-Framework (8417)
4 | Modul : PSA_PHB
5 +-----------------------------------------------------------------------------
6 | Copyright 2005 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Interface of SIM phonebook to ACI (and MFW)
18 |
19 | Details can be found in the design document
20 | "Phone Book Re-Architecture
21 +-----------------------------------------------------------------------------
22 */
23
24 #ifndef PHB_ACI_H
25 #define PHB_ACI_H
26
27 #include "phb_sim.h"
28
29 /*
30 * Constants
31 */
32
33 /* FDN operation mode */
34 typedef enum
35 {
36 NO_OPERATION = 0, /* */
37 FDN_DISABLE, /* FDN disabled */
38 FDN_ENABLE /* FDN enabled */
39 } T_PHB_FDN_MODE;
40
41
42 /* Phonebook callback event */
43 typedef enum
44 {
45 PHB_CB_BOOK_LOCKED, /* Phonebook locked by SIM activity */
46 PHB_CB_BOOK_UNLOCKED, /* Phonebook unlocked from SIM activity */
47 PHB_CB_WRITE_FINISHED /* Write / delete operation finished */
48 } T_PHB_CB_EVENT;
49
50
51 /* Phonebook status */
52 typedef enum
53 {
54 PHB_UNKNOWN = 0, /* Status unknown */
55 PHB_BUSY, /* Phonebook busy, e.g. SIM access in progress */
56 PHB_READY, /* Phonebook ready */
57 PHB_WRITE_FAIL /* Write failed */
58 } T_PHB_STAT;
59
60 /*
61 * Type definitions
62 */
63 /* The ACI part of the phonebook does not define it's own structures or data
64 * types (except of enums which are considered as constants) but relies on
65 * data types defined by the SIM part of the phonebook respective the
66 * database manager. */
67
68 /*
69 * Function prototypes
70 */
71
72 void pb_init (void);
73 void pb_exit (void);
74 void pb_reset (void);
75 void pb_set_sim_ecc (USHORT cause,
76 UBYTE ecc_len,
77 const UBYTE *sim_ecc);
78 void pb_inserted_sim (UBYTE c_sim_serv,
79 UBYTE *sim_serv,
80 const T_imsi_field *imsi_field,
81 UBYTE adn_bdn_fdn_func,
82 UBYTE phase);
83 void pb_start_build (BOOL unchanged);
84 BOOL pb_update (int ref,
85 T_SIM_FILE_UPDATE_IND *fu);
86 T_PHB_RETURN pb_flush_data (void);
87 T_PHB_RETURN pb_add_record (T_PHB_TYPE type,
88
89 USHORT phy_recno,
90 const T_PHB_RECORD *entry);
91 T_PHB_RETURN pb_del_record (T_PHB_TYPE type,
92 USHORT phy_recno);
93 T_PHB_RETURN pb_check_fdn (UBYTE toa,
94 const UBYTE *number);
95 T_PHB_RETURN pb_switch_adn_fdn (T_PHB_FDN_MODE mode,
96 T_ACI_CLASS classFDN);
97 T_PHB_RETURN pb_del_book (T_PHB_TYPE book);
98 T_ACI_CLASS pb_get_fdn_classtype (void);
99 T_PHB_FDN_MODE pb_get_fdn_mode (void);
100 EXTERN T_PHB_TYPE pb_get_phb_type_from_ef (USHORT ef);
101 /*
102 * Wrapper functions
103 */
104
105 T_PHB_RETURN pb_read_record (T_PHB_TYPE type,
106 SHORT phy_recno,
107 T_PHB_RECORD *entry);
108 T_PHB_RETURN pb_read_alpha_record (T_PHB_TYPE type,
109 SHORT order_num,
110 T_PHB_RECORD *entry);
111 T_PHB_RETURN pb_read_number_record (T_PHB_TYPE type,
112 SHORT order_num,
113 T_PHB_RECORD *entry);
114 T_PHB_RETURN pb_search_name (T_PHB_TYPE type,
115 T_PHB_MATCH match,
116 const T_ACI_PB_TEXT *search_tag,
117 SHORT *order_num);
118 T_PHB_RETURN pb_search_number (T_PHB_TYPE type,
119 const UBYTE *number,
120 SHORT *order_num);
121 T_PHB_RETURN pb_read_sizes (T_PHB_TYPE type, /* IN */
122 SHORT *max_rcd, /* OUT */
123 SHORT *used_rcd, /* OUT */
124 UBYTE *num_len, /* OUT */
125 UBYTE *tag_len, /* OUT */
126 SHORT *max_ext, /* OUT */
127 SHORT *used_ext);/* OUT */
128 int pb_get_entry_len (const UBYTE *pb_tag,
129 UBYTE max_pb_len);
130 T_PHB_RETURN pb_del_book (T_PHB_TYPE type);
131
132 /*
133 * Improved functionality / backward compatibility
134 */
135 T_PHB_RETURN pb_search_number_ex (T_PHB_TYPE type,
136 const UBYTE *number,
137 SHORT *order_num,
138 SHORT *found,
139 T_PHB_RECORD *entry);
140
141 T_PHB_RETURN pb_search_name_ex (T_PHB_TYPE type,
142 T_PHB_MATCH match,
143 const T_ACI_PB_TEXT *search_tag,
144 SHORT *order_num,
145 SHORT *found,
146 T_PHB_RECORD *entry);
147
148 /*
149 * New functionality
150 */
151 int pb_find_free_record (T_PHB_TYPE type);
152
153
154 /*
155 * New functionality
156 */
157 int pb_find_ext_free_record ();
158
159 void pb_update_ext_bitmap (UBYTE rec_num, BOOL flag);
160
161
162 /*
163 * Functionality to update status of Phonebook to other modules.
164 */
165 void pb_status_req (UBYTE *pb_stat);
166
167 #endif /* #ifndef PHB_ACI_H */