public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] Error in rfcomm command
Date: Sun, 21 Nov 2004 17:59:52 +0100	[thread overview]
Message-ID: <1101056392.7250.23.camel@pegasus> (raw)
In-Reply-To: <41A081D2.4060503@gmx.net>

Hi Dieter,

> 1. rfcomm connect
> 
> If I want to connect to a device wich has an entry in rfcomm.conf with 
> "rfcomm connect rfcomm0" I get the message "Can't find a config entry 
> for rfcomm0"! I think it's an error in function "cmd_connect" 
> (./bluez-utils-2.11/rfcomm/main.c):
> 
> static void cmd_connect(int ctl, int dev, bdaddr_t *bdaddr, int argc, 
> char **argv)
> {
> 	struct sockaddr_rc laddr, raddr;
> ...
> 	
> 	if (argc < 2) {
> 		if (rfcomm_read_config(rfcomm_config_file) < 0) {
> 			perror("Can't open RFCOMM config file");
> 			return;
> 		}
> 
> 		raddr.rc_family = AF_BLUETOOTH;
> 		bacpy(&raddr.rc_bdaddr, &rfcomm_opts[dev].bdaddr);
> 		raddr.rc_channel = rfcomm_opts[dev].channel;
> 		
> // wrong:	if (bacmp(&req.dst, BDADDR_ANY) == 0) {
> // must be:
> 		if (bacmp(&raddr.rc_bdaddr, BDADDR_ANY) == 0) {
> 			fprintf(stderr, "Can't find a config entry for rfcomm%d\n", dev);
> 
> 			return;
> 		}
> 	} else {
> 		raddr.rc_family = AF_BLUETOOTH;
> ...

it thought I tested this and it always worked for me. However you are
right and it is fixed in CVS now. Next time send a unified diff, because
it is easier to read.

> 2. rfcomm bind
> 
> If I execute "rfcomm bind rfcomm0" prior to "rfcomm connect rfcomm0" I 
> get the message "Can't connect RFCOMM socket: Host is down"!
> After a "rfcomm release rfcomm0" and a repeated "rfcomm connect rfcomm0" 
> the connection will establish.

I don't know why it shows "Host is down", but you can't connect and bind
the same RFCOMM TTY at the same time. If you binded it, then you should
open the TTY to get the connection.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

      reply	other threads:[~2004-11-21 16:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-21 11:53 [Bluez-devel] Error in rfcomm command Dieter Wirtz
2004-11-21 16:59 ` Marcel Holtmann [this message]

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=1101056392.7250.23.camel@pegasus \
    --to=marcel@holtmann.org \
    --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