public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Ionescu <i_p_a_u_l@yahoo.com>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] playing with handsfree program
Date: Wed, 12 Jan 2005 17:28:17 +0100	[thread overview]
Message-ID: <pan.2005.01.12.16.28.16.406386@yahoo.com> (raw)

Hi,

I am trying to use handsfree-040326.tar.gz from
http://140.78.95.100/~vogl/bluez/ to emulate a handsfree device with my
computer and BT adapter. 
I recompiled the program and tried to execute it but I receive imediately
a:
 ./handsfree test.wav 00:60:57:80:84:71 12
Voice setting: 0x0060
Can't connect RFCOMM channel: Invalid argument

I think it is because of recent changes in bluez-libs and utilities,
because a " rfcomm connect hci0 MY_BT_ADDR 12 " works just fine.

The problem I think is in rfcomm_connect() function from handsfree.c. I
will try to do more tests, but if somebody has an idea what might be
wrong, I will apreciate a hint.

I copy here the rfcomm_connect() function for readability.

static int rfcomm_connect(bdaddr_t *src, bdaddr_t *dst, uint8_t channel)
{
    struct sockaddr_rc addr;
    int s;

    if ((s = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) {
        return -1;
    }

    memset(&addr, 0, sizeof(addr));
    addr.rc_family = AF_BLUETOOTH;
    bacpy(&addr.rc_bdaddr, src);
    addr.rc_channel = 0;
    if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
        close(s); 
        return -1;
    }

    memset(&addr, 0, sizeof(addr));
    addr.rc_family = AF_BLUETOOTH;
    bacpy(&addr.rc_bdaddr, dst);
    addr.rc_channel = channel;
    if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0 ){
        close(s); 
        return -1;
    }

    return s;
}




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

             reply	other threads:[~2005-01-12 16:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-12 16:28 Paul Ionescu [this message]
2005-01-12 17:43 ` [Bluez-devel] playing with handsfree program 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=pan.2005.01.12.16.28.16.406386@yahoo.com \
    --to=i_p_a_u_l@yahoo.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