Skip to contentSkip to conversation

Add enc_read_blob_req() as defined in BT Core v4.0

PATCH In review Brian Gix 2 participants 4 messages Dec 17, 2010 – Dec 19, 2010 Bluetooth drivers

lore
Share & tools
lore

Brian Gix

author
#0 lore raw

cover Add enc_read_blob_req() as defined in BT Core v4.0

Trivial addition of ATT API to encode READ_BLOB_REQ pkt.

--
Brian Gix
[email protected]
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

author
#1 lore raw

PATCH 1/1 Add enc_read_blob_req() as defined in BT Core Spec v4.0

---
 attrib/att.c |   19 +++++++++++++++++++
 attrib/att.h |    2 ++
 2 files changed, 21 insertions(+), 0 deletions(-)
attrib/att.c +19 -0
index 445b192..f8dbc02 100644
@@ -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);
attrib/att.h +2 -0
index 2c8c724..0b8612e 100644
@@ -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);
Signature · 1 line
1.7.2.2
#2 lore raw

Re: [PATCH] Add enc_read_blob_req() as defined in BT Core Spec v4.0

Hi Brian,

Quoted 4 lines · Brian Gix
---
 attrib/att.c |   19 +++++++++++++++++++
 attrib/att.h |    2 ++
 2 files changed, 21 insertions(+), 0 deletions(-)

The patch has been pushed upstream. Thanks.

Johan

author
#3 lore raw
In reply to Brian Gix

Hi All

Quoted 2 lines · Brian Gix

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.

Quoted 9 lines

--
Brian Gix
[email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html