[Bluetooth][OTP] Add base code for OTP server role
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-request-handler.c
index 08cb882..2a3275f 100644 (file)
@@ -46,6 +46,7 @@
 #include "bt-service-agent.h"
 #include "bt-service-proximity.h"
 #include "bt-service-tds.h"
+#include "bt-service-otp.h"
 
 static GDBusConnection *bt_service_conn;
 static guint owner_id = 0;
@@ -2345,6 +2346,16 @@ int __bt_bluez_request(int function_name,
                        g_free(handle);
                break;
        }
+       case BT_OTP_SERVER_INIT: {
+               const char *directory;
+               directory = (const char *)g_variant_get_data(in_param1);
+               result = bt_otp_server_init(request_id, directory);
+               break;
+       }
+       case BT_OTP_SERVER_DEINIT: {
+               result = bt_otp_server_deinit(request_id);
+               break;
+       }
        default:
                result = BLUETOOTH_ERROR_INTERNAL;
                break;
@@ -3188,6 +3199,10 @@ gboolean __bt_service_check_privilege(int function_name,
        case BT_TDS_ENABLE_CONTROL_POINT:
        case BT_TDS_ACTIVATE_CONTROL_POINT:
 
+       /* OTP Server */
+       case BT_OTP_SERVER_INIT:
+       case BT_OTP_SERVER_DEINIT:
+
        case BT_MAP_CREATE_SESSION:
        case BT_MAP_DESTROY_SESSION:
        case BT_MAP_SET_FOLDER: