Lines Matching full:inst
40 static int aics_client_common_control(uint8_t opcode, struct bt_aics *inst);
62 struct bt_aics *inst; in aics_client_notify_handler() local
70 inst = lookup_aics_by_handle(conn, handle); in aics_client_notify_handler()
72 if (!inst) { in aics_client_notify_handler()
81 if (handle == inst->cli.state_handle) { in aics_client_notify_handler()
84 LOG_DBG("Inst %p: Gain %d, mute %u, gain_mode %u, counter %u", inst, in aics_client_notify_handler()
87 inst->cli.change_counter = state->change_counter; in aics_client_notify_handler()
89 if (inst->cli.cb && inst->cli.cb->state) { in aics_client_notify_handler()
90 inst->cli.cb->state(inst, 0, state->gain, in aics_client_notify_handler()
95 } else if (handle == inst->cli.status_handle) { in aics_client_notify_handler()
98 LOG_DBG("Inst %p: Status %u", inst, *status); in aics_client_notify_handler()
99 if (inst->cli.cb && inst->cli.cb->status) { in aics_client_notify_handler()
100 inst->cli.cb->status(inst, 0, *status); in aics_client_notify_handler()
103 } else if (handle == inst->cli.desc_handle) { in aics_client_notify_handler()
115 LOG_DBG("Inst %p: Input description: %s", inst, desc); in aics_client_notify_handler()
116 if (inst->cli.cb && inst->cli.cb->description) { in aics_client_notify_handler()
117 inst->cli.cb->description(inst, 0, desc); in aics_client_notify_handler()
129 struct bt_aics *inst = lookup_aics_by_handle(conn, params->single.handle); in aics_client_read_state_cb() local
134 if (!inst) { in aics_client_read_state_cb()
139 LOG_DBG("Inst %p: err: 0x%02X", inst, err); in aics_client_read_state_cb()
140 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in aics_client_read_state_cb()
144 if (inst->cli.cb && inst->cli.cb->state) { in aics_client_read_state_cb()
145 inst->cli.cb->state(inst, cb_err, 0, 0, 0); in aics_client_read_state_cb()
155 inst->cli.change_counter = state->change_counter; in aics_client_read_state_cb()
165 if (inst->cli.cb && inst->cli.cb->state) { in aics_client_read_state_cb()
166 inst->cli.cb->state(inst, cb_err, state->gain, in aics_client_read_state_cb()
178 struct bt_aics *inst = lookup_aics_by_handle(conn, params->single.handle); in aics_client_read_gain_settings_cb() local
183 if (!inst) { in aics_client_read_gain_settings_cb()
188 LOG_DBG("Inst %p: err: 0x%02X", inst, err); in aics_client_read_gain_settings_cb()
189 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in aics_client_read_gain_settings_cb()
193 if (inst->cli.cb && inst->cli.cb->gain_setting) { in aics_client_read_gain_settings_cb()
194 inst->cli.cb->gain_setting(inst, cb_err, 0, 0, 0); in aics_client_read_gain_settings_cb()
212 if (inst->cli.cb && inst->cli.cb->gain_setting) { in aics_client_read_gain_settings_cb()
213 inst->cli.cb->gain_setting(inst, cb_err, gain_settings->units, in aics_client_read_gain_settings_cb()
227 struct bt_aics *inst = lookup_aics_by_handle(conn, params->single.handle); in aics_client_read_type_cb() local
231 if (!inst) { in aics_client_read_type_cb()
236 LOG_DBG("Inst %p: err: 0x%02X", inst, err); in aics_client_read_type_cb()
237 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in aics_client_read_type_cb()
241 if (inst->cli.cb && inst->cli.cb->type) { in aics_client_read_type_cb()
242 inst->cli.cb->type(inst, cb_err, 0); in aics_client_read_type_cb()
259 if (inst->cli.cb && inst->cli.cb->type) { in aics_client_read_type_cb()
260 inst->cli.cb->type(inst, cb_err, *type); in aics_client_read_type_cb()
272 struct bt_aics *inst = lookup_aics_by_handle(conn, params->single.handle); in aics_client_read_status_cb() local
276 if (!inst) { in aics_client_read_status_cb()
281 LOG_DBG("Inst %p: err: 0x%02X", inst, err); in aics_client_read_status_cb()
282 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in aics_client_read_status_cb()
286 if (inst->cli.cb && inst->cli.cb->status) { in aics_client_read_status_cb()
287 inst->cli.cb->status(inst, cb_err, 0); in aics_client_read_status_cb()
304 if (inst->cli.cb && inst->cli.cb->status) { in aics_client_read_status_cb()
305 inst->cli.cb->status(inst, cb_err, *status); in aics_client_read_status_cb()
311 static void aics_cp_notify_app(struct bt_aics *inst, uint8_t err) in aics_cp_notify_app() argument
313 if (!inst->cli.cb) { in aics_cp_notify_app()
317 switch (inst->cli.cp_val.cp.opcode) { in aics_cp_notify_app()
319 if (inst->cli.cb->set_gain) { in aics_cp_notify_app()
320 inst->cli.cb->set_gain(inst, err); in aics_cp_notify_app()
324 if (inst->cli.cb->unmute) { in aics_cp_notify_app()
325 inst->cli.cb->unmute(inst, err); in aics_cp_notify_app()
329 if (inst->cli.cb->mute) { in aics_cp_notify_app()
330 inst->cli.cb->mute(inst, err); in aics_cp_notify_app()
334 if (inst->cli.cb->set_manual_mode) { in aics_cp_notify_app()
335 inst->cli.cb->set_manual_mode(inst, err); in aics_cp_notify_app()
339 if (inst->cli.cb->set_auto_mode) { in aics_cp_notify_app()
340 inst->cli.cb->set_auto_mode(inst, err); in aics_cp_notify_app()
344 LOG_DBG("Unknown opcode 0x%02x", inst->cli.cp_val.cp.opcode); in aics_cp_notify_app()
354 struct bt_aics *inst = lookup_aics_by_handle(conn, params->single.handle); in internal_read_state_cb() local
359 if (!inst) { in internal_read_state_cb()
372 inst->cli.change_counter = state->change_counter; in internal_read_state_cb()
375 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in internal_read_state_cb()
377 if (inst->cli.cp_val.cp.opcode == BT_AICS_OPCODE_SET_GAIN) { in internal_read_state_cb()
378 write_err = bt_aics_client_gain_set(inst, in internal_read_state_cb()
379 inst->cli.cp_val.gain_setting); in internal_read_state_cb()
381 write_err = aics_client_common_control(inst->cli.cp_val.cp.opcode, in internal_read_state_cb()
382 inst); in internal_read_state_cb()
395 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in internal_read_state_cb()
396 aics_cp_notify_app(inst, cb_err); in internal_read_state_cb()
407 struct bt_aics *inst = lookup_aics_by_handle(conn, params->handle); in aics_client_write_aics_cp_cb() local
411 if (!inst) { in aics_client_write_aics_cp_cb()
416 LOG_DBG("Inst %p: err: %d", inst, cb_err); in aics_client_write_aics_cp_cb()
425 atomic_test_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_CP_RETRIED)) { in aics_client_write_aics_cp_cb()
427 } else if (cb_err == BT_AICS_ERR_INVALID_COUNTER && inst->cli.state_handle) { in aics_client_write_aics_cp_cb()
428 inst->cli.read_params.func = internal_read_state_cb; in aics_client_write_aics_cp_cb()
429 inst->cli.read_params.handle_count = 1; in aics_client_write_aics_cp_cb()
430 inst->cli.read_params.single.handle = inst->cli.state_handle; in aics_client_write_aics_cp_cb()
431 inst->cli.read_params.single.offset = 0U; in aics_client_write_aics_cp_cb()
433 atomic_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_CP_RETRIED); in aics_client_write_aics_cp_cb()
435 cb_err = bt_gatt_read(conn, &inst->cli.read_params); in aics_client_write_aics_cp_cb()
444 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_CP_RETRIED); in aics_client_write_aics_cp_cb()
445 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in aics_client_write_aics_cp_cb()
447 aics_cp_notify_app(inst, cb_err); in aics_client_write_aics_cp_cb()
450 static int aics_client_common_control(uint8_t opcode, struct bt_aics *inst) in aics_client_common_control() argument
454 CHECKIF(!inst) { in aics_client_common_control()
459 CHECKIF(!inst->client_instance) { in aics_client_common_control()
464 CHECKIF(inst->cli.conn == NULL) { in aics_client_common_control()
469 if (!inst->cli.control_handle) { in aics_client_common_control()
472 } else if (atomic_test_and_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY)) { in aics_client_common_control()
476 inst->cli.cp_val.cp.opcode = opcode; in aics_client_common_control()
477 inst->cli.cp_val.cp.counter = inst->cli.change_counter; in aics_client_common_control()
479 inst->cli.write_params.offset = 0; in aics_client_common_control()
480 inst->cli.write_params.data = &inst->cli.cp_val.cp; in aics_client_common_control()
481 inst->cli.write_params.length = sizeof(inst->cli.cp_val.cp); in aics_client_common_control()
482 inst->cli.write_params.handle = inst->cli.control_handle; in aics_client_common_control()
483 inst->cli.write_params.func = aics_client_write_aics_cp_cb; in aics_client_common_control()
485 err = bt_gatt_write(inst->cli.conn, &inst->cli.write_params); in aics_client_common_control()
487 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in aics_client_common_control()
499 struct bt_aics *inst = lookup_aics_by_handle(conn, params->single.handle); in aics_client_read_desc_cb() local
503 if (!inst) { in aics_client_read_desc_cb()
508 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in aics_client_read_desc_cb()
512 if (inst->cli.cb && inst->cli.cb->description) { in aics_client_read_desc_cb()
513 inst->cli.cb->description(inst, cb_err, NULL); in aics_client_read_desc_cb()
536 if (inst->cli.cb && inst->cli.cb->description) { in aics_client_read_desc_cb()
537 inst->cli.cb->description(inst, cb_err, desc); in aics_client_read_desc_cb()
543 static bool valid_inst_discovered(struct bt_aics *inst) in valid_inst_discovered() argument
545 return inst->cli.state_handle && in valid_inst_discovered()
546 inst->cli.gain_handle && in valid_inst_discovered()
547 inst->cli.type_handle && in valid_inst_discovered()
548 inst->cli.status_handle && in valid_inst_discovered()
549 inst->cli.control_handle && in valid_inst_discovered()
550 inst->cli.desc_handle; in valid_inst_discovered()
559 struct bt_aics *inst = CONTAINER_OF(client_inst, struct bt_aics, cli); in aics_discover_func() local
562 LOG_DBG("Discovery complete for AICS %p", inst); in aics_discover_func()
566 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in aics_discover_func()
568 if (inst->cli.cb && inst->cli.cb->discover) { in aics_discover_func()
569 int err = valid_inst_discovered(inst) ? 0 : -ENOENT; in aics_discover_func()
571 inst->cli.cb->discover(inst, err); in aics_discover_func()
584 if (inst->cli.start_handle == 0) { in aics_discover_func()
585 inst->cli.start_handle = chrc->value_handle; in aics_discover_func()
587 inst->cli.end_handle = chrc->value_handle; in aics_discover_func()
591 inst->cli.state_handle = chrc->value_handle; in aics_discover_func()
592 sub_params = &inst->cli.state_sub_params; in aics_discover_func()
595 inst->cli.gain_handle = chrc->value_handle; in aics_discover_func()
598 inst->cli.type_handle = chrc->value_handle; in aics_discover_func()
601 inst->cli.status_handle = chrc->value_handle; in aics_discover_func()
602 sub_params = &inst->cli.status_sub_params; in aics_discover_func()
605 inst->cli.control_handle = chrc->value_handle; in aics_discover_func()
608 inst->cli.desc_handle = chrc->value_handle; in aics_discover_func()
610 sub_params = &inst->cli.desc_sub_params; in aics_discover_func()
614 atomic_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_DESC_WRITABLE); in aics_discover_func()
635 if (inst->cli.cb && inst->cli.cb->discover) { in aics_discover_func()
636 inst->cli.cb->discover(inst, err); in aics_discover_func()
647 static void aics_client_reset(struct bt_aics *inst) in aics_client_reset() argument
649 inst->cli.change_counter = 0; in aics_client_reset()
650 inst->cli.gain_mode = 0; in aics_client_reset()
651 inst->cli.start_handle = 0; in aics_client_reset()
652 inst->cli.end_handle = 0; in aics_client_reset()
653 inst->cli.state_handle = 0; in aics_client_reset()
654 inst->cli.gain_handle = 0; in aics_client_reset()
655 inst->cli.type_handle = 0; in aics_client_reset()
656 inst->cli.status_handle = 0; in aics_client_reset()
657 inst->cli.control_handle = 0; in aics_client_reset()
658 inst->cli.desc_handle = 0; in aics_client_reset()
660 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_DESC_WRITABLE); in aics_client_reset()
661 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_CP_RETRIED); in aics_client_reset()
663 if (inst->cli.conn != NULL) { in aics_client_reset()
664 struct bt_conn *conn = inst->cli.conn; in aics_client_reset()
667 inst->cli.conn = NULL; in aics_client_reset()
684 int bt_aics_discover(struct bt_conn *conn, struct bt_aics *inst, in bt_aics_discover() argument
689 CHECKIF(!inst || !conn || !param) { in bt_aics_discover()
690 LOG_DBG("%s cannot be NULL", inst == NULL ? "inst" in bt_aics_discover()
702 CHECKIF(!atomic_test_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_ACTIVE)) { in bt_aics_discover()
707 if (atomic_test_and_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY)) { in bt_aics_discover()
712 aics_client_reset(inst); in bt_aics_discover()
714 (void)memset(&inst->cli.discover_params, 0, sizeof(inst->cli.discover_params)); in bt_aics_discover()
716 inst->cli.discover_params.start_handle = param->start_handle; in bt_aics_discover()
717 inst->cli.discover_params.end_handle = param->end_handle; in bt_aics_discover()
718 inst->cli.discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC; in bt_aics_discover()
719 inst->cli.discover_params.func = aics_discover_func; in bt_aics_discover()
721 err = bt_gatt_discover(conn, &inst->cli.discover_params); in bt_aics_discover()
723 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in bt_aics_discover()
726 inst->cli.conn = bt_conn_ref(conn); in bt_aics_discover()
766 int bt_aics_client_state_get(struct bt_aics *inst) in bt_aics_client_state_get() argument
770 CHECKIF(!inst) { in bt_aics_client_state_get()
775 CHECKIF(!inst->client_instance) { in bt_aics_client_state_get()
780 CHECKIF(inst->cli.conn == NULL) { in bt_aics_client_state_get()
785 if (!inst->cli.state_handle) { in bt_aics_client_state_get()
788 } else if (atomic_test_and_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY)) { in bt_aics_client_state_get()
792 inst->cli.read_params.func = aics_client_read_state_cb; in bt_aics_client_state_get()
793 inst->cli.read_params.handle_count = 1; in bt_aics_client_state_get()
794 inst->cli.read_params.single.handle = inst->cli.state_handle; in bt_aics_client_state_get()
796 err = bt_gatt_read(inst->cli.conn, &inst->cli.read_params); in bt_aics_client_state_get()
798 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in bt_aics_client_state_get()
804 int bt_aics_client_gain_setting_get(struct bt_aics *inst) in bt_aics_client_gain_setting_get() argument
808 CHECKIF(!inst) { in bt_aics_client_gain_setting_get()
813 CHECKIF(!inst->client_instance) { in bt_aics_client_gain_setting_get()
818 CHECKIF(inst->cli.conn == NULL) { in bt_aics_client_gain_setting_get()
823 if (!inst->cli.gain_handle) { in bt_aics_client_gain_setting_get()
826 } else if (atomic_test_and_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY)) { in bt_aics_client_gain_setting_get()
830 inst->cli.read_params.func = aics_client_read_gain_settings_cb; in bt_aics_client_gain_setting_get()
831 inst->cli.read_params.handle_count = 1; in bt_aics_client_gain_setting_get()
832 inst->cli.read_params.single.handle = inst->cli.gain_handle; in bt_aics_client_gain_setting_get()
834 err = bt_gatt_read(inst->cli.conn, &inst->cli.read_params); in bt_aics_client_gain_setting_get()
836 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in bt_aics_client_gain_setting_get()
842 int bt_aics_client_type_get(struct bt_aics *inst) in bt_aics_client_type_get() argument
846 CHECKIF(!inst) { in bt_aics_client_type_get()
851 CHECKIF(!inst->client_instance) { in bt_aics_client_type_get()
856 CHECKIF(inst->cli.conn == NULL) { in bt_aics_client_type_get()
861 if (!inst->cli.type_handle) { in bt_aics_client_type_get()
864 } else if (atomic_test_and_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY)) { in bt_aics_client_type_get()
868 inst->cli.read_params.func = aics_client_read_type_cb; in bt_aics_client_type_get()
869 inst->cli.read_params.handle_count = 1; in bt_aics_client_type_get()
870 inst->cli.read_params.single.handle = inst->cli.type_handle; in bt_aics_client_type_get()
872 err = bt_gatt_read(inst->cli.conn, &inst->cli.read_params); in bt_aics_client_type_get()
874 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in bt_aics_client_type_get()
880 int bt_aics_client_status_get(struct bt_aics *inst) in bt_aics_client_status_get() argument
884 CHECKIF(!inst) { in bt_aics_client_status_get()
889 CHECKIF(!inst->client_instance) { in bt_aics_client_status_get()
894 CHECKIF(inst->cli.conn == NULL) { in bt_aics_client_status_get()
899 if (!inst->cli.status_handle) { in bt_aics_client_status_get()
902 } else if (atomic_test_and_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY)) { in bt_aics_client_status_get()
906 inst->cli.read_params.func = aics_client_read_status_cb; in bt_aics_client_status_get()
907 inst->cli.read_params.handle_count = 1; in bt_aics_client_status_get()
908 inst->cli.read_params.single.handle = inst->cli.status_handle; in bt_aics_client_status_get()
910 err = bt_gatt_read(inst->cli.conn, &inst->cli.read_params); in bt_aics_client_status_get()
912 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in bt_aics_client_status_get()
918 int bt_aics_client_unmute(struct bt_aics *inst) in bt_aics_client_unmute() argument
920 return aics_client_common_control(BT_AICS_OPCODE_UNMUTE, inst); in bt_aics_client_unmute()
923 int bt_aics_client_mute(struct bt_aics *inst) in bt_aics_client_mute() argument
925 return aics_client_common_control(BT_AICS_OPCODE_MUTE, inst); in bt_aics_client_mute()
928 int bt_aics_client_manual_gain_set(struct bt_aics *inst) in bt_aics_client_manual_gain_set() argument
930 return aics_client_common_control(BT_AICS_OPCODE_SET_MANUAL, inst); in bt_aics_client_manual_gain_set()
933 int bt_aics_client_automatic_gain_set(struct bt_aics *inst) in bt_aics_client_automatic_gain_set() argument
935 return aics_client_common_control(BT_AICS_OPCODE_SET_AUTO, inst); in bt_aics_client_automatic_gain_set()
938 int bt_aics_client_gain_set(struct bt_aics *inst, int8_t gain) in bt_aics_client_gain_set() argument
942 CHECKIF(!inst) { in bt_aics_client_gain_set()
947 CHECKIF(!inst->client_instance) { in bt_aics_client_gain_set()
952 CHECKIF(inst->cli.conn == NULL) { in bt_aics_client_gain_set()
957 if (!inst->cli.control_handle) { in bt_aics_client_gain_set()
960 } else if (atomic_test_and_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY)) { in bt_aics_client_gain_set()
964 inst->cli.cp_val.cp.opcode = BT_AICS_OPCODE_SET_GAIN; in bt_aics_client_gain_set()
965 inst->cli.cp_val.cp.counter = inst->cli.change_counter; in bt_aics_client_gain_set()
966 inst->cli.cp_val.gain_setting = gain; in bt_aics_client_gain_set()
968 inst->cli.write_params.data = &inst->cli.cp_val; in bt_aics_client_gain_set()
969 inst->cli.write_params.length = sizeof(inst->cli.cp_val); in bt_aics_client_gain_set()
970 inst->cli.write_params.handle = inst->cli.control_handle; in bt_aics_client_gain_set()
971 inst->cli.write_params.func = aics_client_write_aics_cp_cb; in bt_aics_client_gain_set()
973 err = bt_gatt_write(inst->cli.conn, &inst->cli.write_params); in bt_aics_client_gain_set()
975 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in bt_aics_client_gain_set()
981 int bt_aics_client_description_get(struct bt_aics *inst) in bt_aics_client_description_get() argument
985 CHECKIF(!inst) { in bt_aics_client_description_get()
990 CHECKIF(!inst->client_instance) { in bt_aics_client_description_get()
995 CHECKIF(inst->cli.conn == NULL) { in bt_aics_client_description_get()
1000 if (!inst->cli.desc_handle) { in bt_aics_client_description_get()
1003 } else if (atomic_test_and_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY)) { in bt_aics_client_description_get()
1007 inst->cli.read_params.func = aics_client_read_desc_cb; in bt_aics_client_description_get()
1008 inst->cli.read_params.handle_count = 1; in bt_aics_client_description_get()
1009 inst->cli.read_params.single.handle = inst->cli.desc_handle; in bt_aics_client_description_get()
1011 err = bt_gatt_read(inst->cli.conn, &inst->cli.read_params); in bt_aics_client_description_get()
1013 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in bt_aics_client_description_get()
1019 int bt_aics_client_description_set(struct bt_aics *inst, in bt_aics_client_description_set() argument
1024 CHECKIF(!inst) { in bt_aics_client_description_set()
1029 CHECKIF(!inst->client_instance) { in bt_aics_client_description_set()
1034 CHECKIF(inst->cli.conn == NULL) { in bt_aics_client_description_set()
1039 if (!inst->cli.desc_handle) { in bt_aics_client_description_set()
1042 } else if (!atomic_test_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_DESC_WRITABLE)) { in bt_aics_client_description_set()
1045 } else if (atomic_test_and_set_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY)) { in bt_aics_client_description_set()
1049 err = bt_gatt_write_without_response(inst->cli.conn, inst->cli.desc_handle, description, in bt_aics_client_description_set()
1052 atomic_clear_bit(inst->cli.flags, BT_AICS_CLIENT_FLAG_BUSY); in bt_aics_client_description_set()
1058 void bt_aics_client_cb_register(struct bt_aics *inst, struct bt_aics_cb *cb) in bt_aics_client_cb_register() argument
1060 CHECKIF(!inst) { in bt_aics_client_cb_register()
1061 LOG_DBG("inst cannot be NULL"); in bt_aics_client_cb_register()
1065 inst->cli.cb = cb; in bt_aics_client_cb_register()