1 /**
2  ****************************************************************************************
3  *
4  * @file rwip_task.h
5  *
6  * @brief Task Identifier description for the RW IP
7  *
8  * Copyright (C) RivieraWaves 2009-2016
9  *
10  ****************************************************************************************
11  */
12 
13 #ifndef RWIP_TASK_H_
14 #define RWIP_TASK_H_
15 
16 /**
17  ****************************************************************************************
18  * @addtogroup ROOT
19  * @{
20  *
21  *  Information about RW SW TASK
22  *
23  * @name RW TASK Configuration
24  * @{
25  ****************************************************************************************
26  */
27 
28 #include <stdint.h>
29 
30 /*
31  * DEFINES
32  ****************************************************************************************
33  */
34 
35 
36 /// Build the first message ID of a task. (in fact a ke_msg_id_t)
37 #define TASK_FIRST_MSG(task) ((uint16_t)((task) << 8))
38 
39 /// Builds the task identifier from the type and the index of that task.
40 #define TASK_BUILD(type, index) ((uint16_t)(((index) << 8)|(type)) )
41 
42 /// Retrieves task type from task id.
43 #define TASK_TYPE_GET(ke_task_id) ((uint16_t) & 0xFF)
44 
45 /// Retrieves task index number from task id.
46 #define TASK_IDX_GET(ke_task_id) (((uint16_t) >> 8) & 0xFF)
47 
48 
49 /// Tasks types definition, this value shall be in [0-254] range
50 enum TASK_API_ID
51 {
52     // Link Layer Tasks
53     TASK_ID_LLM          = 0,
54     TASK_ID_LLC          = 1,
55     TASK_ID_LLD          = 2,
56     TASK_ID_DBG          = 3,
57 
58     // BT Controller Tasks
59     TASK_ID_LM           = 4,
60     TASK_ID_LC           = 5,
61     TASK_ID_LB           = 6,
62     TASK_ID_LD           = 7,
63 
64     TASK_ID_HCI          = 8,
65     TASK_ID_DISPLAY      = 9,
66 
67     // -----------------------------------------------------------------------------------
68     // --------------------- BLE HL TASK API Identifiers ---------------------------------
69     // -----------------------------------------------------------------------------------
70 
71     TASK_ID_L2CC         = 10,   // L2CAP Controller Task
72     TASK_ID_GATTM        = 11,   // Generic Attribute Profile Manager Task
73     TASK_ID_GATTC        = 12,   // Generic Attribute Profile Controller Task
74     TASK_ID_GAPM         = 13,   // Generic Access Profile Manager
75     TASK_ID_GAPC         = 14,   // Generic Access Profile Controller
76 
77     TASK_ID_APP          = 15,   // Application API
78     TASK_ID_AHI          = 16,   // Application Host Interface
79 
80     // -----------------------------------------------------------------------------------
81     // --------------------- BLE Profile TASK API Identifiers ----------------------------
82     // -----------------------------------------------------------------------------------
83     TASK_ID_DISS         = 20,   // Device Information Service Server Task
84     TASK_ID_DISC         = 21,   // Device Information Service Client Task
85 
86     TASK_ID_PROXM        = 22,   // Proximity Monitor Task
87     TASK_ID_PROXR        = 23,   // Proximity Reporter Task
88 
89     TASK_ID_FINDL        = 24,   // Find Me Locator Task
90     TASK_ID_FINDT        = 25,   // Find Me Target Task
91 
92     TASK_ID_HTPC         = 26,   // Health Thermometer Collector Task
93     TASK_ID_HTPT         = 27,   // Health Thermometer Sensor Task
94 
95     TASK_ID_BLPS         = 28,   // Blood Pressure Sensor Task
96     TASK_ID_BLPC         = 29,   // Blood Pressure Collector Task
97 
98     TASK_ID_HRPS         = 30,   // Heart Rate Sensor Task
99     TASK_ID_HRPC         = 31,   // Heart Rate Collector Task
100 
101     TASK_ID_TIPS         = 32,   // Time Server Task
102     TASK_ID_TIPC         = 33,   // Time Client Task
103 
104     TASK_ID_SCPPS        = 34,   // Scan Parameter Profile Server Task
105     TASK_ID_SCPPC        = 35,   // Scan Parameter Profile Client Task
106 
107     TASK_ID_BASS         = 36,   // Battery Service Server Task
108     TASK_ID_BASC         = 37,   // Battery Service Client Task
109 
110     TASK_ID_HOGPD        = 38,   // HID Device Task
111     TASK_ID_HOGPBH       = 39,   // HID Boot Host Task
112     TASK_ID_HOGPRH       = 40,   // HID Report Host Task
113 
114     TASK_ID_GLPS         = 41,   // Glucose Profile Sensor Task
115     TASK_ID_GLPC         = 42,   // Glucose Profile Collector Task
116 
117     TASK_ID_RSCPS        = 43,   // Running Speed and Cadence Profile Server Task
118     TASK_ID_RSCPC        = 44,   // Running Speed and Cadence Profile Collector Task
119 
120     TASK_ID_CSCPS        = 45,   // Cycling Speed and Cadence Profile Server Task
121     TASK_ID_CSCPC        = 46,   // Cycling Speed and Cadence Profile Client Task
122 
123     TASK_ID_ANPS         = 47,   // Alert Notification Profile Server Task
124     TASK_ID_ANPC         = 48,   // Alert Notification Profile Client Task
125 
126     TASK_ID_PASPS        = 49,   // Phone Alert Status Profile Server Task
127     TASK_ID_PASPC        = 50,   // Phone Alert Status Profile Client Task
128 
129     TASK_ID_CPPS         = 51,   // Cycling Power Profile Server Task
130     TASK_ID_CPPC         = 52,   // Cycling Power Profile Client Task
131 
132     TASK_ID_LANS         = 53,   // Location and Navigation Profile Server Task
133     TASK_ID_LANC         = 54,   // Location and Navigation Profile Client Task
134 
135     TASK_ID_IPSS         = 55,   // Internet Protocol Support Profile Server Task
136     TASK_ID_IPSC         = 56,   // Internet Protocol Support Profile Client Task
137 
138     TASK_ID_ENVS         = 57,   // Environmental Sensing Profile Server Task
139     TASK_ID_ENVC         = 58,   // Environmental Sensing Profile Client Task
140 
141     TASK_ID_WSCS         = 59,   // Weight Scale Profile Server Task
142     TASK_ID_WSCC         = 60,   // Weight Scale Profile Client Task
143 
144     TASK_ID_UDSS         = 61,   // User Data Service Server Task
145     TASK_ID_UDSC         = 62,   // User Data Service Client Task
146 
147     TASK_ID_BCSS         = 63,   // Body Composition Server Task
148     TASK_ID_BCSC         = 64,   // Body Composition Client Task
149 
150     TASK_ID_WPTS         = 65,   // Wireless Power Transfer Profile Server Task
151     TASK_ID_WPTC         = 66,   // Wireless Power Transfer Profile Client Task
152     TASK_ID_USER        = 67,   // user Service Server Task
153 
154     /* 240 -> 241 reserved for Audio Mode 0 */
155     TASK_ID_AM0          = 240,  // BLE Audio Mode 0 Task
156     TASK_ID_AM0_HAS      = 241,  // BLE Audio Mode 0 Hearing Aid Service Task
157 
158     TASK_ID_INVALID      = 0xFF, // Invalid Task Identifier
159 };
160 
161 /// @} BT Stack Configuration
162 /// @} ROOT
163 
164 #endif //RWIP_CONFIG_H_
165