From: "Geoffrey Doret" <gdoret@gmail.com>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] Patch proposal for serial manager
Date: Tue, 11 Dec 2007 12:00:13 +0100 [thread overview]
Message-ID: <3ad703600712110300j7a3e628cj1e4d55dd9d4a0d5b@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 349 bytes --]
Hello,
I have added a connect service method in the serial service manager that
take the address of an adapter as first parameter to be able to use more
than one adapter. I realy would like to contribute to bluez and see my patch
applied to the CVS. This is a first proposal, if you have any remarks, I
will take them into account.
Geoffrey Doret
[-- Attachment #1.2: Type: text/html, Size: 374 bytes --]
[-- Attachment #2: patch4 --]
[-- Type: application/octet-stream, Size: 3344 bytes --]
Index: utils/serial/manager.c
===================================================================
RCS file: /cvsroot/bluez/utils/serial/manager.c,v
retrieving revision 1.99
diff -u -r1.99 manager.c
--- utils/serial/manager.c 26 Nov 2007 13:43:57 -0000 1.99
+++ utils/serial/manager.c 11 Dec 2007 10:14:20 -0000
@@ -1917,26 +1917,43 @@
struct pending_connect *pending, *pc;
DBusError derr;
bdaddr_t src;
- const char *bda, *pattern;
+ const char *adapter, *bda, *pattern;
long val;
int dev_id, err;
char uuid[MAX_LEN_UUID_STR];
dbus_error_init(&derr);
- if (!dbus_message_get_args(msg, &derr,
- DBUS_TYPE_STRING, &bda,
- DBUS_TYPE_STRING, &pattern,
- DBUS_TYPE_INVALID)) {
- error_invalid_arguments(conn, msg, derr.message);
- dbus_error_free(&derr);
- return DBUS_HANDLER_RESULT_HANDLED;
+ if(dbus_message_has_signature(msg, "sss")) {
+ if (!dbus_message_get_args(msg, &derr,
+ DBUS_TYPE_STRING, &adapter,
+ DBUS_TYPE_STRING, &bda,
+ DBUS_TYPE_STRING, &pattern,
+ DBUS_TYPE_INVALID)) {
+ error_invalid_arguments(conn, msg, derr.message);
+ dbus_error_free(&derr);
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+ /* Handle empty adapter as the default */
+ if(!adapter[0])
+ adapter = NULL;
+ } else {
+ if (!dbus_message_get_args(msg, &derr,
+ DBUS_TYPE_STRING, &bda,
+ DBUS_TYPE_STRING, &pattern,
+ DBUS_TYPE_INVALID)) {
+ error_invalid_arguments(conn, msg, derr.message);
+ dbus_error_free(&derr);
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+ /* Use the default adapter */
+ adapter = NULL;
}
pending = find_pending_connect_by_pattern(bda, pattern);
if (pending)
return error_in_progress(conn, msg, "Connection in progress");
- dev_id = hci_get_route(NULL);
+ dev_id = adapter ? hci_devid(adapter) : hci_get_route(NULL);
if ((dev_id < 0) || (hci_devba(dev_id, &src) < 0))
return error_failed(conn, msg, "Adapter not available");
@@ -2146,6 +2163,7 @@
{ "ListProxies", list_proxies, "", "as" },
{ "RemoveProxy", remove_proxy, "s", "" },
{ "ConnectService", connect_service, "ss", "s" },
+ { "ConnectServiceToAdapter", connect_service, "sss", "s" },
{ "DisconnectService", disconnect_service, "s", "" },
{ "CancelConnectService", cancel_connect_service, "ss", "" },
{ NULL, NULL, NULL, NULL },
Index: utils/serial/serial-api.txt
===================================================================
RCS file: /cvsroot/bluez/utils/serial/serial-api.txt,v
retrieving revision 1.21
diff -u -r1.21 serial-api.txt
--- utils/serial/serial-api.txt 26 Nov 2007 13:41:39 -0000 1.21
+++ utils/serial/serial-api.txt 11 Dec 2007 10:14:20 -0000
@@ -67,6 +67,21 @@
org.bluez.Error.ConnectionAttemptFailed
org.bluez.Error.NotSupported
org.bluez.Error.Failed
+
+ string ConnectServiceToAdapter(string adapter, string address,
+ string pattern)
+
+ Connects to a specific RFCOMM based service on a
+ remote device using the specified adapter and then
+ creates a RFCOMM TTY device for it. The RFCOMM TTY
+ device is returned.
+
+ Possible errors:org.bluez.Error.InvalidArguments
+ org.bluez.Error.Canceled
+ org.bluez.Error.InProgress
+ org.bluez.Error.ConnectionAttemptFailed
+ org.bluez.Error.NotSupported
+ org.bluez.Error.Failed
void CancelConnectService(string address, string pattern)
[-- Attachment #3: Type: text/plain, Size: 277 bytes --]
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next reply other threads:[~2007-12-11 11:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-11 11:00 Geoffrey Doret [this message]
2007-12-13 16:15 ` [Bluez-devel] Patch proposal for serial manager Marcel Holtmann
2007-12-20 14:15 ` Geoffrey Doret
2007-12-20 15:17 ` Marcel Holtmann
2007-12-21 9:16 ` Geoffrey Doret
2007-12-21 9:17 ` Geoffrey Doret
2007-12-21 15:35 ` Geoffrey Doret
2007-12-21 21:20 ` Claudio Takahasi
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=3ad703600712110300j7a3e628cj1e4d55dd9d4a0d5b@mail.gmail.com \
--to=gdoret@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