Skip to content

Commit

Permalink
Hogp: Handle null characteristic during write report
Browse files Browse the repository at this point in the history
Handle null characteristic during write report.

CRs-fixed: 2692250
Change-Id: I8534116d58f9e596dd5e993e4735c2472018e834
  • Loading branch information
Nitin Shivpure committed May 22, 2020
1 parent ecae1df commit 3d532b5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bta/hh/bta_hh_le.cc
Original file line number Diff line number Diff line change
Expand Up @@ -696,11 +696,19 @@ bool bta_hh_le_write_rpt_clt_cfg(tBTA_HH_DEV_CB* p_cb);
static void write_rpt_ctl_cfg_cb(uint16_t conn_id, tGATT_STATUS status,
uint16_t handle, void* data) {
uint8_t srvc_inst_id, hid_inst_id;
uint16_t char_uuid;

tBTA_HH_DEV_CB* p_dev_cb = (tBTA_HH_DEV_CB*)data;
const gatt::Characteristic* characteristic =
BTA_GATTC_GetOwningCharacteristic(conn_id, handle);
uint16_t char_uuid = characteristic->uuid.As16Bit();

if (!characteristic) {
APPL_TRACE_ERROR("%s: error: characteristic not found for handle: %d"
", conn_id: %d, status: %d", __func__, handle, conn_id, status);
return;
} else {
char_uuid = characteristic->uuid.As16Bit();
}

const gatt::Service* service = BTA_GATTC_GetOwningService(conn_id, handle);
if (!service) {
Expand Down

0 comments on commit 3d532b5

Please sign in to comment.