2 * Open Adaptation Layer (OAL)
4 * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
28 #include <arpa/inet.h>
30 #include <sys/types.h>
31 #include "oal-internal.h"
33 #define ADVANCED_AUDIO_UUID "0000110d-0000-1000-8000-00805f9b34fb"
34 #define A2DP_SOURCE_UUID "0000110a-0000-1000-8000-00805f9b34fb"
35 #define A2DP_SINK_UUID "0000110b-0000-1000-8000-00805f9b34fb"
36 #define AVRCP_REMOTE_UUID "0000110e-0000-1000-8000-00805f9b34fb"
37 #define AVRCP_TARGET_UUID "0000110c-0000-1000-8000-00805f9b34fb"
38 #define DEVICE_INFORMATION_UUID "0000180a-0000-1000-8000-00805f9b34fb"
39 #define HID_UUID "00001124-0000-1000-8000-00805f9b34fb"
40 #define SPP_UUID "00001101-0000-1000-8000-00805f9b34fb"
41 #define BASE_UUID "00000000-0000-1000-8000-00805F9B34FB"
43 #define CASE_RETURN_STR(const) case const: return #const;
46 #define BASE 0x0000 //Base
47 #define SDP 0x0001 //Bluetooth Core Specification
48 #define UDP 0x0002 //[NO USE BY PROFILES]
49 #define RFCOMM 0x0003 //RFCOMM with TS 07.10
50 #define TCP 0x0004 //[NO USE BY PROFILES]
51 #define TCS_BIN 0x0005 //Telephony Control Specification / TCS Binary [DEPRECATED]
52 #define TCS_AT 0x0006 //[NO USE BY PROFILES]
53 #define ATT 0x0007 //Attribute Protocol
54 #define OBEX 0x0008 //IrDA Interoperability
55 #define IP 0x0009 //[NO USE BY PROFILES]
56 #define FTP 0x000A //[NO USE BY PROFILES]
57 #define HTTP 0x000C //[NO USE BY PROFILES]
58 #define WSP 0x000E //[NO USE BY PROFILES]
59 #define BNEP 0x000F //Bluetooth Network Encapsulation Protocol (BNEP)
60 #define UPNP 0x0010 //Extended Service Discovery Profile (ESDP) [DEPRECATED]
61 #define HIDP 0x0011 //Human Interface Device Profile (HID)
62 #define HardcopyControlChannel 0x0012 //Hardcopy Cable Replacement Profile (HCRP)
63 #define HardcopyDataChannel 0x0014 //See Hardcopy Cable Replacement Profile (HCRP)
64 #define HardcopyNotification 0x0016 //Hardcopy Cable Replacement Profile (HCRP)
65 #define AVCTP 0x0017 //Audio/Video Control Transport Protocol (AVCTP)
66 #define AVDTP 0x0019 //Audio/Video Distribution Transport Protocol (AVDTP)
67 #define CMTP 0x001B //Common ISDN Access Profile (CIP) [DEPRECATED]
68 #define MCAPControlChannel 0x001E //Multi-Channel Adaptation Protocol (MCAP)
69 #define MCAPDataChannel 0x001F //Multi-Channel Adaptation Protocol (MCAP)
70 #define L2CAP 0x0100 //Bluetooth Core Specification
73 #define ServiceDiscoveryServerServiceClassID 0x1000 //Bluetooth Core Specification Service Class
74 #define BrowseGroupDescriptorServiceClassID 0x1001 //Bluetooth Core Specification Service Class
75 #define SerialPort 0x1101 //Serial Port Profile (SPP)
76 #define LANAccessUsingPPP 0x1102 //LAN Access Profile
77 #define DialupNetworking 0x1103 //Dial-up Networking Profile (DUN)
78 #define IrMCSync 0x1104 //Synchronization Profile (SYNC)
79 #define OBEXObjectPush 0x1105 //Object Push Profile (OPP)
80 #define OBEXFileTransfer 0x1106 //File Transfer Profile (FTP)
81 #define IrMCSyncCommand 0x1107 //Synchronization Profile (SYNC)
82 #define Headset 0x1108 //Headset Profile (HSP)
83 #define CordlessTelephony 0x1109 //Cordless Telephony Profile (CTP)
84 #define AudioSource 0x110A //Advanced Audio Distribution Profile (A2DP) Service Class
85 #define AudioSink 0x110B //Advanced Audio Distribution Profile (A2DP) Service Class
86 #define AV_RemoteControlTarget 0x110C //Audio/Video Remote Control Profile (AVRCP) Service Class
87 #define AdvancedAudioDistribution 0x110D //Advanced Audio Distribution Profile (A2DP) Profile
88 #define AV_RemoteControl 0x110E //Audio/Video Remote Control Profile (AVRCP)
89 #define AV_RemoteControlController 0x110F //Audio/Video Remote Control Profile (AVRCP)
90 #define Intercom 0x1110 //Intercom Profile (ICP)
91 #define Fax 0x1111 //Fax Profile (FAX)
92 #define Headset_Audio_Gateway 0x1112 //Headset Profile (HSP) Service Class
93 #define WAP 0x1113 //Interoperability Requirements for Bluetooth technology as a WAP, Bluetooth SIG [DEPRECATED] Service Class
94 #define WAP_CLIENT 0x1114 //Interoperability Requirements for Bluetooth technology as a WAP, Bluetooth SIG [DEPRECATED] Service Class
95 #define PANU 0x1115 //Personal Area Networking Profile (PAN)
96 #define NAP 0x1116 //Personal Area Networking Profile (PAN)
97 #define GN 0x1117 //Personal Area Networking Profile (PAN)
98 #define DirectPrinting 0x1118 //Basic Printing Profile (BPP) Service Class
99 #define ReferencePrinting 0x1119 //See Basic Printing Profile (BPP) Service Class
100 #define Basic_Imaging_Profile 0x111A //Basic Imaging Profile (BIP) Profile
101 #define ImagingResponder 0x111B //Basic Imaging Profile (BIP) Service Class
102 #define ImagingAutomaticArchive 0x111C //Basic Imaging Profile (BIP) Service Class
103 #define ImagingReferencedObjects 0x111D //Basic Imaging Profile (BIP) Service Class
104 #define Handsfree 0x111E //Hands-Free Profile (HFP)
105 #define HandsfreeAudioGateway 0x111F //Hands-free Profile (HFP) Service Class
106 #define DirectPrintingReferenceObjectsService 0x1120 //Basic Printing Profile (BPP) Service Class
107 #define ReflectedUI 0x1121 //Basic Printing Profile (BPP) Service Class
108 #define BasicPrinting 0x1122 //Basic Printing Profile (BPP) Profile
109 #define PrintingStatus 0x1123 //Basic Printing Profile (BPP) Service Class
110 #define HumanInterfaceDeviceService 0x1124 //Human Interface Device (HID)
111 #define HardcopyCableReplacement 0x1125 //Hardcopy Cable Replacement Profile (HCRP) Profile
112 #define HCR_Print 0x1126 //Hardcopy Cable Replacement Profile (HCRP) Service Class
113 #define HCR_Scan 0x1127 //Hardcopy Cable Replacement Profile (HCRP) Service Class
114 #define Common_ISDN_Access 0x1128 //Common ISDN Access Profile (CIP)
115 #define SIM_Access 0x112D //SIM Access Profile (SAP)
116 #define Phonebook_Access_PCE 0x112E //Phonebook Access Profile (PBAP) Service Class
117 #define Phonebook_Access_PSE 0x112F //Phonebook Access Profile (PBAP) Service Class
118 #define Phonebook_Access 0x1130 //Phonebook Access Profile (PBAP) Profile
119 #define Headset_HS 0x1131 //Headset Profile (HSP)
120 #define Message_Access_Server 0x1132 //Message Access Profile (MAP) Service Class
121 #define Message_Notification_Server 0x1133 //Message Access Profile (MAP) Service Class
122 #define Message_Access_Profile 0x1134 //Message Access Profile (MAP) Profile
123 #define GNSS 0x1135 //Global Navigation Satellite System Profile (GNSS) Profile
124 #define GNSS_Server 0x1136 // Global Navigation Satellite System Profile (GNSS) Service Class
125 #define ThreeD_Display 0x1137 //3D Synchronization Profile (3DSP) Service Class?
126 #define ThreeD_Glasses 0x1138 //3D Synchronization Profile (3DSP) ?Service Class
127 #define ThreeD_Synchronization 0x1139 //3D Synchronization Profile (3DSP) ?Profile
128 #define MPS_Profile 0x113A //Multi-Profile Specification (MPS) ?Profile
129 #define MPS_SC 0x113B //Multi-Profile Specification (MPS) ?Service Class
130 #define CTN_Access_Service 0x113C //Calendar, Task, and Notes (CTN) Profile ?Service Class
131 #define CTN_Notification_Service 0x113D //Calendar Tasks and Notes (CTN) Profile ?Service Class
132 #define CTN_Profile 0x113E //Calendar Tasks and Notes (CTN) Profile ?Profile
133 #define PnPInformation 0x1200 //Device Identification (DID)
134 #define GenericNetworking 0x1201 //N/A Service Class
135 #define GenericFileTransfer 0x1202 //N/A Service Class
136 #define GenericAudio 0x1203 //N/A Service Class
137 #define GenericTelephony 0x1204 //N/A Service Class
138 #define UPNP_Service 0x1205 //Enhanced Service Discovery Profile (ESDP) [DEPRECATED] Service Class
139 #define UPNP_IP_Service 0x1206 //Enhanced Service Discovery Profile (ESDP) [DEPRECATED] Service Class
140 #define ESDP_UPNP_IP_PAN 0x1300 //Enhanced Service Discovery Profile (ESDP) [DEPRECATED] Service Class
141 #define ESDP_UPNP_IP_LAP 0x1301 //Enhanced Service Discovery Profile (ESDP)[DEPRECATED] Service Class
142 #define ESDP_UPNP_L2CAP 0x1302 //Enhanced Service Discovery Profile (ESDP)[DEPRECATED] Service Class
143 #define VideoSource 0x1303 //Video Distribution Profile (VDP) Service Class
144 #define VideoSink 0x1304 //Video Distribution Profile (VDP) Service Class
145 #define VideoDistribution 0x1305 //Video Distribution Profile (VDP) Profile
146 #define HDP 0x1400 //Health Device Profile Profile
147 #define HDP_Source 0x1401 //Health Device Profile (HDP) Service Class
148 #define HDP_Sink 0x1402 //Health Device Profile (HDP) Service Class
150 /* List of GATT Services UUID */
151 #define Generic_Access 0x1800 //Generic Access Service
152 #define Generic_Attribute 0x1801 //Generic Attribute Service
153 #define Immediate_Alert 0x1802 //Immediate Alert Service
154 #define Link_Loss 0x1803 //Link Loss Service
155 #define Tx_Power 0x1804 //Tx Power Service
156 #define Current_Time 0x1805 //Current Time Service
157 #define Reference_Time_Update 0x1806 //Reference Time Update Service
158 #define Next_Dst_Change 0x1807 //Next Destination Change Service
159 #define Glucose 0x1808 //Glucose Service
160 #define Health_Thermometer 0x1809 //Health Thermometer Service
161 #define Device_Information 0x180A //Device Information Service
162 #define Heart_Rate 0x180D //Heart Rate Service
163 #define Phone_Alert_Status 0x180E //Phone Alert Status Service
164 #define Battery_Service 0x180F //Battery Service
165 #define Blood_Pressure 0x1810 //Blood Pressure Service
166 #define Alert_Notification 0x1811 //Alert Notification Service
167 #define Human_Interface_Device 0x1812 //HID Service
168 #define Scan_Parameters 0x1813 //Scan Parameters Service
169 #define Running_Speed_And_Cadence 0x1814 //Running Speed and Cadence Service
170 #define Automation_IO 0x1815 //Automation IO Service
171 #define Cycling_Speed_And_Cadence 0x1816 //Cycling Speed and Cadence Service
172 #define Cycling_Power 0x1818 //Cycling Power Service
173 #define Location_And_Navigation 0x1819 //Location and Navigation Service
174 #define Environmental_Sensing 0x181A //Environment Sensing Service
175 #define Body_Composition 0x181B //Body Composition Service
176 #define User_Data 0x181C //User Data Service
177 #define Weight_Scale 0x181D //Weight Scale Service
178 #define Bond_Management 0x181E //Bond Management Service
179 #define Continuous_Glucose_Monitoring 0x181F //Continuous Glucose Monitoring Service
180 #define Internet_Protocol_Support 0x1820 //Internet Protocol Support Service
181 #define Indoor_Positioning 0x1821 //Indoor Positioning Service
182 #define Pulse_Oximeter 0x1822 //Pulse Oximeter Service
183 #define Http_Proxy 0x1823 //Http Proxy Service
184 #define Transport_Discovery 0x1824 //Transport Discovery Service
185 #define Object_Transfer 0x1825 //Object Transfer Service
187 /* List of GATT Characteristics UUID */
188 #define Gap_Device_Name 0x2A00
189 #define Gap_Appearance 0x2A01
190 #define Gap_Peripheral_Privacy_Flag 0x2A02
191 #define Gap_Reconnection_Address 0x2A03
192 #define Gap_Peripheral_Preferred_Connection_Parameters 0x2A04
193 #define Gatt_Service_Changed 0x2A05
194 #define Alert_Level 0x2A06
195 #define Tx_Power_Level 0x2A07
196 #define Date_Time 0x2A08
197 #define Day_Of_Week 0x2A09
198 #define Day_Date_Time 0x2A0A
199 #define Exact_Time_256 0x2A0C
200 #define Dst_Offset 0x2A0D
201 #define Time_Zone 0x2A0E
202 #define Local_Time_Information 0x2A0F
203 #define Time_With_Dst 0x2A11
204 #define Time_Accuracy 0x2A12
205 #define Time_Source 0x2A13
206 #define Reference_Time_Information 0x2A14
207 #define Time_Update_Control_Point 0x2A16
208 #define Time_Update_State 0x2A17
209 #define Glucose_Measurement 0x2A18
210 #define Battery_Level 0x2A19
211 #define Temperature_Measurement 0x2A1C
212 #define Temperature_Type 0x2A1D
213 #define Intermediate_Temperature 0x2A1E
214 #define Measurement_Interval 0x2A21
215 #define Boot_Keyboard_Input_Report 0x2A22
216 #define System_Id 0x2A23
217 #define Model_Number_String 0x2A24
218 #define Serial_Number_String 0x2A25
219 #define Firmware_Revision_String 0x2A26
220 #define Hardware_Revision_String 0x2A27
221 #define Software_Revision_String 0x2A28
222 #define Manufacturer_Name_String 0x2A29
223 #define Regulatory_Certification_Data_List 0x2A2A
224 #define Current_Time_Charac 0x2A2B
225 #define Magnetic_Declination 0x2A2C
226 #define Scan_Refresh 0x2A31
227 #define Boot_Keyboard_Output_Report 0x2A32
228 #define Boot_Mouse_Input_Report 0x2A33
229 #define Glucose_Measurement_Context 0x2A34
230 #define Blood_Pressure_Measurement 0x2A35
231 #define Intermediate_Cuff_Pressure 0x2A36
232 #define Heart_Rate_Measurement 0x2A37
233 #define Body_Sensor_Location 0x2A38
234 #define Heart_Rate_Control_Point 0x2A39
235 #define Alert_Status 0x2A3F
236 #define Ringer_Control_Point 0x2A40
237 #define Ringer_Setting 0x2A41
238 #define Alert_Category_Id_Bit_Mask 0x2A42
239 #define Alert_Category_Id 0x2A43
240 #define Alert_Notification_Control_Point 0x2A44
241 #define Unread_Alert_Status 0x2A45
242 #define New_Alert 0x2A46
243 #define Supported_New_Alert_Category 0x2A47
244 #define Supported_Unread_Alert_Category 0x2A48
245 #define Blood_Pressure_Feature 0x2A49
246 #define Hid_Information 0x2A4A
247 #define Report_Map 0x2A4B
248 #define Hid_Control_Point 0x2A4C
249 #define Report 0x2A4D
250 #define Protocol_Mode 0x2A4E
251 #define Scan_Interval_Window 0x2A4F
252 #define Pnp_Id 0x2A50
253 #define Glucose_Feature 0x2A51
254 #define Record_Access_Control_Point 0x2A52
255 #define Rsc_Measurement 0x2A53
256 #define Rsc_Feature 0x2A54
257 #define Sc_Control_Point 0x2A55
258 #define Digital 0x2A56
259 #define Analog 0x2A58
260 #define Aggregate 0x2A5A
261 #define Csc_Measurement 0x2A5B
262 #define Csc_Feature 0x2A5C
263 #define Sensor_Location 0x2A5D
264 #define Plx_Spot_Check_Measurement 0x2A5E
265 #define Plx_Continuous_Measurement 0x2A5F
266 #define Plx_Features 0x2A60
267 #define Cycling_Power_Measurement 0x2A63
268 #define Cycling_Power_Vector 0x2A64
269 #define Cycling_Power_Feature 0x2A65
270 #define Cycling_Power_Control_Point 0x2A66
271 #define Location_And_Speed 0x2A67
272 #define Navigation 0x2A68
273 #define Position_Quality 0x2A69
274 #define Ln_Feature 0x2A6A
275 #define Ln_Control_Point 0x2A6B
276 #define Elevation 0x2A6C
277 #define Pressure 0x2A6D
278 #define Temperature 0x2A6E
279 #define Humidity 0x2A6F
280 #define True_Wind_Speed 0x2A70
281 #define True_Wind_Direction 0x2A71
282 #define Apparent_Wind_Speed 0x2A72
283 #define Apparent_Wind_Direction 0x2A73
284 #define Gust_Factor 0x2A74
285 #define Pollen_Concentration 0x2A75
286 #define Uv_Index 0x2A76
287 #define Irradiance 0x2A77
288 #define Rainfall 0x2A78
289 #define Wind_Chill 0x2A79
290 #define Heat_Index 0x2A7A
291 #define Dew_Point 0x2A7B
292 #define Descriptor_Value_Changed 0x2A7D
293 #define Aerobic_Threshold 0x2A7F
295 #define Anaerobic_Heart_Rate_Lower_Limit 0x2A81
296 #define Anaerobic_Heart_Rate_Upper_Limit 0x2A82
297 #define Anaerobic_Threshold 0x2A83
298 #define Aerobic_Heart_Rate_Upper_Limit 0x2A84
299 #define Date_Of_Birth 0x2A85
300 #define Date_Of_Threshold_Assessment 0x2A86
301 #define Email_Address 0x2A87
302 #define Fat_Burn_Heart_Rate_Lower_Limit 0x2A88
303 #define Fat_Burn_Heart_Rate_Upper_Limit 0x2A89
304 #define First_Name 0x2A8A
305 #define Five_Zone_Heart_Rate_Limits 0x2A8B
306 #define Gender 0x2A8C
307 #define Heart_Rate_Max 0x2A8D
308 #define Height 0x2A8E
309 #define Hip_Circumference 0x2A8F
310 #define Last_Name 0x2A90
311 #define Maximum_Recommended_Heart_Rate 0x2A91
312 #define Resting_Heart_Rate 0x2A92
313 #define Sport_Type_For_Aerobic_And_Anaerobic_Thresholds 0x2A93
314 #define Three_Zone_Heart_Rate_Limits 0x2A94
315 #define Two_Zone_Heart_Rate_Limit 0x2A95
316 #define Vo2_Max 0x2A96
317 #define Waist_Circumference 0x2A97
318 #define Weight 0x2A98
319 #define Database_Change_Increment 0x2A99
320 #define User_Index 0x2A9A
321 #define Body_Composition_Feature 0x2A9B
322 #define Body_Composition_Measurement 0x2A9C
323 #define Weight_Measurement 0x2A9D
324 #define Weight_Scale_Feature 0x2A9E
325 #define User_Control_Point 0x2A9F
326 #define Magnetic_Flux_Density_2D 0x2AA0
327 #define Magnetic_Flux_Density_3D 0x2AA1
328 #define Language 0x2AA2
329 #define Barometric_Pressure_Trend 0x2AA3
330 #define Bond_Management_Control_Point 0x2AA4
331 #define Bond_Management_Feature 0x2AA5
332 #define Gap_Central_Address_Resolution_Support 0x2AA6
333 #define Cgm_Measurement 0x2AA7
334 #define Cgm_Feature 0x2AA8
335 #define Cgm_Status 0x2AA9
336 #define Cgm_Session_Start_Time 0x2AAA
337 #define Cgm_Session_Run_Time 0x2AAB
338 #define Cgm_Specific_Ops_Control_Point 0x2AAC
339 #define Indoor_Positioning_Configuration 0x2AAD
340 #define Latitude 0x2AAE
341 #define Longitude 0x2AAF
342 #define Local_North_Coordinate 0x2AB0
343 #define Local_East_Coordinate 0x2AB1
344 #define Floor_Number 0x2AB2
345 #define Altitude 0x2AB3
346 #define Uncertainty 0x2AB4
347 #define Location_Name 0x2AB5
349 #define Http_Headers 0x2AB7
350 #define Http_Status_Code 0x2AB8
351 #define Http_Entity_Body 0x2AB9
352 #define Http_Control_Point 0x2ABA
353 #define Https_Security 0x2ABB
354 #define Tds_Control_Point 0x2ABC
355 #define Ots_Feature 0x2ABD
356 #define Object_Name 0x2ABE
357 #define Object_Type 0x2ABF
358 #define Object_Size 0x2AC0
359 #define Object_First_Created 0x2AC1
360 #define Object_Last_Modified 0x2AC2
361 #define Object_Id 0x2AC3
362 #define Object_Properties 0x2AC4
363 #define Object_Action_Control_Point 0x2AC5
364 #define Object_List_Control_Point 0x2AC6
365 #define Object_List_Filter 0x2AC7
366 #define Object_Changed 0x2AC8
367 #define Fitness_Machine_Control_Point 0xEE1D
369 /* List of GATT Descriptors UUID */
370 #define Gatt_Characteristic_Extended_Properties 0x2900
371 #define Gatt_Characteristic_User_Description 0x2901
372 #define Gatt_Client_Characteristic_Configuration 0x2902
373 #define Gatt_Server_Characteristic_Configuration 0x2903
374 #define Gatt_Characteristic_Presentation_Format 0x2904
375 #define Gatt_Characteristic_Aggregate_Format 0x2905
376 #define Valid_Range 0x2906
377 #define External_Report_Reference 0x2907
378 #define Report_Reference 0x2908
379 #define Number_Of_Digitals 0x2909
380 #define Value_Trigger_Setting 0x290A
381 #define Es_Configuration 0x290B
382 #define Es_Measurement 0x290C
383 #define Es_Trigger_Setting 0x290D
384 #define Time_Trigger_Setting 0x290E
386 /* List of GATT Declarations UUID */
387 #define Gatt_Primary_Service_Declaration 0x2800
388 #define Gatt_Secondary_Service_Declaration 0x2801
389 #define Gatt_Include_Declaration 0x2802
390 #define Gatt_Characteristic_Declaration 0x2803
393 /* Characteristic properties
395 #define BROADCAST (1 << 0)
396 #define READ (1 << 1)
397 #define WRITE_NR (1 << 2)
398 #define WRITE (1 << 3)
399 #define NOTIFY (1 << 4)
400 #define INDICATE (1 << 5)
401 #define AUTH (1 << 6)
402 #define EXT_PROP (1 << 7)
404 /* Characteristic permissions
408 #define ENCRYPT_RD (1 << 2)
409 #define ENCRYPT_WR (1 << 3)
410 #define ENC_AUTH_RD (1 << 4)
411 #define ENC_AUTH_WR (1 << 5)
413 #define MENU_PRINT_ERROR(format, arg...) MENUPRINT(RED(format), ##arg)
415 #define RED(text) "\033[31m"text"\033[0m"
416 #define BLUE(text) "\033[34m"text"\033[0m"
417 #define YELLOW(text) "\033[33m"text"\033[0m"
418 #define GREEN(text) "\033[32m"text"\033[0m"
419 #define MAGENTA(text) "\033[35m"text"\033[0m"
420 #define CYAN(text) "\033[36m"text"\033[0m"
422 typedef char bdstr_t[18];
424 /* Common/util functions */
425 char* bdt_bd2str(const bt_address_t *bdaddr, bdstr_t *bdstr);
426 char* bdaddr_2_str(const bt_bdaddr_t *bd_addr);
427 void string_to_uuid(char *str, service_uuid_t *p_uuid);
428 void uuid_to_string(service_uuid_t *p_uuid, char *str);
429 void uuid_to_stringname(service_uuid_t *p_uuid, char *str);
430 void oal_print_device_address_t(const bt_address_t *addr);
431 void oal_convert_addr_string_to_type(unsigned char *addr, const char *address);
432 int oal_is_address_zero(unsigned char *addr1);
433 void print_bt_properties(int num_properties, bt_property_t *properties);
435 void convert_str_2_hex(unsigned char out[], char in[]);
436 void convert_hex_2_str(unsigned char *hex, int len, char *str_out);
437 char* convert_bt_property_2_str(const bt_property_t *property);
438 char* convert_property_type_2_str(bt_property_type_t prop_type);
439 char* convert_scan_mode_2_str(bt_scan_mode_t scan_mode);
440 char* convert_device_type_2_str(bt_device_type_t device_type);
441 char* convert_bdaddr_2_str(const bt_bdaddr_t *bd_addr, char *buf, int len);
443 void local_le_feat_2_string(char *str, const bt_local_le_features_t *f);
444 const char *dump_uuid_name(int uuid_no);
446 char *char_prop_to_string(uint8_t prop, char *str);
447 char *char_perm_to_string(uint8_t perm, char *str);
449 char *dump_char_prop(uint8_t prop);
450 char *dump_char_perm(uint8_t perm);
454 #endif /* __cplusplus */
455 #endif /*_OAL_UTILS_H_*/