diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2015-03-10 11:22:46 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2015-03-12 15:48:22 +0100 |
commit | 183c07ca92aae0da45c47e60d7a96c181494c523 (patch) | |
tree | 30085d557eec875396394e77455475846a7c1f90 /android/hal-gatt.c | |
parent | f004873ee211aeeb0849e32a404fa7c4ffd69bf3 (diff) | |
download | bluez-183c07ca92aae0da45c47e60d7a96c181494c523.tar.gz |
android/hal-gatt: Add support for server MTU changed callback
Diffstat (limited to 'android/hal-gatt.c')
-rw-r--r-- | android/hal-gatt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/android/hal-gatt.c b/android/hal-gatt.c index 438ad6194..f7217c789 100644 --- a/android/hal-gatt.c +++ b/android/hal-gatt.c @@ -641,6 +641,16 @@ static void handle_server_congestion(void *buf, uint16_t len, int fd) #endif } +static void handle_server_mtu_changed(void *buf, uint16_t len, int fd) +{ +#if ANDROID_VERSION >= PLATFORM_VER(5, 1, 0) + struct hal_ev_gatt_server_mtu_changed *ev = buf; + + if (cbs->server->mtu_changed_cb) + cbs->server->mtu_changed_cb(ev->conn_id, ev->mtu); +#endif +} + /* * handlers will be called from notification thread context, * index in table equals to 'opcode - HAL_MINIMUM_EVENT' @@ -784,6 +794,9 @@ static const struct hal_ipc_handler ev_handlers[] = { /* HAL_EV_GATT_SERVER_CONGESTION */ { handle_server_congestion, false, sizeof(struct hal_ev_gatt_server_congestion) }, + /* HAL_EV_GATT_SERVER_MTU_CHANGED */ + { handle_server_mtu_changed, false, + sizeof(struct hal_ev_gatt_server_mtu_changed) }, }; /* Client API */ |