* [PATCH 0/1] Add enc_read_blob_req() as defined in BT Core v4.0 @ 2010-12-17 19:08 Brian Gix 2010-12-17 19:08 ` [PATCH] Add enc_read_blob_req() as defined in BT Core Spec v4.0 Brian Gix 2010-12-17 21:01 ` [PATCH 0/1] Add enc_read_blob_req() as defined in BT Core v4.0 Brian Gix 0 siblings, 2 replies; 4+ messages in thread From: Brian Gix @ 2010-12-17 19:08 UTC (permalink / raw) Cc: rshaffer, padovan, linux-bluetooth Trivial addition of ATT API to encode READ_BLOB_REQ pkt. -- Brian Gix bgix@codeaurora.org Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Add enc_read_blob_req() as defined in BT Core Spec v4.0 2010-12-17 19:08 [PATCH 0/1] Add enc_read_blob_req() as defined in BT Core v4.0 Brian Gix @ 2010-12-17 19:08 ` Brian Gix 2010-12-19 12:13 ` Johan Hedberg 2010-12-17 21:01 ` [PATCH 0/1] Add enc_read_blob_req() as defined in BT Core v4.0 Brian Gix 1 sibling, 1 reply; 4+ messages in thread From: Brian Gix @ 2010-12-17 19:08 UTC (permalink / raw) Cc: rshaffer, padovan, linux-bluetooth, Brian Gix --- attrib/att.c | 19 +++++++++++++++++++ attrib/att.h | 2 ++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/attrib/att.c b/attrib/att.c index 445b192..f8dbc02 100644 --- a/attrib/att.c +++ b/attrib/att.c @@ -542,6 +542,25 @@ uint16_t enc_read_req(uint16_t handle, uint8_t *pdu, int len) return min_len; } +uint16_t enc_read_blob_req(uint16_t handle, uint16_t offset, uint8_t *pdu, + int len) +{ + const uint16_t min_len = sizeof(pdu[0]) + sizeof(handle) + + sizeof(offset); + + if (pdu == NULL) + return 0; + + if (len < min_len) + return 0; + + pdu[0] = ATT_OP_READ_BLOB_REQ; + att_put_u16(handle, &pdu[1]); + att_put_u16(offset, &pdu[3]); + + return min_len; +} + uint16_t dec_read_req(const uint8_t *pdu, int len, uint16_t *handle) { const uint16_t min_len = sizeof(pdu[0]) + sizeof(*handle); diff --git a/attrib/att.h b/attrib/att.h index 2c8c724..0b8612e 100644 --- a/attrib/att.h +++ b/attrib/att.h @@ -202,6 +202,8 @@ uint16_t enc_write_req(uint16_t handle, const uint8_t *value, int vlen, uint16_t dec_write_req(const uint8_t *pdu, int len, uint16_t *handle, uint8_t *value, int *vlen); uint16_t enc_read_req(uint16_t handle, uint8_t *pdu, int len); +uint16_t enc_read_blob_req(uint16_t handle, uint16_t offset, uint8_t *pdu, + int len); uint16_t dec_read_req(const uint8_t *pdu, int len, uint16_t *handle); uint16_t enc_read_resp(uint8_t *value, int vlen, uint8_t *pdu, int len); uint16_t dec_read_resp(const uint8_t *pdu, int len, uint8_t *value, int *vlen); -- 1.7.2.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Add enc_read_blob_req() as defined in BT Core Spec v4.0 2010-12-17 19:08 ` [PATCH] Add enc_read_blob_req() as defined in BT Core Spec v4.0 Brian Gix @ 2010-12-19 12:13 ` Johan Hedberg 0 siblings, 0 replies; 4+ messages in thread From: Johan Hedberg @ 2010-12-19 12:13 UTC (permalink / raw) To: Brian Gix; +Cc: rshaffer, padovan, linux-bluetooth Hi Brian, On Fri, Dec 17, 2010, Brian Gix wrote: > --- > attrib/att.c | 19 +++++++++++++++++++ > attrib/att.h | 2 ++ > 2 files changed, 21 insertions(+), 0 deletions(-) The patch has been pushed upstream. Thanks. Johan ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/1] Add enc_read_blob_req() as defined in BT Core v4.0 2010-12-17 19:08 [PATCH 0/1] Add enc_read_blob_req() as defined in BT Core v4.0 Brian Gix 2010-12-17 19:08 ` [PATCH] Add enc_read_blob_req() as defined in BT Core Spec v4.0 Brian Gix @ 2010-12-17 21:01 ` Brian Gix 1 sibling, 0 replies; 4+ messages in thread From: Brian Gix @ 2010-12-17 21:01 UTC (permalink / raw) To: linux-bluetooth Hi All On Fri, 2010-12-17 at 11:08 -0800, Brian Gix wrote: > Trivial addition of ATT API to encode READ_BLOB_REQ pkt. > I apologize for messing up what must seem to be trivial rules for what information to put where in the patches I am trying to get incorporated. This particular patch is in fact a trivial addition to the ATT code, which I believe probably is identical in all respects (including WS I hope) to how anyone else here would have implemented it. My follow on to this will be multi-step GATT procedures, I am going to try as an RFC first, as the concept of GATT procedures that contain more than one ATT Request/Response will be something that undoubtedly will cause people to want to offer input on. I also apologize for the sporadic nature of communication this week, as my workstation had a catastrophic failure which is taking some time to recover from. > -- > Brian Gix > bgix@codeaurora.org > Employee of Qualcomm Innovation Center, Inc. > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum > -- > To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-19 12:13 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-12-17 19:08 [PATCH 0/1] Add enc_read_blob_req() as defined in BT Core v4.0 Brian Gix 2010-12-17 19:08 ` [PATCH] Add enc_read_blob_req() as defined in BT Core Spec v4.0 Brian Gix 2010-12-19 12:13 ` Johan Hedberg 2010-12-17 21:01 ` [PATCH 0/1] Add enc_read_blob_req() as defined in BT Core v4.0 Brian Gix
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).