Lines Matching refs:err

96 static void connected(struct bt_conn *conn, uint8_t err)  in connected()  argument
102 if (err != 0) { in connected()
103 FAIL("Failed to connect to %s (%u)\n", addr, err); in connected()
120 int err; in test_provider_name() local
123 err = bt_tbs_set_bearer_provider_name(0, "BabblesimTBS"); in test_provider_name()
124 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_provider_name()
125 FAIL("Could not set bearer provider name: %d\n", err); in test_provider_name()
126 return err; in test_provider_name()
131 return err; in test_provider_name()
136 int err; in test_set_signal_strength() local
139 err = bt_tbs_set_signal_strength(0, 6); in test_set_signal_strength()
140 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_set_signal_strength()
141 FAIL("Could not set bearer provider name: %d\n", err); in test_set_signal_strength()
142 return err; in test_set_signal_strength()
147 return err; in test_set_signal_strength()
152 int err; in test_set_bearer_technology() local
155 err = bt_tbs_set_bearer_technology(0, BT_TBS_TECHNOLOGY_GSM); in test_set_bearer_technology()
156 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_set_bearer_technology()
157 FAIL("Could not set bearer technology: %d\n", err); in test_set_bearer_technology()
158 return err; in test_set_bearer_technology()
163 return err; in test_set_bearer_technology()
168 int err; in test_set_status_flags() local
171 err = bt_tbs_set_status_flags(0, 3); in test_set_status_flags()
172 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_set_status_flags()
173 FAIL("Could not set status flags: %d\n", err); in test_set_status_flags()
174 return err; in test_set_status_flags()
179 return err; in test_set_status_flags()
184 int err; in test_answer_terminate() local
188 err = bt_tbs_originate(0, "tel:000000000001", &g_call_index); in test_answer_terminate()
189 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_answer_terminate()
190 FAIL("Could not originate call: %d\n", err); in test_answer_terminate()
191 return err; in test_answer_terminate()
195 err = bt_tbs_remote_answer(g_call_index); in test_answer_terminate()
196 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_answer_terminate()
197 FAIL("Could not accept call: %d\n", err); in test_answer_terminate()
198 return err; in test_answer_terminate()
202 err = bt_tbs_terminate(g_call_index); in test_answer_terminate()
203 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_answer_terminate()
204 FAIL("Could not terminate call: %d\n", err); in test_answer_terminate()
205 return err; in test_answer_terminate()
210 return err; in test_answer_terminate()
215 int err; in test_hold_retrieve() local
218 err = bt_tbs_originate(0, "tel:000000000001", &g_call_index); in test_hold_retrieve()
219 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_hold_retrieve()
220 FAIL("Could not originate call: %d\n", err); in test_hold_retrieve()
221 return err; in test_hold_retrieve()
224 err = bt_tbs_remote_answer(g_call_index); in test_hold_retrieve()
225 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_hold_retrieve()
226 FAIL("Could not accept call: %d\n", err); in test_hold_retrieve()
227 return err; in test_hold_retrieve()
231 err = bt_tbs_hold(g_call_index); in test_hold_retrieve()
232 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_hold_retrieve()
233 FAIL("Could not terminate call: %d\n", err); in test_hold_retrieve()
234 return err; in test_hold_retrieve()
238 err = bt_tbs_retrieve(g_call_index); in test_hold_retrieve()
239 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_hold_retrieve()
240 FAIL("Could not retrieve call: %d\n", err); in test_hold_retrieve()
241 return err; in test_hold_retrieve()
245 err = bt_tbs_terminate(g_call_index); in test_hold_retrieve()
246 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_hold_retrieve()
247 FAIL("Could not terminate call: %d\n", err); in test_hold_retrieve()
248 return err; in test_hold_retrieve()
253 return err; in test_hold_retrieve()
258 int err; in test_join() local
263 err = bt_tbs_originate(0, "tel:000000000001", &g_call_index); in test_join()
264 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_join()
265 FAIL("Could not originate first call: %d\n", err); in test_join()
266 return err; in test_join()
270 err = bt_tbs_remote_answer(g_call_index); in test_join()
271 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_join()
272 FAIL("Could not answer first call: %d\n", err); in test_join()
273 return err; in test_join()
280 err = bt_tbs_originate(0, "tel:000000000002", &g_call_index); in test_join()
281 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_join()
282 FAIL("Could not originate second call: %d\n", err); in test_join()
283 return err; in test_join()
287 err = bt_tbs_remote_answer(g_call_index); in test_join()
288 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_join()
289 FAIL("Could not answer second call: %d\n", err); in test_join()
290 return err; in test_join()
297 err = bt_tbs_join(2, call_indexes); in test_join()
298 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_join()
299 FAIL("Could not join calls: %d\n", err); in test_join()
300 return err; in test_join()
303 err = bt_tbs_terminate(call_indexes[0]); in test_join()
304 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_join()
305 FAIL("Could not terminate first call: %d\n", err); in test_join()
306 return err; in test_join()
309 err = bt_tbs_terminate(call_indexes[1]); in test_join()
310 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_join()
311 FAIL("Could not terminate second call: %d\n", err); in test_join()
312 return err; in test_join()
317 return err; in test_join()
342 int err; in init() local
344 err = bt_enable(NULL); in init()
345 if (err != 0) { in init()
346 FAIL("Bluetooth enable failed (err %d)\n", err); in init()
353 err = bt_conn_cb_register(&conn_callbacks); in init()
354 if (err != 0) { in init()
355 FAIL("Failed to register conn CBs (err %d)\n", err); in init()
360 err = bt_le_scan_cb_register(&common_scan_cb); in init()
361 if (err != 0) { in init()
362 FAIL("Failed to register scan CBs (err %d)\n", err); in init()
369 err = bt_tbs_register_bearer(&gtbs_param); in init()
370 if (err < 0) { in init()
371 FAIL("Failed to register GTBS (err %d)\n", err); in init()
393 err = bt_tbs_register_bearer(&tbs_param); in init()
394 if (err < 0) { in init()
395 FAIL("Failed to register TBS[%d]: %d", i, err); in init()
400 printk("Registered TBS[%d] with index %u\n", i, (uint8_t)err); in init()
406 int err; in test_main() local
410 err = bt_le_scan_start(BT_LE_SCAN_PASSIVE, NULL); in test_main()
411 if (err != 0) { in test_main()
412 FAIL("Scanning failed to start (err %d)\n", err); in test_main()
422 err = bt_tbs_remote_answer(g_call_index); in test_main()
423 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_main()
424 FAIL("Remote could not answer call: %d\n", err); in test_main()
429 err = bt_tbs_remote_hold(g_call_index); in test_main()
430 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_main()
431 FAIL("Remote could not hold call: %d\n", err); in test_main()
437 err = bt_tbs_remote_retrieve(g_call_index); in test_main()
438 if (err != BT_TBS_RESULT_CODE_SUCCESS) { in test_main()
439 FAIL("Remote could not answer call: %d\n", err); in test_main()