Lines Matching refs:role
135 static bool valid_gmap_role(enum bt_gmap_role role) in valid_gmap_role() argument
137 if (role == 0 || (role & BT_GMAP_ROLE_MASK) != role) { in valid_gmap_role()
138 LOG_DBG("Invalid role %d", role); in valid_gmap_role()
141 if ((role & BT_GMAP_ROLE_UGG) != 0 && !IS_ENABLED(CONFIG_BT_GMAP_UGG_SUPPORTED)) { in valid_gmap_role()
147 if ((role & BT_GMAP_ROLE_UGT) != 0 && !IS_ENABLED(CONFIG_BT_GMAP_UGT_SUPPORTED)) { in valid_gmap_role()
153 if ((role & BT_GMAP_ROLE_BGS) != 0 && !IS_ENABLED(CONFIG_BT_GMAP_BGS_SUPPORTED)) { in valid_gmap_role()
159 if ((role & BT_GMAP_ROLE_BGR) != 0 && !IS_ENABLED(CONFIG_BT_GMAP_BGR_SUPPORTED)) { in valid_gmap_role()
168 static bool valid_gmap_features(enum bt_gmap_role role, struct bt_gmap_feat features) in valid_gmap_features() argument
172 if ((role & BT_GMAP_ROLE_UGG) != 0) { in valid_gmap_features()
206 if ((role & BT_GMAP_ROLE_UGT) != 0) { in valid_gmap_features()
278 if ((role & BT_GMAP_ROLE_BGR) != 0 && !IS_ENABLED(CONFIG_BT_GMAP_BGR_SUPPORTED) && in valid_gmap_features()
288 if ((role & BT_GMAP_ROLE_BGR) != 0) { in valid_gmap_features()
310 static void update_service(enum bt_gmap_role role) in update_service() argument
317 if (role & BT_GMAP_ROLE_UGG) { in update_service()
324 if (role & BT_GMAP_ROLE_UGT) { in update_service()
331 if (role & BT_GMAP_ROLE_BGS) { in update_service()
338 if (role & BT_GMAP_ROLE_BGR) { in update_service()
345 int bt_gmap_register(enum bt_gmap_role role, struct bt_gmap_feat features) in bt_gmap_register() argument
349 CHECKIF(!valid_gmap_role(role)) { in bt_gmap_register()
350 LOG_DBG("Invalid role: %d", role); in bt_gmap_register()
355 CHECKIF(!valid_gmap_features(role, features)) { in bt_gmap_register()
361 update_service(role); in bt_gmap_register()
370 gmap_role = role; in bt_gmap_register()
376 int bt_gmap_set_role(enum bt_gmap_role role, struct bt_gmap_feat features) in bt_gmap_set_role() argument
386 CHECKIF(!valid_gmap_role(role)) { in bt_gmap_set_role()
387 LOG_DBG("Invalid role: %d", role); in bt_gmap_set_role()
392 CHECKIF(!valid_gmap_features(role, features)) { in bt_gmap_set_role()
398 if (gmap_role == role) { in bt_gmap_set_role()
420 err = bt_gmap_register(role, gmap_features); in bt_gmap_set_role()