[Tizen 3.0] Fixed issues in the merged CAPI code 52/36852/1
authorSudha Bheemanna <b.sudha@samsung.com>
Mon, 16 Mar 2015 10:23:31 +0000 (15:53 +0530)
committerSudha Bheemanna <b.sudha@samsung.com>
Mon, 16 Mar 2015 10:23:31 +0000 (15:53 +0530)
1> removed unwanted files.
2> fixed other minor issues in the code.

Change-Id: Ic015225c33c9befe58f4e222af3c80e7a7613fd6
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
bluetooth-test.manifest [deleted file]
bluetooth.manifest [deleted file]
packaging/capi-network-bluetooth.spec
src/bluetooth-common.c
test/CMakeLists.txt
test/bt_unit_test.c
test/bt_unit_test.h
test/capi-network-bluetooth-test [deleted file]
test/capi-network-bluetooth-test.efl [deleted file]

diff --git a/bluetooth-test.manifest b/bluetooth-test.manifest
deleted file mode 100755 (executable)
index 0c26ff0..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<manifest>
-    <define>
-        <domain name="capi-network-bluetooth-test"/>
-       <request>
-               <smack request="bt-service::public" type="w"/>
-               <smack request="bt-service::platform" type="rw"/>
-       </request>
-    </define>
-    <request>
-        <domain name="capi-network-bluetooth-test"/>
-    </request>
-</manifest>
diff --git a/bluetooth.manifest b/bluetooth.manifest
deleted file mode 100755 (executable)
index 75b0fa5..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<manifest>
-    <request>
-        <domain name="_"/>
-    </request>
-</manifest>
index 8fbdf557cffc4eac87b0463a73a9b408350fc313..1e5322beb72caf3d860a2750e7734aa62d1a1195 100755 (executable)
@@ -32,15 +32,7 @@ Group:      Development/Connectivit
 Requires:   %{name} = %{version}-%{release}
 
 %description devel
-Network Bluetooth Framework (DEV).
-
-%package test
-Summary: Network Bluetooth Framework test application
-Group:      Development/Connectivit
-Requires: %{name} = %{version}-%{release}
-
-%description test
-This package is C-API test application.
+Network Bluetooth Framework.
 
 %devel_desc
 
@@ -83,14 +75,13 @@ export FFLAGS+=" -DTELEPHONY_DISABLED"
 %endif
 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
 
 make %{?jobs:-j%jobs}
 
 %install
 %make_install
-install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/capi-network-bluetooth
-install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/capi-network-bluetooth-devel
+
 
 %post -p /sbin/ldconfig
 
@@ -100,13 +91,13 @@ install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/capi-network-bluetoot
 %manifest %{name}.manifest
 %license LICENSE.APLv2 LICENSE
 %{_libdir}/libcapi-network-bluetooth.so.*
-%{_datadir}/license/capi-network-bluetooth
+#%{_datadir}/license/capi-network-bluetooth
 
-%files test
-%manifest bluetooth-test.manifest
-%{_bindir}/bt_unit_test
-%{_bindir}/bt_onoff
-/etc/smack/accesses.d/capi-network-bluetooth-test.efl
+#%files test
+#%manifest bluetooth-test.manifest
+#%{_bindir}/bt_unit_test
+#%{_bindir}/bt_onoff
+#/etc/smack/accesses.d/capi-network-bluetooth-test.efl
 
 %files devel
 %manifest %{name}-devel.manifest
@@ -114,5 +105,5 @@ install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/capi-network-bluetoot
 %{_includedir}/network/bluetooth_type.h
 %{_libdir}/pkgconfig/capi-network-bluetooth.pc
 %{_libdir}/libcapi-network-bluetooth.so
-%{_datadir}/license/capi-network-bluetooth-devel
+#%{_datadir}/license/capi-network-bluetooth-devel
 
index 65687aa9b9e32392e56d81e2d1427e8786a186e0..e9ab591b5d451aa8ed3cd7ee18634f54716c7b46 100755 (executable)
@@ -651,7 +651,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
        case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
                BT_INFO("bt_adapter_device_discovery_state_changed_cb() will be called with BT_ADAPTER_DEVICE_DISCOVERY_FINISHED");
                ((bt_adapter_device_discovery_state_changed_cb)bt_event_slot_container[event_index].callback)
-                   (BT_ERROR_NONE, BT_ADAPTER_DEVICE_DISCOVERY_FINISHED, NULL, bt_event_slot_container[event_index].user_data);
+                   (_bt_get_error_code(param->result), BT_ADAPTER_DEVICE_DISCOVERY_FINISHED, NULL, bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
                BT_INFO("bt_adapter_device_discovery_state_changed_cb() will be called with BT_ADAPTER_DEVICE_DISCOVERY_FOUND");
@@ -664,8 +664,6 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                            (_bt_get_error_code(param->result), BT_ADAPTER_DEVICE_DISCOVERY_FOUND, NULL, bt_event_slot_container[event_index].user_data);
                }
                break;
-       case BLUETOOTH_EVENT_REMOTE_DEVICE_DISAPPEARED:
-       break;
        case BLUETOOTH_EVENT_BONDING_FINISHED:
                BT_INFO("bt_device_bond_created_cb() will be called");
                _bt_get_bt_device_info_s(&bonded_device, (bluetooth_device_info_t *)(param->param_data));
@@ -1257,6 +1255,14 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        bt_event_slot_container[event_index].user_data);
 
                break;
+/*     case BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED:
+               BT_INFO("BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED");
+
+               ((bt_adapter_manufacturer_data_changed_cb)bt_event_slot_container[event_index].callback)
+                (_bt_get_error_code(param->result, NULL, BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED,
+                 bt_event_slot_container[event_index].user_data);
+
+               break;*/
        default:
                break;
        }
@@ -1354,6 +1360,7 @@ static int __bt_get_bt_adapter_device_discovery_info_s(bt_adapter_device_discove
        (*discovery_info)->rssi = (int)source_info->rssi;
        (*discovery_info)->is_bonded = (bool)source_info->paired;
 
+#if 0
        (*discovery_info)->appearance = 0;
 
        (*discovery_info)->manufacturer_data_len = source_info->manufacturer_data.data_len;
@@ -1363,7 +1370,7 @@ static int __bt_get_bt_adapter_device_discovery_info_s(bt_adapter_device_discove
        } else {
                (*discovery_info)->manufacturer_data = NULL;
        }
-
+#endif
        return BT_ERROR_NONE;
 }
 
@@ -1464,7 +1471,6 @@ static int __bt_get_cb_index(int event)
        case BLUETOOTH_EVENT_DISCOVERY_STARTED:
        case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
        case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
-       case BLUETOOTH_EVENT_REMOTE_DEVICE_DISAPPEARED:
                return BT_EVENT_DEVICE_DISCOVERY_STATE_CHANGED;
        case BLUETOOTH_EVENT_LE_DISCOVERY_STARTED:
        case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
index 898754ad50f81ce4bf72747a3b494f7d0d33fd46..5e30e026fa8af8767744a485ae361488d865c355 100755 (executable)
@@ -16,6 +16,5 @@ FOREACH(src ${sources})
     TARGET_LINK_LIBRARIES(${src_name} ${fw_name} ${${fw_test}_LDFLAGS})
 ENDFOREACH()
 
-INSTALL(TARGETS bt_unit_test DESTINATION bin)
-INSTALL(TARGETS bt_onoff DESTINATION bin)
-INSTALL(FILES capi-network-bluetooth-test.efl DESTINATION /etc/smack/accesses.d/)
+#INSTALL(TARGETS bt_unit_test DESTINATION bin)
+#INSTALL(TARGETS bt_onoff DESTINATION bin)
index b3c80b9ae0a241788d1280faa889e9b722e56efd..8e320f671a65a489fa2ea24ed625ad1e37218d7c 100755 (executable)
@@ -41,7 +41,7 @@ const char *spp_uuid = "00001101-0000-1000-8000-00805F9B34FB";
 const char *opp_uuid = "00001105-0000-1000-8000-00805f9b34fb";
 
 static bt_unit_test_table_e current_tc_table;
-static char remote_addr[18] = "F6:FB:8F:D8:C8:7C";
+static char remote_addr[18] = "34:BB:26:5D:78:9C";
 static bool input_automated_test_delay = false;
 
 static int server_fd;
@@ -149,6 +149,7 @@ tc_table_t tc_device[] = {
        {"bt_device_is_profile_connected"                               , BT_UNIT_TEST_FUNCTION_DEVICE_IS_PROFILE_CONNECTED},
        {"bt_device_set_bond_created_cb"                                , BT_UNIT_TEST_FUNCTION_DEVICE_SET_BOND_CREATED_CB},
        {"bt_device_create_bond"                                        , BT_UNIT_TEST_FUNCTION_DEVICE_CREATE_BOND},
+       {"bt_device_destroy_bond"                                       , BT_UNIT_TEST_FUNCTION_DEVICE_DESTROY_BOND},
        {"bt_device_create_bond_by_type"                                , BT_UNIT_TEST_FUNCTION_DEVICE_CREATE_BOND_BY_TYPE},
        {NULL                                   , 0x0000},
 };
@@ -1345,6 +1346,12 @@ int test_input_callback(void *data)
                        break;
                }
 
+               case BT_UNIT_TEST_FUNCTION_DEVICE_DESTROY_BOND : {
+                       ret =           bt_device_destroy_bond(remote_addr);
+                       TC_PRT("sudha returns %s\n", __bt_get_error_message(ret));
+                       break;
+               }
+
                case BT_UNIT_TEST_FUNCTION_DEVICE_CREATE_BOND_BY_TYPE : {
                        ret = bt_device_create_bond_by_type(remote_addr, BT_DEVICE_CONNECTION_LINK_LE);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
index 997a94287ed05a299bb4aede59f68b41e245f11b..5a037163db35ce1a9ab5095a24677bcfdc09e0d7 100755 (executable)
@@ -102,6 +102,7 @@ typedef enum
        BT_UNIT_TEST_FUNCTION_DEVICE_IS_PROFILE_CONNECTED,
        BT_UNIT_TEST_FUNCTION_DEVICE_SET_BOND_CREATED_CB,
        BT_UNIT_TEST_FUNCTION_DEVICE_CREATE_BOND,
+       BT_UNIT_TEST_FUNCTION_DEVICE_DESTROY_BOND,
        BT_UNIT_TEST_FUNCTION_DEVICE_CREATE_BOND_BY_TYPE,
        BT_UNIT_TEST_FUNCTION_SOCKET_CREATE_RFCOMM = 1,
        BT_UNIT_TEST_FUNCTION_SOCKET_DESTROY_RFCOMM,
diff --git a/test/capi-network-bluetooth-test b/test/capi-network-bluetooth-test
deleted file mode 100755 (executable)
index ec7331a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-root capi-network-bluetooth-test rw----
-_default_ capi-network-bluetooth-test rw----
-capi-network-bluetooth-test bt-service::platform rw----
-capi-network-bluetooth-test bt-service::public -w----
diff --git a/test/capi-network-bluetooth-test.efl b/test/capi-network-bluetooth-test.efl
deleted file mode 100755 (executable)
index ec7331a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-root capi-network-bluetooth-test rw----
-_default_ capi-network-bluetooth-test rw----
-capi-network-bluetooth-test bt-service::platform rw----
-capi-network-bluetooth-test bt-service::public -w----