Commit: cffdf1b687cec95448a0ae05498a8a48b2b3c5f6
Parent: 227370ec54f2e18847e9b9087fed6a1a7d58ba22
Author: Arman Uguray <armansito@chromium.org>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2014-11-14 15:10:23
Tree: 7ced048165228431444b97c936db3c4a611119de

shared/att: Add API for sending ATT error response This patch adds bt_att_send_error_rsp which sends an ATT protocol error response PDU over the underlying link based on the parameters that are passed to it. This is a useful function since it reduces a lot of repeated code in shared/gatt-server that does the same thing. The "error" parameter is expressed as a signed integer (in line with the new shared/gatt-db APIs). bt_att_send_error_rsp correctly maps this (including possible UNIX errnos) to ATT protocol error codes. In addition, struct bt_att_pdu_error_rsp is introduced to represent a packed error response PDU which can be sent directly over the wire once properly encoded in network order.

Diffstat

M src/shared/att-types.h | 12 ++++++++++++
M src/shared/att.c | 60 ++++++++++++++++++++++++++++++++++++++++-
M src/shared/att.h | 3 +++
M src/shared/gatt-client.c | 8 ++++++- -
M src/shared/gatt-helpers.c | 8 ++++++- -
M src/shared/gatt-server.c | 208 ++++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

6 files changed, 145 insertions(+), 154 deletions(-)

View Full Diff | Patch