diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-03-10 23:28:15 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2006-03-10 23:28:15 +0000 |
commit | 59d9a9a0eee7f3148e0ab7304fad96f21ddc69c6 (patch) | |
tree | c85f8216e706591f437e1ca5ad301c35fd5b39fa /hcid | |
parent | 4eb7d74b3990230b8acc010d9612ebd1de9fbbf0 (diff) |
Cleanup all the error definitions
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/dbus-adapter.c | 72 | ||||
-rw-r--r-- | hcid/dbus-error.c | 132 | ||||
-rw-r--r-- | hcid/dbus.h | 26 |
3 files changed, 48 insertions, 182 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c index b34261cb..4987afc4 100644 --- a/hcid/dbus-adapter.c +++ b/hcid/dbus-adapter.c @@ -250,7 +250,7 @@ static DBusHandlerResult handle_dev_list_minor_classes_req(DBusConnection *conn, error("Can't read class of device on hci%d: %s(%d)", dbus_data->dev_id, strerror(errno), errno); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } hci_close_dev(dd); @@ -298,7 +298,7 @@ static DBusHandlerResult handle_dev_set_mode_req(DBusConnection *conn, DBusMessa DBUS_TYPE_INVALID); if (!scan_mode) - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_WRONG_PARAM); + return error_invalid_arguments(conn, msg); if (strcasecmp(MODE_OFF, scan_mode) == 0) hci_mode = SCAN_DISABLED; @@ -307,7 +307,7 @@ static DBusHandlerResult handle_dev_set_mode_req(DBusConnection *conn, DBusMessa else if (strcasecmp(MODE_DISCOVERABLE, scan_mode) == 0) hci_mode = (SCAN_PAGE | SCAN_INQUIRY); else - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_WRONG_PARAM); + return error_invalid_arguments(conn, msg); dd = hci_open_dev(dbus_data->dev_id); if (dd < 0) @@ -330,13 +330,13 @@ static DBusHandlerResult handle_dev_set_mode_req(DBusConnection *conn, DBusMessa error("Sending write scan enable command failed: %s (%d)", strerror(errno), errno); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } if (status) { error("Setting scan enable failed with status 0x%02x", status); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_EBT_OFFSET | status); + return error_failed(conn, msg, status); } } @@ -500,7 +500,7 @@ static DBusHandlerResult handle_dev_set_minor_class_req(DBusConnection *conn, DB dbus_message_iter_get_basic(&iter, &minor); if (!minor) - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_WRONG_PARAM); + return error_invalid_arguments(conn, msg); /* FIXME: currently, only computer minor classes are allowed */ for (i = 0; i < sizeof(computer_minor_cls) / sizeof(*computer_minor_cls); i++) @@ -512,7 +512,7 @@ static DBusHandlerResult handle_dev_set_minor_class_req(DBusConnection *conn, DB /* Check if it's a valid minor class */ if (dev_class == 0xFFFFFFFF) - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_WRONG_PARAM); + return error_invalid_arguments(conn, msg); dd = hci_open_dev(dbus_data->dev_id); if (dd < 0) @@ -522,7 +522,7 @@ static DBusHandlerResult handle_dev_set_minor_class_req(DBusConnection *conn, DB error("Can't read class of device on hci%d: %s(%d)", dbus_data->dev_id, strerror(errno), errno); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } dev_class |= (cls[2] << 16) | (cls[1] << 8); @@ -539,7 +539,7 @@ static DBusHandlerResult handle_dev_set_minor_class_req(DBusConnection *conn, DB error("Can't write class of device on hci%d: %s(%d)", dbus_data->dev_id, strerror(errno), errno); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } signal = dev_signal_factory(dbus_data->dev_id, DEV_SIG_MINOR_CLASS_CHANGED, @@ -576,7 +576,7 @@ static DBusHandlerResult handle_dev_get_service_classes_req(DBusConnection *conn error("Can't read class of device on hci%d: %s(%d)", dbus_data->dev_id, strerror(errno), errno); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } reply = dbus_message_new_method_return(msg); @@ -636,7 +636,7 @@ static DBusHandlerResult handle_dev_set_name_req(DBusConnection *conn, DBusMessa if (strlen(str_ptr) == 0) { error("Name change failed: Invalid parameter"); - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_WRONG_PARAM); + return error_invalid_arguments(conn, msg); } hci_devba(dbus_data->dev_id, &bdaddr); @@ -656,14 +656,12 @@ static DBusHandlerResult handle_dev_set_name_req(DBusConnection *conn, DBusMessa static DBusHandlerResult handle_dev_get_remote_version_req(DBusConnection *conn, DBusMessage *msg, void *data) { - /*FIXME: */ - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_NOT_IMPLEMENTED); + return error_not_implemented(conn, msg); } static DBusHandlerResult handle_dev_get_remote_revision_req(DBusConnection *conn, DBusMessage *msg, void *data) { - /*FIXME: */ - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_NOT_IMPLEMENTED); + return error_not_implemented(conn, msg); } static DBusHandlerResult handle_dev_get_remote_manufacturer_req(DBusConnection *conn, DBusMessage *msg, void *data) @@ -684,7 +682,7 @@ static DBusHandlerResult handle_dev_get_remote_manufacturer_req(DBusConnection * str = textfile_get(filename, addr_ptr); if (!str) - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | ENXIO); + return error_failed(conn, msg, ENXIO); compid = atoi(str); @@ -717,7 +715,7 @@ static DBusHandlerResult handle_dev_get_remote_company_req(DBusConnection *conn, tmp = ouitocomp(oui); if (!tmp) - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_RECORD_NOT_FOUND); + return error_record_does_not_exist(conn, msg); reply = dbus_message_new_method_return(msg); if (!reply) { @@ -754,7 +752,7 @@ static DBusHandlerResult handle_dev_get_remote_name_req(DBusConnection *conn, DB name = textfile_get(filename, str_bdaddr); if (!name) - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_RECORD_NOT_FOUND); + return error_record_does_not_exist(conn, msg); reply = dbus_message_new_method_return(msg); if (!reply) { @@ -815,7 +813,7 @@ static DBusHandlerResult handle_dev_set_remote_alias_req(DBusConnection *conn, D if (strlen(str_ptr) == 0) { error("Alias change failed: Invalid parameter"); - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_WRONG_PARAM); + return error_invalid_arguments(conn, msg); } str2ba(addr_ptr, &bdaddr); @@ -858,7 +856,7 @@ static DBusHandlerResult handle_dev_last_seen_req(DBusConnection *conn, DBusMess str = textfile_get(filename, addr_ptr); if (!str) - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | ENXIO); + return error_failed(conn, msg, ENXIO); reply = dbus_message_new_method_return(msg); if (!reply) { @@ -891,7 +889,7 @@ static DBusHandlerResult handle_dev_last_used_req(DBusConnection *conn, DBusMess str = textfile_get(filename, addr_ptr); if (!str) - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | ENXIO); + return error_failed(conn, msg, ENXIO); reply = dbus_message_new_method_return(msg); if (!reply) { @@ -927,10 +925,10 @@ static DBusHandlerResult handle_dev_create_bonding_req(DBusConnection *conn, DBu dev_id = hci_for_each_dev(HCI_UP, find_conn, (long) &bdaddr); if (dev_id < 0) - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_CONN_NOT_FOUND); + return error_failed(conn, msg, ENOTCONN); if (dbus_data->dev_id != dev_id) - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_CONN_NOT_FOUND); + return error_failed(conn, msg, ENOTCONN); dd = hci_open_dev(dev_id); if (dd < 0) @@ -939,7 +937,7 @@ static DBusHandlerResult handle_dev_create_bonding_req(DBusConnection *conn, DBu cr = malloc(sizeof(*cr) + sizeof(struct hci_conn_info)); if (!cr) { hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_NO_MEM); + return error_out_of_memory(conn, msg); } bacpy(&cr->bdaddr, &bdaddr); @@ -948,7 +946,7 @@ static DBusHandlerResult handle_dev_create_bonding_req(DBusConnection *conn, DBu if (ioctl(dd, HCIGETCONNINFO, (unsigned long) cr) < 0) { hci_close_dev(dd); free(cr); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } memset(&cp, 0, sizeof(cp)); @@ -968,7 +966,7 @@ static DBusHandlerResult handle_dev_create_bonding_req(DBusConnection *conn, DBu strerror(errno), errno); hci_close_dev(dd); free(cr); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } reply = dbus_message_new_method_return(msg); @@ -1017,7 +1015,7 @@ static DBusHandlerResult handle_dev_remove_bonding_req(DBusConnection *conn, DBu if (!cr) { error("Can't allocate memory"); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_NO_MEM); + return error_out_of_memory(conn, msg); } bacpy(&cr->bdaddr, &bdaddr); @@ -1034,7 +1032,7 @@ static DBusHandlerResult handle_dev_remove_bonding_req(DBusConnection *conn, DBu error("Disconnect failed"); free(cr); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } /* FIXME: which condition must be verified before send the signal */ @@ -1143,7 +1141,7 @@ static DBusHandlerResult handle_dev_get_pin_code_length_req(DBusConnection *conn len = read_pin_length(&local, &peer); if (len < 0) - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | -len); + return error_failed(conn, msg, -len); reply = dbus_message_new_method_return(msg); @@ -1172,7 +1170,7 @@ static DBusHandlerResult handle_dev_get_encryption_key_size_req(DBusConnection * val = get_encryption_key_size(dbus_data->dev_id, &bdaddr); if (val < 0) - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | -val); + return error_failed(conn, msg, -val); reply = dbus_message_new_method_return(msg); @@ -1223,7 +1221,7 @@ static DBusHandlerResult handle_dev_discover_devices_req(DBusConnection *conn, D error("Unable to start inquiry: %s (%d)", strerror(errno), errno); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } requestor_name = dbus_message_get_sender(msg); @@ -1269,14 +1267,14 @@ static DBusHandlerResult handle_dev_cancel_discovery_req(DBusConnection *conn, D error("Sending cancel inquiry failed: %s (%d)", strerror(errno), errno); hci_close_dev(dd); - return bluez_new_failure_msg(conn, msg, BLUEZ_ESYSTEM_OFFSET | errno); + return error_failed(conn, msg, errno); } hci_close_dev(dd); if (status) { error("Cancel inquiry failed with status 0x%02x", status); - return bluez_new_failure_msg(conn, msg, BLUEZ_EBT_OFFSET | status); + return error_failed(conn, msg, status); } free(dbus_data->requestor_name); @@ -1289,14 +1287,12 @@ static DBusHandlerResult handle_dev_cancel_discovery_req(DBusConnection *conn, D static DBusHandlerResult handle_dev_discover_cache_req(DBusConnection *conn, DBusMessage *msg, void *data) { - /*FIXME: */ - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_NOT_IMPLEMENTED); + return error_not_implemented(conn, msg); } static DBusHandlerResult handle_dev_discover_service_req(DBusConnection *conn, DBusMessage *msg, void *data) { - /*FIXME: */ - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_NOT_IMPLEMENTED); + return error_not_implemented(conn, msg); } static struct service_data dev_services[] = { @@ -1359,7 +1355,7 @@ DBusHandlerResult msg_func_device(DBusConnection *conn, DBusMessage *msg, void * if (dbus_data->path_id == ADAPTER_ROOT_ID) { /* Adapter is down(path unregistered) or the path is wrong */ - return bluez_new_failure_msg(conn, msg, BLUEZ_EDBUS_UNKNOWN_PATH); + return error_no_such_adapter(conn, msg); } handler = find_service_handler(dev_services, msg); diff --git a/hcid/dbus-error.c b/hcid/dbus-error.c index f893d130..dddf8498 100644 --- a/hcid/dbus-error.c +++ b/hcid/dbus-error.c @@ -37,126 +37,6 @@ #include "hcid.h" #include "dbus.h" -typedef struct { - uint32_t code; - const char *str; -} bluez_error_t; - -static const bluez_error_t dbus_error_array[] = { - { BLUEZ_EDBUS_UNKNOWN_METHOD, "Method not found" }, - { BLUEZ_EDBUS_WRONG_SIGNATURE, "Wrong method signature" }, - { BLUEZ_EDBUS_WRONG_PARAM, "Invalid parameters" }, - { BLUEZ_EDBUS_RECORD_NOT_FOUND, "No record found" }, - { BLUEZ_EDBUS_NO_MEM, "No memory" }, - { BLUEZ_EDBUS_CONN_NOT_FOUND, "Connection not found" }, - { BLUEZ_EDBUS_UNKNOWN_PATH, "Unknown D-BUS path" }, - { BLUEZ_EDBUS_NOT_IMPLEMENTED, "Method not implemented" }, - { 0, NULL } -}; - -static const bluez_error_t hci_error_array[] = { - { HCI_UNKNOWN_COMMAND, "Unknown HCI Command" }, - { HCI_NO_CONNECTION, "Unknown Connection Identifier" }, - { HCI_HARDWARE_FAILURE, "Hardware Failure" }, - { HCI_PAGE_TIMEOUT, "Page Timeout" }, - { HCI_AUTHENTICATION_FAILURE, "Authentication Failure" }, - { HCI_PIN_OR_KEY_MISSING, "PIN Missing" }, - { HCI_MEMORY_FULL, "Memory Capacity Exceeded" }, - { HCI_CONNECTION_TIMEOUT, "Connection Timeout" }, - { HCI_MAX_NUMBER_OF_CONNECTIONS, "Connection Limit Exceeded" }, - { HCI_MAX_NUMBER_OF_SCO_CONNECTIONS, "Synchronous Connection Limit To A Device Exceeded" }, - { HCI_ACL_CONNECTION_EXISTS, "ACL Connection Already Exists" }, - { HCI_COMMAND_DISALLOWED, "Command Disallowed" }, - { HCI_REJECTED_LIMITED_RESOURCES, "Connection Rejected due to Limited Resources" }, - { HCI_REJECTED_SECURITY, "Connection Rejected Due To Security Reasons" }, - { HCI_REJECTED_PERSONAL, "Connection Rejected due to Unacceptable BD_ADDR" }, - { HCI_HOST_TIMEOUT, "Connection Accept Timeout Exceeded" }, - { HCI_UNSUPPORTED_FEATURE, "Unsupported Feature or Parameter Value" }, - { HCI_INVALID_PARAMETERS, "Invalid HCI Command Parameters" }, - { HCI_OE_USER_ENDED_CONNECTION, "Remote User Terminated Connection" }, - { HCI_OE_LOW_RESOURCES, "Remote Device Terminated Connection due to Low Resources" }, - { HCI_OE_POWER_OFF, "Remote Device Terminated Connection due to Power Off" }, - { HCI_CONNECTION_TERMINATED, "Connection Terminated By Local Host" }, - { HCI_REPEATED_ATTEMPTS, "Repeated Attempts" }, - { HCI_PAIRING_NOT_ALLOWED, "Pairing Not Allowed" }, - { HCI_UNKNOWN_LMP_PDU, "Unknown LMP PDU" }, - { HCI_UNSUPPORTED_REMOTE_FEATURE, "Unsupported Remote Feature" }, - { HCI_SCO_OFFSET_REJECTED, "SCO Offset Rejected" }, - { HCI_SCO_INTERVAL_REJECTED, "SCO Interval Rejected" }, - { HCI_AIR_MODE_REJECTED, "SCO Air Mode Rejected" }, - { HCI_INVALID_LMP_PARAMETERS, "Invalid LMP Parameters" }, - { HCI_UNSPECIFIED_ERROR, "Unspecified Error" }, - { HCI_UNSUPPORTED_LMP_PARAMETER_VALUE, "Unsupported LMP Parameter Value" }, - { HCI_ROLE_CHANGE_NOT_ALLOWED, "Role Change Not Allowed" }, - { HCI_LMP_RESPONSE_TIMEOUT, "LMP Response Timeout" }, - { HCI_LMP_ERROR_TRANSACTION_COLLISION, "LMP Error Transaction Collision" }, - { HCI_LMP_PDU_NOT_ALLOWED, "LMP PDU Not Allowed" }, - { HCI_ENCRYPTION_MODE_NOT_ACCEPTED, "Encryption Mode Not Acceptable" }, - { HCI_UNIT_LINK_KEY_USED, "Link Key Can Not be Changed" }, - { HCI_QOS_NOT_SUPPORTED, "Requested QoS Not Supported" }, - { HCI_INSTANT_PASSED, "Instant Passed" }, - { HCI_PAIRING_NOT_SUPPORTED, "Pairing With Unit Key Not Supported" }, - { HCI_TRANSACTION_COLLISION, "Different Transaction Collision" }, - { HCI_QOS_UNACCEPTABLE_PARAMETER, "QoS Unacceptable Parameter" }, - { HCI_QOS_REJECTED, "QoS Rejected" }, - { HCI_CLASSIFICATION_NOT_SUPPORTED, "Channel Classification Not Supported" }, - { HCI_INSUFFICIENT_SECURITY, "Insufficient Security" }, - { HCI_PARAMETER_OUT_OF_RANGE, "Parameter Out Of Mandatory Range" }, - { HCI_ROLE_SWITCH_PENDING, "Role Switch Pending" }, - { HCI_SLOT_VIOLATION, "Reserved Slot Violation" }, - { HCI_ROLE_SWITCH_FAILED, "Role Switch Failed" }, - { 0, NULL }, -}; - -static const char *bluez_dbus_error_to_str(const uint32_t ecode) -{ - const bluez_error_t *ptr; - uint32_t raw_code = 0; - - if (ecode & BLUEZ_ESYSTEM_OFFSET) { - /* System error */ - raw_code = (~BLUEZ_ESYSTEM_OFFSET) & ecode; - info("%s - msg:%s", __PRETTY_FUNCTION__, strerror(raw_code)); - return strerror(raw_code); - } else if (ecode & BLUEZ_EDBUS_OFFSET) { - /* D-Bus error */ - for (ptr = dbus_error_array; ptr->code; ptr++) { - if (ptr->code == ecode) { - info("%s - msg:%s", __PRETTY_FUNCTION__, ptr->str); - return ptr->str; - } - } - } else { - /* BLUEZ_EBT_OFFSET - Bluetooth HCI errors */ - for (ptr = hci_error_array; ptr->code; ptr++) { - if (ptr->code == ecode) { - info("%s - msg:%s", __PRETTY_FUNCTION__, ptr->str); - return ptr->str; - } - } - } - - return NULL; -} - -DBusHandlerResult bluez_new_failure_msg(DBusConnection *conn, DBusMessage *msg, const uint32_t ecode) -{ - DBusMessageIter iter; - DBusMessage *reply; - const char *error_msg; - - error_msg = bluez_dbus_error_to_str(ecode); - if (!error_msg) - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - - reply = dbus_message_new_error(msg, ERROR_INTERFACE, error_msg); - - dbus_message_iter_init_append(reply, &iter); - dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32 ,&ecode); - - return send_reply_and_unref(conn, reply); -} - DBusHandlerResult error_failed(DBusConnection *conn, DBusMessage *msg, int err) { const char *str = strerror(err); @@ -172,6 +52,13 @@ DBusHandlerResult error_invalid_arguments(DBusConnection *conn, DBusMessage *msg "Invalid arguments")); } +DBusHandlerResult error_not_implemented(DBusConnection *conn, DBusMessage *msg) +{ + return send_reply_and_unref(conn, + dbus_message_new_error(msg, ERROR_INTERFACE ".NotImplemented", + "Not implemented")); +} + DBusHandlerResult error_not_authorized(DBusConnection *conn, DBusMessage *msg) { return send_reply_and_unref(conn, @@ -259,6 +146,11 @@ DBusHandlerResult error_discover_in_progress(DBusConnection *conn, DBusMessage * return error_in_progress(conn, msg, "Discover in progress"); } +DBusHandlerResult error_record_does_not_exist(DBusConnection *conn, DBusMessage *msg) +{ + return error_does_not_exist(conn, msg, "Record does not exist"); +} + DBusHandlerResult error_passkey_agent_already_exists(DBusConnection *conn, DBusMessage *msg) { return error_already_exists(conn, msg, "Passkey agent already exists"); diff --git a/hcid/dbus.h b/hcid/dbus.h index ec607015..67f45bea 100644 --- a/hcid/dbus.h +++ b/hcid/dbus.h @@ -27,8 +27,6 @@ #include <stdint.h> #include <dbus/dbus.h> -#define __END_SIG__ DBUS_TYPE_INVALID_AS_STRING - #define BASE_PATH "/org/bluez" #define BASE_INTERFACE "org.bluez" @@ -102,6 +100,7 @@ int get_default_dev_id(void); DBusHandlerResult error_failed(DBusConnection *conn, DBusMessage *msg, int err); DBusHandlerResult error_invalid_arguments(DBusConnection *conn, DBusMessage *msg); +DBusHandlerResult error_not_implemented(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_not_authorized(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_out_of_memory(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_no_such_adapter(DBusConnection *conn, DBusMessage *msg); @@ -113,6 +112,7 @@ DBusHandlerResult error_bonding_already_exists(DBusConnection *conn, DBusMessage DBusHandlerResult error_bonding_does_not_exist(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_bonding_in_progress(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_discover_in_progress(DBusConnection *conn, DBusMessage *msg); +DBusHandlerResult error_record_does_not_exist(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_passkey_agent_already_exists(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_passkey_agent_does_not_exist(DBusConnection *conn, DBusMessage *msg); @@ -220,26 +220,4 @@ static inline DBusHandlerResult send_reply_and_unref(DBusConnection *conn, DBusM #define DFT_DISCOVERABLE_TIMEOUT 180 /* 3 seconds */ #define DISCOVERABLE_TIMEOUT_OFF 0 -/* BLUEZ_DBUS_ERROR - * EFailed error messages signature is : su - * Where the first argument is a string(error message description), - * the last is a uint32 that contains the error class(system, dbus or hci). */ - -/* Error code offsets */ -#define BLUEZ_EBT_OFFSET (0x00000000) /* see Bluetooth error code */ -#define BLUEZ_EBT_EXT_OFFSET (0x00000100) -#define BLUEZ_EDBUS_OFFSET (0x00010000) -#define BLUEZ_ESYSTEM_OFFSET (0x00020000) -#define BLUEZ_EFUTURE_OFFSET (0x00040000) - -/* D-Bus error code, class BLUEZ_EDBUS_OFFSET */ -#define BLUEZ_EDBUS_UNKNOWN_METHOD (0x01 | BLUEZ_EDBUS_OFFSET) -#define BLUEZ_EDBUS_WRONG_SIGNATURE (0x02 | BLUEZ_EDBUS_OFFSET) -#define BLUEZ_EDBUS_WRONG_PARAM (0x03 | BLUEZ_EDBUS_OFFSET) -#define BLUEZ_EDBUS_RECORD_NOT_FOUND (0x04 | BLUEZ_EDBUS_OFFSET) -#define BLUEZ_EDBUS_NO_MEM (0x05 | BLUEZ_EDBUS_OFFSET) -#define BLUEZ_EDBUS_CONN_NOT_FOUND (0x06 | BLUEZ_EDBUS_OFFSET) -#define BLUEZ_EDBUS_UNKNOWN_PATH (0x07 | BLUEZ_EDBUS_OFFSET) -#define BLUEZ_EDBUS_NOT_IMPLEMENTED (0x08 | BLUEZ_EDBUS_OFFSET) - #endif /* __H_BLUEZ_DBUS_H__ */ |