All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] ttyS0 problem
Date: Sun, 09 Oct 2005 18:45:03 +0200	[thread overview]
Message-ID: <1128876303.5536.2.camel@blade> (raw)
In-Reply-To: <001901c5ccef$f35b63b0$f7c4fea9@cmsrytxkk3p90i>

Hi David,

> I want to write some commands to the uart(ttyS0), but it fails.
> The steps are as follows:
>  
> 1. hciattach ttyS0 texas
> 2. Open ttyS0 device again and get a fd, init ttyS0 with speed,
> flow_ctl and so on,then write a command(0x30) to the fd but return
> 0; That is nothing is written to ttyS0.
>  
> If I write the same command  in the  function texas(int fd, struct
> uart_t *u, struct termios *ti), it succeeds.
> From bluez-utiles I see the following code which maybe
> the reason why I can't write the command to ttyS0 after running
> hciattach ttyS0 texas.
>  
> /* Set TTY to N_HCI line discipline */
>  i = N_HCI;
>  if (ioctl(fd, TIOCSETD, &i) < 0) {
>   perror("Can't set line discipline");
>   return -1;
>  }
>  
> It seems the codes is very important ,because if I delete these
> codes, the following codes can't run any more.
>  
> Is there any method that I can write the command to the ttyS0
> successfully after step 1?

after step 1, you  must use the HCI raw socket to send commands. What
commands do you wanna send?

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2005-10-09 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-09 16:38 [Bluez-devel] ttyS0 problem davidgchen
2005-10-09 16:45 ` Marcel Holtmann [this message]
     [not found] <1128906830.2417.1.camel@localhost.localdomain>
2005-10-10  1:53 ` david
2005-10-10  3:19   ` Marcel Holtmann
     [not found] <1129010637.2346.1.camel@localhost.localdomain>
2005-10-11  6:39 ` david

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=1128876303.5536.2.camel@blade \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.