From: David Stockwell <dstockwell@frequency-one.com>
To: linux-bluetooth@vger.kernel.org
Cc: lucas.demarchi@profusion.mobi, luiz.dentz@gmail.com,
david_stockwell@att.net
Subject: [PATCH 2/5] Added structs for AVRCP baseline messages
Date: Thu, 11 Aug 2011 09:13:19 -0500 [thread overview]
Message-ID: <201108110913.20006.dstockwell@frequency-one.com> (raw)
Added structs for AVRCP baseline messages:
UnitInfo, SubUnitInfo, Passthrough and Vendor Dependent
Based on Release 4.96
---
audio/control.c | 92
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 92 insertions(+), 0 deletions(-)
diff --git a/audio/control.c b/audio/control.c
index 188297a..8ddcc10 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -282,6 +282,98 @@ struct avrcp_spec_avc_pdu {
#error "Unknown byte order"
#endif
+/* structs for AVRCP UnitInfo, SubUnitInfo, and Passthrough messages. */
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+
+struct avrcp_unitinfo {
+ struct avrcp_header hdr;
+ uint8_t ext_code;
+ uint8_t unit:3;
+ uint8_t unit_type:5;
+ uint8_t company_id[3];
+} __attribute__ ((packed));
+
+struct avrcp_subunit {
+ uint8_t subunit_id_max:3;
+ uint8_t subunit_type:5;
+} __attribute__ ((packed));
+
+struct avrcp_subunitinfo {
+ struct avrcp_header hdr;
+ uint8_t extension:3;
+ uint8_t _rs1:1;
+ uint8_t page:3;
+ uint8_t _rs0:1;
+ struct avrcp_subunit subunit[4];
+} __attribute__ ((packed));
+
+struct avrcp_passthru {
+ struct avrcp_header hdr;
+ uint8_t key:7;
+ uint8_t key_state:1;
+ uint8_t op_len; /* =length(company_id+op_data) */
+ uint8_t company_id[3];
+ uint8_t op_data[];
+} __attribute__ ((packed));
+
+struct avrcp_vendor_dep {
+ struct avrcp_header hdr;
+ uint8_t company_id[3];
+ uint8_t pdu_id;
+ uint8_t packet_type:2;
+ uint8_t _reserved:6;
+ uint16_t length;
+ uint8_t pdu_data[];
+} __attribute__ ((packed));
+
+#elif __BYTE_ORDER == __BIG_ENDIAN
+
+struct avrcp_unitinfo {
+ struct avrcp_header hdr;
+ uint8_t ext_code;
+ uint8_t unit_type:5;
+ uint8_t unit:3;
+ uint8_t company_id[3];
+} __attribute__ ((packed));
+
+struct avrcp_subunit {
+ uint8_t subunit_type:5;
+ uint8_t subunit_id_max:3;
+} __attribute__ ((packed));
+
+struct avrcp_subunitinfo {
+ struct avrcp_header hdr;
+ uint8_t _rs0:1;
+ uint8_t page:3;
+ uint8_t _rs1:1;
+ uint8_t extension:3;
+ struct avrcp_subunit subunit[4];
+} __attribute__ ((packed));
+
+struct avrcp_passthru {
+ struct avrcp_header hdr;
+ uint8_t key_state:1;
+ uint8_t key:7;
+ uint8_t op_len; /* =length(company_id+op_data) */
+ uint8_t company_id[3];
+ uint8_t op_data[];
+} __attribute__ ((packed));
+
+struct avrcp_vendor_dep {
+ struct avrcp_header hdr;
+ uint8_t company_id[3];
+ uint8_t pdu_id;
+ uint8_t _reserved:6;
+ uint8_t packet_type:2;
+ uint16_t length;
+ uint8_t pdu_data[];
+} __attribute__ ((packed));
+
+#else
+#error "Unknown byte order"
+#endif
+
struct avctp_state_callback {
avctp_state_cb cb;
void *user_data;
--
1.7.4.4
reply other threads:[~2011-08-11 14:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=201108110913.20006.dstockwell@frequency-one.com \
--to=dstockwell@frequency-one.com \
--cc=david_stockwell@att.net \
--cc=linux-bluetooth@vger.kernel.org \
--cc=lucas.demarchi@profusion.mobi \
--cc=luiz.dentz@gmail.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).