mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-27 06:43:42 +08:00
Whitespace cleanup
This commit is contained in:
parent
d352bd0438
commit
ba255beb79
@ -1259,7 +1259,7 @@ static gboolean avdtp_suspend_cmd(struct avdtp *session,
|
||||
error("Too short suspend request");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
seid_count = 1 + size - sizeof(struct suspend_req);
|
||||
|
||||
seid = &req->first_seid;
|
||||
|
@ -237,7 +237,7 @@ static void convert_raw_data_to_xml(sdp_data_t *value, int indent_level,
|
||||
hex = 0;
|
||||
|
||||
int num_chars_to_escape = 0;
|
||||
|
||||
|
||||
for (i = 0; i < value->unitSize; i++) {
|
||||
if (i == (value->unitSize - 1)
|
||||
&& value->val.str[i] == '\0')
|
||||
@ -246,16 +246,15 @@ static void convert_raw_data_to_xml(sdp_data_t *value, int indent_level,
|
||||
hex = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* XML is evil, must do this... */
|
||||
if ((value->val.str[i] == '<') ||
|
||||
(value->val.str[i] == '>') ||
|
||||
(value->val.str[i] == '"') ||
|
||||
(value->val.str[i] == '&'))
|
||||
num_chars_to_escape++;
|
||||
|
||||
(value->val.str[i] == '>') ||
|
||||
(value->val.str[i] == '"') ||
|
||||
(value->val.str[i] == '&'))
|
||||
num_chars_to_escape++;
|
||||
}
|
||||
|
||||
|
||||
appender(data, indent);
|
||||
|
||||
appender(data, "<text ");
|
||||
@ -340,10 +339,10 @@ static void convert_raw_data_to_xml(sdp_data_t *value, int indent_level,
|
||||
|
||||
convert_raw_data_to_xml(value->val.dataseq,
|
||||
indent_level + 1, data, appender);
|
||||
|
||||
|
||||
appender(data, indent);
|
||||
appender(data, "</sequence>\n");
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case SDP_ALT8:
|
||||
@ -358,7 +357,7 @@ static void convert_raw_data_to_xml(sdp_data_t *value, int indent_level,
|
||||
appender(data, indent);
|
||||
|
||||
appender(data, "</alternate>\n");
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -577,7 +576,7 @@ sdp_data_t *sdp_xml_parse_int(const char * data, uint8_t dtd)
|
||||
case SDP_INT64:
|
||||
{
|
||||
int64_t val = strtoull(data, &endptr, 0);
|
||||
|
||||
|
||||
/* Failed to parse */
|
||||
if ((endptr != data) && (*endptr != '\0'))
|
||||
return NULL;
|
||||
|
@ -1845,7 +1845,7 @@ static DBusHandlerResult adapter_clear_remote_alias(DBusConnection *conn,
|
||||
str2ba(addr_ptr, &bdaddr);
|
||||
|
||||
ecode = get_device_alias(adapter->dev_id, &bdaddr, NULL, 0);
|
||||
if (ecode == -ENXIO)
|
||||
if (ecode == -ENXIO)
|
||||
had_alias = 0;
|
||||
|
||||
ecode = set_device_alias(adapter->dev_id, &bdaddr, NULL);
|
||||
@ -2820,10 +2820,8 @@ static DBusHandlerResult adapter_cancel_discovery(DBusConnection *conn,
|
||||
strcmp(adapter->discov_requestor, dbus_message_get_sender(msg)))
|
||||
return error_not_authorized(conn, msg);
|
||||
|
||||
/*
|
||||
* Cleanup the discovered devices list and send the cmd
|
||||
* to cancel inquiry or cancel remote name request
|
||||
*/
|
||||
/* Cleanup the discovered devices list and send the cmd to cancel
|
||||
* inquiry or cancel remote name request */
|
||||
err = cancel_discovery(adapter);
|
||||
if (err < 0) {
|
||||
if (err == -ENODEV)
|
||||
|
@ -52,9 +52,9 @@ Error hierarchy
|
||||
Interface org.bluez.Error
|
||||
|
||||
Shared Errors (Can be thrown by hcid or any bluetooth service)
|
||||
|
||||
|
||||
DeviceUnreachable
|
||||
|
||||
|
||||
The remote device is either powered down or out of range.
|
||||
|
||||
AlreadyConnected
|
||||
@ -82,7 +82,7 @@ Shared Errors (Can be thrown by hcid or any bluetooth service)
|
||||
InvalidArguments
|
||||
|
||||
The DBUS request does not contain the right number of
|
||||
arguments with the right type, or the arguments are there
|
||||
arguments with the right type, or the arguments are there
|
||||
but their value is wrong, or does not makes sense in the
|
||||
current context.
|
||||
|
||||
@ -96,8 +96,8 @@ Shared Errors (Can be thrown by hcid or any bluetooth service)
|
||||
Error returned when a specified record is not
|
||||
available.
|
||||
|
||||
NotSupported
|
||||
|
||||
NotSupported
|
||||
|
||||
The remote device does not support the expected
|
||||
feature.
|
||||
|
||||
@ -123,7 +123,7 @@ Hcid specific Errors (Can be thrown by hcid only)
|
||||
Error returned when the adapter is DOWN.
|
||||
|
||||
UnknwownMethod
|
||||
|
||||
|
||||
This is an experimental method.
|
||||
|
||||
NotAuthorized
|
||||
@ -140,9 +140,9 @@ Hcid specific Errors (Can be thrown by hcid only)
|
||||
exists. This error is similar to ENODEV.
|
||||
|
||||
NoSuchService
|
||||
|
||||
|
||||
RequestDeferred
|
||||
|
||||
|
||||
NotInProgress
|
||||
|
||||
UnsupportedMajorClass
|
||||
@ -1164,7 +1164,7 @@ Signals void ModeChanged(string mode)
|
||||
Signals that a bonding was removed.
|
||||
|
||||
void TrustAdded(string address)
|
||||
|
||||
|
||||
Sent when SetTrusted() is called.
|
||||
|
||||
void TrustRemoved(string address)
|
||||
@ -1261,7 +1261,7 @@ Signals void Started()
|
||||
was stopped.
|
||||
|
||||
void TrustAdded(string address)
|
||||
|
||||
|
||||
Sent when SetTrusted() is called.
|
||||
|
||||
void TrustRemoved(string address)
|
||||
|
@ -491,7 +491,7 @@ static DBusHandlerResult cancel_authorization_request(DBusConnection *conn,
|
||||
}
|
||||
|
||||
static DBusMethodVTable database_methods[] = {
|
||||
{ "AddServiceRecord", add_service_record, "ay", "u" },
|
||||
{ "AddServiceRecord", add_service_record, "ay", "u" },
|
||||
{ "AddServiceRecordFromXML", add_service_record_from_xml, "s", "u" },
|
||||
{ "UpdateServiceRecord", update_service_record, "uay", "" },
|
||||
{ "UpdateServiceRecordFromXML", update_service_record_from_xml, "us", "" },
|
||||
|
@ -54,7 +54,7 @@ DBusHandlerResult error_unknown_method(DBusConnection *conn, DBusMessage *msg)
|
||||
|
||||
snprintf(error, 128, "Method \"%s\" with signature \"%s\" on interface \"%s\" doesn't exist",
|
||||
method, signature, interface);
|
||||
|
||||
|
||||
return send_message_and_unref(conn,
|
||||
dbus_message_new_error(msg, ERROR_INTERFACE ".UnknownMethod",
|
||||
error));
|
||||
|
@ -1451,10 +1451,8 @@ void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, uint8_t status,
|
||||
g_slist_free(adapter->found_devices);
|
||||
adapter->found_devices = NULL;
|
||||
|
||||
/*
|
||||
* The discovery completed signal must be sent only for discover
|
||||
* devices request WITH name resolving
|
||||
*/
|
||||
/* The discovery completed signal must be sent only for discover
|
||||
* devices request WITH name resolving */
|
||||
if (adapter->discov_requestor) {
|
||||
name_listener_remove(connection, adapter->discov_requestor,
|
||||
(name_cb_t) discover_devices_req_exit, adapter);
|
||||
@ -2016,11 +2014,8 @@ void discover_devices_req_exit(const char *name, struct adapter *adapter)
|
||||
{
|
||||
debug("DiscoverDevices requestor (%s) exited", name);
|
||||
|
||||
/*
|
||||
* Cleanup the discovered devices list and send the command to
|
||||
* cancel inquiry or cancel remote name request. The return
|
||||
* can be ignored.
|
||||
*/
|
||||
/* Cleanup the discovered devices list and send the command to cancel
|
||||
* inquiry or cancel remote name request. The return can be ignored. */
|
||||
cancel_discovery(adapter);
|
||||
}
|
||||
|
||||
@ -2139,11 +2134,9 @@ void periodic_discover_req_exit(const char *name, struct adapter *adapter)
|
||||
{
|
||||
debug("PeriodicDiscovery requestor (%s) exited", name);
|
||||
|
||||
/*
|
||||
* Cleanup the discovered devices list and send the cmd to exit from
|
||||
/* Cleanup the discovered devices list and send the cmd to exit from
|
||||
* periodic inquiry or cancel remote name request. The return value can
|
||||
* be ignored.
|
||||
*/
|
||||
* be ignored. */
|
||||
|
||||
cancel_periodic_discovery(adapter);
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ static int get_bdaddrs(int sock, bdaddr_t *sba, bdaddr_t *dba)
|
||||
error("getsockname: %s (%d)", strerror(errno), errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
bacpy(sba, &a.l2_bdaddr);
|
||||
|
||||
len = sizeof(a);
|
||||
@ -562,7 +562,7 @@ static void remote_svc_rec_completed_xml_cb(uint8_t type, uint16_t err,
|
||||
src = get_address_from_message(ctxt->conn, ctxt->rq);
|
||||
|
||||
reply = dbus_message_new_method_return(ctxt->rq);
|
||||
|
||||
|
||||
rec = sdp_extract_pdu(rsp, &scanned);
|
||||
if (rec == NULL || size != scanned) {
|
||||
error("Invalid service record!");
|
||||
|
@ -110,7 +110,7 @@ static void hci_req_queue_process(int dev_id)
|
||||
|
||||
data = l->data;
|
||||
data->status = REQ_SENT;
|
||||
|
||||
|
||||
ret_val = hci_send_cmd(dd, data->ogf, data->ocf, data->clen, data->cparam);
|
||||
if (ret_val < 0) {
|
||||
hci_req_queue = g_slist_remove(hci_req_queue, data);
|
||||
|
@ -96,11 +96,11 @@ static struct device *device_new(bdaddr_t *src, bdaddr_t *dst, uint8_t subclass)
|
||||
if (read_device_class(src, dst, &cls) < 0)
|
||||
return NULL;
|
||||
|
||||
major = (cls >> 8) & 0x1f;
|
||||
minor = (cls >> 2) & 0x3f;
|
||||
major = (cls >> 8) & 0x1f;
|
||||
minor = (cls >> 2) & 0x3f;
|
||||
} else {
|
||||
major = 0x05; /* Peripheral */
|
||||
minor = (subclass >> 2) & 0x3f;
|
||||
major = 0x05; /* Peripheral */
|
||||
minor = (subclass >> 2) & 0x3f;
|
||||
}
|
||||
|
||||
idev = g_new0(struct device, 1);
|
||||
@ -199,8 +199,8 @@ static const char *create_input_path(uint8_t major, uint8_t minor)
|
||||
static int next_id = 0;
|
||||
|
||||
switch (major) {
|
||||
case 0x02: /* Phone */
|
||||
strcpy(subpath, "phone");
|
||||
case 0x02: /* Phone */
|
||||
strcpy(subpath, "phone");
|
||||
break;
|
||||
case 0x04: /* Audio */
|
||||
switch (minor) {
|
||||
@ -274,7 +274,7 @@ static const char *create_input_path(uint8_t major, uint8_t minor)
|
||||
static int decode_key(const char *str)
|
||||
{
|
||||
static int mode = UPDOWN_ENABLED, gain = 0;
|
||||
|
||||
|
||||
uint16_t key;
|
||||
int new_gain;
|
||||
|
||||
@ -335,7 +335,7 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
|
||||
|
||||
if (cond & G_IO_NVAL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
if (cond & (G_IO_HUP | G_IO_ERR)) {
|
||||
error("Hangup or error on rfcomm server socket");
|
||||
goto failed;
|
||||
@ -871,7 +871,7 @@ static DBusHandlerResult device_connect(DBusConnection *conn,
|
||||
struct device *idev = data;
|
||||
|
||||
if (idev->pending_connect)
|
||||
return error_in_progress(conn, msg,
|
||||
return error_in_progress(conn, msg,
|
||||
"Device connection already in progress");
|
||||
|
||||
if (is_connected(idev))
|
||||
@ -887,7 +887,7 @@ static DBusHandlerResult device_connect(DBusConnection *conn,
|
||||
error("RFCOMM connect failed: %s(%d)", str, err);
|
||||
dbus_message_unref(idev->pending_connect);
|
||||
idev->pending_connect = NULL;
|
||||
return error_connection_attempt_failed(conn,
|
||||
return error_connection_attempt_failed(conn,
|
||||
msg, err);
|
||||
}
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
@ -987,7 +987,7 @@ static DBusHandlerResult device_get_name(DBusConnection *conn,
|
||||
struct device *idev = data;
|
||||
DBusMessage *reply;
|
||||
const char *pname = (idev->name ? idev->name : "");
|
||||
|
||||
|
||||
reply = dbus_message_new_method_return(msg);
|
||||
if (!reply)
|
||||
return DBUS_HANDLER_RESULT_NEED_MEMORY;
|
||||
|
@ -1154,7 +1154,7 @@ static int sbc_pack_frame(uint8_t *data, struct sbc_frame *frame, size_t len)
|
||||
}
|
||||
|
||||
/* align the last crc byte */
|
||||
if (crc_pos % 8)
|
||||
if (crc_pos % 8)
|
||||
crc_header[crc_pos >> 3] <<= 8 - (crc_pos % 8);
|
||||
|
||||
data[3] = sbc_crc8(crc_header, crc_pos);
|
||||
|
@ -64,7 +64,7 @@
|
||||
#define BUF_SIZE 1024
|
||||
|
||||
/* Waiting for udev to create the device node */
|
||||
#define MAX_OPEN_TRIES 5
|
||||
#define MAX_OPEN_TRIES 5
|
||||
#define OPEN_WAIT 300 /* ms */
|
||||
|
||||
struct pending_connect {
|
||||
@ -80,7 +80,7 @@ struct pending_connect {
|
||||
char *dev; /* tty device name */
|
||||
int id; /* RFCOMM device id */
|
||||
int ntries; /* Open attempts */
|
||||
int canceled; /* Operation canceled */
|
||||
int canceled; /* Operation canceled */
|
||||
};
|
||||
|
||||
/* FIXME: Common file required */
|
||||
@ -1646,7 +1646,7 @@ static DBusHandlerResult proxy_set_serial_params(DBusConnection *conn,
|
||||
struct proxy *prx = data;
|
||||
const char *ratestr, *paritystr;
|
||||
uint8_t databits, stopbits;
|
||||
tcflag_t ctrl; /* Control mode flags */
|
||||
tcflag_t ctrl; /* Control mode flags */
|
||||
speed_t speed = B0; /* In/Out speed */
|
||||
|
||||
/* Don't allow change TTY settings if it is open */
|
||||
@ -1691,7 +1691,7 @@ static DBusMethodVTable proxy_methods[] = {
|
||||
{ "Enable", proxy_enable, "", "" },
|
||||
{ "Disable", proxy_disable, "", "" },
|
||||
{ "GetInfo", proxy_get_info, "", "a{sv}" },
|
||||
{ "SetSerialParameters", proxy_set_serial_params, "syys", "" },
|
||||
{ "SetSerialParameters", proxy_set_serial_params, "syys", "" },
|
||||
{ NULL, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
|
@ -145,7 +145,7 @@ static DBusHandlerResult port_get_name(DBusConnection *conn,
|
||||
DBusMessage *reply;
|
||||
const char *pname;
|
||||
char *name = NULL;
|
||||
|
||||
|
||||
reply = dbus_message_new_method_return(msg);
|
||||
if (!reply)
|
||||
return DBUS_HANDLER_RESULT_NEED_MEMORY;
|
||||
|
@ -157,7 +157,7 @@ Methods: void Enable() [experimental]
|
||||
void Disable() [experimental]
|
||||
|
||||
Unregister the service record and stop listenning.
|
||||
|
||||
|
||||
Possible errors:org.bluez.Error.Failed
|
||||
|
||||
dict GetInfo() [experimental]
|
||||
|
Loading…
Reference in New Issue
Block a user