BLE Gatt Client Socket write and notify implementation
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-common.c
index d9ab407..ce5697b 100644 (file)
@@ -21,7 +21,7 @@
 #include <sys/types.h>
 #include <stdlib.h>
 #include <sys/socket.h>
-
+#include<stdio.h>
 
 #include <gio/gunixfdlist.h>
 
@@ -282,6 +282,24 @@ void _bt_convert_addr_string_to_type(unsigned char *addr, const char *address)
        }
 }
 
+void  _bt_convert_uuid_type_to_string(char *str, const unsigned char *uuid)
+{
+       if (!str) {
+               BT_ERR("str == NULL");
+               return;
+       }
+
+       if (!uuid) {
+               BT_ERR("uuid == NULL");
+               return;
+       }
+
+       snprintf(str, 37,
+                       "%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X",
+                       uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7],
+                       uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]);
+}
+
 void _bt_convert_addr_string_to_secure_string(char *addr, const char *address)
 {
        int len;
@@ -590,6 +608,7 @@ const char *_bt_convert_service_function_to_string(int function)
                {BT_SET_LE_PRIVACY, "BT_SET_LE_PRIVACY"},
                {BT_REQ_ATT_MTU, "BT_REQ_ATT_MTU"},
                {BT_GET_ATT_MTU, "BT_GET_ATT_MTU"},
+               {BT_GATT_ACQUIRE_WRITE, "BT_GATT_ACQUIRE_WRITE"},
                {BT_GET_DEVICE_IDA, "BT_GET_DEVICE_IDA"},
                {BT_SET_LE_STATIC_RANDOM_ADDRESS, "BT_SET_LE_STATIC_RANDOM_ADDRESS"},
                {BT_HDP_CONNECT, "BT_HDP_CONNECT"},