FreeCalypso > hg > tcs211-fcmodem
comparison chipsetsw/services/mks/mks_api.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /** | |
2 * @file mks_api.h | |
3 * | |
4 * API Definition for Magic Key Sequence Service. | |
5 * | |
6 * This file gathers all the constants, structure and functions declaration | |
7 * useful for a MKS service user. | |
8 * | |
9 * @author Laurent Sollier (l-sollier@ti.com) | |
10 * @version 0.1 | |
11 */ | |
12 | |
13 /* | |
14 * History: | |
15 * | |
16 * Date Author Modification | |
17 * ---------------------------------------- | |
18 * 11/19/2001 L Sollier Create | |
19 * | |
20 * | |
21 * (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved | |
22 */ | |
23 | |
24 #ifndef _MKS_API_H_ | |
25 #define _MKS_API_H_ | |
26 | |
27 #include "mks/mks_cfg.h" | |
28 | |
29 #include "kpd/kpd_api.h" | |
30 | |
31 #include "rv/rv_general.h" | |
32 #include "rvf/rvf_api.h" | |
33 | |
34 /** | |
35 * @name External types | |
36 * | |
37 * Types used in API. | |
38 * | |
39 */ | |
40 /*@{*/ | |
41 | |
42 /** Definition of completion type used. | |
43 * Subscriber is notified when key sequence is completed. | |
44 */ | |
45 #define MKS_SEQUENCE_COMPLETED 0x01 | |
46 | |
47 /** Definition of completion type used. | |
48 * Subscriber is notified after key sequence is completed. | |
49 */ | |
50 #define MKS_POST_SEQUENCE 0x02 | |
51 | |
52 | |
53 /** Definition of one magic key sequence. */ | |
54 typedef struct { char name[KPD_MAX_CHAR_NAME+1]; /* It's not ensured that this name is unique */ | |
55 UINT8 nb_key_of_sequence; | |
56 T_KPD_VIRTUAL_KEY_ID key_id[MKS_NB_MAX_OF_KEY_IN_KEY_SEQUENCE]; | |
57 UINT8 completion_type; /* can equal to MKS_SEQUENCE_COMPLETED or MKS_POST_SEQUENCE */ | |
58 UINT8 nb_key_for_post_sequence; /* used only if completion_type == MKS_POST_SEQUENCE */ | |
59 T_RV_RETURN return_path; | |
60 } T_MKS_INFOS_KEY_SEQUENCE; | |
61 | |
62 /*@}*/ | |
63 | |
64 | |
65 | |
66 /** | |
67 * @name API functions | |
68 * | |
69 * API functions declarations. | |
70 */ | |
71 /*@{*/ | |
72 | |
73 /** | |
74 * function: mks_add_key_sequence | |
75 * | |
76 * This function initialize a magic key sequence. | |
77 * | |
78 * @param infos_key_sequence_p Magic key sequence. | |
79 * @return | |
80 * - RV_OK if operation is successful, | |
81 * - RV_INVALID_PARAMETER if one parameter is incorrect, | |
82 * - RV_MEMORY_ERR if memory reach its size limit. | |
83 * | |
84 */ | |
85 T_RV_RET mks_add_key_sequence(T_MKS_INFOS_KEY_SEQUENCE* infos_key_sequence_p); | |
86 | |
87 /** | |
88 * function: mks_remove_key_sequence | |
89 * | |
90 * This function remove an existing magic key sequence. | |
91 * | |
92 * @param infos_key_sequence_p Magic key sequence. | |
93 * @return | |
94 * - RV_OK | |
95 * - RV_MEMORY_ERR if memory reach its size limit. | |
96 * | |
97 * @note | |
98 * - If the name of the key sequence doesn't exist, no return status is | |
99 * sent to inform client that process has failed. | |
100 * | |
101 */ | |
102 T_RV_RET mks_remove_key_sequence(char name[KPD_MAX_CHAR_NAME+1]); | |
103 | |
104 | |
105 /*@}*/ | |
106 | |
107 | |
108 /*************************************************************************/ | |
109 /************************** MESSAGES DEFINITION **************************/ | |
110 /*************************************************************************/ | |
111 | |
112 /** | |
113 * The message offset must differ for each SWE in order to have | |
114 * unique msg_id in the system. | |
115 */ | |
116 #define MKS_MESSAGES_OFFSET (0x37 << 10) | |
117 | |
118 | |
119 | |
120 /** | |
121 * @name MKS_SEQUENCE_COMPLETED | |
122 * | |
123 * This message is sent to a subscriber when a key sequence is completed. | |
124 * | |
125 * Message issued by MKS to a subscriber. | |
126 */ | |
127 /*@{*/ | |
128 | |
129 | |
130 /** Message ID. */ | |
131 #define MKS_SEQUENCE_COMPLETED_MSG (MKS_MESSAGES_OFFSET | 0x001) | |
132 | |
133 /** Message structure. */ | |
134 typedef struct | |
135 { | |
136 /** Message header. */ | |
137 T_RV_HDR hdr; | |
138 | |
139 /** Name of key sequence. */ | |
140 char name[KPD_MAX_CHAR_NAME]; | |
141 | |
142 /** Kind of completion (sequence completed or post_sequence). */ | |
143 UINT8 completion_type; | |
144 | |
145 /** Virtual key Id pressed (used when completion_type == MKS_POST_SEQUENCE). */ | |
146 T_KPD_VIRTUAL_KEY_ID key_pressed; | |
147 | |
148 } T_MKS_SEQUENCE_COMPLETED_MSG; | |
149 /*@}*/ | |
150 | |
151 | |
152 #endif /* #ifndef _MKS_API_H_ */ |