summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-09-12 22:40:09 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-09-12 22:40:09 +0000
commitc38d98180b8d4bf18c54266a4b91a974f38dc5c0 (patch)
treeff4823340b29edb2e2ec3978d5c5f0705dab5372 /hcid
parent26410165076fc1bcbffef6f46c1843bf861b2e9c (diff)
Remove D-Bus 0.23 support
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus.c60
1 files changed, 1 insertions, 59 deletions
diff --git a/hcid/dbus.c b/hcid/dbus.c
index 5ffa97e2..2f66eae9 100644
--- a/hcid/dbus.c
+++ b/hcid/dbus.c
@@ -83,12 +83,7 @@ static void reply_handler_function(DBusPendingCall *call, void *user_data)
if (type != DBUS_TYPE_STRING)
goto error;
-#ifdef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
dbus_message_iter_get_basic(&iter, &pin);
-#else
- pin = dbus_message_iter_get_string(&iter);
-#endif
-
len = strlen(pin);
memset(&pr, 0, sizeof(pr));
@@ -116,13 +111,9 @@ static void free_pin_req(void *req)
void hcid_dbus_request_pin(int dev, struct hci_conn_info *ci)
{
DBusMessage *message;
-#ifdef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
- uint8_t *addr = (uint8_t *) &ci->bdaddr;
-#else
- DBusMessageIter iter;
-#endif
DBusPendingCall *pending = NULL;
struct pin_request *req;
+ uint8_t *addr = (uint8_t *) &ci->bdaddr;
message = dbus_message_new_method_call(SERVICE_NAME, PATH_NAME,
INTERFACE_NAME, REQUEST_NAME);
@@ -135,17 +126,9 @@ void hcid_dbus_request_pin(int dev, struct hci_conn_info *ci)
req->dev = dev;
bacpy(&req->bda, &ci->bdaddr);
-#ifdef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
dbus_message_append_args(message, DBUS_TYPE_BOOLEAN, &ci->out,
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
&addr, sizeof(bdaddr_t), DBUS_TYPE_INVALID);
-#else
- dbus_message_append_iter_init(message, &iter);
-
- dbus_message_iter_append_boolean(&iter, ci->out);
- dbus_message_iter_append_byte_array(&iter,
- (unsigned char *) &ci->bdaddr, sizeof(ci->bdaddr));
-#endif
if (dbus_connection_send_with_reply(connection, message,
&pending, TIMEOUT) == FALSE) {
@@ -171,9 +154,6 @@ failed:
void hcid_dbus_inquiry_start(bdaddr_t *local)
{
DBusMessage *message;
-#ifndef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
- DBusMessageIter iter;
-#endif
char *local_addr;
bdaddr_t tmp;
@@ -186,15 +166,9 @@ void hcid_dbus_inquiry_start(bdaddr_t *local)
goto failed;
}
-#ifdef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
dbus_message_append_args(message,
DBUS_TYPE_STRING, &local_addr,
DBUS_TYPE_INVALID);
-#else
- dbus_message_append_iter_init(message, &iter);
-
- dbus_message_iter_append_string(&iter, local_addr);
-#endif
if (dbus_connection_send(connection, message, NULL) == FALSE) {
syslog(LOG_ERR, "Can't send D-BUS inquiry start message");
@@ -214,9 +188,6 @@ failed:
void hcid_dbus_inquiry_complete(bdaddr_t *local)
{
DBusMessage *message;
-#ifndef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
- DBusMessageIter iter;
-#endif
char *local_addr;
bdaddr_t tmp;
@@ -229,15 +200,9 @@ void hcid_dbus_inquiry_complete(bdaddr_t *local)
goto failed;
}
-#ifdef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
dbus_message_append_args(message,
DBUS_TYPE_STRING, &local_addr,
DBUS_TYPE_INVALID);
-#else
- dbus_message_append_iter_init(message, &iter);
-
- dbus_message_iter_append_string(&iter, local_addr);
-#endif
if (dbus_connection_send(connection, message, NULL) == FALSE) {
syslog(LOG_ERR, "Can't send D-BUS inquiry complete message");
@@ -257,9 +222,6 @@ failed:
void hcid_dbus_inquiry_result(bdaddr_t *local, bdaddr_t *peer, uint32_t class, int8_t rssi)
{
DBusMessage *message;
-#ifndef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
- DBusMessageIter iter;
-#endif
char *local_addr, *peer_addr;
bdaddr_t tmp;
@@ -273,21 +235,12 @@ void hcid_dbus_inquiry_result(bdaddr_t *local, bdaddr_t *peer, uint32_t class, i
goto failed;
}
-#ifdef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
dbus_message_append_args(message,
DBUS_TYPE_STRING, &local_addr,
DBUS_TYPE_STRING, &peer_addr,
DBUS_TYPE_UINT32, &class,
DBUS_TYPE_INT32, &rssi,
DBUS_TYPE_INVALID);
-#else
- dbus_message_append_iter_init(message, &iter);
-
- dbus_message_iter_append_string(&iter, local_addr);
- dbus_message_iter_append_string(&iter, peer_addr);
- dbus_message_iter_append_uint32(&iter, class);
- dbus_message_iter_append_int32(&iter, rssi);
-#endif
if (dbus_connection_send(connection, message, NULL) == FALSE) {
syslog(LOG_ERR, "Can't send D-BUS inquiry result message");
@@ -308,9 +261,6 @@ failed:
void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, char *name)
{
DBusMessage *message;
-#ifndef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
- DBusMessageIter iter;
-#endif
char *local_addr, *peer_addr;
bdaddr_t tmp;
@@ -324,19 +274,11 @@ void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, char *name)
goto failed;
}
-#ifdef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
dbus_message_append_args(message,
DBUS_TYPE_STRING, &local_addr,
DBUS_TYPE_STRING, &peer_addr,
DBUS_TYPE_STRING, &name,
DBUS_TYPE_INVALID);
-#else
- dbus_message_append_iter_init(message, &iter);
-
- dbus_message_iter_append_string(&iter, local_addr);
- dbus_message_iter_append_string(&iter, peer_addr);
- dbus_message_iter_append_string(&iter, name);
-#endif
if (dbus_connection_send(connection, message, NULL) == FALSE) {
syslog(LOG_ERR, "Can't send D-BUS remote name message");