From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [RFC 2/2] btproxy: Add three-wire (h5) protocol initial support
Date: Fri, 27 Nov 2015 14:40:02 +0200 [thread overview]
Message-ID: <20151127124000.GB26866@comms.fi.intel.com> (raw)
In-Reply-To: <F5FF8776-8359-4906-80C5-88B57E4CF898@holtmann.org>
Hi Marcel,
On Fri, Nov 27, 2015 at 04:25:30AM -0800, Marcel Holtmann wrote:
> >>>
> >>> #define BTPROTO_HCI 1
> >>> -struct sockaddr_hci {
> >>> - sa_family_t hci_family;
> >>> - unsigned short hci_dev;
> >>> - unsigned short hci_channel;
> >>> -};
> >>> #define HCI_CHANNEL_USER 1
> >>
> >> please do not do this.
> >
> > Why? I added #include "lib/hci.h" where this structure defined, why do
> > we need redefined it again? It was defined 3 times.
>
> we want to get rid of using libbluetooth over and over again. We need to start somewhere. And I have no idea on what you would gain from including lib/hci.h in this case.
I get packet types definitions from lib/hci.h. But since this would be
moved to h5.c this is not important anymore. I'll remove this chunk.
> >>
> >>> +
> >>> +struct h5_pkt {
> >>> + uint16_t len;
> >>> + uint8_t data[0];
> >>> +};
> >>
> >> I think using get_unaligned_le16 to get the length would be a lot simpler.
> >
> > Sorry, do not get this, how can we use get_unaligned_le16() ?
>
> len = get_unaligned_le16(buf)
This is just my packet, no need for le16 here. I can use of course just
uint8_t array and use first two bytes for length.
Best regards
Andrei Emeltchenko
> data = buf + 2
>
> Regards
>
> Marcel
>
next prev parent reply other threads:[~2015-11-27 12:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-26 15:23 [RFC 1/2] btproxy: Add support for creating pseudoterminal Andrei Emeltchenko
2015-11-26 15:23 ` [RFC 2/2] btproxy: Add three-wire (h5) protocol initial support Andrei Emeltchenko
2015-11-26 15:41 ` Marcel Holtmann
2015-11-27 10:30 ` Andrei Emeltchenko
2015-11-27 12:25 ` Marcel Holtmann
2015-11-27 12:40 ` Andrei Emeltchenko [this message]
2015-11-27 14:38 ` [PATCHv1 0/2] Three-wire (H5) support in btproxy Andrei Emeltchenko
2015-11-27 14:38 ` [PATCHv1 1/2] btproxy: Add support for creating pseudoterminal Andrei Emeltchenko
2015-11-27 14:38 ` [PATCHv1 2/2] btproxy: Add three-wire (h5) protocol initial support Andrei Emeltchenko
2015-11-27 14:56 ` Marcel Holtmann
2015-11-30 11:40 ` Andrei Emeltchenko
2015-11-30 13:49 ` [PATCHv2 0/2] Three-wire (H5) support in btproxy Andrei Emeltchenko
2015-11-30 13:49 ` [PATCHv2 1/2] btproxy: Add support for creating pseudoterminal Andrei Emeltchenko
2015-11-30 13:49 ` [PATCHv2 2/2] btproxy: Add three-wire (h5) protocol initial support Andrei Emeltchenko
2015-12-22 13:32 ` [PATCHv3 0/5] Three-wire (H5) support in btproxy Andrei Emeltchenko
2015-12-22 13:32 ` [PATCHv3 1/5] btproxy: Add support for creating pseudoterminal Andrei Emeltchenko
2015-12-22 13:32 ` [PATCHv3 2/5] btproxy: Add three-wire (h5) protocol initial support Andrei Emeltchenko
2015-12-22 13:32 ` [PATCHv3 3/5] btproxy: Fix possible string overflow Andrei Emeltchenko
2015-12-22 13:32 ` [PATCHv3 4/5] btproxy: Simplify Bluetooth proxy Andrei Emeltchenko
2015-12-22 13:32 ` [PATCHv3 5/5] btproxy: h5: Emulate packet loss Andrei Emeltchenko
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=20151127124000.GB26866@comms.fi.intel.com \
--to=andrei.emeltchenko.news@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
/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;
as well as URLs for NNTP newsgroup(s).