diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-05-02 14:17:55 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-05-02 14:31:02 +0300 |
commit | 6a4d39d5cde11e5c495a1cb6832ea116a1f3582c (patch) | |
tree | 582cfaec3af765e43dd5c83931e136ee5ac2a2b4 | |
parent | 3da30441f59bbf0a9ace1c57b88b9739f81f073e (diff) |
Bluetooth: GATT: Fix error type
Callback errors should contain ATT error code not posix errors.
Change-Id: I698fac086ab8b2dca3487ab99ee974b4318d16f7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-rw-r--r-- | include/bluetooth/gatt.h | 4 | ||||
-rw-r--r-- | samples/bluetooth/peripheral/src/main.c | 4 | ||||
-rw-r--r-- | tests/bluetooth/shell/src/main.c | 2 | ||||
-rw-r--r-- | tests/bluetooth/tester/src/gatt.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/include/bluetooth/gatt.h b/include/bluetooth/gatt.h index 8879fa193..65187ef58 100644 --- a/include/bluetooth/gatt.h +++ b/include/bluetooth/gatt.h @@ -739,7 +739,7 @@ int bt_gatt_notify(struct bt_conn *conn, const struct bt_gatt_attr *attr, */ typedef void (*bt_gatt_indicate_func_t)(struct bt_conn *conn, const struct bt_gatt_attr *attr, - int err); + uint8_t err); /** @brief GATT Indicate Value parameters */ struct bt_gatt_indicate_params { @@ -870,7 +870,7 @@ struct bt_gatt_read_params; * @param data Attribute value data. NULL means read has completed. * @param length Attribute value length. */ -typedef uint8_t (*bt_gatt_read_func_t)(struct bt_conn *conn, int err, +typedef uint8_t (*bt_gatt_read_func_t)(struct bt_conn *conn, uint8_t err, struct bt_gatt_read_params *params, const void *data, uint16_t length); diff --git a/samples/bluetooth/peripheral/src/main.c b/samples/bluetooth/peripheral/src/main.c index f35e29c72..2834523b6 100644 --- a/samples/bluetooth/peripheral/src/main.c +++ b/samples/bluetooth/peripheral/src/main.c @@ -89,9 +89,9 @@ static void vnd_ccc_cfg_changed(uint16_t value) } static void indicate_cb(struct bt_conn *conn, const struct bt_gatt_attr *attr, - int err) + uint8_t err) { - printk("Indication %s\n", err < 0 ? "fail" : "success"); + printk("Indication %s\n", err != 0 ? "fail" : "success"); indicating = 0; } diff --git a/tests/bluetooth/shell/src/main.c b/tests/bluetooth/shell/src/main.c index 45313b598..f3cc2e3e2 100644 --- a/tests/bluetooth/shell/src/main.c +++ b/tests/bluetooth/shell/src/main.c @@ -758,7 +758,7 @@ done: static struct bt_gatt_read_params read_params; -static uint8_t read_func(struct bt_conn *conn, int err, +static uint8_t read_func(struct bt_conn *conn, uint8_t err, struct bt_gatt_read_params *params, const void *data, uint16_t length) { diff --git a/tests/bluetooth/tester/src/gatt.c b/tests/bluetooth/tester/src/gatt.c index fab4a6ae3..223883069 100644 --- a/tests/bluetooth/tester/src/gatt.c +++ b/tests/bluetooth/tester/src/gatt.c @@ -1187,7 +1187,7 @@ static void read_destroy(struct bt_gatt_read_params *params) gatt_buf_clear(); } -static uint8_t read_cb(struct bt_conn *conn, int err, +static uint8_t read_cb(struct bt_conn *conn, uint8_t err, struct bt_gatt_read_params *params, const void *data, uint16_t length) { |