OSDN Git Service

Fix incorrect enum comparison of LE close reason
authorAbhishek Pandit-Subedi <abhishekpandit@google.com>
Tue, 11 May 2021 17:20:36 +0000 (17:20 +0000)
committerChris Manton <cmanton@google.com>
Tue, 11 May 2021 20:05:32 +0000 (20:05 +0000)
commitd9709f256ac265e6943cdf53a2a3f8c8309dfb73
treee1efeb053d9e37af19884c8e6c1ba0e2fce0466c
parentc607a04361543cb60edec6c4370e34d10adc54e3
Fix incorrect enum comparison of LE close reason

The LE close reason is tGATT_DISCONN_REASON but it's compared against
tHCI_ERROR_CODE. Besides just being different types, they are also
backed by different primitives (u16 for gatt vs u8 for hci). This fails
in stricter build environments (i.e. ChromeOS).

Bug: 187836537
Tag: #floss
Test: atest --host bluetooth_test_gd
Change-Id: I0f926b6fad9f20adde5e1e7ff89bcc7c8da01f93
bta/hh/bta_hh_le.cc