linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Claudio Takahasi" <cktakahasi@gmail.com>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] [DBUS PATCH] BondingCreated && BondingFailed
Date: Mon, 20 Feb 2006 10:58:57 -0300	[thread overview]
Message-ID: <e1effdeb0602200558l7946fa17ubdb3042e5014dc9e@mail.gmail.com> (raw)
In-Reply-To: <1140201999.4747.16.camel@aeonflux.holtmann.net>

[-- Attachment #1: Type: text/plain, Size: 1741 bytes --]

Hi Marcel,


On 2/17/06, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Claudio,
>
> > Here is another small patch...
> >
> > According with the BlueZ D-Bus API the bonding result must be sent
> > using the BondingCreated and BondingFailed signals.
> >
> > In the current code, the bonding result the status is added in the
> > signal argument.
>
> do something like
>
> signal = status ? DEV_SIG_BONDING_CREATED : DEV_SIG_BONDING_FAILED;
>
> and then call it with dbus_message_new_signal(..., signal).
>
> This end up in cleaner code and is easier to understand later.
[Claudio Takahasi]
Modification done!

>
> > The next step is start the development of the missing bonding
> > services: RemoveBonding, HasBonding and ListBonding.
>
> The textfile library should have all stuff for it all ready. So it
> should be really easy to add.
[Claudio Takahasi]
I've never checked the textfile functions. I will try understand the
implemented functions and send you new patches soon.

Regards,
Claudio.

>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>


--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT

[-- Attachment #2: bonding-signal01.patch --]
[-- Type: text/x-patch, Size: 1145 bytes --]

--- bluez-utils-cvs.orig/hcid/dbus.c	2006-02-17 15:57:24.000000000 -0200
+++ bluez-utils-cvs-bonding/hcid/dbus.c	2006-02-20 07:39:56.000000000 -0300
@@ -453,6 +453,7 @@
 {
 	DBusMessage *message = NULL;
 	char *local_addr, *peer_addr;
+	const char *name;
 	bdaddr_t tmp;
 	char path[MAX_PATH_LENGTH];
 	int id;
@@ -468,17 +469,21 @@
 
 	snprintf(path, sizeof(path), "%s/hci%d", DEVICE_PATH, id);
 
-	message = dbus_message_new_signal(path, DEVICE_INTERFACE,
-						DEV_SIG_BONDING_CREATED);
+	/*
+	 * 0x00: authentication request successfully completed
+	 * 0x01-0x0F: authentication request failed
+	 */
+	name = ( !status? DEV_SIG_BONDING_CREATED : DEV_SIG_BONDING_FAILED);
+
+	message = dbus_message_new_signal(path, DEVICE_INTERFACE, name);
+
 	if (message == NULL) {
 		syslog(LOG_ERR, "Can't allocate D-BUS remote name message");
 		goto failed;
 	}
 
-	/*FIXME: create the signal based on status value - BondingCreated or BondingFailed*/
 	dbus_message_append_args(message,
 					DBUS_TYPE_STRING, &peer_addr,
-					DBUS_TYPE_BYTE, &status,
 					DBUS_TYPE_INVALID);
 
 	if (dbus_connection_send(connection, message, NULL) == FALSE) {




  reply	other threads:[~2006-02-20 13:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-17 18:07 [Bluez-devel] [DBUS PATCH] BondingCreated && BondingFailed Claudio Takahasi
2006-02-17 18:46 ` Marcel Holtmann
2006-02-20 13:58   ` Claudio Takahasi [this message]
2006-02-20 14:10     ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1effdeb0602200558l7946fa17ubdb3042e5014dc9e@mail.gmail.com \
    --to=cktakahasi@gmail.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).