static struct gatt_request *create_request(struct bt_scpp *scpp, void *user_data) { struct gatt_request *req; DBG(""); req = new0(struct gatt_request, 1); if (!req) return NULL; req->user_data = user_data; req->scpp = bt_scpp_ref(scpp); return req; }
struct bt_scpp *bt_scpp_new(void *primary) { struct bt_scpp *scan; scan = g_try_new0(struct bt_scpp, 1); if (!scan) return NULL; scan->interval = SCAN_INTERVAL; scan->window = SCAN_WINDOW; scan->gatt_op = queue_new(); if (primary) scan->primary = g_memdup(primary, sizeof(*scan->primary)); return bt_scpp_ref(scan); }