From: Marcel Holtmann <marcel@holtmann.org>
To: Scott James Remnant <scott@netsplit.com>
Cc: linux-bluetooth@vger.kernel.org, keybuk@chromium.org
Subject: Re: [RFC PATCH 1/3] lib: add header of device class constants
Date: Sat, 21 Jan 2012 17:30:53 +0100 [thread overview]
Message-ID: <1327163453.1955.43.camel@aeonflux> (raw)
In-Reply-To: <1327100744-28782-2-git-send-email-scott@netsplit.com>
Hi Scott,
> Makefile.am | 2 +-
> lib/bt_ids.h | 133 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 134 insertions(+), 1 deletions(-)
> create mode 100644 lib/bt_ids.h
>
> diff --git a/Makefile.am b/Makefile.am
> index 102ee62..8dbe603 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -59,7 +59,7 @@ plugin_LTLIBRARIES =
>
> lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h lib/mgmt.h \
> lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h lib/uuid.h \
> - lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h
> + lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h lib/bt_ids.h
> local_headers = $(foreach file,$(lib_headers), lib/bluetooth/$(notdir $(file)))
I rather not make this part of the library. We are actually trying to
shrink the library and not keep extending it. So put this file locally
in src/ where you use it.
> +
> +#ifndef __BT_IDS_H
> +#define __BT_IDS_H
Once it is local, please no circular inclusion protection. I wanna have
it fail badly if anybody things circular inclusion are acceptable.
> +
> +/* Service classes */
> +#define BLUETOOTH_SERVICE_CLASS_BITMASK 0xFFE000
> +#define BLUETOOTH_SERVICE_CLASS_LIMITED_DISCOVERABILITY 0x002000
> +#define BLUETOOTH_SERVICE_CLASS_POSITIONING 0x010000
> +#define BLUETOOTH_SERVICE_CLASS_NETWORKING 0x020000
> +#define BLUETOOTH_SERVICE_CLASS_RENDER 0x040000
> +#define BLUETOOTH_SERVICE_CLASS_CAPTURE 0x080000
> +#define BLUETOOTH_SERVICE_CLASS_OBJECT_TRANSFER 0x100000
> +#define BLUETOOTH_SERVICE_CLASS_AUDIO 0x200000
> +#define BLUETOOTH_SERVICE_CLASS_TELEPHONE 0x400000
> +#define BLUETOOTH_SERVICE_CLASS_INFORMATION 0x800000
> +
> +#define BLUETOOTH_SERVICE_CLASS(_class) \
> + ((_class) & BLUETOOTH_SERVICE_CLASS_BITMASK)
You might wanna think about shortening this a bit. Something like
BT_SVC_CLASS or similar.
Regards
Marcel
next prev parent reply other threads:[~2012-01-21 16:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-20 23:05 [RFC PATCH 0/3] Generate PIN for keyboards inside bluetoothd Scott James Remnant
2012-01-20 23:05 ` [RFC PATCH 1/3] lib: add header of device class constants Scott James Remnant
2012-01-21 16:30 ` Marcel Holtmann [this message]
2012-01-21 17:29 ` Scott James Remnant
2012-01-20 23:05 ` [RFC PATCH 2/3] agent: add DisplayPinCode method Scott James Remnant
2012-01-21 16:36 ` Marcel Holtmann
2012-01-23 6:08 ` Scott James Remnant
2012-01-20 23:05 ` [RFC PATCH 3/3] Implement HID profile recommendation for keyboards Scott James Remnant
2012-01-23 12:14 ` [RFC PATCH 0/3] Generate PIN for keyboards inside bluetoothd Bastien Nocera
2012-01-23 15:37 ` Scott James Remnant
2012-01-23 16:03 ` Bastien Nocera
2012-01-23 16:10 ` Scott James Remnant
2012-01-23 16:24 ` Bastien Nocera
2012-01-23 16:26 ` Scott James Remnant
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=1327163453.1955.43.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=keybuk@chromium.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=scott@netsplit.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;
as well as URLs for NNTP newsgroup(s).