[Comment] In CAPI use the common error converting logic.
So we should use the common error.
Change-Id: I9aa9ba511ea12b44b61c62fd85f66bb9d8ac4b61
+bluetooth-frwk (0.1.92) unstable; urgency=low
+
+ * Tagging and upload the package
+ * Git: slp/pkgs/b/bluetooth-frwk
+ * Tag: bluetooth-frwk_0.1.92
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Tue, 11 Sep 2012 16:31:23 +0900
+
bluetooth-frwk (0.1.91) unstable; urgency=low
* Tagging and upload the package
bluetooth-frwk (0.1.91) unstable; urgency=low
* Tagging and upload the package
*/
#include "bluetooth-api-common.h"
*/
#include "bluetooth-api-common.h"
+#include "bluetooth-api.h"
#include "bluetooth-hid-api.h"
#define BLUEZ_INPUT_NAME "org.bluez.Input"
#include "bluetooth-hid-api.h"
#define BLUEZ_INPUT_NAME "org.bluez.Input"
bt_event.event = connected ? BLUETOOTH_HID_CONNECTED : \
BLUETOOTH_HID_DISCONNECTED;
bt_event.event = connected ? BLUETOOTH_HID_CONNECTED : \
BLUETOOTH_HID_DISCONNECTED;
- bt_event.result = HID_ERROR_NONE;
+ bt_event.result = BLUETOOTH_ERROR_NONE;
bt_event.param_data = (void *)device_addr;
if (bt_hid_info.app_cb)
bt_event.param_data = (void *)device_addr;
if (bt_hid_info.app_cb)
address);
bt_event.event = BLUETOOTH_HID_CONNECTED;
address);
bt_event.event = BLUETOOTH_HID_CONNECTED;
- bt_event.result = HID_ERROR_CONNECTION_FAILED;
+ bt_event.result = BLUETOOTH_ERROR_CONNECTION_ERROR;
bt_event.param_data = (void *)&device_address;
if (bt_hid_info.app_cb)
bt_event.param_data = (void *)&device_address;
if (bt_hid_info.app_cb)
address);
bt_event.event = BLUETOOTH_HID_DISCONNECTED;
address);
bt_event.event = BLUETOOTH_HID_DISCONNECTED;
- bt_event.result = HID_ERROR_CONNECTION_FAILED;
+ bt_event.result = BLUETOOTH_ERROR_CONNECTION_ERROR;
bt_event.param_data = (void *)&device_address;
if (bt_hid_info.app_cb)
bt_event.param_data = (void *)&device_address;
if (bt_hid_info.app_cb)
BT_EXPORT_API int bluetooth_hid_init(hid_cb_func_ptr callback_ptr,
void *user_data)
{
BT_EXPORT_API int bluetooth_hid_init(hid_cb_func_ptr callback_ptr,
void *user_data)
{
- int result = HID_ERROR_NONE;
+ int result = BLUETOOTH_ERROR_NONE;
GError *err = NULL;
DBusError dbus_error;
DBusGConnection *conn = NULL;
GError *err = NULL;
DBusError dbus_error;
DBusGConnection *conn = NULL;
if (bt_hid_info.conn) {
DBG("HID is already initialized");
if (bt_hid_info.conn) {
DBG("HID is already initialized");
- return HID_ERROR_ALREADY_INITIALIZED;
+ return BLUETOOTH_ERROR_INTERNAL;
}
conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &err);
}
conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &err);
if (err != NULL) {
DBG("ERROR: Can't get on system bus [%s]", err->message);
g_error_free(err);
if (err != NULL) {
DBG("ERROR: Can't get on system bus [%s]", err->message);
g_error_free(err);
- return HID_ERROR_INTERNAL;
+ return BLUETOOTH_ERROR_INTERNAL;
}
sys_conn = dbus_g_connection_get_connection(conn);
}
sys_conn = dbus_g_connection_get_connection(conn);
if (dbus_error_is_set(&dbus_error)) {
DBG("Fail to add dbus filter signal: %s\n", dbus_error.message);
dbus_error_free(&dbus_error);
if (dbus_error_is_set(&dbus_error)) {
DBG("Fail to add dbus filter signal: %s\n", dbus_error.message);
dbus_error_free(&dbus_error);
- result = HID_ERROR_INTERNAL;
+ result = BLUETOOTH_ERROR_INTERNAL;
+ return BLUETOOTH_ERROR_NONE;
failed:
if (conn)
dbus_g_connection_unref(conn);
failed:
if (conn)
dbus_g_connection_unref(conn);
if (bt_hid_info.conn == NULL) {
DBG("HID is not initialized");
if (bt_hid_info.conn == NULL) {
DBG("HID is not initialized");
- return HID_ERROR_NOT_INITIALIZED;
+ return BLUETOOTH_ERROR_INTERNAL;
}
if (bt_hid_info.sys_conn) {
}
if (bt_hid_info.sys_conn) {
DBG("+\n");
if (device_address == NULL)
DBG("+\n");
if (device_address == NULL)
- return HID_ERROR_INVALID_PARAM;
+ return BLUETOOTH_ERROR_INVALID_PARAM;
if (bt_hid_info.conn == NULL) {
DBG("HID is not initialized");
if (bt_hid_info.conn == NULL) {
DBG("HID is not initialized");
- return HID_ERROR_NOT_INITIALIZED;
+ return BLUETOOTH_ERROR_INTERNAL;
}
/* If the adapter path is wrong, we can think the BT is not enabled. */
if (_bluetooth_internal_get_adapter_path(bt_hid_info.conn, adapter_path) < 0) {
DBG("Could not get adapter path\n");
}
/* If the adapter path is wrong, we can think the BT is not enabled. */
if (_bluetooth_internal_get_adapter_path(bt_hid_info.conn, adapter_path) < 0) {
DBG("Could not get adapter path\n");
- return HID_ERROR_NOT_ENABLED;
+ return BLUETOOTH_ERROR_DEVICE_NOT_ENABLED;
}
adapter_proxy = dbus_g_proxy_new_for_name(bt_hid_info.conn, BLUEZ_SERVICE_NAME,
}
adapter_proxy = dbus_g_proxy_new_for_name(bt_hid_info.conn, BLUEZ_SERVICE_NAME,
if (adapter_proxy == NULL) {
DBG("dbus_g_proxy_new_for_name() failed\n");
if (adapter_proxy == NULL) {
DBG("dbus_g_proxy_new_for_name() failed\n");
- return HID_ERROR_INTERNAL;
+ return BLUETOOTH_ERROR_INTERNAL;
}
_bluetooth_internal_addr_type_to_addr_string(address,
}
_bluetooth_internal_addr_type_to_addr_string(address,
DBG("Failed to Find device: %s\n", g_error->message);
g_error_free(g_error);
g_object_unref(adapter_proxy);
DBG("Failed to Find device: %s\n", g_error->message);
g_error_free(g_error);
g_object_unref(adapter_proxy);
- return HID_ERROR_NOT_PAIRED;
+ return BLUETOOTH_ERROR_NOT_PAIRED;
}
hid_proxy = dbus_g_proxy_new_for_name(bt_hid_info.conn, BLUEZ_SERVICE_NAME,
}
hid_proxy = dbus_g_proxy_new_for_name(bt_hid_info.conn, BLUEZ_SERVICE_NAME,
if (hid_proxy == NULL) {
DBG("Failed to get hidh proxy\n");
g_object_unref(adapter_proxy);
if (hid_proxy == NULL) {
DBG("Failed to get hidh proxy\n");
g_object_unref(adapter_proxy);
- return HID_ERROR_NOT_PAIRED;
+ return BLUETOOTH_ERROR_NOT_PAIRED;
}
bt_hid_info.hid_proxy = hid_proxy;
}
bt_hid_info.hid_proxy = hid_proxy;
g_object_unref(hid_proxy);
g_object_unref(adapter_proxy);
bt_hid_info.hid_proxy = NULL;
g_object_unref(hid_proxy);
g_object_unref(adapter_proxy);
bt_hid_info.hid_proxy = NULL;
- return HID_ERROR_CONNECTION_FAILED;
+ return BLUETOOTH_ERROR_CONNECTION_ERROR;
}
g_object_unref(adapter_proxy);
DBG("-\n");
}
g_object_unref(adapter_proxy);
DBG("-\n");
+ return BLUETOOTH_ERROR_NONE;
}
BT_EXPORT_API int bluetooth_hid_disconnect(hid_device_address_t *device_address)
}
BT_EXPORT_API int bluetooth_hid_disconnect(hid_device_address_t *device_address)
DBG("+\n");
if (device_address == NULL)
DBG("+\n");
if (device_address == NULL)
- return HID_ERROR_INVALID_PARAM;
+ return BLUETOOTH_ERROR_INVALID_PARAM;
if (bt_hid_info.conn == NULL) {
DBG("HID is not initialized");
if (bt_hid_info.conn == NULL) {
DBG("HID is not initialized");
- return HID_ERROR_NOT_INITIALIZED;
+ return BLUETOOTH_ERROR_INTERNAL;
}
/* If the adapter path is wrong, we can think the BT is not enabled. */
if (_bluetooth_internal_get_adapter_path(bt_hid_info.conn, adapter_path) < 0) {
DBG("Could not get adapter path\n");
}
/* If the adapter path is wrong, we can think the BT is not enabled. */
if (_bluetooth_internal_get_adapter_path(bt_hid_info.conn, adapter_path) < 0) {
DBG("Could not get adapter path\n");
- return HID_ERROR_NOT_ENABLED;
+ return BLUETOOTH_ERROR_DEVICE_NOT_ENABLED;
}
adapter_proxy = dbus_g_proxy_new_for_name(bt_hid_info.conn, BLUEZ_SERVICE_NAME,
}
adapter_proxy = dbus_g_proxy_new_for_name(bt_hid_info.conn, BLUEZ_SERVICE_NAME,
if (adapter_proxy == NULL) {
DBG("dbus_g_proxy_new_for_name() failed\n");
if (adapter_proxy == NULL) {
DBG("dbus_g_proxy_new_for_name() failed\n");
- return HID_ERROR_INTERNAL;
+ return BLUETOOTH_ERROR_INTERNAL;
}
_bluetooth_internal_addr_type_to_addr_string(address,
}
_bluetooth_internal_addr_type_to_addr_string(address,
DBG("Failed to Find device: %s\n", g_error->message);
g_error_free(g_error);
g_object_unref(adapter_proxy);
DBG("Failed to Find device: %s\n", g_error->message);
g_error_free(g_error);
g_object_unref(adapter_proxy);
- return HID_ERROR_NOT_PAIRED;
+ return BLUETOOTH_ERROR_NOT_PAIRED;
}
hid_proxy = dbus_g_proxy_new_for_name(bt_hid_info.conn, BLUEZ_SERVICE_NAME,
}
hid_proxy = dbus_g_proxy_new_for_name(bt_hid_info.conn, BLUEZ_SERVICE_NAME,
if (hid_proxy == NULL) {
DBG("Failed to get hidh proxy\n");
g_object_unref(adapter_proxy);
if (hid_proxy == NULL) {
DBG("Failed to get hidh proxy\n");
g_object_unref(adapter_proxy);
- return HID_ERROR_NOT_PAIRED;
+ return BLUETOOTH_ERROR_NOT_PAIRED;
}
bt_hid_info.hid_proxy = hid_proxy;
}
bt_hid_info.hid_proxy = hid_proxy;
g_object_unref(adapter_proxy);
g_object_unref(hid_proxy);
bt_hid_info.hid_proxy = NULL;
g_object_unref(adapter_proxy);
g_object_unref(hid_proxy);
bt_hid_info.hid_proxy = NULL;
- return HID_ERROR_CONNECTION_FAILED;
+ return BLUETOOTH_ERROR_CONNECTION_ERROR;
}
g_object_unref(adapter_proxy);
}
g_object_unref(adapter_proxy);
Name: bluetooth-frwk
Summary: Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
Name: bluetooth-frwk
Summary: Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
Release: 1
Group: TO_BE/FILLED_IN
License: TO BE FILLED IN
Release: 1
Group: TO_BE/FILLED_IN
License: TO BE FILLED IN