RDK Documentation (Open Sourced RDK Components)
btmgr_iarm_internal_interface.c
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 #include <stdlib.h>
20 #include <string.h>
21 
22 #include "btmgr.h"
23 #include "btrMgr_logger.h"
24 #include "btmgr_iarm_interface.h"
26 
27 
28 /* Static Function Prototypes */
29 static IARM_Result_t btrMgr_GetNumberOfAdapters (void* arg);
30 static IARM_Result_t btrMgr_SetAdapterName (void* arg);
31 static IARM_Result_t btrMgr_GetAdapterName (void* arg);
32 static IARM_Result_t btrMgr_SetAdapterPowerStatus (void* arg);
33 static IARM_Result_t btrMgr_GetAdapterPowerStatus (void* arg);
34 static IARM_Result_t btrMgr_SetAdapterDiscoverable (void* arg);
35 static IARM_Result_t btrMgr_IsAdapterDiscoverable (void* arg);
36 static IARM_Result_t btrMgr_ChangeDeviceDiscoveryStatus (void* arg);
37 static IARM_Result_t btrMgr_GetDeviceDiscoveryStatus (void* arg);
38 static IARM_Result_t btrMgr_GetDiscoveredDevices (void* arg);
39 static IARM_Result_t btrMgr_PairDevice (void* arg);
40 static IARM_Result_t btrMgr_UnpairDevice (void* arg);
41 static IARM_Result_t btrMgr_GetPairedDevices (void* arg);
42 static IARM_Result_t btrMgr_ConnectToDevice (void* arg);
43 static IARM_Result_t btrMgr_DisconnectFromDevice (void* arg);
44 static IARM_Result_t btrMgr_GetConnectedDevices (void* arg);
45 static IARM_Result_t btrMgr_GetDeviceProperties (void* arg);
46 static IARM_Result_t btrMgr_StartAudioStreamingOut (void* arg);
47 static IARM_Result_t btrMgr_StopAudioStreamingOut (void* arg);
48 static IARM_Result_t btrMgr_IsAudioStreamingOut (void* arg);
49 static IARM_Result_t btrMgr_SetAudioStreamOutType (void* arg);
50 static IARM_Result_t btrMgr_StartAudioStreamingIn (void* arg);
51 static IARM_Result_t btrMgr_StopAudioStreamingIn (void* arg);
52 static IARM_Result_t btrMgr_IsAudioStreamingIn (void* arg);
53 static IARM_Result_t btrMgr_SetEventResponse (void* arg);
54 static IARM_Result_t btrMgr_ResetAdapter (void* arg);
55 static IARM_Result_t btrMgr_MediaControl (void* arg);
56 static IARM_Result_t btrMgr_SetDeviceVolumeMute (void* arg);
57 static IARM_Result_t btrMgr_GetDeviceVolumeMute (void* arg);
58 static IARM_Result_t btrMgr_GetMediaTrackInfo (void* arg);
59 static IARM_Result_t btrMgr_GetMediaElementTrackInfo (void* arg);
60 static IARM_Result_t btrMgr_GetMediaCurrentPosition (void* arg);
61 static IARM_Result_t btrMgr_SetMediaElementActive (void* arg);
62 static IARM_Result_t btrMgr_GetMediaElementList (void* arg);
63 static IARM_Result_t btrMgr_SelectMediaElement (void* arg);
64 static IARM_Result_t btrMgr_GetLeProperty (void* arg);
65 static IARM_Result_t btrMgr_PerformLeOp (void* arg);
66 static IARM_Result_t btrMgr_SetAudioInServiceState (void* arg);
67 static IARM_Result_t btrMgr_SysDiagInfo(void* arg);
68 static IARM_Result_t btrMgr_ConnectToWifi(void* arg);
69 static IARM_Result_t btrMgr_GetLimitBeaconDetection (void* arg);
70 static IARM_Result_t btrMgr_SetLimitBeaconDetection (void* arg);
71 static IARM_Result_t btrMgr_DeInit (void* arg);
72 static IARM_Result_t btrMgr_LeStartAdvertisement(void* arg);
73 static IARM_Result_t btrMgr_LeStopAdvertisement(void *arg);
74 static IARM_Result_t btrMgr_LeGetPropertyValue(void* arg);
75 static IARM_Result_t btrMgr_LeSetServiceInfo(void* arg);
76 static IARM_Result_t btrMgr_LeSetGattInfo(void* arg);
77 static IARM_Result_t btrMgr_LeSetGattPropertyValue(void* arg);
78 
79 /* Callbacks Prototypes */
80 static BTRMGR_Result_t btrMgr_EventCallback (BTRMGR_EventMessage_t astEventMessage);
81 
82 static unsigned char gIsBTRMGR_Internal_Inited = 0;
83 
84 
85 /* Static Function Definition */
86 static IARM_Result_t
87 btrMgr_GetNumberOfAdapters (
88  void* arg
89 ) {
90  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
91  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
92  unsigned char numOfAdapters = 0;
93  unsigned char* pNumberOfAdapters = (unsigned char*) arg;
94 
95  BTRMGRLOG_INFO ("Entering\n");
96 
97  if (!gIsBTRMGR_Internal_Inited) {
98  retCode = IARM_RESULT_INVALID_STATE;
99  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
100  return retCode;
101  }
102 
103  if (!pNumberOfAdapters) {
104  retCode = IARM_RESULT_INVALID_PARAM;
105  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
106  return retCode;
107  }
108 
109 
110  rc = BTRMGR_GetNumberOfAdapters(&numOfAdapters);
111  if (BTRMGR_RESULT_SUCCESS == rc) {
112  *pNumberOfAdapters = numOfAdapters;
113  BTRMGRLOG_INFO ("Success; Number of Adapters = %d\n", numOfAdapters);
114  }
115  else {
116  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
117  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
118  }
119 
120 
121  return retCode;
122 }
123 
124 static IARM_Result_t
125 btrMgr_SetAdapterName (
126  void* arg
127 ) {
128  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
129  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
131 
132  BTRMGRLOG_INFO ("Entering\n");
133 
134  if (!gIsBTRMGR_Internal_Inited) {
135  retCode = IARM_RESULT_INVALID_STATE;
136  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
137  return retCode;
138  }
139 
140  if (!pName) {
141  retCode = IARM_RESULT_INVALID_PARAM;
142  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
143  return retCode;
144  }
145 
146 
147  rc = BTRMGR_SetAdapterName(pName->m_adapterIndex, pName->m_name);
148  if (BTRMGR_RESULT_SUCCESS == rc) {
149  BTRMGRLOG_INFO ("Success\n");
150  }
151  else {
152  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
153  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
154  }
155 
156 
157  return retCode;
158 }
159 
160 static IARM_Result_t
161 btrMgr_GetAdapterName (
162  void* arg
163 ) {
164  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
165  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
167 
168  BTRMGRLOG_INFO ("Entering\n");
169 
170  if (!gIsBTRMGR_Internal_Inited) {
171  retCode = IARM_RESULT_INVALID_STATE;
172  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
173  return retCode;
174  }
175 
176  if (!pName) {
177  retCode = IARM_RESULT_INVALID_PARAM;
178  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
179  return retCode;
180  }
181 
182 
183  rc = BTRMGR_GetAdapterName(pName->m_adapterIndex, pName->m_name);
184  if (BTRMGR_RESULT_SUCCESS == rc) {
185  BTRMGRLOG_INFO ("Success ; Adapter name is %s\n", pName->m_name);
186  }
187  else {
188  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
189  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
190  }
191 
192 
193  return retCode;
194 }
195 
196 static IARM_Result_t
197 btrMgr_SetAdapterPowerStatus (
198  void* arg
199 ) {
200  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
201  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
203 
204  BTRMGRLOG_INFO ("Entering\n");
205 
206  if (!gIsBTRMGR_Internal_Inited) {
207  retCode = IARM_RESULT_INVALID_STATE;
208  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
209  return retCode;
210  }
211 
212  if (!pPowerStatus) {
213  retCode = IARM_RESULT_INVALID_PARAM;
214  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
215  return retCode;
216  }
217 
218 
219  rc = BTRMGR_SetAdapterPowerStatus(pPowerStatus->m_adapterIndex, pPowerStatus->m_powerStatus);
220  if (BTRMGR_RESULT_SUCCESS == rc) {
221  BTRMGRLOG_INFO ("Success\n");
222  }
223  else {
224  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
225  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
226  }
227 
228 
229  return retCode;
230 }
231 
232 static IARM_Result_t
233 btrMgr_GetAdapterPowerStatus (
234  void* arg
235 ) {
236  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
237  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
239 
240  BTRMGRLOG_INFO ("Entering\n");
241 
242  if (!gIsBTRMGR_Internal_Inited) {
243  retCode = IARM_RESULT_INVALID_STATE;
244  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
245  return retCode;
246  }
247 
248  if (!pPowerStatus) {
249  retCode = IARM_RESULT_INVALID_PARAM;
250  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
251  return retCode;
252  }
253 
254 
255  rc = BTRMGR_GetAdapterPowerStatus(pPowerStatus->m_adapterIndex, &pPowerStatus->m_powerStatus);
256  if (BTRMGR_RESULT_SUCCESS == rc) {
257  BTRMGRLOG_INFO ("Success\n");
258  }
259  else {
260  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
261  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
262  }
263 
264 
265  return retCode;
266 }
267 
268 static IARM_Result_t
269 btrMgr_SetAdapterDiscoverable (
270  void* arg
271 ) {
272  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
273  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
275 
276  BTRMGRLOG_INFO ("Entering\n");
277 
278  if (!gIsBTRMGR_Internal_Inited) {
279  retCode = IARM_RESULT_INVALID_STATE;
280  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
281  return retCode;
282  }
283 
284  if (!pDiscoverable) {
285  retCode = IARM_RESULT_INVALID_PARAM;
286  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
287  return retCode;
288  }
289 
290 
291  rc = BTRMGR_SetAdapterDiscoverable(pDiscoverable->m_adapterIndex, pDiscoverable->m_isDiscoverable, pDiscoverable->m_timeout);
292  if (BTRMGR_RESULT_SUCCESS == rc) {
293  BTRMGRLOG_INFO ("Success\n");
294  }
295  else {
296  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
297  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
298  }
299 
300 
301  return retCode;
302 }
303 
304 static IARM_Result_t
305 btrMgr_IsAdapterDiscoverable (
306  void* arg
307 ) {
308  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
309  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
311 
312  BTRMGRLOG_INFO ("Entering\n");
313 
314  if (!gIsBTRMGR_Internal_Inited) {
315  retCode = IARM_RESULT_INVALID_STATE;
316  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
317  return retCode;
318  }
319 
320  if (!pDiscoverable) {
321  retCode = IARM_RESULT_INVALID_PARAM;
322  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
323  return retCode;
324  }
325 
326 
327  rc = BTRMGR_IsAdapterDiscoverable(pDiscoverable->m_adapterIndex, &pDiscoverable->m_isDiscoverable);
328  if (BTRMGR_RESULT_SUCCESS == rc) {
329  BTRMGRLOG_INFO ("Success\n");
330  }
331  else {
332  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
333  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
334  }
335 
336 
337  return retCode;
338 }
339 
340 static IARM_Result_t
341 btrMgr_ChangeDeviceDiscoveryStatus (
342  void* arg
343 ) {
344  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
345  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
347 
348  BTRMGRLOG_INFO ("Entering\n");
349 
350  if (!gIsBTRMGR_Internal_Inited) {
351  retCode = IARM_RESULT_INVALID_STATE;
352  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
353  return retCode;
354  }
355 
356  if (!pAdapterIndex) {
357  retCode = IARM_RESULT_INVALID_PARAM;
358  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
359  return retCode;
360  }
361 
362 
363  if (pAdapterIndex->m_setDiscovery)
364  rc = BTRMGR_StartDeviceDiscovery(pAdapterIndex->m_adapterIndex, pAdapterIndex->m_enBTRMgrDevOpT);
365  else
366  rc = BTRMGR_StopDeviceDiscovery(pAdapterIndex->m_adapterIndex, pAdapterIndex->m_enBTRMgrDevOpT);
367 
368  if (BTRMGR_RESULT_SUCCESS == rc) {
369  BTRMGRLOG_INFO ("Success\n");
370  }
371  else {
372  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
373  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
374  }
375 
376 
377  return retCode;
378 }
379 
380 static IARM_Result_t
381 btrMgr_GetDeviceDiscoveryStatus (
382  void* arg
383 ) {
384  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
385  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
387 
388  BTRMGRLOG_INFO ("Entering\n");
389 
390  if (!gIsBTRMGR_Internal_Inited) {
391  retCode = IARM_RESULT_INVALID_STATE;
392  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
393  return retCode;
394  }
395 
396  if (!pDiscoverStatus) {
397  retCode = IARM_RESULT_INVALID_PARAM;
398  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
399  return retCode;
400  }
401 
402  rc = BTRMGR_GetDiscoveryStatus(pDiscoverStatus->m_adapterIndex, &pDiscoverStatus->m_discoveryInProgress, &pDiscoverStatus->m_discoveryType);
403  if (BTRMGR_RESULT_SUCCESS == rc) {
404  BTRMGRLOG_INFO ("Success\n");
405  }
406  else {
407  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
408  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
409  }
410  return retCode;
411 }
412 
413 static IARM_Result_t
414 btrMgr_GetDiscoveredDevices (
415  void* arg
416 ) {
417  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
418  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
420 
421  BTRMGRLOG_TRACE ("Entering\n");
422 
423  if (!gIsBTRMGR_Internal_Inited) {
424  retCode = IARM_RESULT_INVALID_STATE;
425  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
426  return retCode;
427  }
428 
429  if (!pDiscoveredDevices) {
430  retCode = IARM_RESULT_INVALID_PARAM;
431  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
432  return retCode;
433  }
434 
435 
436  rc = BTRMGR_GetDiscoveredDevices(pDiscoveredDevices->m_adapterIndex, &pDiscoveredDevices->m_devices);
437  if (BTRMGR_RESULT_SUCCESS == rc) {
438  BTRMGRLOG_TRACE ("Success\n");
439  }
440  else {
441  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
442  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
443  }
444 
445 
446  return retCode;
447 }
448 
449 static IARM_Result_t
450 btrMgr_PairDevice (
451  void* arg
452 ) {
453  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
454  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
455  BTRMGR_IARMPairDevice_t* pPairDevice = (BTRMGR_IARMPairDevice_t*) arg;
456 
457  BTRMGRLOG_INFO ("Entering\n");
458 
459  if (!gIsBTRMGR_Internal_Inited) {
460  retCode = IARM_RESULT_INVALID_STATE;
461  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
462  return retCode;
463  }
464 
465  if (!pPairDevice) {
466  retCode = IARM_RESULT_INVALID_PARAM;
467  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
468  return retCode;
469  }
470 
471 
472  rc = BTRMGR_PairDevice(pPairDevice->m_adapterIndex, pPairDevice->m_deviceHandle);
473  if (BTRMGR_RESULT_SUCCESS == rc) {
474  BTRMGRLOG_INFO ("Success\n");
475  }
476  else {
477 #if 0
478  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
479 #endif
480  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
481  }
482 
483 
484  return retCode;
485 }
486 
487 static IARM_Result_t
488 btrMgr_UnpairDevice (
489  void* arg
490 ) {
491  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
492  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
493  BTRMGR_IARMPairDevice_t* pUnPairDevice = (BTRMGR_IARMPairDevice_t*) arg;
494 
495  BTRMGRLOG_INFO ("Entering\n");
496 
497  if (!gIsBTRMGR_Internal_Inited) {
498  retCode = IARM_RESULT_INVALID_STATE;
499  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
500  return retCode;
501  }
502 
503  if (!pUnPairDevice) {
504  retCode = IARM_RESULT_INVALID_PARAM;
505  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
506  return retCode;
507  }
508 
509 
510  rc = BTRMGR_UnpairDevice(pUnPairDevice->m_adapterIndex, pUnPairDevice->m_deviceHandle);
511  if (BTRMGR_RESULT_SUCCESS == rc) {
512  BTRMGRLOG_INFO ("Success\n");
513  }
514  else {
515 #if 0
516  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
517 #endif
518  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
519  }
520 
521 
522  return retCode;
523 }
524 
525 static IARM_Result_t
526 btrMgr_GetPairedDevices (
527  void* arg
528 ) {
529  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
530  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
532 
533  BTRMGRLOG_TRACE ("Entering\n");
534 
535  if (!gIsBTRMGR_Internal_Inited) {
536  retCode = IARM_RESULT_INVALID_STATE;
537  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
538  return retCode;
539  }
540 
541  if (!pPairedDevices) {
542  retCode = IARM_RESULT_INVALID_PARAM;
543  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
544  return retCode;
545  }
546 
547 
548  rc = BTRMGR_GetPairedDevices(pPairedDevices->m_adapterIndex, &pPairedDevices->m_devices);
549  if (BTRMGR_RESULT_SUCCESS == rc) {
550  BTRMGRLOG_TRACE ("Success\n");
551  }
552  else {
553  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
554  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
555  }
556 
557 
558  return retCode;
559 }
560 
561 static IARM_Result_t
562 btrMgr_ConnectToDevice (
563  void* arg
564 ) {
565  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
566  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
568 
569  BTRMGRLOG_INFO ("Entering\n");
570 
571  if (!gIsBTRMGR_Internal_Inited) {
572  retCode = IARM_RESULT_INVALID_STATE;
573  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
574  return retCode;
575  }
576 
577  if (!pConnect) {
578  retCode = IARM_RESULT_INVALID_PARAM;
579  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
580  return retCode;
581  }
582 
583 
584  rc = BTRMGR_ConnectToDevice(pConnect->m_adapterIndex, pConnect->m_deviceHandle, pConnect->m_connectAs);
585  if (BTRMGR_RESULT_SUCCESS == rc) {
586  BTRMGRLOG_INFO ("Success\n");
587  }
588  else {
589  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
590  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
591  }
592 
593 
594  return retCode;
595 }
596 
597 static IARM_Result_t
598 btrMgr_DisconnectFromDevice (
599  void* arg
600 ) {
601  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
602  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
604 
605  BTRMGRLOG_INFO ("Entering\n");
606 
607  if (!gIsBTRMGR_Internal_Inited) {
608  retCode = IARM_RESULT_INVALID_STATE;
609  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
610  return retCode;
611  }
612 
613  if (!pConnect) {
614  retCode = IARM_RESULT_INVALID_PARAM;
615  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
616  return retCode;
617  }
618 
619 
620  rc = BTRMGR_DisconnectFromDevice(pConnect->m_adapterIndex, pConnect->m_deviceHandle);
621  if (BTRMGR_RESULT_SUCCESS == rc) {
622  BTRMGRLOG_INFO ("Success\n");
623  }
624  else {
625  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
626  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
627  }
628 
629 
630  return retCode;
631 }
632 
633 static IARM_Result_t
634 btrMgr_GetConnectedDevices (
635  void* arg
636 ) {
637  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
638  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
640 
641  BTRMGRLOG_TRACE ("Entering\n");
642 
643  if (!gIsBTRMGR_Internal_Inited) {
644  retCode = IARM_RESULT_INVALID_STATE;
645  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
646  return retCode;
647  }
648 
649  if (!pConnectedDevices) {
650  retCode = IARM_RESULT_INVALID_PARAM;
651  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
652  return retCode;
653  }
654 
655 
656  rc = BTRMGR_GetConnectedDevices(pConnectedDevices->m_adapterIndex, &pConnectedDevices->m_devices);
657  if (BTRMGR_RESULT_SUCCESS == rc) {
658  BTRMGRLOG_TRACE ("Success\n");
659  }
660  else {
661  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
662  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
663  }
664 
665 
666  return retCode;
667 }
668 
669 static IARM_Result_t
670 btrMgr_GetDeviceProperties (
671  void* arg
672 ) {
673  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
674  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
676 
677  BTRMGRLOG_INFO ("Entering\n");
678 
679  if (!gIsBTRMGR_Internal_Inited) {
680  retCode = IARM_RESULT_INVALID_STATE;
681  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
682  return retCode;
683  }
684 
685  if (!pDeviceProperty) {
686  retCode = IARM_RESULT_INVALID_PARAM;
687  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
688  return retCode;
689  }
690 
691 
692  rc = BTRMGR_GetDeviceProperties(pDeviceProperty->m_adapterIndex, pDeviceProperty->m_deviceHandle, &pDeviceProperty->m_deviceProperty);
693  if (BTRMGR_RESULT_SUCCESS == rc) {
694  BTRMGRLOG_INFO ("Success\n");
695  }
696  else {
697  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
698  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
699  }
700 
701 
702  return retCode;
703 }
704 
705 
706 static IARM_Result_t
707 btrMgr_StartAudioStreamingOut (
708  void* arg
709 ) {
710  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
711  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
712  BTRMGR_IARMStreaming_t* pStartStream = (BTRMGR_IARMStreaming_t*) arg;
713 
714  BTRMGRLOG_INFO ("Entering\n");
715 
716  if (!gIsBTRMGR_Internal_Inited) {
717  retCode = IARM_RESULT_INVALID_STATE;
718  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
719  return retCode;
720  }
721 
722  if (!pStartStream) {
723  retCode = IARM_RESULT_INVALID_PARAM;
724  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
725  return retCode;
726  }
727 
728 
729  rc = BTRMGR_StartAudioStreamingOut(pStartStream->m_adapterIndex, pStartStream->m_deviceHandle, pStartStream->m_audioPref);
730  if (BTRMGR_RESULT_SUCCESS == rc) {
731  BTRMGRLOG_INFO ("Success\n");
732  }
733  else {
734  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
735  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
736  }
737 
738 
739  return retCode;
740 }
741 
742 static IARM_Result_t
743 btrMgr_StopAudioStreamingOut (
744  void* arg
745 ) {
746  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
747  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
748  BTRMGR_IARMStreaming_t* pStopStream = (BTRMGR_IARMStreaming_t*) arg;
749 
750  BTRMGRLOG_INFO ("Entering\n");
751 
752  if (!gIsBTRMGR_Internal_Inited) {
753  retCode = IARM_RESULT_INVALID_STATE;
754  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
755  return retCode;
756  }
757 
758  if (!pStopStream) {
759  retCode = IARM_RESULT_INVALID_PARAM;
760  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
761  return retCode;
762  }
763 
764 
765  rc = BTRMGR_StopAudioStreamingOut(pStopStream->m_adapterIndex, pStopStream->m_deviceHandle);
766  if (BTRMGR_RESULT_SUCCESS == rc) {
767  BTRMGRLOG_INFO ("Success\n");
768  }
769  else {
770  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
771  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
772  }
773 
774 
775  return retCode;
776 }
777 
778 static IARM_Result_t
779 btrMgr_IsAudioStreamingOut (
780  void* arg
781 ) {
782  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
783  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
785 
786  BTRMGRLOG_INFO ("Entering\n");
787 
788  if (!gIsBTRMGR_Internal_Inited) {
789  retCode = IARM_RESULT_INVALID_STATE;
790  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
791  return retCode;
792  }
793 
794  if (!pStreamStatus) {
795  retCode = IARM_RESULT_INVALID_PARAM;
796  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
797  return retCode;
798  }
799 
800 
801  rc = BTRMGR_IsAudioStreamingOut(pStreamStatus->m_adapterIndex, &pStreamStatus->m_streamingStatus);
802  if (BTRMGR_RESULT_SUCCESS == rc) {
803  BTRMGRLOG_INFO ("Success\n");
804  }
805  else {
806  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
807  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
808  }
809 
810 
811  return retCode;
812 }
813 
814 static IARM_Result_t
815 btrMgr_SetAudioStreamOutType (
816  void* arg
817 ) {
818  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
819  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
821 
822  BTRMGRLOG_INFO ("Entering\n");
823 
824  if (!gIsBTRMGR_Internal_Inited) {
825  retCode = IARM_RESULT_INVALID_STATE;
826  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
827  return retCode;
828  }
829 
830  if (!pStartStream) {
831  retCode = IARM_RESULT_INVALID_PARAM;
832  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
833  return retCode;
834  }
835 
836 
837  rc = BTRMGR_SetAudioStreamingOutType(pStartStream->m_adapterIndex, pStartStream->m_audioOutType);
838  if (BTRMGR_RESULT_SUCCESS == rc) {
839  BTRMGRLOG_INFO ("Success\n");
840  }
841  else {
842  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
843  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
844  }
845 
846 
847  return retCode;
848 }
849 
850 static IARM_Result_t
851 btrMgr_StartAudioStreamingIn (
852  void* arg
853 ) {
854  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
855  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
856  BTRMGR_IARMStreaming_t* pStartStream = (BTRMGR_IARMStreaming_t*) arg;
857 
858  BTRMGRLOG_INFO ("Entering\n");
859 
860  if (!gIsBTRMGR_Internal_Inited) {
861  retCode = IARM_RESULT_INVALID_STATE;
862  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
863  return retCode;
864  }
865 
866  if (!pStartStream) {
867  retCode = IARM_RESULT_INVALID_PARAM;
868  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
869  return retCode;
870  }
871 
872 
873  rc = BTRMGR_StartAudioStreamingIn(pStartStream->m_adapterIndex, pStartStream->m_deviceHandle, pStartStream->m_audioPref);
874  if (BTRMGR_RESULT_SUCCESS == rc) {
875  BTRMGRLOG_INFO ("Success\n");
876  }
877  else {
878  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
879  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
880  }
881 
882 
883  return retCode;
884 }
885 
886 static IARM_Result_t
887 btrMgr_StopAudioStreamingIn (
888  void* arg
889 ) {
890  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
891  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
892  BTRMGR_IARMStreaming_t* pStopStream = (BTRMGR_IARMStreaming_t*) arg;
893 
894  BTRMGRLOG_INFO ("Entering\n");
895 
896  if (!gIsBTRMGR_Internal_Inited) {
897  retCode = IARM_RESULT_INVALID_STATE;
898  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
899  return retCode;
900  }
901 
902  if (!pStopStream) {
903  retCode = IARM_RESULT_INVALID_PARAM;
904  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
905  return retCode;
906  }
907 
908 
909  rc = BTRMGR_StopAudioStreamingIn(pStopStream->m_adapterIndex, pStopStream->m_deviceHandle);
910  if (BTRMGR_RESULT_SUCCESS == rc) {
911  BTRMGRLOG_INFO ("Success\n");
912  }
913  else {
914  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
915  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
916  }
917 
918 
919  return retCode;
920 }
921 
922 static IARM_Result_t
923 btrMgr_IsAudioStreamingIn (
924  void* arg
925 ) {
926  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
927  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
929 
930  BTRMGRLOG_INFO ("Entering\n");
931 
932  if (!gIsBTRMGR_Internal_Inited) {
933  retCode = IARM_RESULT_INVALID_STATE;
934  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
935  return retCode;
936  }
937 
938  if (!pStreamStatus) {
939  retCode = IARM_RESULT_INVALID_PARAM;
940  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
941  return retCode;
942  }
943 
944 
945  rc = BTRMGR_IsAudioStreamingIn(pStreamStatus->m_adapterIndex, &pStreamStatus->m_streamingStatus);
946  if (BTRMGR_RESULT_SUCCESS == rc) {
947  BTRMGRLOG_INFO ("Success\n");
948  }
949  else {
950  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
951  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
952  }
953 
954  return retCode;
955 }
956 
957 
958 static IARM_Result_t
959 btrMgr_SetEventResponse (
960  void* arg
961 ) {
962  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
963  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
964  BTRMGR_IARMEventResp_t* pIArmEvtResp = (BTRMGR_IARMEventResp_t*) arg;
965 
966  BTRMGRLOG_INFO ("Entering\n");
967 
968  if (!gIsBTRMGR_Internal_Inited) {
969  retCode = IARM_RESULT_INVALID_STATE;
970  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
971  return retCode;
972  }
973 
974  if (!pIArmEvtResp) {
975  retCode = IARM_RESULT_INVALID_PARAM;
976  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
977  return retCode;
978  }
979 
980  rc = BTRMGR_SetEventResponse(pIArmEvtResp->m_adapterIndex, &pIArmEvtResp->m_stBTRMgrEvtRsp);
981  if (BTRMGR_RESULT_SUCCESS == rc) {
982  BTRMGRLOG_INFO ("Success\n");
983  }
984  else {
985  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
986  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
987  }
988 
989  return retCode;
990 }
991 
992 static IARM_Result_t
993 btrMgr_MediaControl (
994  void* arg
995 ) {
996  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
997  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
999 
1000  BTRMGRLOG_INFO ("Entering\n");
1001 
1002  if (!gIsBTRMGR_Internal_Inited) {
1003  retCode = IARM_RESULT_INVALID_STATE;
1004  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1005  return retCode;
1006  }
1007 
1008  if (!pMediaProperty) {
1009  retCode = IARM_RESULT_INVALID_PARAM;
1010  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1011  return retCode;
1012  }
1013 
1014  rc = BTRMGR_MediaControl(pMediaProperty->m_adapterIndex, pMediaProperty->m_deviceHandle, pMediaProperty->m_mediaControlCmd);
1015  if (BTRMGR_RESULT_SUCCESS == rc) {
1016  BTRMGRLOG_INFO ("Success\n");
1017  }
1018  else {
1019  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1020  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1021  }
1022 
1023  return retCode;
1024 }
1025 
1026 
1027 static IARM_Result_t
1028 btrMgr_GetMediaCurrentPosition (
1029  void* arg
1030 ) {
1031  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1032  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1033  BTRMGR_IARMMediaProperty_t *pMediaProperty = (BTRMGR_IARMMediaProperty_t*) arg;
1034 
1035  BTRMGRLOG_INFO ("Entering\n");
1036 
1037  if (!gIsBTRMGR_Internal_Inited) {
1038  retCode = IARM_RESULT_INVALID_STATE;
1039  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1040  return retCode;
1041  }
1042 
1043  if (!pMediaProperty) {
1044  retCode = IARM_RESULT_INVALID_PARAM;
1045  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1046  return retCode;
1047  }
1048 
1049  rc = BTRMGR_GetMediaCurrentPosition(pMediaProperty->m_adapterIndex, pMediaProperty->m_deviceHandle, &pMediaProperty->m_mediaPositionInfo);
1050  if (BTRMGR_RESULT_SUCCESS == rc) {
1051  BTRMGRLOG_INFO ("Success\n");
1052  }
1053  else {
1054  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1055  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1056  }
1057 
1058  return retCode;
1059 }
1060 
1061 static IARM_Result_t
1062 btrMgr_GetDeviceVolumeMute (
1063  void* arg
1064 ) {
1065  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1066  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1068 
1069  BTRMGRLOG_INFO ("Entering\n");
1070 
1071  if (!gIsBTRMGR_Internal_Inited) {
1072  retCode = IARM_RESULT_INVALID_STATE;
1073  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1074  return retCode;
1075  }
1076 
1077  if (!pdevvolmut) {
1078  retCode = IARM_RESULT_INVALID_PARAM;
1079  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1080  return retCode;
1081  }
1082 
1083  rc = BTRMGR_GetDeviceVolumeMute(pdevvolmut->m_adapterIndex, pdevvolmut->m_deviceHandle, pdevvolmut->m_deviceOpType , &pdevvolmut->m_volume, &pdevvolmut->m_mute);
1084  if (BTRMGR_RESULT_SUCCESS == rc) {
1085  BTRMGRLOG_INFO ("Success\n");
1086  }
1087  else {
1088  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1089  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1090  }
1091 
1092  return retCode;
1093 }
1094 
1095 static IARM_Result_t
1096 btrMgr_SetDeviceVolumeMute (
1097  void* arg
1098 ) {
1099  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1100  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1102 
1103  BTRMGRLOG_INFO ("Entering\n");
1104 
1105  if (!gIsBTRMGR_Internal_Inited) {
1106  retCode = IARM_RESULT_INVALID_STATE;
1107  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1108  return retCode;
1109  }
1110 
1111  if (!pdevvolmut) {
1112  retCode = IARM_RESULT_INVALID_PARAM;
1113  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1114  return retCode;
1115  }
1116 
1117  rc = BTRMGR_SetDeviceVolumeMute(pdevvolmut->m_adapterIndex, pdevvolmut->m_deviceHandle, pdevvolmut->m_deviceOpType , pdevvolmut->m_volume, pdevvolmut->m_mute);
1118  if (BTRMGR_RESULT_SUCCESS == rc) {
1119  BTRMGRLOG_INFO ("Success\n");
1120  }
1121  else {
1122  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1123  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1124  }
1125 
1126  return retCode;
1127 }
1128 
1129 static IARM_Result_t
1130 btrMgr_GetMediaTrackInfo (
1131  void* arg
1132 ) {
1133  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1134  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1135  BTRMGR_IARMMediaProperty_t *pMediaProperty = (BTRMGR_IARMMediaProperty_t*) arg;
1136 
1137  BTRMGRLOG_INFO ("Entering\n");
1138 
1139  if (!gIsBTRMGR_Internal_Inited) {
1140  retCode = IARM_RESULT_INVALID_STATE;
1141  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1142  return retCode;
1143  }
1144 
1145  if (!pMediaProperty) {
1146  retCode = IARM_RESULT_INVALID_PARAM;
1147  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1148  return retCode;
1149  }
1150 
1151  rc = BTRMGR_GetMediaTrackInfo(pMediaProperty->m_adapterIndex, pMediaProperty->m_deviceHandle, &pMediaProperty->m_mediaTrackInfo);
1152  if (BTRMGR_RESULT_SUCCESS == rc) {
1153  BTRMGRLOG_INFO ("Success\n");
1154  }
1155  else {
1156  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1157  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1158  }
1159 
1160  return retCode;
1161 }
1162 
1163 
1164 static IARM_Result_t
1165 btrMgr_GetMediaElementTrackInfo (
1166  void* arg
1167 ) {
1168  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1169  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1170  BTRMGR_IARMMediaProperty_t *pMediaProperty = (BTRMGR_IARMMediaProperty_t*) arg;
1171 
1172  BTRMGRLOG_INFO ("Entering\n");
1173 
1174  if (!gIsBTRMGR_Internal_Inited) {
1175  retCode = IARM_RESULT_INVALID_STATE;
1176  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1177  return retCode;
1178  }
1179 
1180  if (!pMediaProperty) {
1181  retCode = IARM_RESULT_INVALID_PARAM;
1182  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1183  return retCode;
1184  }
1185 
1186  rc = BTRMGR_GetMediaElementTrackInfo(pMediaProperty->m_adapterIndex, pMediaProperty->m_deviceHandle, pMediaProperty->m_mediaElementHandle, &pMediaProperty->m_mediaTrackInfo);
1187  if (BTRMGR_RESULT_SUCCESS == rc) {
1188  BTRMGRLOG_INFO ("Success\n");
1189  }
1190  else {
1191  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1192  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1193  }
1194 
1195  return retCode;
1196 }
1197 
1198 static IARM_Result_t
1199 btrMgr_SetMediaElementActive (
1200  void* arg
1201 ) {
1202  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1203  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1205 
1206  BTRMGRLOG_INFO ("Entering\n");
1207 
1208  if (!gIsBTRMGR_Internal_Inited) {
1209  retCode = IARM_RESULT_INVALID_STATE;
1210  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1211  return retCode;
1212  }
1213 
1214  if (!pMedElementList) {
1215  retCode = IARM_RESULT_INVALID_PARAM;
1216  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1217  return retCode;
1218  }
1219 
1220  rc = BTRMGR_SetMediaElementActive (pMedElementList->m_adapterIndex,
1221  pMedElementList->m_deviceHandle,
1222  pMedElementList->m_mediaElementHandle,
1223  pMedElementList->m_mediaElementType);
1224  if (BTRMGR_RESULT_SUCCESS == rc) {
1225  BTRMGRLOG_INFO ("Success\n");
1226  }
1227  else {
1228  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1229  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1230  }
1231 
1232  return retCode;
1233 }
1234 
1235 
1236 static IARM_Result_t
1237 btrMgr_GetMediaElementList (
1238  void* arg
1239 ) {
1240  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1241  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1243 
1244  BTRMGRLOG_INFO ("Entering\n");
1245 
1246  if (!gIsBTRMGR_Internal_Inited) {
1247  retCode = IARM_RESULT_INVALID_STATE;
1248  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1249  return retCode;
1250  }
1251 
1252  if (!pMedElementList) {
1253  retCode = IARM_RESULT_INVALID_PARAM;
1254  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1255  return retCode;
1256  }
1257 
1258  rc = BTRMGR_GetMediaElementList (pMedElementList->m_adapterIndex,
1259  pMedElementList->m_deviceHandle,
1260  pMedElementList->m_mediaElementHandle,
1261  pMedElementList->m_mediaElementStartIdx,
1262  pMedElementList->m_mediaElementEndIdx,
1263  pMedElementList->m_mediaElementListDepth,
1264  pMedElementList->m_mediaElementType,
1265  &pMedElementList->m_mediaTrackListInfo);
1266  if (BTRMGR_RESULT_SUCCESS == rc) {
1267  BTRMGRLOG_INFO ("Success\n");
1268  }
1269  else {
1270  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1271  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1272  }
1273 
1274  return retCode;
1275 }
1276 
1277 static IARM_Result_t
1278 btrMgr_SelectMediaElement (
1279  void* arg
1280 ) {
1281  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1282  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1284 
1285  BTRMGRLOG_INFO ("Entering\n");
1286 
1287  if (!gIsBTRMGR_Internal_Inited) {
1288  retCode = IARM_RESULT_INVALID_STATE;
1289  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1290  return retCode;
1291  }
1292 
1293  if (!pMedElementList) {
1294  retCode = IARM_RESULT_INVALID_PARAM;
1295  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1296  return retCode;
1297  }
1298 
1299  rc = BTRMGR_SelectMediaElement (pMedElementList->m_adapterIndex,
1300  pMedElementList->m_deviceHandle,
1301  pMedElementList->m_mediaElementHandle,
1302  pMedElementList->m_mediaElementType);
1303 
1304  if (BTRMGR_RESULT_SUCCESS == rc) {
1305  BTRMGRLOG_INFO ("Success\n");
1306  }
1307  else {
1308  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1309  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1310  }
1311 
1312  return retCode;
1313 }
1314 
1315 
1316 static IARM_Result_t
1317 btrMgr_GetLeProperty (
1318  void* arg
1319 ) {
1320  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1321  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1322  BTRMGR_IARMLeProperty_t *leProperty = (BTRMGR_IARMLeProperty_t*) arg;
1323  void* propValue = NULL;
1324 
1325  BTRMGRLOG_INFO ("Entering\n");
1326 
1327  if (!gIsBTRMGR_Internal_Inited) {
1328  retCode = IARM_RESULT_INVALID_STATE;
1329  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1330  return retCode;
1331  }
1332 
1333  if (!leProperty) {
1334  retCode = IARM_RESULT_INVALID_PARAM;
1335  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1336  return retCode;
1337  }
1338 
1339  switch (leProperty->m_enLeProperty) {
1340  case BTRMGR_LE_PROP_UUID:
1341  propValue = &leProperty->m_uuidList;
1342  break;
1343  case BTRMGR_LE_PROP_DEVICE:
1344  propValue = &leProperty->m_devicePath;
1345  break;
1346  case BTRMGR_LE_PROP_SERVICE:
1347  propValue = &leProperty->m_servicePath;
1348  break;
1349  case BTRMGR_LE_PROP_CHAR:
1350  propValue = &leProperty->m_characteristicPath;
1351  break;
1352  case BTRMGR_LE_PROP_VALUE:
1353  propValue = &leProperty->m_value;
1354  break;
1355  case BTRMGR_LE_PROP_PRIMARY:
1356  propValue = &leProperty->m_primary;
1357  break;
1358  case BTRMGR_LE_PROP_NOTIFY:
1359  propValue = &leProperty->m_notifying;
1360  break;
1361  case BTRMGR_LE_PROP_FLAGS:
1362  propValue = &leProperty->m_flags;
1363  break;
1364  default:
1365  break;
1366  }
1367 
1368  rc = BTRMGR_GetLeProperty (leProperty->m_adapterIndex, leProperty->m_deviceHandle, leProperty->m_propUuid, leProperty->m_enLeProperty, propValue);
1369  if (BTRMGR_RESULT_SUCCESS == rc) {
1370  BTRMGRLOG_INFO ("Success\n");
1371  }
1372  else {
1373  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1374  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1375  }
1376 
1377  return retCode;
1378 }
1379 
1380 
1381 
1382 static IARM_Result_t
1383 btrMgr_PerformLeOp (
1384  void* arg
1385 ) {
1386  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1387  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1388  BTRMGR_IARMLeOp_t *leOp = (BTRMGR_IARMLeOp_t*) arg;
1389 
1390  BTRMGRLOG_INFO ("Entering\n");
1391 
1392  if (!gIsBTRMGR_Internal_Inited) {
1393  retCode = IARM_RESULT_INVALID_STATE;
1394  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1395  return retCode;
1396  }
1397 
1398  if (!leOp) {
1399  retCode = IARM_RESULT_INVALID_PARAM;
1400  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1401  return retCode;
1402  }
1403 
1404  rc = BTRMGR_PerformLeOp (leOp->m_adapterIndex, leOp->m_deviceHandle, leOp->m_uuid, leOp->m_leOpType, leOp->m_opArg, leOp->m_opRes);
1405  if (BTRMGR_RESULT_SUCCESS == rc) {
1406  BTRMGRLOG_INFO ("Success\n");
1407  }
1408  else {
1409  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1410  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1411  }
1412 
1413  return retCode;
1414 }
1415 
1416 static IARM_Result_t
1417 btrMgr_GetLimitBeaconDetection (
1418  void* arg
1419 ) {
1420  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1421  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1423 
1424  BTRMGRLOG_INFO ("Entering\n");
1425 
1426  if (!gIsBTRMGR_Internal_Inited) {
1427  retCode = IARM_RESULT_INVALID_STATE;
1428  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1429  return retCode;
1430  }
1431 
1432  if (!pBeaconDetection) {
1433  retCode = IARM_RESULT_INVALID_PARAM;
1434  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1435  return retCode;
1436  }
1437 
1438  rc = BTRMGR_GetLimitBeaconDetection(pBeaconDetection->m_adapterIndex, &pBeaconDetection->m_limitBeaconDetection);
1439  if (BTRMGR_RESULT_SUCCESS == rc) {
1440  BTRMGRLOG_INFO ("Get Value : Beacon Detection Limited ? %s\n", pBeaconDetection->m_limitBeaconDetection ? "true" : "false");
1441  }
1442  else {
1443  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1444  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1445  }
1446  return retCode;
1447 }
1448 
1449 
1450 static IARM_Result_t
1451 btrMgr_SetLimitBeaconDetection (
1452  void* arg
1453 ) {
1454  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1455  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1457 
1458  BTRMGRLOG_INFO ("Entering\n");
1459 
1460  if (!gIsBTRMGR_Internal_Inited) {
1461  retCode = IARM_RESULT_INVALID_STATE;
1462  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1463  return retCode;
1464  }
1465 
1466  if (!pBeaconDetection) {
1467  retCode = IARM_RESULT_INVALID_PARAM;
1468  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1469  return retCode;
1470  }
1471 
1472  rc = BTRMGR_SetLimitBeaconDetection (pBeaconDetection->m_adapterIndex, pBeaconDetection->m_limitBeaconDetection);
1473  if (BTRMGR_RESULT_SUCCESS == rc) {
1474  BTRMGRLOG_INFO ("Value set success\n");
1475  }
1476  else {
1477  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1478  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1479  }
1480 
1481  return retCode;
1482 }
1483 
1484 static IARM_Result_t btrMgr_LeStartAdvertisement(void* arg)
1485 {
1486  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1487  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1488 
1489  BTRMGR_IARMAdvtInfo_t* lpstAdvtInfo = (BTRMGR_IARMAdvtInfo_t *)arg;
1490 
1491  if (!gIsBTRMGR_Internal_Inited) {
1492  retCode = IARM_RESULT_INVALID_STATE;
1493  BTRMGRLOG_ERROR("BTRMgr is not Inited\n");
1494  }
1495  else if (NULL == lpstAdvtInfo)
1496  {
1497  retCode = IARM_RESULT_INVALID_PARAM;
1498  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", retCode);
1499  }
1500  else
1501  {
1502  rc = BTRMGR_LE_StartAdvertisement(lpstAdvtInfo->m_adapterIndex, &lpstAdvtInfo->m_CustAdvt);
1503 
1504  if (BTRMGR_RESULT_SUCCESS == rc)
1505  {
1506  BTRMGRLOG_INFO("Success\n");
1507  }
1508  else
1509  {
1510  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1511  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", rc);
1512  }
1513  }
1514 
1515  return retCode;
1516 }
1517 
1518 static IARM_Result_t btrMgr_LeStopAdvertisement(void *arg)
1519 {
1520  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1521  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1522  unsigned char* lpAdapterIndex = (unsigned char*)arg;
1523 
1524  if (!gIsBTRMGR_Internal_Inited) {
1525  retCode = IARM_RESULT_INVALID_STATE;
1526  BTRMGRLOG_ERROR("BTRMgr is not Inited\n");
1527  }
1528  else if (NULL == lpAdapterIndex)
1529  {
1530  retCode = IARM_RESULT_INVALID_PARAM;
1531  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", retCode);
1532  }
1533  else
1534  {
1535  rc = BTRMGR_LE_StopAdvertisement(*lpAdapterIndex);
1536 
1537  if (BTRMGR_RESULT_SUCCESS == rc)
1538  {
1539  BTRMGRLOG_INFO("Success\n");
1540  }
1541  else
1542  {
1543  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1544  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", rc);
1545  }
1546  }
1547  return retCode;
1548 }
1549 
1550 static IARM_Result_t btrMgr_LeGetPropertyValue(void* arg)
1551 {
1552  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1553  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1554 
1555  BTRMGR_IARMGATTValue_t* lpstGattInfo = (BTRMGR_IARMGATTValue_t *)arg;
1556 
1557  if (!gIsBTRMGR_Internal_Inited) {
1558  retCode = IARM_RESULT_INVALID_STATE;
1559  BTRMGRLOG_ERROR("BTRMgr is not Inited\n");
1560  }
1561  else if (NULL == lpstGattInfo)
1562  {
1563  retCode = IARM_RESULT_INVALID_PARAM;
1564  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", retCode);
1565  }
1566  else
1567  {
1568  rc = BTRMGR_LE_GetPropertyValue(lpstGattInfo->m_adapterIndex, lpstGattInfo->m_UUID, lpstGattInfo->m_Value, lpstGattInfo->aElement);
1569 
1570  if (BTRMGR_RESULT_SUCCESS == rc)
1571  {
1572  BTRMGRLOG_INFO("Success\n");
1573  }
1574  else
1575  {
1576  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1577  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", rc);
1578  }
1579  }
1580  return retCode;
1581 }
1582 
1583 static IARM_Result_t btrMgr_LeSetServiceInfo(void* arg)
1584 {
1585  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1586  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1587 
1588  BTRMGR_IARMGATTServiceInfo_t* lpstGattServiceInfo = (BTRMGR_IARMGATTServiceInfo_t *)arg;
1589 
1590  if (!gIsBTRMGR_Internal_Inited) {
1591  retCode = IARM_RESULT_INVALID_STATE;
1592  BTRMGRLOG_ERROR("BTRMgr is not Inited\n");
1593  }
1594  else if (NULL == lpstGattServiceInfo)
1595  {
1596  retCode = IARM_RESULT_INVALID_PARAM;
1597  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", retCode);
1598  }
1599  else
1600  {
1601  rc = BTRMGR_LE_SetServiceInfo(lpstGattServiceInfo->m_adapterIndex, lpstGattServiceInfo->m_UUID, lpstGattServiceInfo->m_ServiceType);
1602 
1603  if (BTRMGR_RESULT_SUCCESS == rc)
1604  {
1605  BTRMGRLOG_INFO("Success\n");
1606  }
1607  else
1608  {
1609  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1610  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", rc);
1611  }
1612  }
1613  return retCode;
1614 }
1615 
1616 static IARM_Result_t btrMgr_LeSetGattInfo(void* arg)
1617 {
1618  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1619  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1620 
1621  BTRMGR_IARMGATTInfo_t* lpstGattInfo = (BTRMGR_IARMGATTInfo_t *)arg;
1622 
1623  if (!gIsBTRMGR_Internal_Inited) {
1624  retCode = IARM_RESULT_INVALID_STATE;
1625  BTRMGRLOG_ERROR("BTRMgr is not Inited\n");
1626  }
1627  else if (NULL == lpstGattInfo)
1628  {
1629  retCode = IARM_RESULT_INVALID_PARAM;
1630  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", retCode);
1631  }
1632  else
1633  {
1634  rc = BTRMGR_LE_SetGattInfo(lpstGattInfo->m_adapterIndex, lpstGattInfo->m_ParentUUID, lpstGattInfo->m_UUID, lpstGattInfo->m_Flags, lpstGattInfo->m_Value, lpstGattInfo->m_Element);
1635 
1636  if (BTRMGR_RESULT_SUCCESS == rc)
1637  {
1638  BTRMGRLOG_INFO("Success\n");
1639  }
1640  else
1641  {
1642  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1643  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", rc);
1644  }
1645  }
1646  return retCode;
1647 }
1648 
1649 static IARM_Result_t btrMgr_LeSetGattPropertyValue(void* arg) {
1650  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1651  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1652 
1653  BTRMGR_IARMGATTValue_t* lpstGattInfo = (BTRMGR_IARMGATTValue_t *)arg;
1654 
1655  if (!gIsBTRMGR_Internal_Inited) {
1656  retCode = IARM_RESULT_INVALID_STATE;
1657  BTRMGRLOG_ERROR("BTRMgr is not Inited\n");
1658  }
1659  else if (NULL == lpstGattInfo)
1660  {
1661  retCode = IARM_RESULT_INVALID_PARAM;
1662  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", retCode);
1663  }
1664  else
1665  {
1666  rc = BTRMGR_LE_SetGattPropertyValue(lpstGattInfo->m_adapterIndex, lpstGattInfo->m_UUID, lpstGattInfo->m_Value, lpstGattInfo->aElement);
1667 
1668  if (BTRMGR_RESULT_SUCCESS == rc)
1669  {
1670  BTRMGRLOG_INFO("Success\n");
1671  }
1672  else
1673  {
1674  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1675  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", rc);
1676  }
1677  }
1678  return retCode;
1679 }
1680 
1681 static IARM_Result_t
1682 btrMgr_SetAudioInServiceState (
1683  void* arg
1684 ) {
1685  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1686  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1688 
1689  BTRMGRLOG_INFO ("Entering\n");
1690 
1691  if (!gIsBTRMGR_Internal_Inited) {
1692  retCode = IARM_RESULT_INVALID_STATE;
1693  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1694  return retCode;
1695  }
1696 
1697  if (!audioInSerivceState) {
1698  retCode = IARM_RESULT_INVALID_PARAM;
1699  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1700  return retCode;
1701  }
1702 
1703  rc = BTRMGR_SetAudioInServiceState (audioInSerivceState->m_adapterIndex, audioInSerivceState->m_serviceState);
1704  if (BTRMGR_RESULT_SUCCESS == rc) {
1705  BTRMGRLOG_INFO ("Success\n");
1706  }
1707  else {
1708  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1709  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1710  }
1711 
1712  return retCode;
1713 }
1714 
1715 static IARM_Result_t
1716 btrMgr_SetHidGamePadServiceState (
1717  void* arg
1718 ) {
1719  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1720  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1722 
1723  BTRMGRLOG_INFO ("Entering\n");
1724 
1725  if (!gIsBTRMGR_Internal_Inited) {
1726  retCode = IARM_RESULT_INVALID_STATE;
1727  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1728  return retCode;
1729  }
1730 
1731  if (!hidGamePadSerivceState) {
1732  retCode = IARM_RESULT_INVALID_PARAM;
1733  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1734  return retCode;
1735  }
1736 
1737  rc = BTRMGR_SetHidGamePadServiceState (hidGamePadSerivceState->m_adapterIndex, hidGamePadSerivceState->m_serviceState);
1738  if (BTRMGR_RESULT_SUCCESS == rc) {
1739  BTRMGRLOG_INFO ("Success\n");
1740  }
1741  else {
1742  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1743  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1744  }
1745 
1746  return retCode;
1747 }
1748 
1749 static IARM_Result_t
1750 btrMgr_SysDiagInfo(
1751  void* arg
1752 ) {
1753  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1754  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1755  BTRMGR_IARMDiagInfo_t *lDiagInfo = (BTRMGR_IARMDiagInfo_t*)arg;
1756 
1757  BTRMGRLOG_INFO("Entering\n");
1758 
1759  if (!gIsBTRMGR_Internal_Inited) {
1760  retCode = IARM_RESULT_INVALID_STATE;
1761  BTRMGRLOG_ERROR("BTRMgr is not Inited\n");
1762  return retCode;
1763  }
1764 
1765  rc = BTRMGR_SysDiagInfo(lDiagInfo->m_adapterIndex, lDiagInfo->m_UUID, lDiagInfo->m_DiagInfo, lDiagInfo->m_OpType);
1766  if (BTRMGR_RESULT_SUCCESS == rc) {
1767  BTRMGRLOG_INFO("Success\n");
1768  }
1769  else {
1770  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1771  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", rc);
1772  }
1773 
1774  return retCode;
1775 }
1776 
1777 static IARM_Result_t
1778 btrMgr_ConnectToWifi(
1779  void* arg
1780 ) {
1781  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1782  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1784 
1785  BTRMGRLOG_INFO("Entering\n");
1786 
1787  if (!gIsBTRMGR_Internal_Inited) {
1788  retCode = IARM_RESULT_INVALID_STATE;
1789  BTRMGRLOG_ERROR("BTRMgr is not Inited\n");
1790  return retCode;
1791  }
1792 
1793  rc = BTRMGR_ConnectToWifi(lWifiInfo->m_adapterIndex, lWifiInfo->m_SSID, lWifiInfo->m_Password, lWifiInfo->m_SecMode);
1794 
1795  if (BTRMGR_RESULT_SUCCESS == rc) {
1796  BTRMGRLOG_INFO("Success\n");
1797  }
1798  else {
1799  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1800  BTRMGRLOG_ERROR("Failed; RetCode = %d\n", rc);
1801  }
1802 
1803  return retCode;
1804 }
1805 
1806 
1807 static IARM_Result_t
1808 btrMgr_ResetAdapter (
1809  void* arg
1810 ) {
1811  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
1812  BTRMGR_Result_t rc = BTRMGR_RESULT_SUCCESS;
1813  unsigned char* pAdapterIndex = (unsigned char*) arg;
1814 
1815  BTRMGRLOG_INFO ("Entering\n");
1816 
1817  if (!gIsBTRMGR_Internal_Inited) {
1818  retCode = IARM_RESULT_INVALID_STATE;
1819  BTRMGRLOG_ERROR ("BTRMgr is not Inited\n");
1820  return retCode;
1821  }
1822 
1823  if (!pAdapterIndex) {
1824  retCode = IARM_RESULT_INVALID_PARAM;
1825  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", retCode);
1826  return retCode;
1827  }
1828 
1829 
1830  rc = BTRMGR_ResetAdapter (*pAdapterIndex);
1831  if (BTRMGR_RESULT_SUCCESS == rc) {
1832  BTRMGRLOG_INFO ("Success\n");
1833  }
1834  else {
1835  retCode = IARM_RESULT_IPCCORE_FAIL; /* We do not have other IARM Error code to describe this. */
1836  BTRMGRLOG_ERROR ("Failed; RetCode = %d\n", rc);
1837  }
1838 
1839  return retCode;
1840 }
1841 
1842 
1843 static IARM_Result_t
1844 btrMgr_DeInit (
1845  void* arg
1846 ) {
1847  if (gIsBTRMGR_Internal_Inited)
1848  BTRMGR_DeInit();
1849 
1850  return IARM_RESULT_SUCCESS;
1851 }
1852 
1853 
1854 /* Public Functions */
1855 void
1856 BTRMgr_BeginIARMMode (
1857  void
1858 ) {
1859 
1860  BTRMGRLOG_INFO ("Entering\n");
1861 
1862  if (!gIsBTRMGR_Internal_Inited) {
1863  gIsBTRMGR_Internal_Inited = 1;
1864  IARM_Bus_Init(IARM_BUS_BTRMGR_NAME);
1865  IARM_Bus_Connect();
1866 
1867  BTRMGRLOG_INFO ("IARM Interface Initializing\n");
1868 
1869  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_NUMBER_OF_ADAPTERS, btrMgr_GetNumberOfAdapters);
1870  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_ADAPTER_NAME, btrMgr_SetAdapterName);
1871  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_ADAPTER_NAME, btrMgr_GetAdapterName);
1872  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_ADAPTER_POWERSTATUS, btrMgr_SetAdapterPowerStatus);
1873  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_ADAPTER_POWERSTATUS, btrMgr_GetAdapterPowerStatus);
1874  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_ADAPTER_DISCOVERABLE, btrMgr_SetAdapterDiscoverable);
1875  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_IS_ADAPTER_DISCOVERABLE, btrMgr_IsAdapterDiscoverable);
1876  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_CHANGE_DEVICE_DISCOVERY_STATUS, btrMgr_ChangeDeviceDiscoveryStatus);
1877  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_DISCOVERY_STATUS, btrMgr_GetDeviceDiscoveryStatus);
1878  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_DISCOVERED_DEVICES, btrMgr_GetDiscoveredDevices);
1879  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_PAIR_DEVICE, btrMgr_PairDevice);
1880  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_UNPAIR_DEVICE, btrMgr_UnpairDevice);
1881  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_PAIRED_DEVICES, btrMgr_GetPairedDevices);
1882  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_CONNECT_TO_DEVICE, btrMgr_ConnectToDevice);
1883  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_DISCONNECT_FROM_DEVICE, btrMgr_DisconnectFromDevice);
1884  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_CONNECTED_DEVICES, btrMgr_GetConnectedDevices);
1885  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_DEVICE_PROPERTIES, btrMgr_GetDeviceProperties);
1886  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_START_AUDIO_STREAMING_OUT, btrMgr_StartAudioStreamingOut);
1887  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_STOP_AUDIO_STREAMING_OUT, btrMgr_StopAudioStreamingOut);
1888  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_IS_AUDIO_STREAMING_OUT, btrMgr_IsAudioStreamingOut);
1889  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_AUDIO_STREAM_OUT_TYPE, btrMgr_SetAudioStreamOutType);
1890  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_START_AUDIO_STREAMING_IN, btrMgr_StartAudioStreamingIn);
1891  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_STOP_AUDIO_STREAMING_IN, btrMgr_StopAudioStreamingIn);
1892  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_IS_AUDIO_STREAMING_IN, btrMgr_IsAudioStreamingIn);
1893  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_EVENT_RESPONSE, btrMgr_SetEventResponse);
1894  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_RESET_ADAPTER, btrMgr_ResetAdapter);
1895  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_MEDIA_CONTROL, btrMgr_MediaControl);
1896  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_DEVICE_VOLUME_MUTE_INFO, btrMgr_SetDeviceVolumeMute);
1897  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_DEVICE_VOLUME_MUTE_INFO, btrMgr_GetDeviceVolumeMute);
1898  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_MEDIA_TRACK_INFO, btrMgr_GetMediaTrackInfo);
1899  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_MEDIA_ELEMENT_TRACK_INFO, btrMgr_GetMediaElementTrackInfo);
1900  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_MEDIA_CURRENT_POSITION, btrMgr_GetMediaCurrentPosition);
1901  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_MEDIA_ELEMENT_ACTIVE, btrMgr_SetMediaElementActive);
1902  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_MEDIA_ELEMENT_LIST, btrMgr_GetMediaElementList);
1903  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SELECT_MEDIA_ELEMENT, btrMgr_SelectMediaElement);
1904  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_LE_PROPERTY, btrMgr_GetLeProperty);
1905  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_PERFORM_LE_OP, btrMgr_PerformLeOp);
1906  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_AUDIO_IN_SERVICE_STATE, btrMgr_SetAudioInServiceState);
1907  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_HID_GAMEPAD_SERVICE_STATE, btrMgr_SetHidGamePadServiceState);
1908  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_SET_LIMIT_BEACON_DETECTION, btrMgr_SetLimitBeaconDetection);
1909  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_LIMIT_BEACON_DETECTION, btrMgr_GetLimitBeaconDetection);
1910  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_LE_START_ADVERTISEMENT, btrMgr_LeStartAdvertisement);
1911  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_LE_STOP_ADVERTISEMENT, btrMgr_LeStopAdvertisement);
1912  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_LE_GET_PROP_VALUE, btrMgr_LeGetPropertyValue);
1913  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_LE_SET_GATT_SERVICE_INFO, btrMgr_LeSetServiceInfo);
1914  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_LE_SET_GATT_CHAR_INFO, btrMgr_LeSetGattInfo);
1915  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_LE_SET_GATT_PROPERTY_VALUE, btrMgr_LeSetGattPropertyValue);
1916  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_GET_SYS_DIAG_INFO, btrMgr_SysDiagInfo);
1917  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_WIFI_CONNECT_INFO, btrMgr_ConnectToWifi);
1918  IARM_Bus_RegisterCall(BTRMGR_IARM_METHOD_DEINIT, btrMgr_DeInit);
1919 
1920  IARM_Bus_RegisterEvent(BTRMGR_IARM_EVENT_MAX);
1921 
1922  /* Register a callback */
1923  BTRMGR_RegisterEventCallback(btrMgr_EventCallback);
1924 
1925  BTRMGRLOG_INFO ("IARM Interface Inited Successfully\n");
1926  }
1927  else {
1928  BTRMGRLOG_INFO ("IARM Interface Already Inited\n");
1929  }
1930 
1931  return;
1932 }
1933 
1934 void
1935 BTRMgr_TermIARMMode (
1936  void
1937 ) {
1938  BTRMGRLOG_INFO ("Entering\n");
1939 
1940  if (gIsBTRMGR_Internal_Inited) {
1941  BTRMGRLOG_INFO ("IARM Interface Being terminated\n");
1943  IARM_Bus_Term();
1944  }
1945  else {
1946  BTRMGRLOG_INFO ("IARM Interface Not Inited\n");
1947  }
1948 }
1949 
1950 
1951 /* Incoming Callbacks */
1952 static BTRMGR_Result_t
1953 btrMgr_EventCallback (
1954  BTRMGR_EventMessage_t astEventMessage
1955 ) {
1956  BTRMGR_EventMessage_t lstEventMessage;
1957  IARM_Result_t lenIarmResult = IARM_RESULT_SUCCESS;
1958  BTRMGR_Result_t lenBtrMgrResult = BTRMGR_RESULT_SUCCESS;
1959 
1960  BTRMGRLOG_INFO ("Entering\n");
1961 
1962  memcpy (&lstEventMessage, &astEventMessage, sizeof(BTRMGR_EventMessage_t));
1963 
1964  if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_OUT_OF_RANGE) {
1965  BTRMGRLOG_WARN ("Post Device Out of Range event\n");
1966  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_OUT_OF_RANGE, (void *)&lstEventMessage, sizeof(lstEventMessage));
1967  }
1968  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_DISCOVERY_STARTED) {
1969  BTRMGRLOG_WARN ("Post Discovery Started event\n");
1970  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_DISCOVERY_STARTED, (void *)&lstEventMessage, sizeof(lstEventMessage));
1971  }
1972  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_DISCOVERY_UPDATE) {
1973  BTRMGRLOG_WARN ("Post Discovery Status update\n");
1974  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_DISCOVERY_UPDATE, (void *)&lstEventMessage, sizeof(lstEventMessage));
1975  }
1976  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_DISCOVERY_COMPLETE) {
1977  BTRMGRLOG_WARN ("Post Discovery Complete event\n");
1978  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_DISCOVERY_COMPLETE, (void *)&lstEventMessage, sizeof(lstEventMessage));
1979  }
1980  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_PAIRING_COMPLETE) {
1981  BTRMGRLOG_WARN ("Post Device Pairing Complete event\n");
1982  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_PAIRING_COMPLETE, (void *)&lstEventMessage, sizeof(lstEventMessage));
1983  }
1984  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_UNPAIRING_COMPLETE) {
1985  BTRMGRLOG_WARN ("Post Device UnPairing Complete event\n");
1986  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_UNPAIRING_COMPLETE, (void *)&lstEventMessage, sizeof(lstEventMessage));
1987  }
1988  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_CONNECTION_COMPLETE) {
1989  BTRMGRLOG_WARN ("Post Device Connection Complete event\n");
1990  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_CONNECTION_COMPLETE, (void *)&lstEventMessage, sizeof(lstEventMessage));
1991  }
1992  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_DISCONNECT_COMPLETE) {
1993  BTRMGRLOG_WARN ("Post Device Disconnected event\n");
1994  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_DISCONNECT_COMPLETE, (void *)&lstEventMessage, sizeof(lstEventMessage));
1995  }
1996  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_PAIRING_FAILED) {
1997  BTRMGRLOG_WARN ("Post Device Pairing Failed event\n");
1998  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_PAIRING_FAILED, (void *)&lstEventMessage, sizeof(lstEventMessage));
1999  }
2000  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_UNPAIRING_FAILED) {
2001  BTRMGRLOG_WARN ("Post Device UnPairing Failed event\n");
2002  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_UNPAIRING_FAILED, (void *)&lstEventMessage, sizeof(lstEventMessage));
2003  }
2004  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_CONNECTION_FAILED) {
2005  BTRMGRLOG_WARN ("Post Device Connection Failed event\n");
2006  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_CONNECTION_FAILED, (void *)&lstEventMessage, sizeof(lstEventMessage));
2007  }
2008  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_DISCONNECT_FAILED) {
2009  BTRMGRLOG_WARN ("Post Device Disconnect Failed event\n");
2010  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_DISCONNECT_FAILED, (void *)&lstEventMessage, sizeof(lstEventMessage));
2011  }
2012  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_RECEIVED_EXTERNAL_PAIR_REQUEST) {
2013  BTRMGRLOG_WARN ("Post External Device Pair Request event\n");
2014  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_RECEIVED_EXTERNAL_PAIR_REQUEST, (void *)&lstEventMessage, sizeof(lstEventMessage));
2015  }
2016  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_RECEIVED_EXTERNAL_CONNECT_REQUEST) {
2017  BTRMGRLOG_WARN ("Post External Device Connect Request event\n");
2018  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_RECEIVED_EXTERNAL_CONNECT_REQUEST, (void *)&lstEventMessage, sizeof(lstEventMessage));
2019  }
2020  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_RECEIVED_EXTERNAL_PLAYBACK_REQUEST) {
2021  BTRMGRLOG_WARN ("Post External Device Playback Request event\n");
2022  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_RECEIVED_EXTERNAL_PLAYBACK_REQUEST, (void *)&lstEventMessage, sizeof(lstEventMessage));
2023  }
2024  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_FOUND) {
2025  BTRMGRLOG_WARN ("Post External Device Found Back event\n");
2026  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_FOUND, (void *)&lstEventMessage, sizeof(lstEventMessage));
2027  }
2028  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_TRACK_STARTED) {
2029  BTRMGRLOG_WARN ("Post Media Track Started event\n");
2030  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_TRACK_STARTED, (void *)&lstEventMessage, sizeof(lstEventMessage));
2031  }
2032  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_TRACK_PLAYING) {
2033  BTRMGRLOG_WARN ("Post Media Track Playing event\n");
2034  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_TRACK_PLAYING, (void *)&lstEventMessage, sizeof(lstEventMessage));
2035  }
2036  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_TRACK_PAUSED) {
2037  BTRMGRLOG_WARN ("Post Media Track Paused event\n");
2038  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_TRACK_PAUSED, (void *)&lstEventMessage, sizeof(lstEventMessage));
2039  }
2040  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_TRACK_STOPPED) {
2041  BTRMGRLOG_WARN ("Post Media Track Stopped event\n");
2042  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_TRACK_STOPPED, (void *)&lstEventMessage, sizeof(lstEventMessage));
2043  }
2044  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_TRACK_POSITION) {
2045  BTRMGRLOG_WARN ("Post Media Track Position event\n");
2046  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_TRACK_POSITION, (void *)&lstEventMessage, sizeof(lstEventMessage));
2047  }
2048  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_TRACK_CHANGED) {
2049  BTRMGRLOG_WARN ("Post Media Track Changed event\n");
2050  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_TRACK_CHANGED, (void *)&lstEventMessage, sizeof(lstEventMessage));
2051  }
2052  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYBACK_ENDED) {
2053  BTRMGRLOG_WARN ("Post Media Playback Ended event\n");
2054  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYBACK_ENDED, (void *)&lstEventMessage, sizeof(lstEventMessage));
2055  }
2056  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_OP_READY) {
2057  BTRMGRLOG_WARN ("Post External Device Op Ready\n");
2058  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_OP_READY, (void *)&lstEventMessage, sizeof(lstEventMessage));
2059  }
2060  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_OP_INFORMATION) {
2061  BTRMGRLOG_WARN ("Post External Device Op Information\n");
2062  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_OP_INFORMATION, (void *)&lstEventMessage, sizeof(lstEventMessage));
2063  }
2064  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_NAME) {
2065  BTRMGRLOG_WARN ("Post Media Player Name event\n");
2066  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_NAME, (void *)&lstEventMessage, sizeof(lstEventMessage));
2067  }
2068  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_VOLUME) {
2069  BTRMGRLOG_WARN ("Post Media Player Volume event\n");
2070  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_VOLUME, (void *)&lstEventMessage, sizeof(lstEventMessage));
2071  }
2072  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_EQUALIZER_OFF) {
2073  BTRMGRLOG_WARN ("Post Media Player Equalizer Off\n");
2074  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_EQUALIZER_OFF, (void *)&lstEventMessage, sizeof(lstEventMessage));
2075  }
2076  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_EQUALIZER_ON) {
2077  BTRMGRLOG_WARN ("Post Media Player Equalizer On\n");
2078  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_EQUALIZER_ON, (void *)&lstEventMessage, sizeof(lstEventMessage));
2079  }
2080  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_SHUFFLE_OFF) {
2081  BTRMGRLOG_WARN ("Post Media Player Shuffle Off\n");
2082  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_SHUFFLE_OFF, (void *)&lstEventMessage, sizeof(lstEventMessage));
2083  }
2084  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_SHUFFLE_ALLTRACKS) {
2085  BTRMGRLOG_WARN ("Post Media Player Shuffle All Tracks\n");
2086  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_SHUFFLE_ALLTRACKS, (void *)&lstEventMessage, sizeof(lstEventMessage));
2087  }
2088  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_SHUFFLE_GROUP) {
2089  BTRMGRLOG_WARN ("Post Media Player Shuffle Group\n");
2090  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_SHUFFLE_GROUP, (void *)&lstEventMessage, sizeof(lstEventMessage));
2091  }
2092  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_REPEAT_OFF) {
2093  BTRMGRLOG_WARN ("Post Media Player Repeat Off\n");
2094  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_REPEAT_OFF, (void *)&lstEventMessage, sizeof(lstEventMessage));
2095  }
2096  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_REPEAT_SINGLETRACK) {
2097  BTRMGRLOG_WARN ("Post Media Player Repeat Single Track\n");
2098  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_REPEAT_SINGLETRACK, (void *)&lstEventMessage, sizeof(lstEventMessage));
2099  }
2100  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_REPEAT_ALLTRACKS) {
2101  BTRMGRLOG_WARN ("Post Media Player Repeat All Tracks\n");
2102  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_REPEAT_ALLTRACKS, (void *)&lstEventMessage, sizeof(lstEventMessage));
2103  }
2104  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_REPEAT_GROUP) {
2105  BTRMGRLOG_WARN ("Post Media Player Repeat Group\n");
2106  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_REPEAT_GROUP, (void *)&lstEventMessage, sizeof(lstEventMessage));
2107  }
2108  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_ALBUM_INFO) {
2109  BTRMGRLOG_WARN ("Post Media Album Info\n");
2110  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_ALBUM_INFO, (void *)&lstEventMessage, sizeof(lstEventMessage));
2111  }
2112  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_ARTIST_INFO) {
2113  BTRMGRLOG_WARN ("Post Media Artist Info\n");
2114  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_ARTIST_INFO, (void *)&lstEventMessage, sizeof(lstEventMessage));
2115  }
2116  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_GENRE_INFO) {
2117  BTRMGRLOG_WARN ("Post Media Genre Info\n");
2118  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_GENRE_INFO, (void *)&lstEventMessage, sizeof(lstEventMessage));
2119  }
2120  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_COMPILATION_INFO) {
2121  BTRMGRLOG_WARN ("Post Media Compilation Info\n");
2122  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_COMPILATION_INFO, (void *)&lstEventMessage, sizeof(lstEventMessage));
2123  }
2124  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYLIST_INFO) {
2125  BTRMGRLOG_WARN ("Post Media PlayList Info\n");
2126  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYLIST_INFO, (void *)&lstEventMessage, sizeof(lstEventMessage));
2127  }
2128  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_TRACKLIST_INFO) {
2129  BTRMGRLOG_WARN ("Post Media TrackList Info\n");
2130  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_TRACKLIST_INFO, (void *)&lstEventMessage, sizeof(lstEventMessage));
2131  }
2132  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_TRACK_INFO) {
2133  BTRMGRLOG_WARN ("Post Media Track Info\n");
2134  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_TRACK_INFO, (void *)&lstEventMessage, sizeof(lstEventMessage));
2135  }
2136  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_MUTE) {
2137  BTRMGRLOG_WARN ("Post Media Mute Info\n");
2138  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_MUTE, (void *)&lstEventMessage, sizeof(lstEventMessage));
2139  }
2140  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_MEDIA_PLAYER_UNMUTE) {
2141  BTRMGRLOG_WARN ("Post Media UnMute Info\n");
2142  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_MEDIA_PLAYER_UNMUTE, (void *)&lstEventMessage, sizeof(lstEventMessage));
2143  }
2144  else if (lstEventMessage.m_eventType == BTRMGR_EVENT_DEVICE_MEDIA_STATUS) {
2145  BTRMGRLOG_WARN ("Post Device Media Status Info\n");
2146  lenIarmResult = IARM_Bus_BroadcastEvent(IARM_BUS_BTRMGR_NAME, (IARM_EventId_t) BTRMGR_IARM_EVENT_DEVICE_MEDIA_STATUS, (void *)&lstEventMessage, sizeof(lstEventMessage));
2147  }
2148 
2149  if (lenIarmResult != IARM_RESULT_SUCCESS) {
2150  lenBtrMgrResult = BTRMGR_RESULT_GENERIC_FAILURE;
2151  }
2152 
2153  return lenBtrMgrResult;
2154 }
2155 
btrMgr_IarmInternalIfce.h
BTRMGR_GetMediaCurrentPosition
BTRMGR_Result_t BTRMGR_GetMediaCurrentPosition(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMGR_MediaPositionInfo_t *mediaPositionInfo)
This API fetches the current position and total duration of the media.
Definition: btrMgr.c:5251
BTRMGR_DeInit
BTRMGR_Result_t BTRMGR_DeInit(void)
This API invokes the deinit function of bluetooth core and persistant interface module.
Definition: btrMgr.c:2455
BTRMGR_SetAdapterName
BTRMGR_Result_t BTRMGR_SetAdapterName(unsigned char aui8AdapterIdx, const char *pNameOfAdapter)
This API is used to set the new name to the bluetooth adapter.
Definition: btrMgr.c:2645
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
BTRMGR_UnpairDevice
BTRMGR_Result_t BTRMGR_UnpairDevice(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl)
This API is used to remove the pairing information of the device selected.
Definition: btrMgr.c:3440
_BTRMGR_IARMDeviceVolumeMute_t
Definition: btmgr_iarm_interface.h:226
_BTRMGR_IARMBeaconDetection_t
Definition: btmgr_iarm_interface.h:146
_BTRMGR_IARMAdapterDiscoverable_t
Definition: btmgr_iarm_interface.h:172
_BTRMGR_IARMGATTValue_t
Definition: btmgr_iarm_interface.h:309
_BTRMGR_IARMPairDevice_t
Definition: btmgr_iarm_interface.h:156
_BTRMGR_IARMPairedDevices_t
Definition: btmgr_iarm_interface.h:195
BTRMGR_SetAdapterDiscoverable
BTRMGR_Result_t BTRMGR_SetAdapterDiscoverable(unsigned char aui8AdapterIdx, unsigned char discoverable, int timeout)
This API is to make the adapter discoverable until the given timeout.
Definition: btrMgr.c:2830
BTRMGR_GetMediaTrackInfo
BTRMGR_Result_t BTRMGR_GetMediaTrackInfo(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMGR_MediaTrackInfo_t *mediaTrackInfo)
This API fetches the media track info like title, genre, duration, number of tracks,...
Definition: btrMgr.c:5172
BTRMGR_IsAdapterDiscoverable
BTRMGR_Result_t BTRMGR_IsAdapterDiscoverable(unsigned char aui8AdapterIdx, unsigned char *pDiscoverable)
This API checks the adapter is discoverable or not.
Definition: btrMgr.c:2894
_BTRMGR_IARMDiscoveredDevices_t
Definition: btmgr_iarm_interface.h:190
BTRMGR_PairDevice
BTRMGR_Result_t BTRMGR_PairDevice(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl)
This API is used to pair the device that you wish to pair.
Definition: btrMgr.c:3313
BTRMGR_Result_t
enum _BTRMGR_Result_t BTRMGR_Result_t
Represents the status of the operation.
_BTRMGR_IARMStreamingStatus_t
Definition: btmgr_iarm_interface.h:211
BTRMGR_PerformLeOp
BTRMGR_Result_t BTRMGR_PerformLeOp(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, const char *aBtrLeUuid, BTRMGR_LeOp_t aLeOpType, char *aLeOpArg, char *rOpResult)
This API performs LE operations on the specified bluetooth adapter.
Definition: btrMgr.c:5801
_BTRMGR_IARMConnectedDevices_t
Definition: btmgr_iarm_interface.h:200
btmgr.h
_BTRMGR_IARMAdapterDiscover_t
Definition: btmgr_iarm_interface.h:178
IARM_Bus_RegisterEvent
IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId)
This API is used to register all the events that are published by the application.
_BTRMGR_IARMDiscoveryStatus_t
Definition: btmgr_iarm_interface.h:293
BTRMGR_GetAdapterPowerStatus
BTRMGR_Result_t BTRMGR_GetAdapterPowerStatus(unsigned char aui8AdapterIdx, unsigned char *pPowerStatus)
This API fetches the power status, either 0 or 1.
Definition: btrMgr.c:2790
IARM_Bus_RegisterCall
IARM_Result_t IARM_Bus_RegisterCall(const char *methodName, IARM_BusCall_t handler)
This API is used to register an RPC method that can be invoked by other applications.
BTRMGR_MediaControl
BTRMGR_Result_t BTRMGR_MediaControl(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMGR_MediaControlCommand_t mediaCtrlCmd)
This API is used to perform the media control operations.
Definition: btrMgr.c:4680
BTRMGR_StartAudioStreamingOut
BTRMGR_Result_t BTRMGR_StartAudioStreamingOut(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMGR_DeviceOperationType_t connectAs)
This API initates the streaming from the device with the selected operation type.
Definition: btrMgr.c:4179
BTRMGR_StartDeviceDiscovery
BTRMGR_Result_t BTRMGR_StartDeviceDiscovery(unsigned char aui8AdapterIdx, BTRMGR_DeviceOperationType_t aenBTRMgrDevOpT)
This API initiates the scanning process.
Definition: btrMgr.c:3141
BTRMGR_GetLimitBeaconDetection
BTRMGR_Result_t BTRMGR_GetLimitBeaconDetection(unsigned char aui8AdapterIdx, unsigned char *isLimited)
This API Gets Beacon Detection status on the specified bluetooth adapter.
Definition: btrMgr.c:5590
_BTRMGR_IARMAdapterPower_t
Definition: btmgr_iarm_interface.h:167
_BTRMGR_IARMMediaProperty_t
Definition: btmgr_iarm_interface.h:234
BTRMGR_GetNumberOfAdapters
BTRMGR_Result_t BTRMGR_GetNumberOfAdapters(unsigned char *pNumOfAdapters)
This API returns the number of bluetooth adapters available.
Definition: btrMgr.c:2550
IARM_Bus_Disconnect
IARM_Result_t IARM_Bus_Disconnect(void)
This API disconnect Application from IARM Bus so the application will not receive any IARM event or R...
BTRMGR_DisconnectFromDevice
BTRMGR_Result_t BTRMGR_DisconnectFromDevice(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl)
This API terminates the current connection.
Definition: btrMgr.c:3674
BTRMGR_SelectMediaElement
BTRMGR_Result_t BTRMGR_SelectMediaElement(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMgrMediaElementHandle ahBTRMgrMedElementHdl, BTRMGR_MediaElementType_t aMediaElementType)
This API performs operation based on the element type selected.
Definition: btrMgr.c:5444
BTRMGR_SetMediaElementActive
BTRMGR_Result_t BTRMGR_SetMediaElementActive(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMgrMediaElementHandle ahBTRMgrMedElementHdl, BTRMGR_MediaElementType_t aMediaElementType)
This API sets the mentioned media element list active/in_scope for further operations on it.
Definition: btrMgr.c:5290
_BTRMGR_IARMWifiConnectInfo_t
Definition: btmgr_iarm_interface.h:343
_BTRMGR_IARMEventResp_t
Definition: btmgr_iarm_interface.h:221
_BTRMGR_IARMLeOp_t
Definition: btmgr_iarm_interface.h:284
BTRMGR_GetAdapterName
BTRMGR_Result_t BTRMGR_GetAdapterName(unsigned char aui8AdapterIdx, char *pNameOfAdapter)
This API fetches the bluetooth adapter name.
Definition: btrMgr.c:2685
BTRMGR_GetDiscoveryStatus
BTRMGR_Result_t BTRMGR_GetDiscoveryStatus(unsigned char aui8AdapterIdx, BTRMGR_DiscoveryStatus_t *aeDiscoveryStatus, BTRMGR_DeviceOperationType_t *aenBTRMgrDevOpT)
This API gives the discovery status.
Definition: btrMgr.c:3195
IARM_Bus_BroadcastEvent
IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *data, size_t len)
This API is used to publish an Asynchronous event to all IARM client registered for this perticular e...
BTRMGR_StopAudioStreamingIn
BTRMGR_Result_t BTRMGR_StopAudioStreamingIn(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl)
This API termines the audio streaming.
Definition: btrMgr.c:4530
BTRMGR_StopAudioStreamingOut
BTRMGR_Result_t BTRMGR_StopAudioStreamingOut(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl)
This API terminates the streaming from the device.
Definition: btrMgr.c:4205
BTRMGR_SetDeviceVolumeMute
BTRMGR_Result_t BTRMGR_SetDeviceVolumeMute(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMGR_DeviceOperationType_t deviceOpType, unsigned char ui8Volume, unsigned char ui8Mute)
This API is used to set the media volume and mute data.
Definition: btrMgr.c:5051
_BTRMGR_IARMGATTInfo_t
Definition: btmgr_iarm_interface.h:322
_BTRMGR_EventMessage_t
Represents the event message info.
Definition: btmgr.h:576
BTRMGR_GetDeviceProperties
BTRMGR_Result_t BTRMGR_GetDeviceProperties(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMGR_DevicesProperty_t *pDeviceProperty)
This API returns the device information that includes the device name, mac address,...
Definition: btrMgr.c:3961
BTRMGR_SetLimitBeaconDetection
BTRMGR_Result_t BTRMGR_SetLimitBeaconDetection(unsigned char aui8AdapterIdx, unsigned char isLimited)
This API Sets Beacon Detection status on the specified bluetooth adapter.
Definition: btrMgr.c:5619
BTRMGR_GetConnectedDevices
BTRMGR_Result_t BTRMGR_GetConnectedDevices(unsigned char aui8AdapterIdx, BTRMGR_ConnectedDevicesList_t *pConnectedDevices)
This API returns the list of devices connected.
Definition: btrMgr.c:3845
BTRMGR_SetAdapterPowerStatus
BTRMGR_Result_t BTRMGR_SetAdapterPowerStatus(unsigned char aui8AdapterIdx, unsigned char power_status)
This API sets the bluetooth adapter power to ON/OFF.
Definition: btrMgr.c:2728
BTRMGR_SetAudioInServiceState
BTRMGR_Result_t BTRMGR_SetAudioInServiceState(unsigned char aui8AdapterIdx, unsigned char aui8State)
This API Enable/Disables Audio-In on the specified bluetooth adapter.
Definition: btrMgr.c:5562
BTRMGR_ConnectToDevice
BTRMGR_Result_t BTRMGR_ConnectToDevice(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMGR_DeviceOperationType_t connectAs)
This API connects the device as audio sink/headset/audio src based on the device type specified.
Definition: btrMgr.c:3635
_BTRMGR_IARMConnectDevice_t
Definition: btmgr_iarm_interface.h:161
BTRMGR_StartAudioStreamingIn
BTRMGR_Result_t BTRMGR_StartAudioStreamingIn(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMGR_DeviceOperationType_t connectAs)
This API starts the audio streaming.
Definition: btrMgr.c:4339
BTRMGR_ResetAdapter
BTRMGR_Result_t BTRMGR_ResetAdapter(unsigned char aui8AdapterIdx)
This API is designed to reset the bluetooth adapter.
Definition: btrMgr.c:2589
_BTRMGR_IARMAdvtInfo_t
Definition: btmgr_iarm_interface.h:331
BTRMGR_GetDiscoveredDevices
BTRMGR_Result_t BTRMGR_GetDiscoveredDevices(unsigned char aui8AdapterIdx, BTRMGR_DiscoveredDevicesList_t *pDiscoveredDevices)
This API fetches the list of devices scanned.
Definition: btrMgr.c:3226
BTRMGR_GetPairedDevices
BTRMGR_Result_t BTRMGR_GetPairedDevices(unsigned char aui8AdapterIdx, BTRMGR_PairedDevicesList_t *pPairedDevices)
This API returns the list of devices paired.
Definition: btrMgr.c:3556
BTRMGR_GetDeviceVolumeMute
BTRMGR_Result_t BTRMGR_GetDeviceVolumeMute(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMGR_DeviceOperationType_t deviceOpType, unsigned char *pui8Volume, unsigned char *pui8Mute)
This API is used to fetch the media volume and mute data.
Definition: btrMgr.c:4966
BTRMGR_GetMediaElementList
BTRMGR_Result_t BTRMGR_GetMediaElementList(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMgrMediaElementHandle ahBTRMgrMedElementHdl, unsigned short aui16MediaElementStartIdx, unsigned short aui16MediaElementEndIdx, unsigned char abMediaElementListDepth, BTRMGR_MediaElementType_t aMediaElementType, BTRMGR_MediaElementListInfo_t *aMediaElementListInfo)
This API gets the media element list.
Definition: btrMgr.c:5362
_BTRMGR_IARMStreamingType_t
Definition: btmgr_iarm_interface.h:216
_BTRMGR_IARMDiagInfo_t
Definition: btmgr_iarm_interface.h:336
IARM_Bus_Connect
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
Definition: iarmMgrMocks.cpp:33
BTRMGR_StopDeviceDiscovery
BTRMGR_Result_t BTRMGR_StopDeviceDiscovery(unsigned char aui8AdapterIdx, BTRMGR_DeviceOperationType_t aenBTRMgrDevOpT)
This API terminates the scanning process.
Definition: btrMgr.c:3169
_BTRMGR_IARMHidGamePadServiceState_t
Definition: btmgr_iarm_interface.h:304
BTRMGR_GetMediaElementTrackInfo
BTRMGR_Result_t BTRMGR_GetMediaElementTrackInfo(unsigned char aui8AdapterIdx, BTRMgrDeviceHandle ahBTRMgrDevHdl, BTRMgrMediaElementHandle ahBTRMgrMedElementHdl, BTRMGR_MediaTrackInfo_t *mediaTrackInfo)
This API fetches the media track info like title, genre, duration, number of tracks,...
Definition: btrMgr.c:5210
_BTRMGR_IARMGATTServiceInfo_t
Definition: btmgr_iarm_interface.h:316
_BTRMGR_IARMMediaElementListInfo_t
Definition: btmgr_iarm_interface.h:246
BTRMGR_IsAudioStreamingIn
BTRMGR_Result_t BTRMGR_IsAudioStreamingIn(unsigned char aui8AdapterIdx, unsigned char *pStreamingStatus)
This API returns the audio streaming status.
Definition: btrMgr.c:4574
_BTRMGR_IARMAudioInServiceState_t
Definition: btmgr_iarm_interface.h:299
_BTRMGR_IARMLeProperty_t
Definition: btmgr_iarm_interface.h:265
BTRMGR_SetEventResponse
BTRMGR_Result_t BTRMGR_SetEventResponse(unsigned char aui8AdapterIdx, BTRMGR_EventResponse_t *apstBTRMgrEvtRsp)
This API handles the events received.
Definition: btrMgr.c:4602
BTRMGR_SetAudioStreamingOutType
BTRMGR_Result_t BTRMGR_SetAudioStreamingOutType(unsigned char aui8AdapterIdx, BTRMGR_StreamOut_Type_t type)
This API is to set the audio type as primary or secondary.
Definition: btrMgr.c:4287
IARM_Bus_Init
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.
Definition: iarmMgrMocks.cpp:38
_BTRMGR_IARMAdapterName_t
Definition: btmgr_iarm_interface.h:151
btmgr_iarm_interface.h
BTRMGR_SetHidGamePadServiceState
BTRMGR_Result_t BTRMGR_SetHidGamePadServiceState(unsigned char aui8AdapterIdx, unsigned char aui8State)
This API Enable/Disables Hid GamePad on the specified bluetooth adapter.
Definition: btrMgr.c:5576
_BTRMGR_IARMStreaming_t
Definition: btmgr_iarm_interface.h:205
BTRMGR_IsAudioStreamingOut
BTRMGR_Result_t BTRMGR_IsAudioStreamingOut(unsigned char aui8AdapterIdx, unsigned char *pStreamingStatus)
This API returns the stream out status.
Definition: btrMgr.c:4252
_BTRMGR_IARMDDeviceProperty_t
Definition: btmgr_iarm_interface.h:184