diff --git a/android/hog.c b/android/hog.c
index 8598c5b..abc625c 100644
--- a/android/hog.c
+++ b/android/hog.c
report_ccc_written_cb, user_data);
}
+static void ccc_read_cb(guint8 status, const guint8 *pdu, guint16 len,
+ gpointer user_data)
+{
+ struct report *report = user_data;
+
+ if (status != 0) {
+ error("Error reading CCC value: %s", att_ecode2str(status));
+ return;
+ }
+
+ write_ccc(report->hog->attrib, report->ccc_handle, report);
+}
+
static void report_reference_cb(guint8 status, const guint8 *pdu,
guint16 plen, gpointer user_data)
{
/* Enable notifications only for Input Reports */
if (report->type == HOG_REPORT_TYPE_INPUT)
- write_ccc(report->hog->attrib, report->ccc_handle, report);
+ gatt_read_char(report->hog->attrib, report->ccc_handle,
+ ccc_read_cb, report);
}
static void external_report_reference_cb(guint8 status, const guint8 *pdu,