OSDN Git Service

Suspend properly when receiving events without response
authorJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
Wed, 6 Jan 2016 07:27:51 +0000 (15:27 +0800)
committerAndre Eisenbach <eisenbach@google.com>
Wed, 17 Feb 2016 19:07:53 +0000 (11:07 -0800)
In the BTU handler for messages from the controller, rn event may be
received that the stack does not have to respond to. In this case, the
stack should go to sleep.

This patch calls the provided function in the BTU to enter sleep.

Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
Signed-off-by: Yingkai Cheng <yingkaix.cheng@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
Change-Id: Ie7c3fcae418eb2480338509e86b7cc870177a965

stack/btu/btu_task.c

index c8abc48..6c2a7a8 100644 (file)
@@ -120,6 +120,11 @@ static void btu_hci_msg_process(BT_HDR *p_msg) {
     {
         case BTU_POST_TO_TASK_NO_GOOD_HORRIBLE_HACK: // TODO(zachoverflow): remove this
             ((post_to_task_hack_t *)(&p_msg->data[0]))->callback(p_msg);
+#if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE)
+            /* If the host receives events which it doesn't responsd to, */
+            /* it should start an idle timer to enter sleep mode.        */
+            btu_check_bt_sleep ();
+#endif
             break;
         case BT_EVT_TO_BTU_HCI_ACL:
             /* All Acl Data goes to L2CAP */