Lines Matching +full:hysteresis +full:- +full:mode
11 * SPDX-License-Identifier: Apache-2.0
53 /* Connection context for BR/EDR legacy pairing in sec mode 3 */
125 "non-resolvable"; in print_le_addr()
310 switch (data->type) { in data_cb()
314 memcpy(name, data->data, MIN(data->data_len, NAME_LEN - 1)); in data_cb()
331 for (int16_t i = len - 1; i >= 0; i--) { in print_data_hex()
356 print_data_hex(&scan_data[idx], scan_data_len - idx, SHELL_WARNING); in print_data_set()
362 bt_shell_fprintf_info("%*sType 0x%02x: ", strlen(scan_response_label), "", data->type); in data_verbose_cb()
364 switch (data->type) { in data_verbose_cb()
368 print_data_set(BT_UUID_SIZE_16, data->data, data->data_len); in data_verbose_cb()
374 if (data->data_len < BT_UUID_SIZE_16) { in data_verbose_cb()
376 data->data_len); in data_verbose_cb()
379 print_data_set(BT_UUID_SIZE_16, data->data, BT_UUID_SIZE_16); in data_verbose_cb()
380 if (data->data_len > BT_UUID_SIZE_16) { in data_verbose_cb()
382 print_data_set(1, data->data + BT_UUID_SIZE_16, in data_verbose_cb()
383 data->data_len - BT_UUID_SIZE_16); in data_verbose_cb()
388 print_data_set(BT_UUID_SIZE_32, data->data, data->data_len); in data_verbose_cb()
394 if (data->data_len < BT_UUID_SIZE_32) { in data_verbose_cb()
396 data->data_len); in data_verbose_cb()
399 print_data_set(BT_UUID_SIZE_32, data->data, BT_UUID_SIZE_32); in data_verbose_cb()
400 if (data->data_len > BT_UUID_SIZE_32) { in data_verbose_cb()
402 print_data_set(1, data->data + BT_UUID_SIZE_32, in data_verbose_cb()
403 data->data_len - BT_UUID_SIZE_32); in data_verbose_cb()
409 print_data_set(BT_UUID_SIZE_128, data->data, data->data_len); in data_verbose_cb()
415 if (data->data_len < BT_UUID_SIZE_128) { in data_verbose_cb()
417 data->data_len); in data_verbose_cb()
420 print_data_set(BT_UUID_SIZE_128, data->data, BT_UUID_SIZE_128); in data_verbose_cb()
421 if (data->data_len > BT_UUID_SIZE_128) { in data_verbose_cb()
423 print_data_set(1, data->data + BT_UUID_SIZE_128, in data_verbose_cb()
424 data->data_len - BT_UUID_SIZE_128); in data_verbose_cb()
430 bt_shell_fprintf_info("%.*s", data->data_len, data->data); in data_verbose_cb()
435 print_data_set(BT_ADDR_SIZE, data->data, data->data_len); in data_verbose_cb()
438 print_data_set(3, data->data, data->data_len); in data_verbose_cb()
442 print_data_set(1, data->data, data->data_len); in data_verbose_cb()
451 size_t decrypted_data_size = BT_EAD_DECRYPTED_PAYLOAD_SIZE(data->data_len); in data_verbose_cb()
455 data->data, data->data_len, decrypted_data); in data_verbose_cb()
471 print_data_set(1, data->data, data->data_len); in data_verbose_cb()
502 if (scan_filter.rssi_set && (scan_filter.rssi > info->rssi)) { in passes_scan_filter()
507 (scan_filter.pa_interval > BT_CONN_INTERVAL_TO_MS(info->interval))) { in passes_scan_filter()
514 bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); in passes_scan_filter()
555 bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); in scan_recv()
561 le_addr, info->adv_type, info->rssi, name, in scan_recv()
562 (info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0, in scan_recv()
563 (info->adv_props & BT_GAP_ADV_PROP_SCANNABLE) != 0, in scan_recv()
564 (info->adv_props & BT_GAP_ADV_PROP_DIRECTED) != 0, in scan_recv()
565 (info->adv_props & BT_GAP_ADV_PROP_SCAN_RESPONSE) != 0, in scan_recv()
566 (info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0, in scan_recv()
567 phy2str(info->primary_phy), phy2str(info->secondary_phy), in scan_recv()
568 info->interval, BT_CONN_INTERVAL_TO_US(info->interval), in scan_recv()
569 info->sid); in scan_recv()
572 bt_shell_info("%*s[SCAN DATA START - %s]", in scan_recv()
574 scan_response_type_txt(info->adv_type)); in scan_recv()
580 if ((info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0U) { in scan_recv()
581 struct bt_conn *conn = bt_conn_lookup_addr_le(selected_id, info->addr); in scan_recv()
583 /* Only store auto-connect address for devices we are not already connected to */ in scan_recv()
587 bt_addr_le_copy(&auto_connect.addr, info->addr); in scan_recv()
621 info->num_sent); in adv_sent()
629 bt_addr_le_to_str(info->addr, str, sizeof(str)); in adv_scanned()
641 bt_addr_le_to_str(bt_conn_get_dst(info->conn), str, sizeof(str)); in adv_connected()
697 bt_addr_le_to_str(info.le.dst, str, sizeof(str) - 2);
732 bt_addr_le_to_str(&oob->addr, addr, sizeof(addr)); in print_le_oob()
734 bin2hex(oob->le_sc_data.c, sizeof(oob->le_sc_data.c), c, sizeof(c)); in print_le_oob()
735 bin2hex(oob->le_sc_data.r, sizeof(oob->le_sc_data.r), r, sizeof(r)); in print_le_oob()
738 shell_print(sh, "%-29s %-32s %-32s", "addr", "random", "confirm"); in print_le_oob()
777 /* clear connection reference for sec mode 3 pairing */ in connected()
827 param->interval_min, param->interval_max, in le_param_req()
828 param->latency, param->timeout); in le_param_req()
850 bt_shell_print("Identity resolved %s -> %s", addr_rpa, addr_identity); in identity_resolved()
908 "manufacturer 0x%04x", bt_hci_get_ver_str(remote_info->version), in remote_info_available()
909 remote_info->version, remote_info->subversion, in remote_info_available()
910 remote_info->manufacturer); in remote_info_available()
917 sys_memcpy_swap(features, remote_info->le.features, in remote_info_available()
931 info->tx_max_len, info->tx_max_time, in le_data_len_updated()
932 info->rx_max_len, info->rx_max_time); in le_data_len_updated()
941 phy2str(info->tx_phy), phy2str(info->rx_phy)); in le_phy_updated()
950 tx_power_report_reason2str(report->reason), tx_pwr_ctrl_phy2str(report->phy), in tx_power_report()
951 report->tx_power_level); in tx_power_report()
953 tx_power_flag2str(report->tx_power_level_flag), report->delta); in tx_power_report()
962 plm_report_zone_str(report->zone), report->path_loss); in path_loss_threshold_report()
970 if (params->status == BT_HCI_ERR_SUCCESS) { in subrate_changed()
976 params->factor, in subrate_changed()
977 params->continuation_number, in subrate_changed()
978 params->peripheral_latency, in subrate_changed()
979 params->supervision_timeout, in subrate_changed()
980 params->supervision_timeout * 10); in subrate_changed()
982 bt_shell_print("Subrate change failed (HCI status 0x%02x)", params->status); in subrate_changed()
992 "- Num CS configurations: %d\n" in print_remote_cs_capabilities()
993 "- Max consecutive CS procedures: %d\n" in print_remote_cs_capabilities()
994 "- Num antennas supported: %d\n" in print_remote_cs_capabilities()
995 "- Max antenna paths supported: %d\n" in print_remote_cs_capabilities()
996 "- Initiator role supported: %s\n" in print_remote_cs_capabilities()
997 "- Reflector role supported: %s\n" in print_remote_cs_capabilities()
998 "- Mode 3 supported: %s\n" in print_remote_cs_capabilities()
999 "- RTT AA only supported: %s\n" in print_remote_cs_capabilities()
1000 "- RTT AA only is 10ns precise: %s\n" in print_remote_cs_capabilities()
1001 "- RTT AA only N: %d\n" in print_remote_cs_capabilities()
1002 "- RTT sounding supported: %s\n" in print_remote_cs_capabilities()
1003 "- RTT sounding is 10ns precise: %s\n" in print_remote_cs_capabilities()
1004 "- RTT sounding N: %d\n" in print_remote_cs_capabilities()
1005 "- RTT random payload supported: %s\n" in print_remote_cs_capabilities()
1006 "- RTT random payload is 10ns precise: %s\n" in print_remote_cs_capabilities()
1007 "- RTT random payload N: %d\n" in print_remote_cs_capabilities()
1008 "- Phase-based NADM with sounding sequences supported: %s\n" in print_remote_cs_capabilities()
1009 "- Phase-based NADM with random sequences supported: %s\n" in print_remote_cs_capabilities()
1010 "- CS Sync 2M PHY supported: %s\n" in print_remote_cs_capabilities()
1011 "- CS Sync 2M 2BT PHY supported: %s\n" in print_remote_cs_capabilities()
1012 "- CS without transmitter FAE supported: %s\n" in print_remote_cs_capabilities()
1013 "- Channel selection algorithm #3c supported: %s\n" in print_remote_cs_capabilities()
1014 "- Phase-based ranging from RTT sounding sequence supported: %s\n" in print_remote_cs_capabilities()
1015 "- T_IP1 times supported: 0x%04x\n" in print_remote_cs_capabilities()
1016 "- T_IP2 times supported: 0x%04x\n" in print_remote_cs_capabilities()
1017 "- T_FCS times supported: 0x%04x\n" in print_remote_cs_capabilities()
1018 "- T_PM times supported: 0x%04x\n" in print_remote_cs_capabilities()
1019 "- T_SW time supported: %d us\n" in print_remote_cs_capabilities()
1020 "- TX SNR capability: 0x%02x", in print_remote_cs_capabilities()
1021 params->num_config_supported, params->max_consecutive_procedures_supported, in print_remote_cs_capabilities()
1022 params->num_antennas_supported, params->max_antenna_paths_supported, in print_remote_cs_capabilities()
1023 params->initiator_supported ? "Yes" : "No", in print_remote_cs_capabilities()
1024 params->reflector_supported ? "Yes" : "No", params->mode_3_supported ? "Yes" : "No", in print_remote_cs_capabilities()
1025 params->rtt_aa_only_precision == BT_CONN_LE_CS_RTT_AA_ONLY_NOT_SUPP ? "No" : "Yes", in print_remote_cs_capabilities()
1026 params->rtt_aa_only_precision == BT_CONN_LE_CS_RTT_AA_ONLY_10NS ? "Yes" : "No", in print_remote_cs_capabilities()
1027 params->rtt_aa_only_n, in print_remote_cs_capabilities()
1028 params->rtt_sounding_precision == BT_CONN_LE_CS_RTT_SOUNDING_NOT_SUPP ? "No" in print_remote_cs_capabilities()
1030 params->rtt_sounding_precision == BT_CONN_LE_CS_RTT_SOUNDING_10NS ? "Yes" : "No", in print_remote_cs_capabilities()
1031 params->rtt_sounding_n, in print_remote_cs_capabilities()
1032 params->rtt_random_payload_precision == BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_NOT_SUPP in print_remote_cs_capabilities()
1035 params->rtt_random_payload_precision == BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_10NS in print_remote_cs_capabilities()
1038 params->rtt_random_payload_n, in print_remote_cs_capabilities()
1039 params->phase_based_nadm_sounding_supported ? "Yes" : "No", in print_remote_cs_capabilities()
1040 params->phase_based_nadm_random_supported ? "Yes" : "No", in print_remote_cs_capabilities()
1041 params->cs_sync_2m_phy_supported ? "Yes" : "No", in print_remote_cs_capabilities()
1042 params->cs_sync_2m_2bt_phy_supported ? "Yes" : "No", in print_remote_cs_capabilities()
1043 params->cs_without_fae_supported ? "Yes" : "No", in print_remote_cs_capabilities()
1044 params->chsel_alg_3c_supported ? "Yes" : "No", in print_remote_cs_capabilities()
1045 params->pbr_from_rtt_sounding_seq_supported ? "Yes" : "No", in print_remote_cs_capabilities()
1046 params->t_ip1_times_supported, params->t_ip2_times_supported, in print_remote_cs_capabilities()
1047 params->t_fcs_times_supported, params->t_pm_times_supported, params->t_sw_time, in print_remote_cs_capabilities()
1048 params->tx_snr_capability); in print_remote_cs_capabilities()
1054 bt_shell_hexdump(params->remote_fae_table, 72); in print_remote_cs_fae_table()
1061 const char *rtt_type_str[8] = {"AA only", "32-bit sounding", "96-bit sounding", in le_cs_config_created()
1062 "32-bit random", "64-bit random", "96-bit random", in le_cs_config_created()
1063 "128-bit random", "Invalid"}; in le_cs_config_created()
1068 uint8_t main_mode_idx = config->main_mode_type > 0 && config->main_mode_type < 4 in le_cs_config_created()
1069 ? config->main_mode_type in le_cs_config_created()
1071 uint8_t sub_mode_idx = config->sub_mode_type < 4 ? config->sub_mode_type : 0; in le_cs_config_created()
1072 uint8_t role_idx = MIN(config->role, 2); in le_cs_config_created()
1073 uint8_t rtt_type_idx = MIN(config->rtt_type, 7); in le_cs_config_created()
1075 config->cs_sync_phy > 0 && config->cs_sync_phy < 4 ? config->cs_sync_phy : 0; in le_cs_config_created()
1076 uint8_t chsel_type_idx = MIN(config->channel_selection_type, 2); in le_cs_config_created()
1077 uint8_t ch3c_shape_idx = MIN(config->ch3c_shape, 2); in le_cs_config_created()
1081 "- ID: %d\n" in le_cs_config_created()
1082 "- Role: %s\n" in le_cs_config_created()
1083 "- Main mode: %s\n" in le_cs_config_created()
1084 "- Sub mode: %s\n" in le_cs_config_created()
1085 "- RTT type: %s\n" in le_cs_config_created()
1086 "- Main mode steps: %d - %d\n" in le_cs_config_created()
1087 "- Main mode repetition: %d\n" in le_cs_config_created()
1088 "- Mode 0 steps: %d\n" in le_cs_config_created()
1089 "- CS sync PHY: %s\n" in le_cs_config_created()
1090 "- T_IP1 time: %d\n" in le_cs_config_created()
1091 "- T_IP2 time: %d\n" in le_cs_config_created()
1092 "- T_FCS time: %d\n" in le_cs_config_created()
1093 "- T_PM time: %d\n" in le_cs_config_created()
1094 "- Channel map: 0x%08X%08X%04X\n" in le_cs_config_created()
1095 "- Channel map repetition: %d\n" in le_cs_config_created()
1096 "- Channel selection type: %s\n" in le_cs_config_created()
1097 "- Ch3c shape: %s\n" in le_cs_config_created()
1098 "- Ch3c jump: %d\n", in le_cs_config_created()
1099 config->id, role_str[role_idx], mode_str[main_mode_idx], mode_str[sub_mode_idx], in le_cs_config_created()
1100 rtt_type_str[rtt_type_idx], config->min_main_mode_steps, in le_cs_config_created()
1101 config->max_main_mode_steps, config->main_mode_repetition, config->mode_0_steps, in le_cs_config_created()
1102 phy_str[phy_idx], config->t_ip1_time_us, config->t_ip2_time_us, in le_cs_config_created()
1103 config->t_fcs_time_us, config->t_pm_time_us, in le_cs_config_created()
1104 sys_get_le32(&config->channel_map[6]), sys_get_le32(&config->channel_map[2]), in le_cs_config_created()
1105 sys_get_le16(&config->channel_map[0]), config->channel_map_repetition, in le_cs_config_created()
1107 config->ch3c_jump); in le_cs_config_created()
1184 const bool is_past_peer = info->conn != NULL; in per_adv_sync_sync_cb()
1188 bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); in per_adv_sync_sync_cb()
1191 conn_addr_str(info->conn, past_peer, sizeof(past_peer)); in per_adv_sync_sync_cb()
1197 info->interval, BT_CONN_INTERVAL_TO_US(info->interval), in per_adv_sync_sync_cb()
1198 phy2str(info->phy), info->service_data, in per_adv_sync_sync_cb()
1201 if (info->conn) { /* if from PAST */ in per_adv_sync_sync_cb()
1224 bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); in per_adv_sync_terminated_cb()
1236 bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); in per_adv_sync_recv_cb()
1239 bt_le_per_adv_sync_get_index(sync), le_addr, info->tx_power, in per_adv_sync_recv_cb()
1240 info->rssi, info->cte_type, buf->len); in per_adv_sync_recv_cb()
1248 bt_addr_le_to_str(biginfo->addr, le_addr, sizeof(le_addr)); in per_adv_sync_biginfo_cb()
1253 bt_le_per_adv_sync_get_index(sync), le_addr, biginfo->sid, biginfo->num_bis, in per_adv_sync_biginfo_cb()
1254 biginfo->sub_evt_count, biginfo->iso_interval, in per_adv_sync_biginfo_cb()
1255 BT_CONN_INTERVAL_TO_US(biginfo->iso_interval), biginfo->burst_number, in per_adv_sync_biginfo_cb()
1256 biginfo->offset, biginfo->rep_count, biginfo->max_pdu, biginfo->sdu_interval, in per_adv_sync_biginfo_cb()
1257 biginfo->max_sdu, phy2str(biginfo->phy), biginfo->framing, in per_adv_sync_biginfo_cb()
1258 biginfo->encryption ? "" : "not "); in per_adv_sync_biginfo_cb()
1318 if (!strcmp(arg, "no-settings-load")) { in cmd_init()
1382 return -ENOEXEC; in cmd_hci_cmd()
1386 sizeof(hex_data) - hex_data_len); in cmd_hci_cmd()
1389 return -ENOEXEC; in cmd_hci_cmd()
1395 return -ENOMEM; in cmd_hci_cmd()
1406 shell_hexdump(sh, rsp->data, rsp->len); in cmd_hci_cmd()
1448 return -EINVAL; in cmd_appearance()
1454 return -EINVAL; in cmd_appearance()
1503 return -ENOEXEC; in cmd_id_reset()
1537 return -ENOEXEC; in cmd_id_delete()
1582 return -ENOEXEC; in cmd_id_select()
1691 } else if (!strcmp(arg, "no-1m")) { in cmd_scan()
1746 return -ENOEXEC; in cmd_scan_filter_set_name()
1758 const size_t max_cpy_len = sizeof(scan_filter.addr) - 1; in cmd_scan_filter_set_addr()
1765 return -ENOEXEC; in cmd_scan_filter_set_addr()
1775 return -ENOEXEC; in cmd_scan_filter_set_addr()
1803 err = -ERANGE; in cmd_scan_filter_set_rssi()
1836 err = -ERANGE; in cmd_scan_filter_set_pa_interval()
1896 /* Set BR/EDR Not Supported if LE-only device */ in ad_init()
1900 /* A privacy-enabled Set Member should advertise RSI values only when in in ad_init()
1901 * the GAP Limited Discoverable mode. in ad_init()
1936 data_array_size - ad_len, discoverable); in ad_init()
1949 audio_ad_len = audio_ad_data_add(&data_array[ad_len], data_array_size - ad_len, in ad_init()
1963 ad->type = BT_DATA_NAME_COMPLETE; in set_ad_name_complete()
1964 ad->data_len = strlen(name); in set_ad_name_complete()
1965 ad->data = name; in set_ad_name_complete()
1992 return -ENOEXEC; in cmd_advertise()
2024 } else if (!strcmp(arg, "fal-scan")) { in cmd_advertise()
2026 } else if (!strcmp(arg, "fal-conn")) { in cmd_advertise()
2030 } else if (!strcmp(arg, "no-name")) { in cmd_advertise()
2032 } else if (!strcmp(arg, "name-ad")) { in cmd_advertise()
2035 } else if (!strcmp(arg, "disable-37")) { in cmd_advertise()
2037 } else if (!strcmp(arg, "disable-38")) { in cmd_advertise()
2039 } else if (!strcmp(arg, "disable-39")) { in cmd_advertise()
2062 err = ad_init(&ad[ad_len], ARRAY_SIZE(ad) - ad_len, adv_opt); in cmd_advertise()
2064 return -ENOEXEC; in cmd_advertise()
2081 return -ENOEXEC; in cmd_advertise()
2108 } else if (!strcmp(arg, "dir-rpa")) { in cmd_directed_adv()
2110 } else if (!strcmp(arg, "disable-37")) { in cmd_directed_adv()
2112 } else if (!strcmp(arg, "disable-38")) { in cmd_directed_adv()
2114 } else if (!strcmp(arg, "disable-39")) { in cmd_directed_adv()
2118 return -ENOEXEC; in cmd_directed_adv()
2125 return -ENOEXEC; in cmd_directed_adv()
2140 if (!strcmp(argv[1], "conn-scan")) { in adv_param_parse()
2141 param->options |= BT_LE_ADV_OPT_CONN; in adv_param_parse()
2142 param->options |= BT_LE_ADV_OPT_SCANNABLE; in adv_param_parse()
2143 } else if (!strcmp(argv[1], "conn-nscan")) { in adv_param_parse()
2144 param->options |= BT_LE_ADV_OPT_CONN; in adv_param_parse()
2145 } else if (!strcmp(argv[1], "nconn-scan")) { in adv_param_parse()
2146 param->options |= BT_LE_ADV_OPT_SCANNABLE; in adv_param_parse()
2147 } else if (!strcmp(argv[1], "nconn-nscan")) { in adv_param_parse()
2156 if (!strcmp(arg, "ext-adv")) { in adv_param_parse()
2157 param->options |= BT_LE_ADV_OPT_EXT_ADV; in adv_param_parse()
2159 param->options |= BT_LE_ADV_OPT_CODED; in adv_param_parse()
2160 } else if (!strcmp(arg, "no-2m")) { in adv_param_parse()
2161 param->options |= BT_LE_ADV_OPT_NO_2M; in adv_param_parse()
2163 param->options |= BT_LE_ADV_OPT_ANONYMOUS; in adv_param_parse()
2164 } else if (!strcmp(arg, "tx-power")) { in adv_param_parse()
2165 param->options |= BT_LE_ADV_OPT_USE_TX_POWER; in adv_param_parse()
2166 } else if (!strcmp(arg, "scan-reports")) { in adv_param_parse()
2167 param->options |= BT_LE_ADV_OPT_NOTIFY_SCAN_REQ; in adv_param_parse()
2169 param->options |= BT_LE_ADV_OPT_FILTER_SCAN_REQ; in adv_param_parse()
2170 param->options |= BT_LE_ADV_OPT_FILTER_CONN; in adv_param_parse()
2171 } else if (!strcmp(arg, "fal-scan")) { in adv_param_parse()
2172 param->options |= BT_LE_ADV_OPT_FILTER_SCAN_REQ; in adv_param_parse()
2173 } else if (!strcmp(arg, "fal-conn")) { in adv_param_parse()
2174 param->options |= BT_LE_ADV_OPT_FILTER_CONN; in adv_param_parse()
2176 param->options |= BT_LE_ADV_OPT_USE_IDENTITY; in adv_param_parse()
2178 param->options |= BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY; in adv_param_parse()
2179 } else if (!strcmp(arg, "dir-rpa")) { in adv_param_parse()
2180 param->options |= BT_LE_ADV_OPT_DIR_ADDR_RPA; in adv_param_parse()
2181 } else if (!strcmp(arg, "disable-37")) { in adv_param_parse()
2182 param->options |= BT_LE_ADV_OPT_DISABLE_CHAN_37; in adv_param_parse()
2183 } else if (!strcmp(arg, "disable-38")) { in adv_param_parse()
2184 param->options |= BT_LE_ADV_OPT_DISABLE_CHAN_38; in adv_param_parse()
2185 } else if (!strcmp(arg, "disable-39")) { in adv_param_parse()
2186 param->options |= BT_LE_ADV_OPT_DISABLE_CHAN_39; in adv_param_parse()
2198 param->peer = &addr; in adv_param_parse()
2205 param->id = selected_id; in adv_param_parse()
2206 param->sid = 0; in adv_param_parse()
2207 if (param->peer && in adv_param_parse()
2208 !(param->options & BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY)) { in adv_param_parse()
2209 param->interval_min = 0; in adv_param_parse()
2210 param->interval_max = 0; in adv_param_parse()
2212 param->interval_min = BT_GAP_ADV_FAST_INT_MIN_2; in adv_param_parse()
2213 param->interval_max = BT_GAP_ADV_FAST_INT_MAX_2; in adv_param_parse()
2228 return -ENOEXEC; in cmd_adv_create()
2234 return -ENOEXEC; in cmd_adv_create()
2259 return -ENOEXEC; in cmd_adv_param()
2265 return -ENOEXEC; in cmd_adv_param()
2291 return -EINVAL; in cmd_adv_data()
2307 return -ENOEXEC; in cmd_adv_data()
2322 if (strcmp(arg, "scan-response") && *data_len == ARRAY_SIZE(ad)) { in cmd_adv_data()
2327 return -ENOEXEC; in cmd_adv_data()
2336 } else if (!strcmp(arg, "scan-response")) { in cmd_adv_data()
2339 "duplicate scan-response option"); in cmd_adv_data()
2340 return -ENOEXEC; in cmd_adv_data()
2347 } else if (!strcmp(arg, "dev-name")) { in cmd_adv_data()
2352 sizeof(hex_data) - hex_data_len); in cmd_adv_data()
2354 if (!len || (len - 1) != (hex_data[hex_data_len])) { in cmd_adv_data()
2357 return -ENOEXEC; in cmd_adv_data()
2361 data[*data_len].data_len = len - 2; in cmd_adv_data()
2370 return -ENOEXEC; in cmd_adv_data()
2379 return -ENOEXEC; in cmd_adv_data()
2390 len = ad_init(&data[*data_len], AD_SIZE - *data_len, adv_set_opt[selected_adv]); in cmd_adv_data()
2394 return -ENOEXEC; in cmd_adv_data()
2407 return -ENOEXEC; in cmd_adv_data()
2423 return -EINVAL; in cmd_adv_start()
2437 if (!strcmp(arg, "num-events")) { in cmd_adv_start()
2452 return -ENOEXEC; in cmd_adv_start()
2460 return -ENOEXEC; in cmd_adv_start()
2470 return -EINVAL; in cmd_adv_stop()
2476 return -ENOEXEC; in cmd_adv_stop()
2490 return -EINVAL; in cmd_adv_delete()
2509 return -EINVAL; in cmd_adv_select()
2522 return -ENOEXEC; in cmd_adv_select()
2532 return -EINVAL; in cmd_adv_info()
2555 return -EINVAL; in cmd_adv_oob()
2581 return -EINVAL; in cmd_adv_rpa_expire()
2595 return -EINVAL; in cmd_per_adv()
2612 return -EINVAL; in cmd_per_adv()
2627 return -EINVAL; in cmd_per_adv_param()
2644 return -EINVAL; in cmd_per_adv_param()
2647 if (argc > 3 && !strcmp(argv[3], "tx-power")) { in cmd_per_adv_param()
2656 return -ENOEXEC; in cmd_per_adv_param()
2671 data_array_size - ad_len); in pa_ad_init()
2694 return -EINVAL; in cmd_per_adv_data()
2707 return -ENOEXEC; in cmd_per_adv_data()
2716 stack_ad_len = pa_ad_init(&ad[ad_len], ARRAY_SIZE(ad) - ad_len); in cmd_per_adv_data()
2720 return -ENOEXEC; in cmd_per_adv_data()
2727 return -ENOEXEC; in cmd_per_adv_data()
2747 shell_error(sh, "Selected per-adv-sync is not NULL"); in cmd_per_adv_sync_create()
2748 return -ENOEXEC; in cmd_per_adv_sync_create()
2754 return -ENOEXEC; in cmd_per_adv_sync_create()
2813 shell_error(sh, "Selected per-adv-sync is NULL"); in cmd_per_adv_sync_delete()
2814 return -EINVAL; in cmd_per_adv_sync_delete()
2838 return -ENOEXEC; in cmd_per_adv_sync_select()
2843 return -EINVAL; in cmd_per_adv_sync_select()
2856 return -ENOEXEC; in cmd_per_adv_sync_select()
2870 return -ENOEXEC; in cmd_past_subscribe()
2908 return -EINVAL; in cmd_past_subscribe()
2944 return -EINVAL; in cmd_past_unsubscribe()
2978 ARRAY_SIZE(per_adv_syncs) - 1, index); in cmd_per_adv_sync_transfer()
2983 return -EINVAL; in cmd_per_adv_sync_transfer()
3005 sh->ctx->active_cmd.syntax); in cmd_per_adv_set_info_transfer()
3006 return -ENOEXEC; in cmd_per_adv_set_info_transfer()
3049 int8_t unachievable_current_level = -100; in cmd_read_local_tx_power()
3056 return -ENOEXEC; in cmd_read_local_tx_power()
3065 return -EIO; in cmd_read_local_tx_power()
3094 return -ENOEXEC; in cmd_set_power_report_enable()
3120 return -ENOEXEC; in cmd_set_path_loss_reporting_parameters()
3144 return -ENOEXEC; in cmd_set_path_loss_reporting_parameters()
3157 return -ENOEXEC; in cmd_set_path_loss_reporting_enable()
3170 return -ENOEXEC; in cmd_set_path_loss_reporting_enable()
3203 return -ENOEXEC; in cmd_subrate_set_defaults()
3215 return -ENOEXEC; in cmd_subrate_request()
3239 return -ENOEXEC; in cmd_subrate_request()
3262 return -ENOENT; in bt_do_connect_le()
3268 return -EINVAL; in bt_do_connect_le()
3278 } else if (!strcmp(arg, "no-1m")) { in bt_do_connect_le()
3294 return -ENOEXEC; in bt_do_connect_le()
3310 case -ENOENT: in cmd_connect_le()
3314 case -EINVAL: in cmd_connect_le()
3320 case -ENOEXEC: in cmd_connect_le()
3322 return -ENOEXEC; in cmd_connect_le()
3394 return -ENOEXEC; in cmd_disconnect()
3424 return -ENOEXEC; in cmd_select()
3493 return -ENOEXEC; in cmd_info()
3510 print_le_addr("Remote on-air", info.le.remote); in cmd_info()
3511 print_le_addr("Local on-air", info.le.local); in cmd_info()
3522 phy2str(info.le.phy->tx_phy), in cmd_info()
3523 phy2str(info.le.phy->rx_phy)); in cmd_info()
3527 info.le.data_len->tx_max_len, info.le.data_len->tx_max_time, in cmd_info()
3528 info.le.data_len->rx_max_len, info.le.data_len->rx_max_time); in cmd_info()
3532 info.le.subrate->factor, info.le.subrate->continuation_number); in cmd_info()
3558 sh->ctx->active_cmd.syntax); in cmd_conn_update()
3559 return -ENOEXEC; in cmd_conn_update()
3606 sh->ctx->active_cmd.syntax); in cmd_conn_data_len_update()
3607 return -ENOEXEC; in cmd_conn_data_len_update()
3623 phy = info.le.phy->tx_phy; in cmd_conn_data_len_update()
3650 sh->ctx->active_cmd.syntax); in cmd_conn_phy_update()
3651 return -ENOEXEC; in cmd_conn_phy_update()
3689 return -ENOEXEC; in cmd_chan_map()
3742 return -ENOEXEC; in cmd_oob_remote()
3780 return -ENOEXEC; in cmd_clear()
3810 return -ENOEXEC; in cmd_security()
3819 sec = *argv[1] - '0'; in cmd_security()
3824 return -ENOEXEC; in cmd_security()
3830 return -ENOEXEC; in cmd_security()
3834 if (!strcmp(argv[2], "force-pair")) { in cmd_security()
3838 return -ENOEXEC; in cmd_security()
3875 return -ENOEXEC; in cmd_conn_bondable()
3889 return -ENOEXEC; in cmd_conn_bondable()
3901 bt_addr_le_to_str(&info->addr, addr, sizeof(addr)); in bond_info()
4030 /* clear connection reference for sec mode 3 pairing */ in auth_cancel()
4076 if (oob_info->type == BT_CONN_OOB_LE_SC) { in auth_pairing_oob_data_request()
4078 oob_info->lesc.oob_config != BT_CONN_OOB_REMOTE_ONLY in auth_pairing_oob_data_request()
4082 oob_info->lesc.oob_config != BT_CONN_OOB_LOCAL_ONLY in auth_pairing_oob_data_request()
4106 oob_config_str(oob_info->lesc.oob_config), addr); in auth_pairing_oob_data_request()
4156 * Save connection info since in security mode 3 (link level enforced in auth_pincode_entry()
4172 feat->io_capability, feat->oob_data_flag, in pairing_accept()
4173 feat->auth_req, feat->max_enc_key_size, in pairing_accept()
4174 feat->init_key_dist, feat->resp_key_dist); in pairing_accept()
4337 return -ENOEXEC; in cmd_auth_cancel()
4350 return -ENOEXEC; in cmd_auth_passkey_confirm()
4362 return -ENOEXEC; in cmd_auth_pairing_confirm()
4435 } else if (!strcmp(arg, "no-1m")) { in cmd_fal_connect()
4482 shell_print(sh, "Passkey should be between 0-999999"); in cmd_fixed_passkey()
4483 return -ENOEXEC; in cmd_fixed_passkey()
4503 return -ENOEXEC; in cmd_auth_passkey()
4508 shell_print(sh, "Passkey should be between 0-999999"); in cmd_auth_passkey()
4509 return -EINVAL; in cmd_auth_passkey()
4530 return -ENOEXEC; in cmd_auth_passkey_notify()
4541 return -EINVAL; in cmd_auth_passkey_notify()
4564 return -EINVAL; in cmd_auth_oob_tk()
4589 return -ENOEXEC; in cmd_encrypted_ad_set_keys()
4595 return -ENOEXEC; in cmd_encrypted_ad_set_keys()
4617 return -ENOEXEC; in encrypted_ad_store_ad()
4673 return -ENOEXEC; in cmd_encrypted_ad_add_ead()
4679 return -ENOEXEC; in cmd_encrypted_ad_add_ead()
4685 return -ENOEXEC; in cmd_encrypted_ad_add_ead()
4688 /* store not-yet encrypted AD but claim the expected size of encrypted AD */ in cmd_encrypted_ad_add_ead()
4707 return -ENOEXEC; in cmd_encrypted_ad_add_ad()
4714 ad_len = payload[0] - 1; in cmd_encrypted_ad_add_ad()
4723 "Core Spec. Only one non-encrypted AD payload can be added at a time."); in cmd_encrypted_ad_add_ad()
4724 return -ENOEXEC; in cmd_encrypted_ad_add_ad()
4750 return -1; in ead_encrypt_ad()
4773 ad->data_len = bt_shell_ead_data[idx] - 1; in ead_update_ad()
4775 if (ad->data_len < 0) { in ead_update_ad()
4778 return -ENOEXEC; in ead_update_ad()
4781 ad->type = bt_shell_ead_data[idx + 1]; in ead_update_ad()
4783 if (ad->data_len > 0) { in ead_update_ad()
4784 if (ad->type == BT_DATA_ENCRYPTED_AD_DATA) { in ead_update_ad()
4785 /* for EAD the size used to store the non-encrypted data in ead_update_ad()
4789 BT_EAD_DECRYPTED_PAYLOAD_SIZE(ad->data_len), in ead_update_ad()
4792 ad->data = &encrypted_data_buf[encrypted_data_buf_len]; in ead_update_ad()
4793 encrypted_data_buf_len += ad->data_len; in ead_update_ad()
4795 ad->data = &bt_shell_ead_data[idx + 2]; in ead_update_ad()
4800 idx += ad->data_len + 2; in ead_update_ad()
4806 return -ENOEXEC; in ead_update_ad()
4832 return -ENOEXEC; in cmd_encrypted_ad_decrypt_scan()
4848 return -EINVAL; in cmd_default_handler()
4857 #define EXT_ADV_SCAN_OPT " [coded] [no-1m]"
4859 "<type: conn-scan conn-nscan, nconn-scan nconn-nscan> " \
4860 "[ext-adv] [no-2m] [coded] [anon] [tx-power] [scan-reports] " \
4861 "[filter-accept-list: fal, fal-scan, fal-conn] [identity] " \
4862 "[directed " HELP_ADDR_LE "] [mode: low] [dir-rpa] " \
4863 "[disable-37] [disable-38] [disable-39]"
4889 SHELL_CMD_ARG(set-keys, NULL, "<session key> <init vector>", cmd_encrypted_ad_set_keys, 3,
4891 SHELL_CMD_ARG(add-ead, NULL, "<advertising data>", cmd_encrypted_ad_add_ead, 2, 0),
4892 SHELL_CMD_ARG(add-ad, NULL, "<advertising data>", cmd_encrypted_ad_add_ad, 2, 0),
4893 SHELL_CMD(clear-ad, NULL, HELP_NONE, cmd_encrypted_ad_clear_ad),
4894 SHELL_CMD(commit-ad, NULL, HELP_NONE, cmd_encrypted_ad_commit_ad),
4895 SHELL_CMD_ARG(decrypt-scan, NULL, HELP_ONOFF, cmd_encrypted_ad_decrypt_scan, 2, 0),
4900 SHELL_CMD_ARG(init, NULL, "[no-settings-load], [sync]",
4904 SHELL_CMD_ARG(settings-load, NULL, HELP_NONE, cmd_settings_load, 1, 0),
4907 SHELL_CMD_ARG(hci-cmd, NULL, "<ogf> <ocf> [data]", cmd_hci_cmd, 3, 1),
4909 SHELL_CMD_ARG(id-create, NULL, HELP_ADDR, cmd_id_create, 1, 1),
4910 SHELL_CMD_ARG(id-reset, NULL, "<id> "HELP_ADDR, cmd_id_reset, 2, 1),
4911 SHELL_CMD_ARG(id-delete, NULL, "<id>", cmd_id_delete, 2, 0),
4912 SHELL_CMD_ARG(id-show, NULL, HELP_NONE, cmd_id_show, 1, 0),
4913 SHELL_CMD_ARG(id-select, NULL, "<id>", cmd_id_select, 2, 0),
4925 SHELL_CMD(scan-filter-set, &bt_scan_filter_set_cmds,
4928 SHELL_CMD(scan-filter-clear, &bt_scan_filter_clear_cmds,
4931 SHELL_CMD_ARG(scan-verbose-output, NULL, "<value: on, off>", cmd_scan_verbose_output, 2, 0),
4934 SHELL_CMD_ARG(read-remote-tx-power, NULL, HELP_NONE, cmd_read_remote_tx_power, 2, 0),
4935 SHELL_CMD_ARG(read-local-tx-power, NULL, HELP_NONE, cmd_read_local_tx_power, 2, 0),
4936 SHELL_CMD_ARG(set-power-report-enable, NULL, HELP_NONE, cmd_set_power_report_enable, 3, 0),
4939 SHELL_CMD_ARG(path-loss-monitoring-set-params, NULL,
4940 "<high threshold> <high hysteresis> <low threshold> <low hysteresis> <min time spent>",
4942 SHELL_CMD_ARG(path-loss-monitoring-enable, NULL, "<enable: true, false>",
4946 SHELL_CMD_ARG(subrate-set-defaults, NULL,
4950 SHELL_CMD_ARG(subrate-request, NULL,
4957 "<type: off, on, nconn> [mode: discov, non_discov] "
4958 "[filter-accept-list: fal, fal-scan, fal-conn] [identity] [no-name] "
4959 "[name-ad] [appearance] "
4960 "[disable-37] [disable-38] [disable-39]",
4963 SHELL_CMD_ARG(directed-adv, NULL, HELP_ADDR_LE " [mode: low] "
4964 "[identity] [dir-rpa]",
4968 SHELL_CMD_ARG(adv-create, NULL, EXT_ADV_PARAM, cmd_adv_create, 2, 11),
4969 SHELL_CMD_ARG(adv-param, NULL, EXT_ADV_PARAM, cmd_adv_param, 2, 11),
4970 SHELL_CMD_ARG(adv-data, NULL, "<data> [scan-response <data>] "
4972 "[name <str>] [dev-name]",
4974 SHELL_CMD_ARG(adv-start, NULL,
4975 "[timeout <timeout>] [num-events <num events>]",
4977 SHELL_CMD_ARG(adv-stop, NULL, HELP_NONE, cmd_adv_stop, 1, 0),
4978 SHELL_CMD_ARG(adv-delete, NULL, HELP_NONE, cmd_adv_delete, 1, 0),
4979 SHELL_CMD_ARG(adv-select, NULL, "[adv]", cmd_adv_select, 1, 1),
4980 SHELL_CMD_ARG(adv-info, NULL, HELP_NONE, cmd_adv_info, 1, 0),
4982 SHELL_CMD_ARG(adv-oob, NULL, HELP_NONE, cmd_adv_oob, 1, 0),
4985 SHELL_CMD_ARG(adv-rpa-expire, NULL, HELP_ONOFF, cmd_adv_rpa_expire, 2, 0),
4988 SHELL_CMD_ARG(per-adv, NULL, HELP_ONOFF, cmd_per_adv, 2, 0),
4989 SHELL_CMD_ARG(per-adv-param, NULL,
4990 "[<interval-min> [<interval-max> [tx_power]]]",
4992 SHELL_CMD_ARG(per-adv-data, NULL, "[data]", cmd_per_adv_data, 1, 1),
4997 SHELL_CMD_ARG(per-adv-sync-create, NULL,
5001 SHELL_CMD_ARG(per-adv-sync-delete, NULL, "[<index>]",
5003 SHELL_CMD_ARG(per-adv-sync-select, NULL, "[adv]", cmd_per_adv_sync_select, 1, 1),
5006 SHELL_CMD(encrypted-ad, &bt_encrypted_ad_cmds, "Manage advertiser with encrypted data",
5011 SHELL_CMD_ARG(past-subscribe, NULL, "[conn] [skip <count>] "
5014 SHELL_CMD_ARG(past-unsubscribe, NULL, "[conn]",
5019 SHELL_CMD_ARG(per-adv-sync-transfer, NULL, "[<index>]",
5023 SHELL_CMD_ARG(per-adv-set-info-transfer, NULL, "",
5030 SHELL_CMD_ARG(connect-name, NULL, "<name filter>",
5036 SHELL_CMD_ARG(conn-update, NULL, "<min> <max> <latency> <timeout>",
5039 SHELL_CMD_ARG(data-len-update, NULL, "<tx_max_len> [tx_max_time]",
5043 SHELL_CMD_ARG(phy-update, NULL, "<tx_phy> [rx_phy] [s2] [s8]",
5047 SHELL_CMD_ARG(channel-map, NULL, "<channel-map: XXXXXXXXXX> (36-0)",
5053 SHELL_CMD_ARG(security, NULL, "<security level BR/EDR: 0 - 3, "
5054 "LE: 1 - 4> [force-pair]",
5059 SHELL_CMD_ARG(conn-bondable, NULL, HELP_ONOFF, cmd_conn_bondable, 2, 0),
5067 SHELL_CMD_ARG(auth-cancel, NULL, HELP_NONE, cmd_auth_cancel, 1, 0),
5068 SHELL_CMD_ARG(auth-passkey, NULL, "<passkey>", cmd_auth_passkey, 2, 0),
5070 SHELL_CMD_ARG(auth-passkey-notify, NULL, "<type>",
5073 SHELL_CMD_ARG(auth-passkey-confirm, NULL, HELP_NONE,
5075 SHELL_CMD_ARG(auth-pairing-confirm, NULL, HELP_NONE,
5078 SHELL_CMD_ARG(auth-oob-tk, NULL, "<tk>", cmd_auth_oob_tk, 2, 0),
5080 SHELL_CMD_ARG(oob-remote, NULL,
5083 SHELL_CMD_ARG(oob-clear, NULL, HELP_NONE, cmd_oob_clear, 1, 0),
5085 SHELL_CMD_ARG(fal-add, NULL, HELP_ADDR_LE, cmd_fal_add, 3, 0),
5086 SHELL_CMD_ARG(fal-rem, NULL, HELP_ADDR_LE, cmd_fal_rem, 3, 0),
5087 SHELL_CMD_ARG(fal-clear, NULL, HELP_NONE, cmd_fal_clear, 1, 0),
5090 SHELL_CMD_ARG(fal-connect, NULL, HELP_ONOFF EXT_ADV_SCAN_OPT,
5095 SHELL_CMD_ARG(fixed-passkey, NULL, "[passkey]", cmd_fixed_passkey,
5105 SHELL_CMD(ll-addr, NULL, "<random|public>", cmd_ll_addr_read),