From: Marcel Holtmann <marcel@holtmann.org>
To: "Zhang, Zhenhua" <zhenhua.zhang@intel.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: RE: ioctl(RFCOMMCREATEDEV) failed: File descriptor in bad state
Date: Mon, 14 Sep 2009 06:28:20 -0700 [thread overview]
Message-ID: <1252934900.3421.12.camel@localhost.localdomain> (raw)
In-Reply-To: <0463F45F3606F4428ED35AC8C709F92E089A416114@pdsmsx502.ccr.corp.intel.com>
Hi,
> >> I am calling ioctl(RFCOMMCREATEDEV) to create tty device from a
> >> rfcomm fd using hands-free profile. If the HF send connection
> >> request to AG and make rfcomm connect, the tty could be made
> >> successfully. However, if the AG(mobile) side make request to create
> >> rfcomm connection, the rfcomm could be created but fail to create
> >> the tty device. The kernel returns error because socket is not
> >> connected, see below code. Any idea? Thanks much!
> >
> > why do you wanna create the TTY in the first place? Going via the TTY
> > layer is pretty bad idea. Don't even think about doing that. Use the
> > RFCOMM socket.
>
> I want to create TTY and expose it to Ofono as /dev/rfcomm0. Ofono side
> could treat bluetooth connection as a TTY device, and create
> GAtChat *chat by using g_at_chat_new_from_tty(tty, syntax).
and that is just wrong to begin with. Write an oFono plugin that uses
Bluetooth RFCOMM sockets directly. I really don't understand why you
wanna make your life so complicated. Within oFono you have to do a
non-blocking RFCOMM connect() anyway using GIOChannel. And once you have
the GIOChannel you can just hand it to g_at_chat_new(). Plain and
simple. Just extend modemconf.c to support a "bluetooth" driver and then
you can even configure address and channel.
Regards
Marcel
prev parent reply other threads:[~2009-09-14 13:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 10:02 ioctl(RFCOMMCREATEDEV) failed: File descriptor in bad state Zhang, Zhenhua
2009-09-14 11:01 ` Marcel Holtmann
2009-09-14 11:38 ` Zhang, Zhenhua
2009-09-14 13:28 ` 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=1252934900.3421.12.camel@localhost.localdomain \
--to=marcel@holtmann.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=zhenhua.zhang@intel.com \
/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