static void foreach_deviceinfo_service(struct gatt_db_attribute *attr, void *user_data) { struct btd_device *device = user_data; gatt_db_service_foreach_char(attr, handle_characteristic, device); }
static bool create_characteristics(struct gatt_db_attribute *attr, struct service *service) { struct export_data data; data.root = service; data.failed = false; gatt_db_service_foreach_char(attr, export_char, &data); if (data.failed) return false; /* Obtain extended properties */ queue_foreach(service->pending_ext_props, read_ext_props, NULL); return true; }
static void print_service(struct gatt_db_attribute *attr, void *user_data) { struct server *server = user_data; uint16_t start, end; bool primary; bt_uuid_t uuid; if (!gatt_db_attribute_get_service_data(attr, &start, &end, &primary, &uuid)) return; printf(COLOR_RED "service" COLOR_OFF " - start: 0x%04x, " "end: 0x%04x, type: %s, uuid: ", start, end, primary ? "primary" : "secondary"); print_uuid(&uuid); gatt_db_service_foreach_incl(attr, print_incl, server); gatt_db_service_foreach_char(attr, print_chrc, NULL); printf("\n"); }
static void handle_gap_service(struct gas *gas) { gatt_db_service_foreach_char(gas->attr, handle_characteristic, gas); }