1 /**
2  ****************************************************************************************
3  *
4  * @file rwprf_config.h
5  *
6  * @brief Header file - Profile Configuration
7  *
8  * Copyright (C) RivieraWaves 2009-2016
9  *
10  ****************************************************************************************
11  */
12 
13 
14 #ifndef _RWPRF_CONFIG_H_
15 #define _RWPRF_CONFIG_H_
16 
17 
18 /**
19  ****************************************************************************************
20  * @addtogroup PRF_CONFIG
21  * @ingroup PROFILE
22  * @brief Profile configuration
23  *
24  * @{
25  ****************************************************************************************
26  */
27 
28 //ATT DB,Testing and Qualification related flags
29 #if (BLE_CENTRAL || BLE_PERIPHERAL)
30 /// Proximity Profile Monitor Role
31 #if defined(CFG_PRF_PXPM)
32 #define BLE_PROX_MONITOR        1
33 #else
34 #define BLE_PROX_MONITOR        0
35 #endif // defined(CFG_PRF_PXPM)
36 
37 /// Proximity Profile Reporter Role
38 #if defined(CFG_PRF_PXPR)
39 #define BLE_PROX_REPORTER       1
40 #else
41 #define BLE_PROX_REPORTER       0
42 #endif // defined(CFG_PRF_PXPR)
43 
44 ///Find Me Profile Locator role
45 #if defined(CFG_PRF_FMPL)
46 #define BLE_FINDME_LOCATOR      1
47 #else
48 #define BLE_FINDME_LOCATOR      0
49 #endif // defined(CFG_PRF_FMPL)
50 
51 ///Find Me Profile Target role
52 #if defined(CFG_PRF_FMPT)
53 #define BLE_FINDME_TARGET       1
54 #else
55 #define BLE_FINDME_TARGET       0
56 #endif // defined(CFG_PRF_FMPT)
57 
58 ///Health Thermometer Profile Collector Role
59 #if defined(CFG_PRF_HTPC)
60 #define BLE_HT_COLLECTOR        1
61 #else
62 #define BLE_HT_COLLECTOR        0
63 #endif // defined(CFG_PRF_HTPC)
64 
65 ///Health Thermometer Profile Thermometer Role
66 #if defined(CFG_PRF_HTPT)
67 #define BLE_HT_THERMOM          1
68 #else
69 #define BLE_HT_THERMOM          0
70 #endif // defined(CFG_PRF_HTPT)
71 
72 ///Device Information Service Client Role
73 #if defined(CFG_PRF_DISC)
74 #define BLE_DIS_CLIENT          1
75 #else
76 #define BLE_DIS_CLIENT          0
77 #endif // defined(CFG_PRF_DISC)
78 
79 ///Device Information Service Server Role
80 #if defined(CFG_PRF_DISS)
81 #define BLE_DIS_SERVER          1
82 #else
83 #define BLE_DIS_SERVER          0
84 #endif // defined(CFG_PRF_DISS)
85 
86 ///Blood Pressure Profile Collector Role
87 #if defined(CFG_PRF_BLPC)
88 #define BLE_BP_COLLECTOR        1
89 #else
90 #define BLE_BP_COLLECTOR        0
91 #endif // defined(CFG_PRF_BLPC)
92 
93 ///Blood Pressure Profile Sensor Role
94 #if defined(CFG_PRF_BLPS)
95 #define BLE_BP_SENSOR           1
96 #else
97 #define BLE_BP_SENSOR           0
98 #endif // defined(CFG_PRF_BLPS)
99 
100 ///Time Profile Client Role
101 #if defined(CFG_PRF_TIPC)
102 #define BLE_TIP_CLIENT          1
103 #else
104 #define BLE_TIP_CLIENT          0
105 #endif // defined(CFG_PRF_TIPC)
106 
107 ///Time Profile Server Role
108 #if defined(CFG_PRF_TIPS)
109 #define BLE_TIP_SERVER          1
110 #else
111 #define BLE_TIP_SERVER          0
112 #endif // defined(CFG_PRF_TIPS)
113 
114 ///Heart Rate Profile Collector Role
115 #if defined(CFG_PRF_HRPC)
116 #define BLE_HR_COLLECTOR        1
117 #else
118 #define BLE_HR_COLLECTOR        0
119 #endif // defined(CFG_PRF_HRPC)
120 
121 ///Heart Rate Profile Sensor Role
122 #if defined(CFG_PRF_HRPS)
123 #define BLE_HR_SENSOR           1
124 #else
125 #define BLE_HR_SENSOR           0
126 #endif // defined(CFG_PRF_HRPS)
127 
128 ///Scan Parameter Profile Client Role
129 #if defined(CFG_PRF_SCPPC)
130 #define BLE_SP_CLIENT           1
131 #else
132 #define BLE_SP_CLIENT           0
133 #endif // defined(CFG_PRF_SCPPC)
134 
135 ///Scan Parameter Profile Server Role
136 #if defined(CFG_PRF_SCPPS)
137 #define BLE_SP_SERVER           1
138 #else
139 #define BLE_SP_SERVER           0
140 #endif // defined(CFG_PRF_SCPPS)
141 
142 ///Battery Service Client Role
143 #if defined(CFG_PRF_BASC)
144 #define BLE_BATT_CLIENT         1
145 #else
146 #define BLE_BATT_CLIENT         0
147 #endif // defined(CFG_PRF_BASC)
148 
149 ///Battery Service Server Role
150 #if defined(CFG_PRF_BASS)
151 #define BLE_BATT_SERVER         1
152 #else
153 #define BLE_BATT_SERVER         0
154 #endif // defined(CFG_PRF_BASS)
155 
156 ///HID Device Role
157 #if defined(CFG_PRF_HOGPD)
158 #define BLE_HID_DEVICE          1
159 #else
160 #define BLE_HID_DEVICE          0
161 #endif // defined(CFG_PRF_HOGPD)
162 
163 ///HID Boot Host Role
164 #if defined(CFG_PRF_HOGPBH)
165 #define BLE_HID_BOOT_HOST       1
166 #else
167 #define BLE_HID_BOOT_HOST       0
168 #endif // defined(CFG_PRF_HOGPBH)
169 
170 ///HID Report Host Role
171 #if defined(CFG_PRF_HOGPRH)
172 #define BLE_HID_REPORT_HOST     1
173 #else
174 #define BLE_HID_REPORT_HOST     0
175 #endif // defined(CFG_PRF_HOGPRH)
176 
177 /// Glucose Profile Collector Role
178 #if defined(CFG_PRF_GLPC)
179 #define BLE_GL_COLLECTOR        1
180 #else
181 #define BLE_GL_COLLECTOR        0
182 #endif // defined(CFG_PRF_GLPC)
183 
184 /// Glucose Profile Sensor Role
185 #if defined(CFG_PRF_GLPS)
186 #define BLE_GL_SENSOR           1
187 #else
188 #define BLE_GL_SENSOR           0
189 #endif // defined(CFG_PRF_GLPS)
190 
191 /// Running Speed and Cadence Profile Collector Role
192 #if defined(CFG_PRF_RSCPC)
193 #define BLE_RSC_COLLECTOR       1
194 #else
195 #define BLE_RSC_COLLECTOR       0
196 #endif // defined(CFG_PRF_RSCPC)
197 
198 /// Running Speed and Cadence Profile Server Role
199 #if defined(CFG_PRF_RSCPS)
200 #define BLE_RSC_SENSOR          1
201 #else
202 #define BLE_RSC_SENSOR          0
203 #endif // defined(CFG_PRF_RSCPS)
204 
205 /// Cycling Speed and Cadence Profile Collector Role
206 #if defined(CFG_PRF_CSCPC)
207 #define BLE_CSC_COLLECTOR       1
208 #else
209 #define BLE_CSC_COLLECTOR       0
210 #endif // defined(CFG_PRF_CSCPC)
211 
212 /// Cycling Speed and Cadence Profile Server Role
213 #if defined(CFG_PRF_CSCPS)
214 #define BLE_CSC_SENSOR          1
215 #else
216 #define BLE_CSC_SENSOR          0
217 #endif // defined(CFG_PRF_CSCPS)
218 
219 /// Cycling Power Profile Collector Role
220 #if defined(CFG_PRF_CPPC)
221 #define BLE_CP_COLLECTOR        1
222 #else
223 #define BLE_CP_COLLECTOR        0
224 #endif // defined (CFG_PRF_CPPC)
225 
226 /// Cycling Power Profile Server Role
227 #if defined(CFG_PRF_CPPS)
228 #define BLE_CP_SENSOR            1
229 #else
230 #define BLE_CP_SENSOR            0
231 #endif // defined (CFG_PRF_CPPS)
232 
233 /// Location and Navigation Profile Collector Role
234 #if defined(CFG_PRF_LANC)
235 #define BLE_LN_COLLECTOR        1
236 #else
237 #define BLE_LN_COLLECTOR        0
238 #endif // defined (CFG_PRF_LANC)
239 
240 /// Location and Navigation Profile Server Role
241 #if defined(CFG_PRF_LANS)
242 #define BLE_LN_SENSOR            1
243 #else
244 #define BLE_LN_SENSOR            0
245 #endif // defined (CFG_PRF_LANS)
246 
247 /// Alert Notification Profile Client Role
248 #if defined(CFG_PRF_ANPC)
249 #define BLE_AN_CLIENT           1
250 #else
251 #define BLE_AN_CLIENT           0
252 #endif // defined(CFG_PRF_ANPC)
253 
254 /// Alert Notification Profile Server Role
255 #if defined(CFG_PRF_ANPS)
256 #define BLE_AN_SERVER           1
257 #else
258 #define BLE_AN_SERVER           0
259 #endif // defined(CFG_PRF_ANPS)
260 
261 /// Phone Alert Status Profile Client Role
262 #if defined(CFG_PRF_PASPC)
263 #define BLE_PAS_CLIENT          1
264 #else
265 #define BLE_PAS_CLIENT          0
266 #endif // defined(CFG_PRF_PASPC)
267 
268 /// Phone Alert Status Profile Server Role
269 #if defined(CFG_PRF_PASPS)
270 #define BLE_PAS_SERVER          1
271 #else
272 #define BLE_PAS_SERVER          0
273 #endif // defined(CFG_PRF_PASPS)
274 
275 /// Internet Protocol Support Profile Server Role
276 #if defined(CFG_PRF_IPSS)
277 #define BLE_IPS_SERVER          1
278 #else
279 #define BLE_IPS_SERVER          0
280 #endif // defined(CFG_PRF_IPSS)
281 
282 /// Internet Protocol Support Profile Client Role
283 #if defined(CFG_PRF_IPSC)
284 #define BLE_IPS_CLIENT          1
285 #else
286 #define BLE_IPS_CLIENT          0
287 #endif // defined(CFG_PRF_IPSC)
288 
289 /// Environmental Sensing Profile Server Role
290 #if defined(CFG_PRF_ENVS)
291 #define BLE_ENV_SERVER          1
292 #else
293 #define BLE_ENV_SERVER          0
294 #endif // defined(CFG_PRF_ENVS)
295 
296 /// Environmental Sensing Profile Client Role
297 #if defined(CFG_PRF_ENVC)
298 #define BLE_ENV_CLIENT          1
299 #else
300 #define BLE_ENV_CLIENT          0
301 #endif // defined(CFG_PRF_ENVC)
302 
303 /// Weight Scale Profile Server Role
304 #if defined(CFG_PRF_WSCS)
305 #define BLE_WSC_SERVER          1
306 #else
307 #define BLE_WSC_SERVER          0
308 #endif // defined(CFG_PRF_WSCS)
309 
310 /// Weight Scale Profile Client Role
311 #if defined(CFG_PRF_WSCC)
312 #define BLE_WSC_CLIENT          1
313 #else
314 #define BLE_WSC_CLIENT          0
315 #endif // defined(CFG_PRF_WSCC)
316 
317 /// Body Composition Server Role
318 #if defined(CFG_PRF_BCSS)
319 #define BLE_BCS_SERVER          1
320 #else
321 #define BLE_BCS_SERVER          0
322 #endif // defined(CFG_PRF_BCSS)
323 
324 /// Body Composition Client Role
325 #if defined(CFG_PRF_BCSC)
326 #define BLE_BCS_CLIENT          1
327 #else
328 #define BLE_BCS_CLIENT          0
329 #endif // defined(CFG_PRF_BCSC)
330 
331 /// User Data Service Server Role
332 #if defined(CFG_PRF_UDSS)
333 #define BLE_UDS_SERVER          1
334 #else
335 #define BLE_UDS_SERVER          0
336 #endif // defined(CFG_PRF_UDSS)
337 
338 /// User Data Service Client Role
339 #if defined(CFG_PRF_UDSC)
340 #define BLE_UDS_CLIENT          1
341 #else
342 #define BLE_UDS_CLIENT          0
343 #endif // defined(CFG_PRF_UDSC)
344 
345 /// Wireless Power Transfer Profile Server Role
346 #if defined(CFG_PRF_WPTS)
347 #define BLE_WPT_SERVER          1
348 #else
349 #define BLE_WPT_SERVER          0
350 #endif // defined(CFG_PRF_WPTS)
351 
352 /// Wireless Power Transfer Profile Client Role
353 #if defined(CFG_PRF_WPTC)
354 #define BLE_WPT_CLIENT          1
355 #else
356 #define BLE_WPT_CLIENT          0
357 #endif // defined(CFG_PRF_WPTC)
358 ///Health Thermometer Profile Thermometer Role
359 #if defined(CFG_APP_USER)
360 #define BLE_APP_SERVER        1
361 #else
362 #define BLE_APP_SERVER          0
363 #endif // defined(CFG_PRF_HTPT)
364 /// BLE_CLIENT_PRF indicates if at least one client profile is present
365 #if (BLE_PROX_MONITOR || BLE_FINDME_LOCATOR || BLE_HT_COLLECTOR || BLE_BP_COLLECTOR \
366         || BLE_HR_COLLECTOR || BLE_DIS_CLIENT || BLE_TIP_CLIENT || BLE_SP_CLIENT \
367         || BLE_BATT_CLIENT || BLE_GL_COLLECTOR || BLE_HID_BOOT_HOST || BLE_HID_REPORT_HOST \
368         || BLE_RSC_COLLECTOR || BLE_CSC_COLLECTOR || BLE_CP_COLLECTOR || BLE_LN_COLLECTOR || BLE_AN_CLIENT \
369         || BLE_PAS_CLIENT || BLE_IPS_CLIENT || BLE_ENV_CLIENT || BLE_WSC_CLIENT \
370         || BLE_UDS_CLIENT || BLE_BCS_CLIENT || BLE_WPT_CLIENT)
371 #define BLE_CLIENT_PRF          1
372 #else
373 #define BLE_CLIENT_PRF          0
374 #endif //(BLE_PROX_MONITOR || BLE_FINDME_LOCATOR ...)
375 
376 /// BLE_SERVER_PRF indicates if at least one server profile is present
377 #if (BLE_PROX_REPORTER || BLE_FINDME_TARGET || BLE_HT_THERMOM || BLE_BP_SENSOR \
378         || BLE_TIP_SERVER || BLE_HR_SENSOR || BLE_DIS_SERVER || BLE_SP_SERVER \
379         || BLE_BATT_SERVER || BLE_HID_DEVICE || BLE_GL_SENSOR || BLE_RSC_SENSOR  \
380         || BLE_CSC_SENSOR || BLE_CP_SENSOR || BLE_LN_SENSOR || BLE_AN_SERVER \
381         || BLE_PAS_SERVER || BLE_IPS_SERVER || BLE_ENV_SERVER || BLE_WSC_SERVER \
382         || BLE_UDS_SERVER || BLE_BCS_SERVER || BLE_WPT_SERVER||BLE_APP_SERVER)
383 #define BLE_SERVER_PRF          1
384 #else
385 #define BLE_SERVER_PRF          0
386 #endif //(BLE_PROX_REPORTER || BLE_FINDME_TARGET ...)
387 
388 //Force ATT parts depending on profile roles or compile options
389 /// Attribute Client
390 #if (BLE_CLIENT_PRF)
391 #define BLE_ATTC                    1
392 #endif //(BLE_CLIENT_PRF)
393 
394 /// Attribute Server
395 #if (BLE_SERVER_PRF)
396 #define BLE_ATTS                    1
397 #endif //(BLE_SERVER_PRF)
398 
399 
400 #elif (BLE_OBSERVER || BLE_BROADCASTER)
401 /// Proximity Profile Monitor Role
402 #define BLE_PROX_MONITOR            0
403 /// Proximity Profile Reporter Role
404 #define BLE_PROX_REPORTER           0
405 ///Find Me Profile Locator role
406 #define BLE_FINDME_LOCATOR          0
407 ///Find Me Profile Target role
408 #define BLE_FINDME_TARGET           0
409 ///Health Thermometer Profile Collector Role
410 #define BLE_HT_COLLECTOR            0
411 ///Health Thermometer Profile Thermometer Role
412 #define BLE_HT_THERMOM              0
413 ///Blood Pressure Profile Collector Role
414 #define BLE_BP_COLLECTOR            0
415 ///Blood Pressure Profile Sensor Role
416 #define BLE_BP_SENSOR               0
417 ///Heart Rate Profile Collector Role
418 #define BLE_HR_COLLECTOR            0
419 ///Heart Rate Profile Sensor Role
420 #define BLE_HR_SENSOR               0
421 ///Time Profile Client Role
422 #define BLE_TIP_CLIENT              0
423 ///Time Profile Server Role
424 #define BLE_TIP_SERVER              0
425 /// Device Information Service Client Role
426 #define BLE_DIS_CLIENT              0
427 /// Device Information Service Server Role
428 #define BLE_DIS_SERVER              0
429 /// Scan Parameter Profile Client Role
430 #define BLE_SP_CLIENT               0
431 /// Scan Parameter Profile Server Role
432 #define BLE_SP_SERVER               0
433 /// Battery Service Client Role
434 #define BLE_BATT_CLIENT             0
435 /// Battery Service Server Role
436 #define BLE_BATT_SERVER             0
437 /// HID Device Role
438 #define BLE_HID_DEVICE              0
439 /// HID Boot Host Role
440 #define BLE_HID_BOOT_HOST           0
441 /// HID Report Host Role
442 #define BLE_HID_REPORT_HOST         0
443 /// Glucose Profile Collector Role
444 #define BLE_GL_COLLECTOR            0
445 /// Glucose Profile Sensor Role
446 #define BLE_GL_SENSOR               0
447 /// Running Speed and Cadence Collector Role
448 #define BLE_RSC_COLLECTOR           0
449 /// Running Speed and Cadence Server Role
450 #define BLE_RSC_SENSOR              0
451 /// Cycling Speed and Cadence Collector Role
452 #define BLE_CSC_COLLECTOR           0
453 /// Cycling Speed and Cadence Server Role
454 #define BLE_CSC_SENSOR              0
455 /// Cycling Power Collector Role
456 #define BLE_CP_COLLECTOR            0
457 /// Cycling Power Server Role
458 #define BLE_CP_SENSOR               0
459 /// Location and Navigation Collector Role
460 #define BLE_LN_COLLECTOR            0
461 /// Location and Navigation Server Role
462 #define BLE_LN_SENSOR               0
463 /// Alert Notification Client Role
464 #define BLE_AN_CLIENT               0
465 /// Alert Notification Server Role
466 #define BLE_AN_SERVER               0
467 /// Phone Alert Status Client Role
468 #define BLE_PAS_CLIENT              0
469 /// Phone Alert Status Server Role
470 #define BLE_PAS_SERVER              0
471 /// Internet Protocol Support Profile Server Role
472 #define BLE_IPS_SERVER              0
473 /// Internet Protocol Support Profile Client Role
474 #define BLE_IPS_CLIENT              0
475 /// Environmental Sensing Profile Server Role
476 #define BLE_ENV_SERVER              0
477 /// Environmental Sensing Profile Client Role
478 #define BLE_ENV_CLIENT              0
479 /// Weight Scale Profile Server Role
480 #define BLE_WSC_SERVER              0
481 /// Weight Scale Profile Client Role
482 #define BLE_WSC_CLIENT              0
483 /// Body Composition Profile Client Role
484 #define BLE_BCS_CLIENT          0
485 /// Body Composition Profile Server Role
486 #define BLE_BCS_SERVER          0
487 /// User Data Service Server Role
488 #define BLE_UDS_SERVER              0
489 /// User Data Service Client Role
490 #define BLE_UDS_CLIENT              0
491 /// Wireless Power Transfer Profile Server Role
492 #define BLE_WPT_SERVER              0
493 /// Wireless Power Transfer Profile Client Role
494 #define BLE_WPT_CLIENT              0
495 
496 //Force ATT parts to 0
497 /// External database management
498 #define BLE_EXT_ATTS_DB             0
499 /// Profile Server
500 #define BLE_SERVER_PRF              0
501 /// Profile Client
502 #define BLE_CLIENT_PRF              0
503 #endif //(BLE_OBSERVER || BLE_BROADCASTER)
504 
505 
506 /// @} PRF_CONFIG
507 
508 #endif /* _RWPRF_CONFIG_H_ */
509