RDK Documentation (Open Sourced RDK Components)
btrCore_bt_ifce.h
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 
20 /*
21  * @file btrCore_bt_ifce_.h
22  * DBus layer abstraction for BT functionality
23  */
24 
25 
26 #ifndef __BTR_CORE_BT_IFCE_H__
27 #define __BTR_CORE_BT_IFCE_H__
28 
29 /**
30  * @addtogroup BLUETOOTH_TYPES
31  * @{
32  */
33 
34 /**
35  * @brief Bluetooth max string length.
36  *
37  */
38 #define BT_MAX_STR_LEN 256
39 
40 /**
41  * @brief Bluetooth max device path length.
42  *
43  */
44 #define BT_MAX_DEV_PATH_LEN 64 //BT_MAX_STR_LEN/4
45 
46 /**
47  * @brief Bluetooth max uuid length.
48  *
49  * The data type uuid stores Universally Unique Identifiers (UUID) as defined by RFC 4122,
50  * ISO/IEC 9834-8:2005, and related standards.
51  */
52 #define BT_MAX_UUID_STR_LEN 64 //BT_MAX_STR_LEN/4
53 
54 /**
55  * @brief Bluetooth max number of devices that can be connected.
56  */
57 #define BT_MAX_NUM_DEVICE 32
58 
59 /**
60  * @brief Bluetooth max number of device profiles that are allowed.
61  * Device Profiles are definitions of possible applications and specify general behaviors that
62  * Bluetooth enabled devices use to communicate with other Bluetooth devices.
63  */
64 #define BT_MAX_DEVICE_PROFILE 32
65 
66 /**
67  * @brief Bluetooth max number of bluetooth adapters that can be connected over USB/UART
68  */
69 #define BT_MAX_NUM_ADAPTERS 4
70 
71 /**
72  * @brief Bluetooth Advertising Service Data max length.
73  */
74 #define BT_MAX_SERVICE_DATA_LEN 32
75 
76 
77 /**
78  * @brief Bluetooth A2DP Source UUID
79  */
80 #define BT_UUID_A2DP_SOURCE "0000110a-0000-1000-8000-00805f9b34fb"
81 
82 /**
83  * @brief Bluetooth A2DP Sink UUID
84  */
85 #define BT_UUID_A2DP_SINK "0000110b-0000-1000-8000-00805f9b34fb"
86 
87 /**
88  * @brief Bluetooth LE Tile 1 UUID
89  */
90 #define BT_UUID_GATT_TILE_1 "0000feed-0000-1000-8000-00805f9b34fb"
91 
92 /**
93  * @brief Bluetooth LE Tile 2 UUID
94  */
95 #define BT_UUID_GATT_TILE_2 "0000feec-0000-1000-8000-00805f9b34fb"
96 
97 /**
98  * @brief Bluetooth LE Tile 2 UUID
99  */
100 #define BT_UUID_GATT_TILE_3 "0000febe-0000-1000-8000-00805f9b34fb"
101 
102 /**
103  * @brief Bluetooth Hands Free Audio Gateway UUID
104  */
105 #define BT_UUID_HFP_AG "0000111f-0000-1000-8000-00805f9b34fb"
106 
107 /**
108  * @brief Bluetooth Hands Free Headset UUID
109  */
110 #define BT_UUID_HFP_HS "0000111e-0000-1000-8000-00805f9b34fb"
111 
112 
113 /**
114  * @brief Bluetooth Media Codec SBC - Must be same as the Ifce
115  */
116 #define BT_MEDIA_CODEC_SBC 0x00
117 
118 /**
119  * @brief Bluetooth Media Codec MPEG12 - Must be same as the Ifce
120  */
121 #define BT_MEDIA_CODEC_MPEG12 0x01
122 
123 /**
124  * @brief Bluetooth Media Codec MPEG24 - Must be same as the Ifce
125  */
126 #define BT_MEDIA_CODEC_MPEG24 0x02
127 
128 /**
129  * @brief Bluetooth Media Codec ATRAC - Must be same as the Ifce
130  */
131 #define BT_MEDIA_CODEC_ATRAC 0x03
132 /**
133  * @brief Bluetooth Media Codec Vendor - Must be same as the Ifce
134  */
135 #define BT_MEDIA_CODEC_VENDOR 0xFF
136 
137 /**
138  * @brief Bluetooth Media Codec PCM - Must be same as the Ifce
139  */
140 #define BT_MEDIA_CODEC_PCM 0x00
141 
142 
143 #define BT_MAX_NUM_GATT_SERVICE 4
144 #define BT_MAX_NUM_GATT_CHAR 10
145 #define BT_MAX_NUM_GATT_DESC 4
146 #define BT_MAX_GATT_OP_DATA_LEN BT_MAX_STR_LEN * 3
147 
148 
149  /* Characteristic Property bit field and Characteristic Extented Property bit field Values */
150 #define BT_GATT_CHAR_FLAG_READ 1 << 0
151 #define BT_GATT_CHAR_FLAG_WRITE 1 << 1
152 #define BT_GATT_CHAR_FLAG_ENCRYPT_READ 1 << 2
153 #define BT_GATT_CHAR_FLAG_ENCRYPT_WRITE 1 << 3
154 #define BT_GATT_CHAR_FLAG_ENCRYPT_AUTHENTICATED_READ 1 << 4
155 #define BT_GATT_CHAR_FLAG_ENCRYPT_AUTHENTICATED_WRITE 1 << 5
156 #define BT_GATT_CHAR_FLAG_SECURE_READ 1 << 6 /* Server Mode only */
157 #define BT_GATT_CHAR_FLAG_SECURE_WRITE 1 << 7 /* Server Mode only */
158 #define BT_GATT_CHAR_FLAG_NOTIFY 1 << 8
159 #define BT_GATT_CHAR_FLAG_INDICATE 1 << 9
160 #define BT_GATT_CHAR_FLAG_BROADCAST 1 << 10
161 #define BT_GATT_CHAR_FLAG_WRITE_WITHOUT_RESPONSE 1 << 11
162 #define BT_GATT_CHAR_FLAG_AUTHENTICATED_SIGNED_WRITES 1 << 12
163 #define BT_GATT_CHAR_FLAG_RELIABLE_WRITE 1 << 13
164 #define BT_GATT_CHAR_FLAG_WRITABLE_AUXILIARIES 1 << 14
165 
166 
167 #define BT_MAX_NUM_GATT_CHAR_FLAGS 15
168 #define BT_MAX_NUM_GATT_DESC_FLAGS 8
169 
170 typedef unsigned long long int tBTMediaItemId;
171 /* Enum Types */
172 /**
173  * @brief Bluetooth device types.
174  *
175  * This enumeration lists different bluetooth device types.
176  */
177 typedef enum _enBTDeviceType {
178  enBTDevAudioSink,
179  enBTDevAudioSource,
180  enBTDevHFPHeadset,
181  enBTDevHFPAudioGateway,
182  enBTDevLE,
183  enBTDevHID,
184  enBTDevUnknown
186 
187 /**
188  * @brief Bluetooth device classes.
189  *
190  * This enumeration lists different bluetooth devices that represent the class of device (CoD)
191  * record as defined by the Bluetooth specification.
192  */
193 typedef enum _enBTDeviceClass {
194  enBTDCTablet = 0x11Cu,
195  enBTDCSmartPhone = 0x20Cu,
196  enBTDCWearableHeadset = 0x404u,
197  enBTDCHandsfree = 0x408u,
198  enBTDCReserved = 0x40Cu,
199  enBTDCMicrophone = 0x410u,
200  enBTDCLoudspeaker = 0x414u,
201  enBTDCHeadphones = 0x418u,
202  enBTDCPortableAudio = 0x41Cu,
203  enBTDCCarAudio = 0x420u,
204  enBTDCSTB = 0x424u,
205  enBTDCHIFIAudioDevice = 0x428u,
206  enBTDCVCR = 0x42Cu,
207  enBTDCVideoCamera = 0x430u,
208  enBTDCCamcoder = 0x434u,
209  enBTDCVideoMonitor = 0x438u,
210  enBTDCTV = 0x43Cu,
211  enBTDCVideoConference = 0x440u,
212  enBTDCKeyboard = 0x540u,
213  enBTDCMouse = 0x580u,
214  enBTDCMouseKeyBoard = 0x5C0u,
215  enBTDCJoystick = 0x504u,
216  enBTDCGamePad = 0x508u,
217  enBTDCAudioRemote = 0x50Cu,
218 
219  enBTDCUnknown = 0x000u
221 
222 /**
223  * @brief Bluetooth device operation types.
224  *
225  * This enumeration lists different operations a bluetooth device serves.
226  */
227 typedef enum _enBTOpType {
228  enBTAdapter,
229  enBTDevice,
230  enBTMediaTransport,
231  enBTMediaControl,
232  enBTMediaPlayer,
233  enBTMediaItem,
234  enBTMediaFolder,
235  enBTGattService,
236  enBTGattCharacteristic,
237  enBTGattDescriptor,
238  enBTAdvertisement,
239  enBTUnknown
241 
242 /**
243  * @brief Bluetooth device state.
244  *
245  * This enumeration lists different states of a bluetooth device.
246  */
247 typedef enum _enBTDeviceState {
248  enBTDevStCreated,
249  enBTDevStScanInProgress,
250  enBTDevStFound,
251  enBTDevStLost,
252  enBTDevStPairingRequest,
253  enBTDevStPairingInProgress,
254  enBTDevStPaired,
255  enBTDevStUnPaired,
256  enBTDevStConnectInProgress,
257  enBTDevStConnected,
258  enBTDevStDisconnected,
259  enBTDevStPropChanged,
260  enBTDevStRSSIUpdate,
261  enBTDevStUnknown
263 
264 /**
265  * @brief Bluetooth Adapter operations.
266  *
267  * This enumeration lists different operations a bluetooth adapter serves.
268  */
269 typedef enum _enBTAdapterOp {
270  enBTAdpOpFindPairedDev,
271  enBTAdpOpCreatePairedDev,
272  enBTAdpOpCreatePairedDevASync,
273  enBTAdpOpRemovePairedDev,
274  enBTAdpOpUnknown
275 } enBTAdapterOp;
276 
277 /**
278  * @brief Bluetooth Gatt operations.
279  *
280  * This enumeration lists different operations a bluetooth Gatt serves.
281  */
282 typedef enum _enBTLeGattOp {
283  enBTLeGattOpReadValue,
284  enBTLeGattOpWriteValue,
285  enBTLeGattOpStartNotify,
286  enBTLeGattOpStopNotify,
287  enBTLeGattOpUnknown
288 } enBTLeGattOp;
289 
290 /**
291  * @brief Bluetooth adapter properties.
292  *
293  * This enumeration lists different properties a bluetooth adapters possess.
294  */
295 typedef enum _enBTAdapterProp {
296  enBTAdPropName,
297  enBTAdPropAddress,
298  enBTAdPropPowered,
299  enBTAdPropDiscoverable,
300  enBTAdPropDiscoverableTimeOut,
301  enBTAdPropDiscoveryStatus,
302  enBTAdPropPairable,
303  enBTAdPropUnknown
305 
306 /**
307  * @brief Bluetooth device properties.
308  *
309  * This enumeration lists different properties a bluetooth device possesses.
310  */
311 typedef enum _enBTDeviceProp {
312  enBTDevPropPaired,
313  enBTDevPropConnected,
314  enBTDevPropVendor,
315  enBTDevPropSrvRslvd,
316  enBTDevPropUnknown
318 
319 /**
320  * @brief Bluetooth Media transport properties.
321  *
322  * This enumeration lists the transport properties of bluetooth media.
323  */
325  enBTMedTPropDelay,
326  enBTMedTPropState,
327  enBTMedTPropVol,
328  enBTMedTPropUnknown
330 
331 /**
332  * @brief Bluetooth Media Control Properties.
333  *
334  * This enumeration lists the property updates of a bluetooth media control.
335  */
336 typedef enum _enBTMediaControlProp {
337  enBTMedControlPropConnected,
338  enBTMedControlPropPath,
339  enBTMedControlUnknown
341 
342 /**
343  * @brief Bluetooth Media Player Properties.
344  *
345  * This enumeration lists the property updates of a bluetooth media player.
346  */
347 typedef enum _enBTMediaPlayerProp {
348 
349  enBTMedPlayerPropName,
350  enBTMedPlayerPropType,
351  enBTMedPlayerPropSubtype,
352  enBTMedPlayerPropEqualizer,
353  enBTMedPlayerPropShuffle,
354  enBTMedPlayerPropScan,
355  enBTMedPlayerPropRepeat,
356  enBTMedPlayerPropPosition,
357  enBTMedPlayerPropStatus,
358  enBTMedPlayerPropTrack,
359  enBTMedPlayerPropBrowsable,
360  enBTMedPlayerPropSearchable,
361  enBTMedPlayerPropPlaylist,
362  enBTMedPlayerPropUnknown
364 
365 /**
366  * @brief Bluetooth Media Folder Properties.
367  *
368  * This enumeration lists the property updates of a bluetooth media folder.
369  */
370 typedef enum _enBTMediaFolderProp {
371  enBTMedFolderPropName,
372  enBTMedFolderPropNumberOfItems
374 
375 /**
376  * @brief Bluetooth Gatt service properties.
377  *
378  * This enumeration lists the properties of bluetooth Gatt services.
379  */
380 typedef enum _enBTGattServiceProp {
381  enBTGattSPropUUID,
382  enBTGattSPropPrimary,
383  enBTGattSPropDevice,
384  enBTGattSPropServPath,
385  enBTGattSPropUnknown
387 
388 /**
389  * @brief Bluetooth Gatt characteristic properties.
390  *
391  * This enumeration lists the properties of bluetooth Gatt characteristics.
392  */
393 typedef enum _enBTGattCharProp {
394  enBTGattCPropUUID,
395  enBTGattCPropService,
396  enBTGattCPropValue,
397  enBTGattCPropNotifying,
398  enBTGattCPropFlags,
399  enBTGattCPropUnknown
401 
402 /**
403  * @brief Bluetooth Gatt characteristic Flag properties.
404  *
405  * This enumeration lists the flags of bluetooth Gatt characteristics.
406  */
407 typedef enum _enBTGattCharFlagProp {
408  enBTGattCharFlagRead,
409  enBTGattCharFlagWrite,
410  enBTGattCharFlagEncryptRead,
411  enBTGattCharFlagEncryptWrite,
412  enBTGattCharFlagEncryptAuthenticatedRead,
413  enBTGattCharFlagEncryptAuthenticatedWrite,
414  enBTGattCharFlagSecureRead,
415  enBTGattCharFlagSecureWrite,
416  enBTGattCharFlagNotify,
417  enBTGattCharFlagIndicate,
418  enBTGattCharFlagBroadcast,
419  enBTGattCharFlagWriteWithoutResponse,
420  enBTGattCharFlagAuthenticatedSignedWrites,
421  enBTGattCharFlagReliableWrite,
422  enBTGattCharFlagWritableAuxiliaries,
423  enBTGattCharFlagUnknown
425 
426 /**
427  * @brief Bluetooth Gatt Descriptor properties.
428  *
429  * This enumeration lists the properties of a bluetooth Gatt descriptors.
430  */
431 typedef enum _enBTGattDescProp {
432  enBTGattDPropUUID,
433  enBTGattDPropCharacteristic,
434  enBTGattDPropValue,
435  enBTGattDPropFlags,
436  enBTGattDPropUnknown
438 
439 /**
440  * @brief Bluetooth Media transport states.
441  *
442  * This enumeration lists the transport states of a bluetooth media.
443  */
445  enBTMedTransportStNone,
446  enBTMedTransportStIdle, /* Not Streaming and not Acquired */
447  enBTMedTransportStPending, /* Streaming, but not acquire - acquire() to be called */
448  enBTMedTransportStActive /* Streaming and Acquired */
450 
451 /**
452  * @brief Bluetooth Media Player Status.
453  *
454  * This enumeration lists the status of the media player.
455  */
457  enBTMedPlayerStPlaying,
458  enBTMedPlayerStStopped,
459  enBTMedPlayerStPaused,
460  enBTMedPlayerStForwardSeek,
461  enBTMedPlayerStReverseSeek,
462  enBTMedPlayerStError
464 
465 /**
466  * @brief Bluetooth Media Players' Equalizer State.
467  *
468  * This enumeration lists the equalizer states of the media player.
469  */
471  enBTMedPlayerEqualizerOff,
472  enBTMedPlayerEqualizerOn
474 
475 /**
476  * @brief Bluetooth Media Players' Shuffle State.
477  *
478  * This enumeration lists the shuffle states of the media player.
479  */
481  enBTMedPlayerShuffleOff,
482  enBTMedPlayerShuffleAllTracks,
483  enBTMedPlayerShuffleGroup
485 
486 /**
487  * @brief Bluetooth Media Players' Scan State.
488  *
489  * This enumeration lists the scan states of the media player.
490  */
491 typedef enum _enBTMediaPlayerScan {
492  enBTMedPlayerScanOff,
493  enBTMedPlayerScanAllTracks,
494  enBTMedPlayerScanGroup
496 
497 /**
498  * @brief Bluetooth Media Players' Repeat States.
499  *
500  * This enumeration lists the repeat states of the media player.
501  */
503  enBTMedPlayerRpOff,
504  enBTMedPlayerRpSingleTrack,
505  enBTMedPlayerRpAllTracks,
506  enBTMedPlayerRpGroup
508 
509 /**
510  * @brief Bluetooth Media Players' Type.
511  *
512  * This enumeration lists the type of the media player.
513  */
514 typedef enum _enBTMediaPlayerType {
515  enBTMedPlayerTypAudio,
516  enBTMedPlayerTypVideo,
517  enBTMedPlayerTypAudioBroadcasting,
518  enBTMedPlayerTypVideoBroadcasting
520 
521 /**
522  * @brief Bluetooth Media Players' Subtype.
523  *
524  * This enumeration lists the subtype of the media player.
525  */
527  enBTMedPlayerSbTypAudioBook,
528  enBTMedPlayerSbTypPodcast
530 
531 /**
532  * @brief Bluetooth Media Items' Type.
533  *
534  * This enumeration lists the type of media item.
535  */
536 typedef enum _enBTMediaItemType {
537  enBTMediaItemTypUnknown,
538  enBTMediaItemTypAudio,
539  enBTMediaItemTypVideo,
540  enBTMediaItemTypFolder
542 
543 #if 0
544 /**
545  * @brief Bluetooth Media Status updates.
546  *
547  * This enumeration lists the status updates of a bluetooth media.
548  */
549 typedef enum _enBTMediaStatusUpdate {
550  enBTMediaTransportUpdate, /* Transport path Add/Rem */
551  enBTMediaPlayerUpdate, /* MediaPlayer Add/Rem */
552  enBTMediaPlaylistUpdate, /* NowPlaying list Add/Rem */
553  enBTMediaBrowserUpdate /* Media Browser Add/Rem */
554 } enBTMediaStatusUpdate;
555 #endif
556 
557 /**
558  * @brief Bluetooth Media types.
559  *
560  * This enumeration lists different Bluetooth Media types.
561  */
562 typedef enum _enBTMediaType {
563  enBTMediaTypePCM,
564  enBTMediaTypeSBC,
565  enBTMediaTypeMP3,
566  enBTMediaTypeAAC,
567  enBTMediaTypeUnknown
568 } enBTMediaType;
569 
570 /**
571  * @brief Bluetooth Media Controls.
572  *
573  * This enumeration lists the properties of a bluetooth media transport.
574  */
575 typedef enum _enBTMediaControlCmd {
576  enBTMediaCtrlPlay,
577  enBTMediaCtrlPause,
578  enBTMediaCtrlStop,
579  enBTMediaCtrlNext,
580  enBTMediaCtrlPrevious,
581  enBTMediaCtrlFastForward,
582  enBTMediaCtrlRewind,
583  enBTMediaCtrlVolumeUp,
584  enBTMediaCtrlVolumeDown,
585  enBTMediaCtrlEqlzrOff,
586  enBTMediaCtrlEqlzrOn,
587  enBTMediaCtrlShflOff,
588  enBTMediaCtrlShflAllTracks,
589  enBTMediaCtrlShflGroup,
590  enBTMediaCtrlRptOff,
591  enBTMediaCtrlRptSingleTrack,
592  enBTMediaCtrlRptAllTracks,
593  enBTMediaCtrlRptGroup,
594  enBTMediaCtrlUnknown
596 
597 typedef enum _enBTMediaFolderType {
598  enBTMediaFldTypAlbum,
599  enBTMediaFldTypArtist,
600  enBTMediaFldTypGenre,
601  enBTMediaFldTypCompilation,
602  //enBTMediaFldTypMixed,
603  enBTMediaFldTypPlayList,
604  enBTMediaFldTypTrackList,
605  enBTMediaFldTypTrack
606 } enBTMediaFolderType;
607 
608 /* Union Types */
609 typedef union _unBTOpIfceProp {
610  enBTAdapterProp enBtAdapterProp;
611  enBTDeviceProp enBtDeviceProp;
612  enBTMediaTransportProp enBtMediaTransportProp;
613  enBTMediaControlProp enBtMediaControlProp;
614  enBTMediaPlayerProp enBtMediaPlayerProp;
615  //enBTMediaItemProp enBtMediaItemProp;
616  enBTMediaFolderProp enBtMediaFolderProp;
617  enBTGattServiceProp enBtGattServiceProp;
618  enBTGattCharProp enBtGattCharProp;
619  enBTGattDescProp enBtGattDescProp;
620  // Add other enums which define the required properties
622 
623 
624 /* Structure Types */
625 typedef struct _stBTAdapterInfo {
626  char pcAddress[BT_MAX_STR_LEN]; // Bluetooth device address
627  char pcName[BT_MAX_STR_LEN]; // Bluetooth system name (pretty hostname)
628  char pcAlias[BT_MAX_STR_LEN]; // Bluetooth friendly name
629  unsigned int ui32Class; // Bluetooth class of device
630  int bPowered; // Bluetooth adapter 'powered' state
631  int bDiscoverable; // Bluetooth adapter visible/hidden
632  int bPairable; // Bluetooth adapter pairable or non-pairable
633  unsigned int ui32PairableTimeout; // 0 (default) = timeout disabled; stays in pairable mode forever
634  unsigned int ui32DiscoverableTimeout; // default = 180s (3m). 0 = timeout disabled; stays in discoverable/limited mode forever
635  int bDiscovering; // device discovery procedure active?
636  char ppcUUIDs[BT_MAX_DEVICE_PROFILE][BT_MAX_UUID_STR_LEN]; // List of 128-bit UUIDs that represents the available local services
637  char pcModalias[BT_MAX_STR_LEN]; // Local Device ID information in modalias format used by the kernel and udev
638  char pcPath[BT_MAX_DEV_PATH_LEN]; // Bluetooth adapter path
640 
641 typedef struct _stBTAdServiceData {
642  char pcUUIDs[BT_MAX_UUID_STR_LEN];;
643  uint8_t pcData[BT_MAX_SERVICE_DATA_LEN];
644  size_t len;
646 
647 typedef struct _stBTDeviceInfo {
648  int bPaired;
649  int bConnected;
650  int bTrusted;
651  int bBlocked;
652  int bServiceResolved;
653  unsigned short ui16Vendor;
654  unsigned short ui16VendorSource;
655  unsigned short ui16Product;
656  unsigned short ui16Version;
657  unsigned int ui32Class;
658  int i32RSSI;
659  unsigned short ui16Appearance;
660  char pcName[BT_MAX_STR_LEN];
661  char pcAddress[BT_MAX_STR_LEN];
662  char pcAlias[BT_MAX_STR_LEN];
663  char pcIcon[BT_MAX_STR_LEN];
665  char pcDevicePrevState[BT_MAX_STR_LEN];
666  char pcDeviceCurrState[BT_MAX_STR_LEN];
667  char pcDevicePath[BT_MAX_DEV_PATH_LEN];
669  // TODO: Array of objects Services;
670  // TODO: Array of objects Nodes;
672 
673 typedef struct _stBTPairedDeviceInfo {
674  unsigned short numberOfDevices;
675  char devicePath[BT_MAX_NUM_DEVICE][BT_MAX_DEV_PATH_LEN];
676  stBTDeviceInfo deviceInfo[BT_MAX_NUM_DEVICE];
678 
680  unsigned int uuid_value;
681  char profile_name[BT_MAX_STR_LEN];
683 
685  int numberOfService;
688 
689 typedef struct _stBTMediaTrackInfo {
690  char pcAlbum[BT_MAX_STR_LEN];
691  char pcGenre[BT_MAX_STR_LEN];
692  char pcTitle[BT_MAX_STR_LEN];
693  char pcArtist[BT_MAX_STR_LEN];
694  unsigned int ui32TrackNumber;
695  unsigned int ui32Duration;
696  unsigned int ui32NumberOfTracks;
698 
699 
700 typedef struct _stBTMediaStatusUpdate {
701  enBTOpIfceType aenBtOpIfceType;
702  unBTOpIfceProp aunBtOpIfceProp;
703 
704  union {
705  enBTMediaTransportState m_mediaTransportState;
706  unsigned char m_mediaTransportVolume;
707  enBTMediaPlayerType enMediaPlayerType;
708  enBTMediaPlayerSubtype enMediaPlayerSubtype;
709  enBTMediaPlayerEqualizer enMediaPlayerEqualizer;
710  enBTMediaPlayerShuffle enMediaPlayerShuffle;
711  enBTMediaPlayerScan enMediaPlayerScan;
712  enBTMediaPlayerRepeat enMediaPlayerRepeat;
713  enBTMediaPlayerStatus enMediaPlayerStatus;
714  unsigned char m_mediaPlayerBrowsable;
715  unsigned char m_mediaPlayerSearchable;
716  unsigned char m_mediaPlayerConnected;
717  unsigned int m_mediaPlayerPosition;
718  stBTMediaTrackInfo m_mediaTrackInfo;
719  char m_mediaPlayerPath[BT_MAX_STR_LEN];
720  char m_mediaPlayerName[BT_MAX_STR_LEN];
721  char m_mediaFolderName[BT_MAX_STR_LEN];
722  unsigned int m_mediaFolderNumberOfItems;
723  };
725 
726 typedef struct _stBTMediaBrowserUpdate {
727  char pcMediaItemName[BT_MAX_STR_LEN];
728  char pcMediaItemPath[BT_MAX_STR_LEN];
729  enBTMediaItemType eMediaItemType;
730  enBTMediaFolderType eMediaFolderType;
731  tBTMediaItemId ui32BTMediaItemId;
732  unsigned int ui32NumberOfItems;
733  stBTMediaTrackInfo mediaTrackInfo;
735 
736 
737 /* GattDescriptor1 Properties */
738 typedef struct _stBTLeGattDesc {
739  char descPath[BT_MAX_STR_LEN]; /* Descriptor Path */
740  char descUuid[BT_MAX_UUID_STR_LEN]; /* 128-bit service UUID */
741  unsigned short descFlags; /* Descriptor Flags - bit field values */
742  char propertyValue[BT_MAX_GATT_OP_DATA_LEN]; /* value of the descriptor */
744 
745 /* GattCharacteristic1 Path and Properties */
746 typedef struct _stBTLeGattChar {
747  char charPath[BT_MAX_STR_LEN]; /* Characteristic Path */
748  char charUuid[BT_MAX_UUID_STR_LEN]; /* 128-bit service UUID */
749  stBTLeGattDesc atBTRGattDesc[BT_MAX_NUM_GATT_DESC]; /* Max of 8 Gatt Descriptor array */
750  unsigned short ui16NumberOfGattDesc; /* Number of Gatt Service ID */
751  unsigned short charFlags; /* Characteristic Flags - bit field values */
752  char value[BT_MAX_GATT_OP_DATA_LEN]; /* value of the characteristic */
754 
755 /* GattService Path and Properties */
756 typedef struct _stBTLeGattService {
757  char servicePath[BT_MAX_STR_LEN]; /* Service Path */
758  char serviceUuid[BT_MAX_UUID_STR_LEN]; /* 128-bit service UUID */
759  unsigned char serviceType; /* Primary(True) or secondary(False) gatt service*/
760  stBTLeGattChar astBTRGattChar[BT_MAX_NUM_GATT_CHAR]; /* Max of 6 Gatt Charactristic array */
761  unsigned short ui16NumberOfGattChar; /* Number of Gatt Charactristics */
763 
764 typedef struct _stBTLeGattInfo {
765  stBTLeGattService astBTRGattService[BT_MAX_NUM_GATT_SERVICE];
766  int nNumGattServices;
768 
769 /* Advertisement data structure */
770 typedef struct _stBTLeManfData {
771  unsigned short ManfID; /* Manufacturer ID Key */
772  unsigned int lenManfData; /* Length of data associated with the manufacturer ID */
773  unsigned char data[BT_MAX_GATT_OP_DATA_LEN]; /* Data associated with the manufacturer ID */
775 
776 typedef struct _stBTLeServData {
777  char UUID[BT_MAX_STR_LEN]; /* UUID of the service data - Key */
778  uint8_t data[BT_MAX_GATT_OP_DATA_LEN]; /* Data associated with the service UUID */
780 
781 typedef struct _stBTLeCustomAdv {
782  char pui8AdvertPath[BT_MAX_STR_LEN]; /* Service Path */
783  char AdvertisementType[BT_MAX_STR_LEN]; /* Type of advertising packet : "Broadcast"/"Peripheral" */
784  char ServiceUUID[BT_MAX_NUM_GATT_SERVICE][BT_MAX_STR_LEN]; /* List of the UUIDs of the services supported by the device */
785  int numServiceUUID; /* Number of Services supported by the device */
786  char SolicitUUID[BT_MAX_NUM_GATT_SERVICE][BT_MAX_STR_LEN]; /* Services the Peripheral device maybe interested in when it is a Gatt client too */
787  int numSolicitUUID; /* Number of solicit services of the device */
788  stBTLeManfData ManfData; /* Manufacturer Id and the data assosciated */
789  stBTLeServData ServiceData; /* Arbitary data associated with the UUID */
790  unsigned char bTxPower; /* Includes Tx power in advertisement */
792 
793 
794 /* Fptr Callbacks types */
795 typedef int (*fPtr_BtrCore_BTAdapterStatusUpdateCb)(enBTAdapterProp aeBtAdapterProp, stBTAdapterInfo* apstBTAdapterInfo, void* apUserData);
796 typedef int (*fPtr_BtrCore_BTDevStatusUpdateCb)(enBTDeviceType aeBtDeviceType, enBTDeviceState aeBtDeviceState, stBTDeviceInfo* apstBTDeviceInfo, void* apUserData);
797 typedef int (*fPtr_BtrCore_BTMediaStatusUpdateCb)(enBTDeviceType aeBtDeviceType, stBTMediaStatusUpdate* apstBtMediaStUpdate, const char* apcBtDevAddr, void* apUserData);
798 typedef int (*fPtr_BtrCore_BTNegotiateMediaCb)(void* apBtMediaCapsInput, void** appBtMediaCapsOutput, enBTDeviceType aenBTDeviceType, enBTMediaType aenBTMediaType, void* apUserData);
799 typedef int (*fPtr_BtrCore_BTTransportPathMediaCb)(const char* apBtMediaTransportPath, const char* apBtMediaUUID, void* apBtMediaCaps, enBTDeviceType aenBTDeviceType, enBTMediaType aenBTMediaType, void* apUserData);
800 typedef int (*fPtr_BtrCore_BTMediaPlayerPathCb)(const char* apcBTMediaPlayerPath, void* apUserData);
801 typedef int (*fPtr_BtrCore_BTConnIntimCb)(enBTDeviceType aeBtDeviceType, stBTDeviceInfo* apstBTDeviceInfo, unsigned int aui32devPassKey, unsigned char ucIsReqConfirmation, void* apUserData);
802 typedef int (*fPtr_BtrCore_BTConnAuthCb)(enBTDeviceType aeBtDeviceType, stBTDeviceInfo* apstBTDeviceInfo, void* apUserData);
803 typedef int (*fPtr_BtrCore_BTMediaBrowserPathCb)(stBTMediaBrowserUpdate* apstBtMediaBsrUpdate, unsigned char ucItemScope, const char* apcBtDevAddr, void* apUserData);
804 typedef int (*fPtr_BtrCore_BTLeGattPathCb)(enBTOpIfceType enBtOpIfceType, enBTLeGattOp aenGattOp, const char* apBtGattPath, const char* apcBtDevAddr, enBTDeviceState aenBTDeviceState, void* apLeCbData, void* apUserData);
805 typedef int (*fPtr_BtrCore_BTLeAdvertisementCb)(const char* apBtAdvPath, stBTLeCustomAdv** appstBtCoreLeCustomAdv, void* apUserData);
806 /* @} */ // End of group BLUETOOTH_TYPES
807 
808 /**
809  * @addtogroup BLUETOOTH_APIS
810  * @{
811  */
812 
813 //callback to process connection requests:
814 int (*p_ConnAuth_callback) ();
815 
816 /* Interfaces */
817 
818 /**
819  * @brief This API Initializes the Bluetooth core and fetches DBus connection and returns a handle to the instance.
820  *
821  * This handle will be used in all future communication with the Bluetooth core.
822  *
823  * @retval Returns NULL if DBus connection establishment fails.
824  */
825 void* BtrCore_BTInitGetConnection (void);
826 
827 /**
828  * @brief This API DeInitializes the Bluetooth core and releases the DBus connection.
829  *
830  * This handle will be used in all future communication with the Bluetooth core.
831  * This function will release the memory allocated toBT Adapters & BT agent.
832  *
833  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection. NULL is valid for this API.
834  *
835  * @return Returns the status of the operation.
836  * @retval Returns 0 on success, appropriate error code otherwise.
837  */
838 int BtrCore_BTDeInitReleaseConnection (void* apBtConn);
839 
840 /**
841  * @brief Using this API, a default Path is assigned to the Bluetooth Agent.
842  *
843  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection. NULL is valid for this API.
844  *
845  * @return assigned bluetooth agent path is returned.
846  */
847 char* BtrCore_BTGetAgentPath (void* apBtConn);
848 
849 /**
850  * @brief Using this API the path assigned to the Bluetooth Agent is released.
851  *
852  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection. NULL is valid for this API.
853  *
854  * @return Returns the status of the operation.
855  * @retval Returns 0 on success, appropriate error code otherwise.
856  */
857 int BtrCore_BTReleaseAgentPath (void* apBtConn);
858 
859 /**
860  * @brief using this API, DBus object path is registered with bluetooth agent path and current adapter's path.
861  *
862  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
863  * @param[in] apBtAdapter The current bluetooth Adapter path.
864  * @param[in] apBtAgentPath The bluetooth agent path.
865  * @param[in] capabilities Bluetooth core capabilities.
866  *
867  * @return Returns the status of the operation.
868  * @retval Returns 0 on success, appropriate error code otherwise.
869  */
870 int BtrCore_BTRegisterAgent (void* apBtConn, const char* apBtAdapter, const char* apBtAgentPath, const char *capabilities);
871 
872 /**
873  * @brief Using this API, DBus object path is unregistered with bluetooth agent path and current adapter's path.
874  *
875  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
876  * @param[in] apBtAdapter The current bluetooth Adapter path.
877  * @param[in] apBtAgentPath The bluetooth agent path.
878  *
879  * @return Returns the status of the operation.
880  * @retval Returns 0 on success, appropriate error code otherwise.
881 */
882 int BtrCore_BTUnregisterAgent (void* apBtConn, const char* apBtAdapter, const char* apBtAgentPath);
883 
884 /**
885  * @brief This API obtains adapter list from Dbus object path.
886  *
887  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
888  * @param[out] apBtNumAdapters Total number of bluetooth adapters available.
889  * @param[out] apcArrBtAdapterPath Array of bluetooth adapter paths.
890  *
891  * @return Returns the status of the operation.
892  * @retval Returns 0 on success, appropriate error code otherwise.
893 */
894 int BtrCore_BTGetAdapterList (void* apBtConn, unsigned int *apBtNumAdapters, char* apcArrBtAdapterPath[BT_MAX_NUM_ADAPTERS]);
895 
896 /**
897  * @brief Using this API adapter path is fetched from Dbus object path.
898  *
899  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
900  * NULL is valid for this API.
901  * @param[in] apBtAdapter Current bluetooth adapter whose path has to be fetched.
902  *
903  * @return Retrieved bluetooth adapter path is returned.
904  */
905 char* BtrCore_BTGetAdapterPath (void* apBtConn, const char* apBtAdapter);
906 
907 /**
908  * @brief Using this API the path assigned to the current Bluetooth Adapter is released.
909  *
910  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
911  * NULL is valid for this API.
912  * @param[in] apBtAdapter Current bluetooth adapter whose path has to be released.
913  *
914  * @return Returns the status of the operation.
915  * @retval Returns 0 on success, appropriate error code otherwise.
916  */
917 int BtrCore_BTReleaseAdapterPath (void* apBtConn, const char* apBtAdapter);
918 
919 /**
920  * @brief using this API, Bluetooth interface version is obtained from bluetooth daemon of the kernel
921  * and default name "Bluez" is assigned as interface name.
922  *
923  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
924  * NULL is valid for this API.
925  * @param[out] apBtOutIfceName Bluetooth interface name that has to be fetched.
926  * @param[out] apBtOutVersion Bluetooth interface version that has to be fetched.
927  *
928  * @return Returns the status of the operation.
929  * @retval Returns 0 on success, appropiate error code otherwise.
930  */
931 int BtrCore_BTGetIfceNameVersion (void* apBtConn, char* apBtOutIfceName, char* apBtOutVersion);
932 
933 /**
934  * @brief This API gets different properties of different BT devices and services.
935  *
936  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
937  * NULL is valid for this API.
938  * @param[in] apcOpIfcePath Bluetooth interface path.
939  * @param[in] aenBtOpIfceType Bluetooth interface type.
940  * @param[in] aunBtOpIfceProp Bluetooth interface property whose property value has to be fetched.
941  * @param[out] apvVal Property value which has to be fetched from Dbus iterator.
942  *
943  * @return Returns the status of the operation.
944  * @retval Returns 0 on success, appropriate error code otherwise.
945  */
946 int BtrCore_BTGetProp (void* apBtConn, const char* apcOpIfcePath, enBTOpIfceType aenBtOpIfceType, unBTOpIfceProp aunBtOpIfceProp, void* apvVal);
947 
948 /**
949  * @brief This API sets different properties of different BT devices and services.
950  *
951  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
952  * NULL is valid for this API.
953  * @param[in] apcOpIfcePath Bluetooth interface path.
954  * @param[in] aenBtOpIfceType Bluetooth interface type.
955  * @param[in] aunBtOpIfceProp Bluetooth interface property whose property value has to be fetched.
956  * @param[in] apvVal Property value which has to be set to Dbus iterator.
957  *
958  * @return Returns the status of the operation.
959  * @retval Returns 0 on success, appropriate error code otherwise.
960  */
961 int BtrCore_BTSetProp (void* apBtConn, const char* apcOpIfcePath, enBTOpIfceType aenBtOpIfceType, unBTOpIfceProp aunBtOpIfceProp, void* apvVal);
962 
963 /**
964  * @brief This API is used to discover the Bluetooth adapter.
965  *
966  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
967  * NULL is valid for this API.
968  * @param[in] apBtAdapter Bluetooth adapter.
969  * @param[in] apBtAgentPath Bluetooth agent path.
970  *
971  * @return Returns the status of the operation.
972  * @retval Returns 0 on success, appropriate error code otherwise.
973  */
974 int BtrCore_BTStartDiscovery (void* apBtConn, const char* apBtAdapter, const char* apBtAgentPath);
975 
976 /**
977  * @brief This API is used to stop discovering Bluetooth adapter.
978  *
979  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
980  * NULL is valid for this API.
981  * @param[in] apBtAdapter Bluetooth adapter.
982  * @param[in] apBtAgentPath Bluetooth agent path.
983  *
984  * @return Returns the status of the operation.
985  * @retval Returns 0 on success, appropriate error code otherwise.
986  */
987 int BtrCore_BTStopDiscovery (void* apBtConn, const char* apBtAdapter, const char* apBtAgentPath);
988 
989 /**
990  * @brief This API is used to discover the low energy Bluetooth adapter.
991  *
992  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
993  * NULL is valid for this API.
994  * @param[in] apBtAdapter Bluetooth adapter.
995  * @param[in] apBtAgentPath Bluetooth agent path.
996  *
997  * @return Returns the status of the operation.
998  * @retval Returns 0 on success, appropriate error code otherwise.
999  */
1000 int BtrCore_BTStartLEDiscovery (void* apBtConn, const char* apBtAdapter, const char* apBtAgentPath);
1001 
1002 /**
1003  * @brief This API is used to stop discovering low energy Bluetooth adapter.
1004  *
1005  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1006  * NULL is valid for this API.
1007  * @param[in] apBtAdapter Bluetooth adapter.
1008  * @param[in] apBtAgentPath Bluetooth agent path.
1009  *
1010  * @return Returns the status of the operation.
1011  * @retval Returns 0 on success, appropriate error code otherwise.
1012  */
1013 int BtrCore_BTStopLEDiscovery (void* apBtConn, const char* apBtAdapter, const char* apBtAgentPath);
1014 
1015 /**
1016  * @brief This API is used to discover the Classic Bluetooth Devices.
1017  *
1018  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1019  * NULL is valid for this API.
1020  * @param[in] apBtAdapter Bluetooth adapter.
1021  * @param[in] apBtAgentPath Bluetooth agent path.
1022  *
1023  * @return Returns the status of the operation.
1024  * @retval Returns 0 on success, appropriate error code otherwise.
1025  */
1026 int BtrCore_BTStartClassicDiscovery (void* apBtConn, const char* apBtAdapter, const char* apBtAgentPath);
1027 
1028 /**
1029  * @brief This API is used to stop discovering Classic Bluetooth Devices.
1030  *
1031  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1032  * NULL is valid for this API.
1033  * @param[in] apBtAdapter Bluetooth adapter.
1034  * @param[in] apBtAgentPath Bluetooth agent path.
1035  *
1036  * @return Returns the status of the operation.
1037  * @retval Returns 0 on success, appropriate error code otherwise.
1038  */
1039 int BtrCore_BTStopClassicDiscovery (void* apBtConn, const char* apBtAdapter, const char* apBtAgentPath);
1040 
1041 /**
1042  * @brief This API fetches all the paired devices' paths and number of paired devices.
1043  *
1044  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1045  * NULL is valid for this API.
1046  * @param[in] apBtAdapter Bluetooth adapter.
1047  * @param[out] apui32PairedDevCnt Number of paired devices that are found.
1048  * @param[out] apcArrPairedDevPath Array that stores the device paths of paired devices found.
1049  *
1050  * @return Returns the status of the operation.
1051  * @retval Returns 0 on success, appropriate error code otherwise.
1052  */
1053 int BtrCore_BTGetPairedDevices (void* apBtConn, const char* apBtAdapter, unsigned int* apui32PairedDevCnt, char** apcArrPairedDevPath);
1054 
1055 /**
1056  * @brief This API fetches all BT paired devices' device information.
1057  *
1058  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1059  * NULL is valid for this API.
1060  * @param[in] apBtAdapter Bluetooth adapter.
1061  * @param[out] pPairedDeviceInfo A structure that fetches device information of all the paired devices.
1062  *
1063  * @return Returns the status of the operation.
1064  * @retval Returns 0 on success, appropriate error code otherwise.
1065  */
1066 int BtrCore_BTGetPairedDeviceInfo (void* apBtConn, const char* apBtAdapter, stBTPairedDeviceInfo *pPairedDeviceInfo);
1067 
1068 /**
1069  * @brief This API is used to discover the supported services and fetch the profiles of all those devices.
1070  *
1071  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1072  * NULL is valid for this API.
1073  * @param[in] apcDevPath Bluetooth device path.
1074  * @param[out] pProfileList A structure that fetches Profile information of all the supported services.
1075  *
1076  * @return Returns the status of the operation.
1077  * @retval Returns 0 on success, appropriate error code otherwise.
1078  */
1079 int BtrCore_BTDiscoverDeviceServices (void* apBtConn, const char* apcDevPath, stBTDeviceSupportedServiceList *pProfileList);
1080 
1081 /**
1082  * @brief This API is used to find all supported services and fetch the profiles of all those devices.
1083  *
1084  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1085  * NULL is valid for this API.
1086  * @param[in] apcDevPath Bluetooth device path.
1087  * @param[in] apcSearchString Usually, the UUID that has to be searched for.
1088  * @param[out] apcDataString The actual string that is fetched from Dbus iterator which matches the provided UUID.
1089  *
1090  * @return Returns the status of the operation.
1091  * @retval Returns 0 on success, appropiate error code otherwise.
1092  */
1093 int BtrCore_BTFindServiceSupported(void* apBtConn, const char* apcDevPath, const char* apcSearchString, char* apcDataString);
1094 
1095 /**
1096  * @brief This API is used to perform BT adapter operations.
1097  *
1098  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1099  * NULL is valid for this API.
1100  * @param[in] apBtAdapter Bluetooth Adapter
1101  * @param[in] apBtAgentPath BT agent path.
1102  * @param[in] apcDevPath Bluetooth device path.
1103  * @param[in] aenBTAdpOp Adapter operation that has to be performed.
1104  *
1105  * @return Returns the status of the operation.
1106  * @retval Returns 0 on success, appropriate error code otherwise.
1107  */
1108 int BtrCore_BTPerformAdapterOp (void* apBtConn, const char* apBtAdapter, const char* apBtAgentPath, const char* apcDevPath, enBTAdapterOp aenBTAdpOp);
1109 
1110 /**
1111  * @brief This API is used to run device connectable command.
1112  *
1113  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1114  * NULL is valid for this API.
1115  * @param[in] apcDevPath Bluetooth device path.
1116  *
1117  * @return Returns the status of the operation.
1118  * @retval Returns 0 on success, appropriate error code otherwise.
1119  */
1120 int BtrCore_BTIsDeviceConnectable (void* apBtConn, const char* apcDevPath);
1121 
1122 /**
1123  * @brief This API is used to establish the connection with a BT device.
1124  *
1125  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1126  * NULL is valid for this API.
1127  * @param[in] apDevPath Bluetooth device path.
1128  * @param[in] aenBTDevType Bluetooth device type.
1129  *
1130  * @return Returns the status of the operation.
1131  * @retval Returns 0 on success, appropriate error code otherwise.
1132  */
1133 int BtrCore_BTConnectDevice (void* apBtConn, const char* apDevPath, enBTDeviceType aenBTDevType);
1134 
1135 /**
1136  * @brief This API is used to diconnect a BT device.
1137  *
1138  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1139  * NULL is valid for this API.
1140  * @param[in] apDevPath Bluetooth device path.
1141  * @param[in] aenBTDevType Bluetooth device type.
1142  *
1143  * @return Returns the status of the operation.
1144  * @retval Returns 0 on success, appropriate error code otherwise.
1145  */
1146 int BtrCore_BTDisconnectDevice (void* apBtConn, const char* apDevPath, enBTDeviceType aenBTDevType);
1147 
1148 /**
1149  * @brief This API is used to Enable Enhanced Retransmission on all BT adapter.
1150  *
1151  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1152  * NULL is valid for this API.
1153  *
1154  * @return Returns the status of the operation.
1155  * @retval Returns 0 on success, appropriate error code otherwise.
1156  */
1157 int BtrCore_BTEnableEnhancedRetransmissionMode (void* apstBtIfceHdl);
1158 
1159 /**
1160  * @brief This API is used to Disable Enhanced Retransmission on all BT adapter.
1161  *
1162  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1163  * NULL is valid for this API.
1164  *
1165  * @return Returns the status of the operation.
1166  * @retval Returns 0 on success, appropriate error code otherwise.
1167  */
1168 int BtrCore_BTDisableEnhancedRetransmissionMode (void* apstBtIfceHdl);
1169 
1170 /**
1171  * @brief This API is used to register a media device.
1172  *
1173  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1174  * NULL is valid for this API.
1175  * @param[in] apBtAdapter Bluetooth device path.
1176  * @param[in] aenBTDevType Device type.
1177  * @param[in] aenMediaType Media codec type.
1178  * @param[in] apBtUUID Bluetooth UUID
1179  * @param[in] apBtMediaCapabilities Media capabilities like frequency, block length, Min bitpool, Max bitpool etc.
1180  * @param[in] apBtMediaCapabilitiesSize size of apBtMediaCapabilities.
1181  * @param[in] abBtMediaDelayReportEnable Flag that indicates if any delay.
1182  *
1183  * @return Returns the status of the operation.
1184  * @retval Returns 0 on success, appropriate error code otherwise.
1185 */
1186 int BtrCore_BTRegisterMedia (void* apBtConn, const char* apBtAdapter, enBTDeviceType aenBTDevType, enBTMediaType aenBTMediaType,
1187  const char* apBtUUID, void* apBtMediaCapabilities, int apBtMediaCapabilitiesSize,int abBtMediaDelayReportEnable);
1188 
1189 /**
1190  * @brief This API is used to unregister the media device.
1191  *
1192  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1193  * NULL is valid for this API.
1194  * @param[in] apBtAdapter Bluetooth device path.
1195  * @param[in] aenBTDevType Bluetooth device type.
1196  * @param[in] aenMediaType Media codec type.
1197  *
1198  * @return Returns the status of the operation.
1199  * @retval Returns 0 on success, appropriate error code otherwise.
1200  */
1201 int BtrCore_BTUnRegisterMedia (void* apBtConn, const char* apBtAdapter, enBTDeviceType aenBTDevType, enBTMediaType aenBTMediaType);
1202 
1203 /**
1204  * @brief This API is used to acquire device data path.
1205  *
1206  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1207  * NULL is valid for this API.
1208  * @param[in] apcDevTransportPath Bluetooth device transport path.
1209  * @param[out] dataPathFd Data path file descriptor that has to be fetched.
1210  * @param[out] dataReadMTU Fetches MTU of data reading.
1211  * @param[out] dataWriteMTU Fetches MTU of data writing.
1212  *
1213  * @return Returns the status of the operation.
1214  * @retval Returns 0 on success, appropriate error code otherwise.
1215  */
1216 int BtrCore_BTAcquireDevDataPath (void* apBtConn, char* apcDevTransportPath, int* dataPathFd, int* dataReadMTU, int* dataWriteMTU);
1217 
1218 /**
1219  * @brief This API is used to release the acquired device data path.
1220  *
1221  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1222  * NULL is valid for this API.
1223  * @param[in] apcDevTransportPath Bluetooth device transport path.
1224  *
1225  * @return Returns the status of the operation.
1226  * @retval Returns 0 on success, appropriate error code otherwise.
1227  */
1228 int BtrCore_BTReleaseDevDataPath (void* apBtConn, char* apcDevTransportPath);
1229 
1230 /**
1231  * @brief This API is used to release the acquired device data path.
1232  *
1233  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1234  * NULL is valid for this API.
1235  * @param[in] aui32AckTOutms Data write acknowledgment timeout
1236  *
1237  * @return Returns the status of the operation.
1238  * @retval Returns 0 on success, appropriate error code otherwise.
1239  */
1240 int BtrCore_BTSetDevDataAckTimeout (void* apBtConn, unsigned int aui32AckTOutms);
1241 
1242 
1243 // AVRCP Interfaces
1244 
1245 /**
1246  * @brief A Path is assigned to Media player using Bluetooth device path.
1247  *
1248  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1249  * NULL is valid for this API.
1250  * @param[in] apBtDevPath Bluetooth device path.
1251  *
1252  * @return assigned Media player path is returned.
1253  */
1254 char* BtrCore_BTGetMediaPlayerPath (void* apBtConn, const char* apBtDevPath);
1255 
1256 /**
1257  * @brief This API is used to control the media device.
1258  *
1259  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1260  * NULL is valid for this API.
1261  * @param[in] apmediaPlayerPath Media player path.
1262  * @param[in] aenBTMediaOper Media operation that has to be performed.
1263  *
1264  * @return assigned Media player path is returned.
1265  */
1266 int BtrCore_BTDevMediaControl (void* apBtConn, const char* apmediaPlayerPath, enBTMediaControlCmd aenBTMediaOper);
1267 
1268 /**
1269  * @brief This API is used to get the state of the BT device .
1270  *
1271  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1272  * NULL is valid for this API.
1273  * @param[in] apBtDataPath Bt Data path.
1274  * @param[out] state Transport state of the BT device.
1275  *
1276  * @return Returns the status of the operation.
1277  * @retval Returns 0 on success, appropriate error code otherwise.
1278  */
1279 int BtrCore_BTGetTransportState (void* apBtConn, const char* apBtDataPath, void* state);
1280 
1281 /**
1282  * @brief This API is used to get media player property value using the object path of BT device and media property.
1283  *
1284  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1285  * NULL is valid for this API.
1286  * @param[in] apBtObjectPath Bluetooth device path.
1287  * @param[in] mediaProperty Property of the Mediaplayer.
1288  * @param[out] mediaPropertyValue Property value of media player.
1289  *
1290  * @return Returns the status of the operation.
1291  * @retval Returns 0 on success, appropriate error code otherwise.
1292  */
1293 int BtrCore_BTGetMediaPlayerProperty (void* apBtConn, const char* apBtObjectPath, const char* mediaProperty, void* mediaPropertyValue);
1294 
1295 /**
1296  * @brief This API is used to get the number of items in the current media folder.
1297  *
1298  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1299  * NULL is valid for this API.
1300  * @param[in] apBtMediaPlayerPath Media Player path.
1301  * @param[out] aui32NumberOfItems number of items.
1302  *
1303  * @return Returns the status of the operation.
1304  * @retval Returns 0 on success, appropriate error code otherwise.
1305  */
1306 int BtrCore_BTGetMediaFolderNumberOfItems (void* apBtConn, const char* apBtMediaPlayerPath, unsigned int* aui32NumberOfItems);
1307 
1308 /**
1309  * @brief This API is used to set the media property of the BT device .
1310  *
1311  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1312  * NULL is valid for this API.
1313  * @param[in] apBtAdapterPath Blue tooth adapter path.
1314  * @param[in] mediaProperty Media Property that has to be set to BT device.
1315  * @param[in] pValue Value of the media property that has been set.
1316  *
1317  * @return Returns the status of the operation.
1318  * @retval Returns 0 on success, appropriate error code otherwise.
1319  */
1320 int BtrCore_BTSetMediaProperty (void* apBtConn, const char* apBtAdapterPath, char* mediaProperty, char* pValue);
1321 
1322 /**
1323  * @brief This API is used to retrieve the information about the track that is being played on BT media device.
1324  *
1325  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1326  * NULL is valid for this API.
1327  * @param[in] apBtmediaPlayerObjectPath Object path of the BT media player.
1328  * @param[out] lpstBTMediaTrackInfo Track information that has to be retrieved.
1329  *
1330  * @return Returns the status of the operation.
1331  * @retval Returns 0 on success, appropriate error code otherwise.
1332  */
1333 int BtrCore_BTGetTrackInformation (void* apBtConn, const char* apBtmediaPlayerObjectPath, stBTMediaTrackInfo* lpstBTMediaTrackInfo);
1334 
1335 /**
1336  * @brief This API is used to change from the current media folder path to another path.
1337  *
1338  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1339  * NULL is valid for this API.
1340  * @param[in] apBtmediaPlayerObjectPath Object path of the BT media player.
1341  * @param[in] apBtdestMediaFolderPath Destination Folder path.
1342  *
1343  * @return Returns the status of the operation.
1344  * @retval Returns 0 on success, appropriate error code otherwise.
1345  */
1346 int BtrCore_BTChangeMediaFolder (void* apstBtIfceHdl, const char* apBtmediaPlayerObjectPath, const char* apBtdestMediaFolderPath);
1347 
1348 /**
1349  * @brief This API is used to list the media items in the current folder.
1350  *
1351  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1352  * NULL is valid for this API.
1353  * @param[in] apBtmediaPlayerObjectPath Object path of the BT media player.
1354  * @param[in] apBtMediaFolderStartIndex Starting index of the list.
1355  * @param[in] apBtMediaFolderEndIndex Ending indx of the list.
1356  * @param[in] apBtMediaFilter Filter to be applied.
1357  * @param[in] apBtMediaFilterSize Filter size.
1358  *
1359  * @return Returns the status of the operation.
1360  * @retval Returns 0 on success, appropriate error code otherwise.
1361  */
1362 int BtrCore_BTSelectMediaFolderItems (void* apstBtIfceHdl, const char* apBtMediaPlayerObjectPath, unsigned int apBtMediaFolderStartIndex, unsigned int apBtMediaFolderEndIndex, const char* apBtMediaFilter, int apBtMediaFilterSize);
1363 
1364 /**
1365  * @brief This API is used to Play the mentioned media track.
1366  *
1367  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1368  * NULL is valid for this API.
1369  * @param[in] apBtmediaItemObjectPath Object path of the media Track.
1370  *
1371  * @return Returns the status of the operation.
1372  * @retval Returns 0 on success, appropriate error code otherwise.
1373  */
1374 int BtrCore_BTPlayMediaTrackItem (void* apstBtIfceHdl, const char* apBtMediaItemObjectPath);
1375 
1376 /**
1377  * @brief This API is used to get the mediaItemID of the node which is the immediate common parent of the src and dest nodes.
1378  *
1379  * @param[in] aBTcurrMediaItemId mediaItemId of the current browsing folder.
1380  * @param[in] aBTdestMediaItemId mediaItemId of the destination browsing folder, we need to switch.
1381  *
1382  * @return Returns the result of the operation.
1383  * @return Returns the common parents' mediaItemId.
1384  */
1385 tBTMediaItemId BtrCore_BTGetCommonParentMediaItemId (tBTMediaItemId aBTcurrMediaItemId, tBTMediaItemId aBTdestMediaItemId);
1386 
1387 /******************************************
1388 * LE Functions
1389 *******************************************/
1390 
1391 /**
1392  * @brief This API is used to invoke the bluez API advertisement method call RegisterAdvertisment
1393  *
1394  * @param[in] apstBtIfceHdl The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1395  * @param[in] apBtAdapter Bluetooth adapter
1396  *
1397  * @return Returns the status of the operation.
1398  * @retval Returns 0 on success, appropriate error code otherwise.
1399  */
1400 int BtrCore_BTRegisterLeAdvertisement( void* apstBtIfceHdl, const char* apBtAdapter);
1401 
1402 /**
1403  * @brief This API is used to invoke the bluez API gatt service method call RegisterApplication
1404  *
1405  * @param[in] apstBtIfceHdl The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1406  * @param[in] apBtAdapter Bluetooth adapter
1407  *
1408  * @return Returns the status of the operation.
1409  * @retval Returns 0 on success, appropriate error code otherwise.
1410  */
1411 int BtrCore_BTRegisterLeGatt (void* apBtConn, const char* apBtAdapter);
1412 
1413 /**
1414  * @brief This API is used to invoke the bluez API gatt service method call UnRegisterApplication
1415  *
1416  * @param[in] apstBtIfceHdl The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1417  * @param[in] apBtAdapter Bluetooth adapter
1418  *
1419  * @return Returns the status of the operation.
1420  * @retval Returns 0 on success, appropriate error code otherwise.
1421  */
1422 int BtrCore_BTUnRegisterLeGatt (void* apBtConn, const char* apBtAdapter);
1423 
1424 /**
1425  * @brief This API is used to perform gatt services of the BT device .
1426  *
1427  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1428  * NULL is valid for this API.
1429  * @param[in] apBtLePath LE Blue tooth device path.
1430  * @param[in] aenBTOpIfceType Bluetooth interface type.
1431  * @param[in] aenBTLeGattOp Bluetooth interface property whose propert value has to be fetched.
1432  * @param[in] apUserdata1 LE gatt operation userdata.
1433  * @param[in] apUserdata2 LE gatt operation userdata.
1434  * @param[out] rpLeOpRes LE operation result.
1435  *
1436  * @return Returns the status of the operation.
1437  * @retval Returns 0 on success, appropriate error code otherwise.
1438  */
1439 int BtrCore_BTPerformLeGattOp (void* apBtConn, const char* apBtLePath, enBTOpIfceType aenBTOpIfceType, enBTLeGattOp aenBTLeGattOp, char* apLeGatOparg1, char* apLeGatOparg2, char* rpLeOpRes);
1440 
1441 /**
1442  * @brief This API is used to read, write and dispatch BT device information.
1443  *
1444  * @param[in] apBtConn The Dbus connection handle as returned by BtrCore_BTInitGetConnection.
1445  * NULL is valid for this API.
1446  *
1447  * @return Returns the status of the operation.
1448  * @retval Returns 0 on success, appropriate error code otherwise.
1449  */
1450 int BtrCore_BTSendReceiveMessages (void* apBtConn);
1451 
1452 // Outgoing callbacks Registration Interfaces
1453 int BtrCore_BTRegisterAdapterStatusUpdateCb (void* apBtConn, fPtr_BtrCore_BTAdapterStatusUpdateCb afpcBAdapterStatusUpdate, void* apUserData);
1454 int BtrCore_BTRegisterDevStatusUpdateCb (void* apBtConn, fPtr_BtrCore_BTDevStatusUpdateCb afpcBDevStatusUpdate, void* apUserData);
1455 int BtrCore_BTRegisterMediaStatusUpdateCb (void* apBtConn, fPtr_BtrCore_BTMediaStatusUpdateCb afpcBMediaStatusUpdate, void* apUserData);
1456 int BtrCore_BTRegisterConnIntimationCb (void* apBtConn, fPtr_BtrCore_BTConnIntimCb afpcBConnIntim, void* apUserData);
1457 int BtrCore_BTRegisterConnAuthCb (void* apBtConn, fPtr_BtrCore_BTConnAuthCb afpcBConnAuth, void* apUserData);
1458 int BtrCore_BTRegisterNegotiateMediaCb (void* apBtConn, const char* apBtAdapter,
1459  fPtr_BtrCore_BTNegotiateMediaCb afpcBNegotiateMedia, void* apUserData);
1460 int BtrCore_BTRegisterTransportPathMediaCb (void* apBtConn, const char* apBtAdapter,
1461  fPtr_BtrCore_BTTransportPathMediaCb afpcBTransportPathMedia, void* apUserData);
1462 int BtrCore_BTRegisterMediaPlayerPathCb (void* apBtConn, const char* apBtAdapter,
1463  fPtr_BtrCore_BTMediaPlayerPathCb afpcBTMediaPlayerPath, void* apUserData);
1464 int BtrCore_BTRegisterMediaBrowserUpdateCb (void* apBtConn, fPtr_BtrCore_BTMediaBrowserPathCb afpcBTMediaBrowserPath, void* apUserData);
1465 int BtrCore_BTRegisterLEGattInfoCb (void* apBtConn, const char* apBtAdapter, fPtr_BtrCore_BTLeGattPathCb afpcBLeGattPath, void* apUserData);
1466 int BtrCore_BTRegisterLEAdvInfoCb(void* apBtConn, const char* apBtAdapter, fPtr_BtrCore_BTLeAdvertisementCb afpcBLeAdvPath, void* apUserData);
1467 
1468 #endif // __BTR_CORE_BT_IFCE_H__
BtrCore_BTStopDiscovery
int BtrCore_BTStopDiscovery(void *apBtConn, const char *apBtAdapter, const char *apBtAgentPath)
This API is used to stop discovering Bluetooth adapter.
Definition: btrCore_dbus_bluez4.c:1931
_stBTLeGattService
Definition: btrCore_bt_ifce.h:756
_stBTMediaStatusUpdate
Definition: btrCore_bt_ifce.h:700
_stBTDeviceSupportedServiceList
Definition: btrCore_bt_ifce.h:684
BtrCore_BTDevMediaControl
int BtrCore_BTDevMediaControl(void *apBtConn, const char *apmediaPlayerPath, enBTMediaControlCmd aenBTMediaOper)
This API is used to control the media device.
Definition: btrCore_dbus_bluez5.c:6089
BtrCore_BTEnableEnhancedRetransmissionMode
int BtrCore_BTEnableEnhancedRetransmissionMode(void *apstBtIfceHdl)
This API is used to Enable Enhanced Retransmission on all BT adapter.
Definition: btrCore_dbus_bluez5.c:5494
_stBTMediaTrackInfo
Definition: btrCore_bt_ifce.h:689
BtrCore_BTUnregisterAgent
int BtrCore_BTUnregisterAgent(void *apBtConn, const char *apBtAdapter, const char *apBtAgentPath)
Using this API, DBus object path is unregistered with bluetooth agent path and current adapter's path...
Definition: btrCore_dbus_bluez4.c:1336
_stBTAdapterInfo
Definition: btrCore_bt_ifce.h:625
BtrCore_BTRegisterLeGatt
int BtrCore_BTRegisterLeGatt(void *apBtConn, const char *apBtAdapter)
This API is used to invoke the bluez API gatt service method call RegisterApplication.
Definition: btrCore_dbus_bluez5.c:6771
BtrCore_BTGetPairedDeviceInfo
int BtrCore_BTGetPairedDeviceInfo(void *apBtConn, const char *apBtAdapter, stBTPairedDeviceInfo *pPairedDeviceInfo)
This API fetches all BT paired devices' device information.
Definition: btrCore_dbus_bluez4.c:1986
BT_MAX_NUM_ADAPTERS
#define BT_MAX_NUM_ADAPTERS
Bluetooth max number of bluetooth adapters that can be connected over USB/UART.
Definition: btrCore_bt_ifce.h:69
BtrCore_BTReleaseAdapterPath
int BtrCore_BTReleaseAdapterPath(void *apBtConn, const char *apBtAdapter)
Using this API the path assigned to the current Bluetooth Adapter is released.
Definition: btrCore_dbus_bluez4.c:1499
BtrCore_BTPlayMediaTrackItem
int BtrCore_BTPlayMediaTrackItem(void *apstBtIfceHdl, const char *apBtMediaItemObjectPath)
This API is used to Play the mentioned media track.
Definition: btrCore_dbus_bluez5.c:6632
_enBTMediaPlayerType
_enBTMediaPlayerType
Bluetooth Media Players' Type.
Definition: btrCore_bt_ifce.h:514
BtrCore_BTRegisterMedia
int BtrCore_BTRegisterMedia(void *apBtConn, const char *apBtAdapter, enBTDeviceType aenBTDevType, enBTMediaType aenBTMediaType, const char *apBtUUID, void *apBtMediaCapabilities, int apBtMediaCapabilitiesSize, int abBtMediaDelayReportEnable)
This API is used to register a media device.
Definition: btrCore_dbus_bluez5.c:5594
enBTMediaType
enum _enBTMediaType enBTMediaType
Bluetooth Media types.
enBTMediaControlProp
enum _enBTMediaControlProp enBTMediaControlProp
Bluetooth Media Control Properties.
BtrCore_BTSetDevDataAckTimeout
int BtrCore_BTSetDevDataAckTimeout(void *apBtConn, unsigned int aui32AckTOutms)
This API is used to release the acquired device data path.
Definition: btrCore_dbus_bluez5.c:6010
BtrCore_BTDisableEnhancedRetransmissionMode
int BtrCore_BTDisableEnhancedRetransmissionMode(void *apstBtIfceHdl)
This API is used to Disable Enhanced Retransmission on all BT adapter.
Definition: btrCore_dbus_bluez5.c:5544
_stBTMediaBrowserUpdate
Definition: btrCore_bt_ifce.h:726
BtrCore_BTSetProp
int BtrCore_BTSetProp(void *apBtConn, const char *apcOpIfcePath, enBTOpIfceType aenBtOpIfceType, unBTOpIfceProp aunBtOpIfceProp, void *apvVal)
This API sets different properties of different BT devices and services.
Definition: btrCore_dbus_bluez4.c:1737
_stBTLeCustomAdv
Definition: btrCore_bt_ifce.h:781
_stBTPairedDeviceInfo
Definition: btrCore_bt_ifce.h:673
enBTDeviceProp
enum _enBTDeviceProp enBTDeviceProp
Bluetooth device properties.
_enBTGattDescProp
_enBTGattDescProp
Bluetooth Gatt Descriptor properties.
Definition: btrCore_bt_ifce.h:431
BtrCore_BTConnectDevice
int BtrCore_BTConnectDevice(void *apBtConn, const char *apDevPath, enBTDeviceType aenBTDevType)
This API is used to establish the connection with a BT device.
Definition: btrCore_dbus_bluez4.c:2456
_enBTDeviceProp
_enBTDeviceProp
Bluetooth device properties.
Definition: btrCore_bt_ifce.h:311
BtrCore_BTGetAdapterPath
char * BtrCore_BTGetAdapterPath(void *apBtConn, const char *apBtAdapter)
Using this API adapter path is fetched from Dbus object path.
Definition: btrCore_dbus_bluez4.c:1438
BtrCore_BTRegisterLeAdvertisement
int BtrCore_BTRegisterLeAdvertisement(void *apstBtIfceHdl, const char *apBtAdapter)
This API is used to invoke the bluez API advertisement method call RegisterAdvertisment.
Definition: btrCore_dbus_bluez5.c:6710
_enBTDeviceClass
_enBTDeviceClass
Bluetooth device classes.
Definition: btrCore_bt_ifce.h:193
_enBTDeviceType
_enBTDeviceType
Bluetooth device types.
Definition: btrCore_bt_ifce.h:177
_enBTMediaPlayerProp
_enBTMediaPlayerProp
Bluetooth Media Player Properties.
Definition: btrCore_bt_ifce.h:347
enBTDeviceType
enum _enBTDeviceType enBTDeviceType
Bluetooth device types.
_enBTMediaPlayerStatus
_enBTMediaPlayerStatus
Bluetooth Media Player Status.
Definition: btrCore_bt_ifce.h:456
_enBTGattCharProp
_enBTGattCharProp
Bluetooth Gatt characteristic properties.
Definition: btrCore_bt_ifce.h:393
BtrCore_BTGetPairedDevices
int BtrCore_BTGetPairedDevices(void *apBtConn, const char *apBtAdapter, unsigned int *apui32PairedDevCnt, char **apcArrPairedDevPath)
This API fetches all the paired devices' paths and number of paired devices.
Definition: btrCore_dbus_bluez4.c:2040
enBTMediaFolderProp
enum _enBTMediaFolderProp enBTMediaFolderProp
Bluetooth Media Folder Properties.
BtrCore_BTStopLEDiscovery
int BtrCore_BTStopLEDiscovery(void *apBtConn, const char *apBtAdapter, const char *apBtAgentPath)
This API is used to stop discovering low energy Bluetooth adapter.
Definition: btrCore_dbus_bluez4.c:1976
BtrCore_BTInitGetConnection
void * BtrCore_BTInitGetConnection(void)
This API Initializes the Bluetooth core and fetches DBus connection and returns a handle to the insta...
Definition: btrCore_dbus_bluez4.c:1160
enBTMediaPlayerStatus
enum _enBTMediaPlayerStatus enBTMediaPlayerStatus
Bluetooth Media Player Status.
BtrCore_BTGetAgentPath
char * BtrCore_BTGetAgentPath(void *apBtConn)
Using this API, a default Path is assigned to the Bluetooth Agent.
Definition: btrCore_dbus_bluez4.c:1249
_stBTDeviceSupportedService
Definition: btrCore_bt_ifce.h:679
BtrCore_BTPerformAdapterOp
int BtrCore_BTPerformAdapterOp(void *apBtConn, const char *apBtAdapter, const char *apBtAgentPath, const char *apcDevPath, enBTAdapterOp aenBTAdpOp)
This API is used to perform BT adapter operations.
Definition: btrCore_dbus_bluez4.c:2327
BtrCore_BTGetCommonParentMediaItemId
tBTMediaItemId BtrCore_BTGetCommonParentMediaItemId(tBTMediaItemId aBTcurrMediaItemId, tBTMediaItemId aBTdestMediaItemId)
This API is used to get the mediaItemID of the node which is the immediate common parent of the src a...
Definition: btrCore_dbus_bluez5.c:6419
enBTAdapterProp
enum _enBTAdapterProp enBTAdapterProp
Bluetooth adapter properties.
BtrCore_BTGetIfceNameVersion
int BtrCore_BTGetIfceNameVersion(void *apBtConn, char *apBtOutIfceName, char *apBtOutVersion)
using this API, Bluetooth interface version is obtained from bluetooth daemon of the kernel and defau...
Definition: btrCore_dbus_bluez4.c:1523
_unBTOpIfceProp
Definition: btrCore_bt_ifce.h:609
_stBTLeManfData
Definition: btrCore_bt_ifce.h:770
enBTMediaPlayerScan
enum _enBTMediaPlayerScan enBTMediaPlayerScan
Bluetooth Media Players' Scan State.
_enBTLeGattOp
_enBTLeGattOp
Bluetooth Gatt operations.
Definition: btrCore_bt_ifce.h:282
BtrCore_BTReleaseDevDataPath
int BtrCore_BTReleaseDevDataPath(void *apBtConn, char *apcDevTransportPath)
This API is used to release the acquired device data path.
Definition: btrCore_dbus_bluez4.c:2859
BtrCore_BTStartLEDiscovery
int BtrCore_BTStartLEDiscovery(void *apBtConn, const char *apBtAdapter, const char *apBtAgentPath)
This API is used to discover the low energy Bluetooth adapter.
Definition: btrCore_dbus_bluez4.c:1966
BtrCore_BTGetMediaFolderNumberOfItems
int BtrCore_BTGetMediaFolderNumberOfItems(void *apBtConn, const char *apBtMediaPlayerPath, unsigned int *aui32NumberOfItems)
This API is used to get the number of items in the current media folder.
Definition: btrCore_dbus_bluez5.c:6267
enBTGattServiceProp
enum _enBTGattServiceProp enBTGattServiceProp
Bluetooth Gatt service properties.
enBTMediaControlCmd
enum _enBTMediaControlCmd enBTMediaControlCmd
Bluetooth Media Controls.
_enBTAdapterOp
_enBTAdapterOp
Bluetooth Adapter operations.
Definition: btrCore_bt_ifce.h:269
enBTMediaPlayerEqualizer
enum _enBTMediaPlayerEqualizer enBTMediaPlayerEqualizer
Bluetooth Media Players' Equalizer State.
_enBTMediaControlProp
_enBTMediaControlProp
Bluetooth Media Control Properties.
Definition: btrCore_bt_ifce.h:336
BtrCore_BTAcquireDevDataPath
int BtrCore_BTAcquireDevDataPath(void *apBtConn, char *apcDevTransportPath, int *dataPathFd, int *dataReadMTU, int *dataWriteMTU)
This API is used to acquire device data path.
Definition: btrCore_dbus_bluez4.c:2793
enBTDeviceState
enum _enBTDeviceState enBTDeviceState
Bluetooth device state.
BtrCore_BTStopClassicDiscovery
int BtrCore_BTStopClassicDiscovery(void *apBtConn, const char *apBtAdapter, const char *apBtAgentPath)
This API is used to stop discovering Classic Bluetooth Devices.
Definition: btrCore_dbus_bluez5.c:4587
enBTMediaTransportState
enum _enBTMediaTransportState enBTMediaTransportState
Bluetooth Media transport states.
_enBTMediaItemType
_enBTMediaItemType
Bluetooth Media Items' Type.
Definition: btrCore_bt_ifce.h:536
BT_MAX_UUID_STR_LEN
#define BT_MAX_UUID_STR_LEN
Bluetooth max uuid length.
Definition: btrCore_bt_ifce.h:52
_enBTMediaControlCmd
_enBTMediaControlCmd
Bluetooth Media Controls.
Definition: btrCore_bt_ifce.h:575
_enBTMediaPlayerScan
_enBTMediaPlayerScan
Bluetooth Media Players' Scan State.
Definition: btrCore_bt_ifce.h:491
_stBTAdServiceData
Definition: btrCore_bt_ifce.h:641
_enBTAdapterProp
_enBTAdapterProp
Bluetooth adapter properties.
Definition: btrCore_bt_ifce.h:295
BT_MAX_NUM_DEVICE
#define BT_MAX_NUM_DEVICE
Bluetooth max number of devices that can be connected.
Definition: btrCore_bt_ifce.h:57
BtrCore_BTRegisterAgent
int BtrCore_BTRegisterAgent(void *apBtConn, const char *apBtAdapter, const char *apBtAgentPath, const char *capabilities)
using this API, DBus object path is registered with bluetooth agent path and current adapter's path.
Definition: btrCore_dbus_bluez4.c:1286
BtrCore_BTPerformLeGattOp
int BtrCore_BTPerformLeGattOp(void *apBtConn, const char *apBtLePath, enBTOpIfceType aenBTOpIfceType, enBTLeGattOp aenBTLeGattOp, char *apLeGatOparg1, char *apLeGatOparg2, char *rpLeOpRes)
This API is used to perform gatt services of the BT device .
Definition: btrCore_dbus_bluez5.c:6995
BtrCore_BTGetProp
int BtrCore_BTGetProp(void *apBtConn, const char *apcOpIfcePath, enBTOpIfceType aenBtOpIfceType, unBTOpIfceProp aunBtOpIfceProp, void *apvVal)
This API gets different properties of different BT devices and services.
Definition: btrCore_dbus_bluez4.c:1560
_stBTLeGattDesc
Definition: btrCore_bt_ifce.h:738
BtrCore_BTUnRegisterMedia
int BtrCore_BTUnRegisterMedia(void *apBtConn, const char *apBtAdapter, enBTDeviceType aenBTDevType, enBTMediaType aenBTMediaType)
This API is used to unregister the media device.
Definition: btrCore_dbus_bluez5.c:5789
enBTGattDescProp
enum _enBTGattDescProp enBTGattDescProp
Bluetooth Gatt Descriptor properties.
enBTGattCharProp
enum _enBTGattCharProp enBTGattCharProp
Bluetooth Gatt characteristic properties.
BtrCore_BTGetMediaPlayerProperty
int BtrCore_BTGetMediaPlayerProperty(void *apBtConn, const char *apBtObjectPath, const char *mediaProperty, void *mediaPropertyValue)
This API is used to get media player property value using the object path of BT device and media prop...
Definition: btrCore_dbus_bluez4.c:3112
BtrCore_BTChangeMediaFolder
int BtrCore_BTChangeMediaFolder(void *apstBtIfceHdl, const char *apBtmediaPlayerObjectPath, const char *apBtdestMediaFolderPath)
This API is used to change from the current media folder path to another path.
Definition: btrCore_dbus_bluez5.c:6441
BtrCore_BTStartClassicDiscovery
int BtrCore_BTStartClassicDiscovery(void *apBtConn, const char *apBtAdapter, const char *apBtAgentPath)
This API is used to discover the Classic Bluetooth Devices.
Definition: btrCore_dbus_bluez5.c:4523
BT_MAX_SERVICE_DATA_LEN
#define BT_MAX_SERVICE_DATA_LEN
Bluetooth Advertising Service Data max length.
Definition: btrCore_bt_ifce.h:74
enBTMediaPlayerProp
enum _enBTMediaPlayerProp enBTMediaPlayerProp
Bluetooth Media Player Properties.
enBTMediaPlayerSubtype
enum _enBTMediaPlayerSubtype enBTMediaPlayerSubtype
Bluetooth Media Players' Subtype.
BtrCore_BTGetAdapterList
int BtrCore_BTGetAdapterList(void *apBtConn, unsigned int *apBtNumAdapters, char *apcArrBtAdapterPath[4])
This API obtains adapter list from Dbus object path.
_enBTMediaTransportProp
_enBTMediaTransportProp
Bluetooth Media transport properties.
Definition: btrCore_bt_ifce.h:324
BtrCore_BTUnRegisterLeGatt
int BtrCore_BTUnRegisterLeGatt(void *apBtConn, const char *apBtAdapter)
This API is used to invoke the bluez API gatt service method call UnRegisterApplication.
Definition: btrCore_dbus_bluez5.c:6880
enBTAdapterOp
enum _enBTAdapterOp enBTAdapterOp
Bluetooth Adapter operations.
enBTGattCharFlagProp
enum _enBTGattCharFlagProp enBTGattCharFlagProp
Bluetooth Gatt characteristic Flag properties.
BtrCore_BTStartDiscovery
int BtrCore_BTStartDiscovery(void *apBtConn, const char *apBtAdapter, const char *apBtAgentPath)
This API is used to discover the Bluetooth adapter.
Definition: btrCore_dbus_bluez4.c:1896
enBTDeviceClass
enum _enBTDeviceClass enBTDeviceClass
Bluetooth device classes.
_enBTGattCharFlagProp
_enBTGattCharFlagProp
Bluetooth Gatt characteristic Flag properties.
Definition: btrCore_bt_ifce.h:407
enBTMediaPlayerRepeat
enum _enBTMediaPlayerRepeat enBTMediaPlayerRepeat
Bluetooth Media Players' Repeat States.
BtrCore_BTGetTransportState
int BtrCore_BTGetTransportState(void *apBtConn, const char *apBtDataPath, void *state)
This API is used to get the state of the BT device .
Definition: btrCore_dbus_bluez4.c:3142
_stBTLeServData
Definition: btrCore_bt_ifce.h:776
_enBTMediaTransportState
_enBTMediaTransportState
Bluetooth Media transport states.
Definition: btrCore_bt_ifce.h:444
BtrCore_BTIsDeviceConnectable
int BtrCore_BTIsDeviceConnectable(void *apBtConn, const char *apcDevPath)
This API is used to run device connectable command.
Definition: btrCore_dbus_bluez4.c:2409
BtrCore_BTDeInitReleaseConnection
int BtrCore_BTDeInitReleaseConnection(void *apBtConn)
This API DeInitializes the Bluetooth core and releases the DBus connection.
Definition: btrCore_dbus_bluez4.c:1203
BtrCore_BTSetMediaProperty
int BtrCore_BTSetMediaProperty(void *apBtConn, const char *apBtAdapterPath, char *mediaProperty, char *pValue)
This API is used to set the media property of the BT device .
Definition: btrCore_dbus_bluez4.c:3130
BtrCore_BTGetTrackInformation
int BtrCore_BTGetTrackInformation(void *apBtConn, const char *apBtmediaPlayerObjectPath, stBTMediaTrackInfo *lpstBTMediaTrackInfo)
This API is used to retrieve the information about the track that is being played on BT media device.
Definition: btrCore_dbus_bluez5.c:6352
_enBTOpType
_enBTOpType
Bluetooth device operation types.
Definition: btrCore_bt_ifce.h:227
_enBTMediaPlayerSubtype
_enBTMediaPlayerSubtype
Bluetooth Media Players' Subtype.
Definition: btrCore_bt_ifce.h:526
BtrCore_BTDisconnectDevice
int BtrCore_BTDisconnectDevice(void *apBtConn, const char *apDevPath, enBTDeviceType aenBTDevType)
This API is used to diconnect a BT device.
Definition: btrCore_dbus_bluez4.c:2511
enBTMediaTransportProp
enum _enBTMediaTransportProp enBTMediaTransportProp
Bluetooth Media transport properties.
_stBTLeGattInfo
Definition: btrCore_bt_ifce.h:764
_enBTMediaType
_enBTMediaType
Bluetooth Media types.
Definition: btrCore_bt_ifce.h:562
enBTMediaPlayerShuffle
enum _enBTMediaPlayerShuffle enBTMediaPlayerShuffle
Bluetooth Media Players' Shuffle State.
enBTMediaItemType
enum _enBTMediaItemType enBTMediaItemType
Bluetooth Media Items' Type.
BT_MAX_STR_LEN
#define BT_MAX_STR_LEN
Bluetooth max string length.
Definition: btrCore_bt_ifce.h:38
_enBTMediaFolderProp
_enBTMediaFolderProp
Bluetooth Media Folder Properties.
Definition: btrCore_bt_ifce.h:370
_stBTDeviceInfo
Definition: btrCore_bt_ifce.h:647
enBTOpIfceType
enum _enBTOpType enBTOpIfceType
Bluetooth device operation types.
BtrCore_BTReleaseAgentPath
int BtrCore_BTReleaseAgentPath(void *apBtConn)
Using this API the path assigned to the Bluetooth Agent is released.
Definition: btrCore_dbus_bluez4.c:1270
_enBTGattServiceProp
_enBTGattServiceProp
Bluetooth Gatt service properties.
Definition: btrCore_bt_ifce.h:380
BT_MAX_DEV_PATH_LEN
#define BT_MAX_DEV_PATH_LEN
Bluetooth max device path length.
Definition: btrCore_bt_ifce.h:44
_stBTLeGattChar
Definition: btrCore_bt_ifce.h:746
_enBTDeviceState
_enBTDeviceState
Bluetooth device state.
Definition: btrCore_bt_ifce.h:247
BtrCore_BTGetMediaPlayerPath
char * BtrCore_BTGetMediaPlayerPath(void *apBtConn, const char *apBtDevPath)
A Path is assigned to Media player using Bluetooth device path.
Definition: btrCore_dbus_bluez5.c:6053
BtrCore_BTFindServiceSupported
int BtrCore_BTFindServiceSupported(void *apBtConn, const char *apcDevPath, const char *apcSearchString, char *apcDataString)
This API is used to find all supported services and fetch the profiles of all those devices.
Definition: btrCore_dbus_bluez4.c:2223
_enBTMediaPlayerShuffle
_enBTMediaPlayerShuffle
Bluetooth Media Players' Shuffle State.
Definition: btrCore_bt_ifce.h:480
_enBTMediaPlayerRepeat
_enBTMediaPlayerRepeat
Bluetooth Media Players' Repeat States.
Definition: btrCore_bt_ifce.h:502
enBTLeGattOp
enum _enBTLeGattOp enBTLeGattOp
Bluetooth Gatt operations.
BT_MAX_DEVICE_PROFILE
#define BT_MAX_DEVICE_PROFILE
Bluetooth max number of device profiles that are allowed. Device Profiles are definitions of possible...
Definition: btrCore_bt_ifce.h:64
BtrCore_BTSelectMediaFolderItems
int BtrCore_BTSelectMediaFolderItems(void *apstBtIfceHdl, const char *apBtMediaPlayerObjectPath, unsigned int apBtMediaFolderStartIndex, unsigned int apBtMediaFolderEndIndex, const char *apBtMediaFilter, int apBtMediaFilterSize)
This API is used to list the media items in the current folder.
Definition: btrCore_dbus_bluez5.c:6485
_enBTMediaPlayerEqualizer
_enBTMediaPlayerEqualizer
Bluetooth Media Players' Equalizer State.
Definition: btrCore_bt_ifce.h:470
enBTMediaPlayerType
enum _enBTMediaPlayerType enBTMediaPlayerType
Bluetooth Media Players' Type.
BtrCore_BTDiscoverDeviceServices
int BtrCore_BTDiscoverDeviceServices(void *apBtConn, const char *apcDevPath, stBTDeviceSupportedServiceList *pProfileList)
This API is used to discover the supported services and fetch the profiles of all those devices.
Definition: btrCore_dbus_bluez4.c:2092
BtrCore_BTSendReceiveMessages
int BtrCore_BTSendReceiveMessages(void *apBtConn)
This API is used to read, write and dispatch BT device information.
Definition: btrCore_dbus_bluez4.c:2909