Fix 64bit build error
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-common.c
index 39b5480..a962652 100644 (file)
 #include "bluetooth-gatt-server-api.h"
 #endif
 
-#ifdef TIZEN_GATT_CLIENT
 #include "bluetooth-gatt-client-api.h"
-#endif
+#include "bluetooth-mesh-api.h"
 
 #include "bt-common.h"
 #include "bt-request-sender.h"
 #include "bt-event-handler.h"
-
-#ifdef TIZEN_FEATURE_BT_DPM
 #include "bt-dpm.h"
-#endif
 
 static bt_user_info_t user_info[BT_MAX_USER_INFO];
 static GDBusConnection *system_shared_conn = NULL;
@@ -141,6 +137,7 @@ int _bt_common_send_rfcomm_rx_details(unsigned int len)
        int ret = BLUETOOTH_ERROR_NONE;
 
        BT_INFO("+");
+       BT_CHECK_ENABLED(return);
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -164,6 +161,7 @@ int _bt_common_send_rfcomm_tx_details(unsigned int len)
        int ret = BLUETOOTH_ERROR_NONE;
 
        BT_INFO("+");
+       BT_CHECK_ENABLED(return);
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -283,7 +281,6 @@ void _bt_avrcp_event_cb(int event, int result, void *param,
                                        user_data);
 }
 
-#ifdef TIZEN_GATT_CLIENT
 void _bt_gatt_client_event_cb(int event, int result, void *param,
                void *callback, void *user_data)
 {
@@ -300,7 +297,6 @@ void _bt_gatt_client_event_cb(int event, int result, void *param,
                BT_ERR("GATT Client event callback is not registered!!!");
        }
 }
-#endif
 
 #ifndef GATT_DIRECT
 void _bt_gatt_server_event_cb(int event, int result, void *param,
@@ -319,6 +315,23 @@ void _bt_gatt_server_event_cb(int event, int result, void *param,
 }
 #endif
 
+void _bt_mesh_event_cb(int event, int result, void *param,
+               void *callback, void *user_data)
+{
+       BT_DBG("_bt_mesh_event_cb");
+       mesh_event_param_t bt_event = { 0, 0, NULL, NULL };
+       bt_event.event = event;
+       bt_event.result = result;
+       bt_event.param_data = param;
+       if (callback) {
+               BT_DBG("Mesh event callback is registered");
+               ((mesh_cb_func_ptr)callback)(bt_event.event, &bt_event,
+                       user_data);
+       } else {
+               BT_ERR("Mesh event callback is not registered!!!");
+       }
+}
+
 void _bt_divide_device_class(bluetooth_device_class_t *device_class,
                                unsigned int cod)
 {