diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 5661e39..ff0c559 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
struct gatt_primary *hog_primary;
GSList *reports;
struct bt_uhid *uhid;
+ gboolean uhid_created;
gboolean has_report_id;
uint16_t bcdhid;
uint8_t bcountrycode;
struct hog_device *hogdev = report->hogdev;
uint8_t value[2];
+ if (!hogdev->uhid_created)
+ return;
+
if (!report->ccc_handle)
return;
ssize_t vlen;
char itemstr[20]; /* 5x3 (data) + 4 (continuation) + 1 (null) */
int i, err;
+ GSList *l;
if (status != 0) {
error("Report Map read failed: %s", att_ecode2str(status));
bt_uhid_register(hogdev->uhid, UHID_OUTPUT, forward_report, hogdev);
bt_uhid_register(hogdev->uhid, UHID_SET_REPORT, set_report, hogdev);
bt_uhid_register(hogdev->uhid, UHID_GET_REPORT, get_report, hogdev);
+
+ hogdev->uhid_created = TRUE;
+
+ for (l = hogdev->reports; l; l = l->next) {
+ struct report *r = l->data;
+
+ enable_report_notifications(r, true);
+ }
}
static void info_read_cb(guint8 status, const guint8 *pdu, guint16 plen,