From 65d1c84f5b4c2d452b4927ab7f8670a4951db3ce Mon Sep 17 00:00:00 2001 From: tturney Date: Mon, 31 Aug 2015 15:16:59 -0700 Subject: [PATCH] Fix btwrite timer timeout for Angler (2/2) When calculating the appropriate LPM's idle timeout, the local chip name was NULL. This is fixed by calculating LMP's idle timeout when the chip is enabling. Bug: 23248798 Change-Id: I8ee2b28fb4363359e035e242fdcff8a736ee448c --- hci/src/low_power_manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hci/src/low_power_manager.c b/hci/src/low_power_manager.c index 9435e4fe1..f5345ef4e 100644 --- a/hci/src/low_power_manager.c +++ b/hci/src/low_power_manager.c @@ -79,7 +79,6 @@ static void init(thread_t *post_thread) { thread = post_thread; vendor->set_callback(VENDOR_SET_LPM_MODE, vendor_enable_disable_callback); - vendor->send_command(VENDOR_GET_LPM_IDLE_TIMEOUT, &idle_timeout_ms); idle_alarm = alarm_new(); if (!idle_alarm) { @@ -147,6 +146,8 @@ static void enable(bool enable) { } else { uint8_t command = enable ? BT_VND_LPM_ENABLE : BT_VND_LPM_DISABLE; state = enable ? LPM_ENABLING : LPM_DISABLING; + if (state == LPM_ENABLING) + vendor->send_command(VENDOR_GET_LPM_IDLE_TIMEOUT, &idle_timeout_ms); vendor->send_async_command(VENDOR_SET_LPM_MODE, &command); } } -- 2.11.0