From patchwork Mon Sep 6 08:04:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Archie Pusaka X-Patchwork-Id: 507615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93716C433EF for ; Mon, 6 Sep 2021 08:05:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F0476044F for ; Mon, 6 Sep 2021 08:05:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240621AbhIFIGY (ORCPT ); Mon, 6 Sep 2021 04:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240600AbhIFIGX (ORCPT ); Mon, 6 Sep 2021 04:06:23 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EBDDC061575 for ; Mon, 6 Sep 2021 01:05:17 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id d13-20020a056a0010cd00b003eb385150d1so2987308pfu.10 for ; Mon, 06 Sep 2021 01:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=NU7WehHP1bxjAeJE/FjFEFd5yFXHAoiOUvoBXgbxPBI=; b=P1wxOnlngtLhDpWUvTBw6endq9YOVQK7OPM6WOhJ96z8uqIbo2NoxtCeIVm0wZ7NpH XJ/CpX6eV0Xh7rbi6E4miH7nFkpnid8Xfk6BDt9N2YBOOAHjt80hehz/JdTiEajDXmtB 6nuavq7+nFO1TAuEr4cRZopjnG0qDFpxYHWd6jiwg8h17YkidF5EdZBWVkQLZ4J8PbEr jLZX2l3pGJemlcqKQ54/etDI3rS2u3cUlh81nVqemPVCyPmjTFbMDlKNpZoJ2enhrY25 rxLwU07DwCQP47jBMmQz8keGwOBggBgLfOv39FLw7fcLktF0nu3xT+PDLX9WAnSnyqi1 Z8ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=NU7WehHP1bxjAeJE/FjFEFd5yFXHAoiOUvoBXgbxPBI=; b=NjAhhB/x1175Ma2bOE7hY6GxRN1d9+Dym45f1zpajlHfLDel0T3HQN2qk9t7kEb+8X rmYqywaGIzyCdx9cdQVaQPBnSHfIaht0vTkEAB2m3RdR3I6w4rL56jR3O/iJiB4WAcsE dfzwFERIzUwRALUGQIp+V/8dp0H4sBmgQO//Bss4fpz42+PlNwoUlrTxIo03Dm/cO2B9 KbTaXI5SLGbwT1xndHyf5bVsktqjZwPQLdWWY8DMihyuz+K3jPcHkkzewTPxC0iGJLK0 9o4Q200ile91U0F9Ex6IdMRvXc6aXaKGVlGWCUAGKe0FSaGRny4uLZtE2yuwrgC4PCkF QjJw== X-Gm-Message-State: AOAM530MfKAjO3m/R8ixBV2bG8G0Xb0Fjd0NL2ZDWBsafPnkEN6LpgU4 2wm3rbldhGpeBwz/vZEUinwXv379GewKnbD2Pn7VFJwZpOkii7oFMP7VsC6yL6CWsFTxnos8dht 2p+xtXG7bRiodS0hOQOx3h8whE3uyOe2KRGHat1WcY4a3/VuM8rJZi1JSwrhVIuStKWVMCvxDMO fy X-Google-Smtp-Source: ABdhPJxOyHW14+OyBwyOju5z2nGQyTF/hlXZ5nh5nK6T/ZpF/iV+SodtML4ZkUDQggjXhKL0VN699t3HcrzA X-Received: from apusaka-p920.tpe.corp.google.com ([2401:fa00:1:10:3b13:95ba:12e5:7134]) (user=apusaka job=sendgmr) by 2002:a17:90a:7f04:: with SMTP id k4mr860365pjl.0.1630915516333; Mon, 06 Sep 2021 01:05:16 -0700 (PDT) Date: Mon, 6 Sep 2021 16:04:43 +0800 In-Reply-To: <20210906080450.1771211-1-apusaka@google.com> Message-Id: <20210906160340.Bluez.v4.5.I700d72f935b48346f2e74088152eeef41dc5b938@changeid> Mime-Version: 1.0 References: <20210906080450.1771211-1-apusaka@google.com> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog Subject: [Bluez PATCH v4 05/12] tools: Inclusive language changes From: Archie Pusaka To: linux-bluetooth , Luiz Augusto von Dentz Cc: CrosBT Upstreaming , Archie Pusaka Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Archie Pusaka BT core spec 5.3 promotes the usage of inclusive languages. This CL replaces some terms with the more appropriate counterparts, such as "central", "peripheral", "accept list", "reject list", and "temporary link key". Note that some suggestions come from https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf --- Changes in v4: * Aggresively fix line over 80 columns Changes in v2: * Merging several patches from the same directory into one tools/3dsp.c | 33 +++++---- tools/bdaddr.rst | 2 +- tools/btiotest.c | 22 +++--- tools/btpclientctl.c | 2 +- tools/hci-tester.c | 12 +-- tools/hciconfig.c | 148 ++++++++++++++++++++++++------------- tools/hciconfig.rst | 24 +++--- tools/hcitool.c | 102 ++++++++++++------------- tools/hcitool.rst | 30 ++++---- tools/l2cap-tester.c | 24 +++--- tools/l2test.c | 18 ++--- tools/mesh-cfgclient.c | 4 +- tools/mesh-gatt/mesh-net.h | 4 +- tools/mesh-gatt/net.c | 60 +++++++-------- tools/mesh/mesh-db.c | 28 ++++--- tools/mesh/mesh-db.h | 4 +- tools/mesh/remote.c | 53 +++++++------ tools/mesh/remote.h | 5 +- tools/meshctl.c | 6 +- tools/mgmt-tester.c | 120 +++++++++++++++--------------- tools/oobtest.c | 8 +- tools/parser/avdtp.c | 11 ++- tools/parser/csr.c | 17 +++-- tools/parser/ericsson.c | 2 +- tools/parser/hci.c | 38 +++++----- tools/parser/lmp.c | 112 ++++++++++++++-------------- tools/parser/parser.h | 2 +- tools/parser/smp.c | 12 +-- tools/rctest.c | 19 ++--- tools/rctest.rst | 4 +- tools/rfcomm-tester.c | 14 ++-- tools/rfcomm.c | 15 ++-- tools/rfcomm.rst | 2 +- tools/sco-tester.c | 10 +-- tools/smp-tester.c | 12 +-- 35 files changed, 514 insertions(+), 465 deletions(-) diff --git a/tools/3dsp.c b/tools/3dsp.c index 5227c30b63..267a39e904 100644 --- a/tools/3dsp.c +++ b/tools/3dsp.c @@ -112,10 +112,10 @@ static void start_inquiry(void) inquiry_started, NULL, NULL); } -static void set_slave_broadcast_receive(const void *data, uint8_t size, +static void set_peripheral_broadcast_receive(const void *data, uint8_t size, void *user_data) { - printf("Slave broadcast receiption enabled\n"); + printf("Peripheral broadcast reception enabled\n"); } static void sync_train_received(const void *data, uint8_t size, @@ -149,7 +149,7 @@ static void sync_train_received(const void *data, uint8_t size, bt_hci_send(hci_dev, BT_HCI_CMD_SET_PERIPHERAL_BROADCAST_RECEIVE, &cmd, sizeof(cmd), - set_slave_broadcast_receive, NULL, NULL); + set_peripheral_broadcast_receive, NULL, NULL); } static void brcm_sync_train_received(const void *data, uint8_t size, @@ -183,7 +183,7 @@ static void brcm_sync_train_received(const void *data, uint8_t size, bt_hci_send(hci_dev, BT_HCI_CMD_SET_PERIPHERAL_BROADCAST_RECEIVE, &cmd, sizeof(cmd), - set_slave_broadcast_receive, NULL, NULL); + set_peripheral_broadcast_receive, NULL, NULL); } static void truncated_page_complete(const void *data, uint8_t size, @@ -209,7 +209,7 @@ static void truncated_page_complete(const void *data, uint8_t size, NULL, NULL, NULL); } -static void slave_broadcast_timeout(const void *data, uint8_t size, +static void peripheral_broadcast_timeout(const void *data, uint8_t size, void *user_data) { const struct bt_hci_evt_peripheral_broadcast_timeout *evt = data; @@ -226,7 +226,7 @@ static void slave_broadcast_timeout(const void *data, uint8_t size, NULL, NULL, NULL); } -static void slave_broadcast_receive(const void *data, uint8_t size, +static void peripheral_broadcast_receive(const void *data, uint8_t size, void *user_data) { const struct bt_hci_evt_peripheral_broadcast_receive *evt = data; @@ -327,9 +327,9 @@ static void start_glasses(void) bt_hci_register(hci_dev, BT_HCI_EVT_TRUNCATED_PAGE_COMPLETE, truncated_page_complete, NULL, NULL); bt_hci_register(hci_dev, BT_HCI_EVT_PERIPHERAL_BROADCAST_TIMEOUT, - slave_broadcast_timeout, NULL, NULL); + peripheral_broadcast_timeout, NULL, NULL); bt_hci_register(hci_dev, BT_HCI_EVT_PERIPHERAL_BROADCAST_RECEIVE, - slave_broadcast_receive, NULL, NULL); + peripheral_broadcast_receive, NULL, NULL); start_inquiry(); } @@ -381,7 +381,7 @@ static void conn_request(const void *data, uint8_t size, void *user_data) start_sync_train(); } -static void slave_page_response_timeout(const void *data, uint8_t size, +static void peripheral_page_response_timeout(const void *data, uint8_t size, void *user_data) { printf("Incoming truncated page received\n"); @@ -389,8 +389,8 @@ static void slave_page_response_timeout(const void *data, uint8_t size, start_sync_train(); } -static void slave_broadcast_channel_map_change(const void *data, uint8_t size, - void *user_data) +static void peripheral_broadcast_channel_map_change(const void *data, + uint8_t size, void *user_data) { printf("Broadcast channel map changed\n"); @@ -447,13 +447,14 @@ static void read_clock(const void *data, uint8_t size, void *user_data) bcastdata, sizeof(bcastdata), NULL, NULL, NULL); } -static void set_slave_broadcast(const void *data, uint8_t size, void *user_data) +static void set_peripheral_broadcast(const void *data, uint8_t size, + void *user_data) { const struct bt_hci_rsp_set_peripheral_broadcast *rsp = data; struct bt_hci_cmd_read_clock cmd; if (rsp->status) { - printf("Failed to set slave broadcast transmission\n"); + printf("Failed to set peripheral broadcast transmission\n"); shutdown_device(); return; } @@ -493,10 +494,10 @@ static void start_display(void) conn_request, NULL, NULL); bt_hci_register(hci_dev, BT_HCI_EVT_PERIPHERAL_PAGE_RESPONSE_TIMEOUT, - slave_page_response_timeout, NULL, NULL); + peripheral_page_response_timeout, NULL, NULL); bt_hci_register(hci_dev, BT_HCI_EVT_PERIPHERAL_BROADCAST_CHANNEL_MAP_CHANGE, - slave_broadcast_channel_map_change, NULL, NULL); + peripheral_broadcast_channel_map_change, NULL, NULL); bt_hci_register(hci_dev, BT_HCI_EVT_SYNC_TRAIN_COMPLETE, sync_train_complete, NULL, NULL); @@ -512,7 +513,7 @@ static void start_display(void) cmd.timeout = cpu_to_le16(0xfffe); bt_hci_send(hci_dev, BT_HCI_CMD_SET_PERIPHERAL_BROADCAST, &cmd, - sizeof(cmd), set_slave_broadcast, NULL, NULL); + sizeof(cmd), set_peripheral_broadcast, NULL, NULL); } static void signal_callback(int signum, void *user_data) diff --git a/tools/bdaddr.rst b/tools/bdaddr.rst index 1d21e2ca39..a84950bc35 100644 --- a/tools/bdaddr.rst +++ b/tools/bdaddr.rst @@ -61,7 +61,7 @@ FILES ===== /usr/share/misc/oui.txt - IEEE Organizationally Unique Identifier master file. + IEEE Organizationally Unique Identifier consolidated file. Manually update from: http://standards.ieee.org/regauth/oui/oui.txt diff --git a/tools/btiotest.c b/tools/btiotest.c index 3f4900a5a5..1da8c20caf 100644 --- a/tools/btiotest.c +++ b/tools/btiotest.c @@ -310,7 +310,7 @@ static void l2cap_connect(const char *src, const char *dst, uint8_t addr_type, static void l2cap_listen(const char *src, uint8_t addr_type, uint16_t psm, uint16_t cid, int defer, int reject, int disconn, int accept, int sec, - gboolean master) + gboolean central) { struct io_data *data; BtIOConnect conn; @@ -343,7 +343,7 @@ static void l2cap_listen(const char *src, uint8_t addr_type, uint16_t psm, BT_IO_OPT_PSM, psm, BT_IO_OPT_CID, cid, BT_IO_OPT_SEC_LEVEL, sec, - BT_IO_OPT_CENTRAL, master, + BT_IO_OPT_CENTRAL, central, BT_IO_OPT_INVALID); else l2_srv = bt_io_listen(conn, cfm, data, @@ -353,7 +353,7 @@ static void l2cap_listen(const char *src, uint8_t addr_type, uint16_t psm, BT_IO_OPT_PSM, psm, BT_IO_OPT_CID, cid, BT_IO_OPT_SEC_LEVEL, sec, - BT_IO_OPT_CENTRAL, master, + BT_IO_OPT_CENTRAL, central, BT_IO_OPT_INVALID); if (!l2_srv) { @@ -402,7 +402,7 @@ static void rfcomm_connect(const char *src, const char *dst, uint8_t ch, static void rfcomm_listen(const char *src, uint8_t ch, gboolean defer, int reject, int disconn, int accept, - int sec, gboolean master) + int sec, gboolean central) { struct io_data *data; BtIOConnect conn; @@ -427,7 +427,7 @@ static void rfcomm_listen(const char *src, uint8_t ch, gboolean defer, BT_IO_OPT_SOURCE, src, BT_IO_OPT_CHANNEL, ch, BT_IO_OPT_SEC_LEVEL, sec, - BT_IO_OPT_CENTRAL, master, + BT_IO_OPT_CENTRAL, central, BT_IO_OPT_INVALID); else rc_srv = bt_io_listen(conn, cfm, @@ -435,7 +435,7 @@ static void rfcomm_listen(const char *src, uint8_t ch, gboolean defer, &err, BT_IO_OPT_CHANNEL, ch, BT_IO_OPT_SEC_LEVEL, sec, - BT_IO_OPT_CENTRAL, master, + BT_IO_OPT_CENTRAL, central, BT_IO_OPT_INVALID); if (!rc_srv) { @@ -540,7 +540,7 @@ static int opt_reject = -1; static int opt_disconn = -1; static int opt_accept = DEFAULT_ACCEPT_TIMEOUT; static int opt_sec = 0; -static gboolean opt_master = FALSE; +static gboolean opt_central = FALSE; static int opt_priority = 0; static int opt_cid = 0; static guint8 opt_addr_type = 0; @@ -576,8 +576,8 @@ static GOptionEntry options[] = { "Disconnect connection after N seconds" }, { "accept", 'a', 0, G_OPTION_ARG_INT, &opt_accept, "Accept connection after N seconds" }, - { "master", 'm', 0, G_OPTION_ARG_NONE, &opt_master, - "Master role switch (incoming connections)" }, + { "central", 'C', 0, G_OPTION_ARG_NONE, &opt_central, + "Central role switch (incoming connections)" }, { "priority", 'P', 0, G_OPTION_ARG_INT, &opt_priority, "Transmission priority: Setting a priority " "outside the range 0 to 6 requires the" @@ -614,7 +614,7 @@ int main(int argc, char *argv[]) else l2cap_listen(opt_dev, opt_addr_type, opt_psm, opt_cid, opt_defer, opt_reject, opt_disconn, - opt_accept, opt_sec, opt_master); + opt_accept, opt_sec, opt_central); } if (opt_channel != -1) { @@ -624,7 +624,7 @@ int main(int argc, char *argv[]) else rfcomm_listen(opt_dev, opt_channel, opt_defer, opt_reject, opt_disconn, opt_accept, - opt_sec, opt_master); + opt_sec, opt_central); } if (opt_sco) { diff --git a/tools/btpclientctl.c b/tools/btpclientctl.c index 6553f2f3a7..c30d5bd4e7 100644 --- a/tools/btpclientctl.c +++ b/tools/btpclientctl.c @@ -676,7 +676,7 @@ const struct indexstr_data ad_type_table[] = { { 0x10, "BT_AD_DEVICE_ID" }, { 0x10, "BT_AD_SMP_TK" }, { 0x11, "BT_AD_SMP_OOB_FLAGS" }, - { 0x12, "BT_AD_SLAVE_CONN_INTERVAL" }, + { 0x12, "BT_AD_PERIPHERAL_CONN_INTERVAL" }, { 0x14, "BT_AD_SOLICIT16" }, { 0x15, "BT_AD_SOLICIT128" }, { 0x16, "BT_AD_SERVICE_DATA16" }, diff --git a/tools/hci-tester.c b/tools/hci-tester.c index 645d89e721..79193220fe 100644 --- a/tools/hci-tester.c +++ b/tools/hci-tester.c @@ -335,12 +335,12 @@ static void test_read_local_supported_codecs(const void *test_data) test_command(BT_HCI_CMD_READ_LOCAL_CODECS); } -static void test_le_read_white_list_size(const void *test_data) +static void test_le_read_accept_list_size(const void *test_data) { test_command(BT_HCI_CMD_LE_READ_ACCEPT_LIST_SIZE); } -static void test_le_clear_white_list(const void *test_data) +static void test_le_clear_accept_list(const void *test_data) { test_command(BT_HCI_CMD_LE_CLEAR_ACCEPT_LIST); } @@ -944,10 +944,10 @@ int main(int argc, char *argv[]) test_hci_local("Read Local Supported Codecs", NULL, NULL, test_read_local_supported_codecs); - test_hci_local("LE Read White List Size", NULL, NULL, - test_le_read_white_list_size); - test_hci_local("LE Clear White List", NULL, NULL, - test_le_clear_white_list); + test_hci_local("LE Read Accept List Size", NULL, NULL, + test_le_read_accept_list_size); + test_hci_local("LE Clear Accept List", NULL, NULL, + test_le_clear_accept_list); test_hci_local("LE Encrypt", NULL, NULL, test_le_encrypt); test_hci_local("LE Rand", NULL, NULL, diff --git a/tools/hciconfig.c b/tools/hciconfig.c index 491f216135..e4d5215833 100644 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -116,8 +116,8 @@ static void print_le_states(uint64_t states) "Directed Advertising State", "Passive Scanning State", "Active Scanning State", - "Initiating State/Connection State in Master Role", - "Connection State in the Slave Role", + "Initiating State/Connection State in Central Role", + "Connection State in the Peripheral Role", "Non-connectable Advertising State and Passive Scanning State combination", "Scannable Advertising State and Passive Scanning State combination", "Connectable Advertising State and Passive Scanning State combination", @@ -128,17 +128,17 @@ static void print_le_states(uint64_t states) "Directed Advertising State and Active Scanning State combination", "Non-connectable Advertising State and Initiating State combination", "Scannable Advertising State and Initiating State combination", - "Non-connectable Advertising State and Master Role combination", - "Scannable Advertising State and Master Role combination", - "Non-connectable Advertising State and Slave Role combination", - "Scannable Advertising State and Slave Role combination", + "Non-connectable Advertising State and Central Role combination", + "Scannable Advertising State and Central Role combination", + "Non-connectable Advertising State and Peripheral Role combination", + "Scannable Advertising State and Peripheral Role combination", "Passive Scanning State and Initiating State combination", "Active Scanning State and Initiating State combination", - "Passive Scanning State and Master Role combination", - "Active Scanning State and Master Role combination", - "Passive Scanning State and Slave Role combination", - "Active Scanning State and Slave Role combination", - "Initiating State and Master Role combination/Master Role and Master Role combination", + "Passive Scanning State and Central Role combination", + "Active Scanning State and Central Role combination", + "Passive Scanning State and Peripheral Role combination", + "Active Scanning State and Peripheral Role combination", + "Initiating State and Central Role combination/Central Role and Central Role combination", NULL }; @@ -1886,50 +1886,92 @@ static struct { char *opt; char *doc; } command[] = { - { "up", cmd_up, 0, "Open and initialize HCI device" }, - { "down", cmd_down, 0, "Close HCI device" }, - { "reset", cmd_reset, 0, "Reset HCI device" }, - { "rstat", cmd_rstat, 0, "Reset statistic counters" }, - { "auth", cmd_auth, 0, "Enable Authentication" }, - { "noauth", cmd_auth, 0, "Disable Authentication" }, - { "encrypt", cmd_encrypt, 0, "Enable Encryption" }, - { "noencrypt", cmd_encrypt, 0, "Disable Encryption" }, - { "piscan", cmd_scan, 0, "Enable Page and Inquiry scan" }, - { "noscan", cmd_scan, 0, "Disable scan" }, - { "iscan", cmd_scan, 0, "Enable Inquiry scan" }, - { "pscan", cmd_scan, 0, "Enable Page scan" }, - { "ptype", cmd_ptype, "[type]", "Get/Set default packet type" }, - { "lm", cmd_lm, "[mode]", "Get/Set default link mode" }, - { "lp", cmd_lp, "[policy]", "Get/Set default link policy" }, - { "name", cmd_name, "[name]", "Get/Set local name" }, - { "class", cmd_class, "[class]", "Get/Set class of device" }, - { "voice", cmd_voice, "[voice]", "Get/Set voice setting" }, - { "iac", cmd_iac, "[iac]", "Get/Set inquiry access code" }, - { "inqtpl", cmd_inq_tpl, "[level]", "Get/Set inquiry transmit power level" }, - { "inqmode", cmd_inq_mode, "[mode]", "Get/Set inquiry mode" }, - { "inqdata", cmd_inq_data, "[data]", "Get/Set inquiry data" }, - { "inqtype", cmd_inq_type, "[type]", "Get/Set inquiry scan type" }, - { "inqparms", cmd_inq_parms, "[win:int]", "Get/Set inquiry scan window and interval" }, - { "pageparms", cmd_page_parms, "[win:int]", "Get/Set page scan window and interval" }, - { "pageto", cmd_page_to, "[to]", "Get/Set page timeout" }, - { "afhmode", cmd_afh_mode, "[mode]", "Get/Set AFH mode" }, - { "sspmode", cmd_ssp_mode, "[mode]", "Get/Set Simple Pairing Mode" }, - { "aclmtu", cmd_aclmtu, "", "Set ACL MTU and number of packets" }, - { "scomtu", cmd_scomtu, "", "Set SCO MTU and number of packets" }, - { "delkey", cmd_delkey, "", "Delete link key from the device" }, - { "oobdata", cmd_oob_data, 0, "Get local OOB data" }, - { "commands", cmd_commands, 0, "Display supported commands" }, - { "features", cmd_features, 0, "Display device features" }, - { "version", cmd_version, 0, "Display version information" }, - { "revision", cmd_revision, 0, "Display revision information" }, - { "block", cmd_block, "", "Add a device to the blacklist" }, - { "unblock", cmd_unblock, "", "Remove a device from the blacklist" }, - { "lerandaddr", cmd_le_addr, "", "Set LE Random Address" }, - { "leadv", cmd_le_adv, "[type]", "Enable LE advertising" + { "up", cmd_up, 0, + "Open and initialize HCI device" }, + { "down", cmd_down, 0, + "Close HCI device" }, + { "reset", cmd_reset, 0, + "Reset HCI device" }, + { "rstat", cmd_rstat, 0, + "Reset statistic counters" }, + { "auth", cmd_auth, 0, + "Enable Authentication" }, + { "noauth", cmd_auth, 0, + "Disable Authentication" }, + { "encrypt", cmd_encrypt, 0, + "Enable Encryption" }, + { "noencrypt", cmd_encrypt, 0, + "Disable Encryption" }, + { "piscan", cmd_scan, 0, + "Enable Page and Inquiry scan" }, + { "noscan", cmd_scan, 0, + "Disable scan" }, + { "iscan", cmd_scan, 0, + "Enable Inquiry scan" }, + { "pscan", cmd_scan, 0, + "Enable Page scan" }, + { "ptype", cmd_ptype, "[type]", + "Get/Set default packet type" }, + { "lm", cmd_lm, "[mode]", + "Get/Set default link mode" }, + { "lp", cmd_lp, "[policy]", + "Get/Set default link policy" }, + { "name", cmd_name, "[name]", + "Get/Set local name" }, + { "class", cmd_class, "[class]", + "Get/Set class of device" }, + { "voice", cmd_voice, "[voice]", + "Get/Set voice setting" }, + { "iac", cmd_iac, "[iac]", + "Get/Set inquiry access code" }, + { "inqtpl", cmd_inq_tpl, "[level]", + "Get/Set inquiry transmit power level" }, + { "inqmode", cmd_inq_mode, "[mode]", + "Get/Set inquiry mode" }, + { "inqdata", cmd_inq_data, "[data]", + "Get/Set inquiry data" }, + { "inqtype", cmd_inq_type, "[type]", + "Get/Set inquiry scan type" }, + { "inqparms", cmd_inq_parms, "[win:int]", + "Get/Set inquiry scan window and interval" }, + { "pageparms", cmd_page_parms, "[win:int]", + "Get/Set page scan window and interval" }, + { "pageto", cmd_page_to, "[to]", + "Get/Set page timeout" }, + { "afhmode", cmd_afh_mode, "[mode]", + "Get/Set AFH mode" }, + { "sspmode", cmd_ssp_mode, "[mode]", + "Get/Set Simple Pairing Mode" }, + { "aclmtu", cmd_aclmtu, "", + "Set ACL MTU and number of packets" }, + { "scomtu", cmd_scomtu, "", + "Set SCO MTU and number of packets" }, + { "delkey", cmd_delkey, "", + "Delete link key from the device" }, + { "oobdata", cmd_oob_data, 0, + "Get local OOB data" }, + { "commands", cmd_commands, 0, + "Display supported commands" }, + { "features", cmd_features, 0, + "Display device features" }, + { "version", cmd_version, 0, + "Display version information" }, + { "revision", cmd_revision, 0, + "Display revision information" }, + { "block", cmd_block, "", + "Add a device to the reject list" }, + { "unblock", cmd_unblock, "", + "Remove a device from the reject list" }, + { "lerandaddr", cmd_le_addr, "", + "Set LE Random Address" }, + { "leadv", cmd_le_adv, "[type]", + "Enable LE advertising" "\n\t\t\t0 - Connectable undirected advertising (default)" "\n\t\t\t3 - Non connectable undirected advertising"}, - { "noleadv", cmd_no_le_adv, 0, "Disable LE advertising" }, - { "lestates", cmd_le_states, 0, "Display the supported LE states" }, + { "noleadv", cmd_no_le_adv, 0, + "Disable LE advertising" }, + { "lestates", cmd_le_states, 0, + "Display the supported LE states" }, { NULL, NULL, 0 } }; diff --git a/tools/hciconfig.rst b/tools/hciconfig.rst index 7d59b4046e..2d56eeb413 100644 --- a/tools/hciconfig.rst +++ b/tools/hciconfig.rst @@ -216,24 +216,24 @@ revision Display revision information. lm [*mode*] - With no *mode*, prints link mode. **MASTER** or **SLAVE** mean, - respectively, to ask to become master or to remain slave when a connection - request comes in. The additional keyword **ACCEPT** means that baseband - connections will be accepted even if there are no listening *AF_BLUETOOTH* - sockets. *mode* is **NONE** or a comma-separated list of keywords, where - possible keywords are **MASTER** and **ACCEPT**. **NONE** sets link policy - to the default behaviour of remaining slave and not accepting baseband - connections when there are no listening *AF_BLUETOOTH* sockets. If - **MASTER** is present, the device will ask to become master if a - connection request comes in. If **ACCEPT** is present, the device will + With no *mode*, prints link mode. **CENTRAL** or **PERIPHERAL** mean, + respectively, to ask to become central or to remain peripheral when a + connection request comes in. The additional keyword **ACCEPT** means that + baseband connections will be accepted even if there are no listening + *AF_BLUETOOTH* sockets. *mode* is **NONE** or a comma-separated list of + keywords, where possible keywords are **CENTRAL** and **ACCEPT**. **NONE** + sets link policy to the default behaviour of remaining peripheral and not + accepting baseband connections when there are no listening *AF_BLUETOOTH* + sockets. If **CENTRAL** is present, the device will ask to become central + if a connection request comes in. If **ACCEPT** is present, the device will accept baseband connections even when there are no listening *AF_BLUETOOTH* sockets. block <*bdaddr*> - Add a device to the blacklist + Add a device to the reject list unblock <*bdaddr*> - Remove a device from the blacklist + Remove a device from the reject list lerandaddr <*bdaddr*> Set LE Random Address diff --git a/tools/hcitool.c b/tools/hcitool.c index c6a9093733..6e6a39ed2f 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -1210,10 +1210,10 @@ static struct option cc_options[] = { static const char *cc_help = "Usage:\n" - "\tcc [--role=m|s] [--ptype=pkt_types] \n" + "\tcc [--role=c|p] [--ptype=pkt_types] \n" "Example:\n" "\tcc --ptype=dm1,dh3,dh5 01:02:03:04:05:06\n" - "\tcc --role=m 01:02:03:04:05:06\n"; + "\tcc --role=c 01:02:03:04:05:06\n"; static void cmd_cc(int dev_id, int argc, char **argv) { @@ -1360,10 +1360,10 @@ static void cmd_sr(int dev_id, int argc, char **argv) str2ba(argv[0], &bdaddr); switch (argv[1][0]) { - case 'm': + case 'c': role = 0; break; - case 's': + case 'p': role = 1; break; default: @@ -2474,7 +2474,7 @@ static struct option lescan_options[] = { { "static", 0, 0, 's' }, { "privacy", 0, 0, 'p' }, { "passive", 0, 0, 'P' }, - { "whitelist", 0, 0, 'w' }, + { "acceptlist", 0, 0, 'a' }, { "discovery", 1, 0, 'd' }, { "duplicates", 0, 0, 'D' }, { 0, 0, 0, 0 } @@ -2484,7 +2484,7 @@ static const char *lescan_help = "Usage:\n" "\tlescan [--privacy] enable privacy\n" "\tlescan [--passive] set scan type passive (default active)\n" - "\tlescan [--whitelist] scan for address in the whitelist only\n" + "\tlescan [--acceptlist] scan for address in the accept list only\n" "\tlescan [--discovery=g|l] enable general or limited discovery" "procedure\n" "\tlescan [--duplicates] don't filter duplicates\n"; @@ -2511,8 +2511,8 @@ static void cmd_lescan(int dev_id, int argc, char **argv) case 'P': scan_type = 0x00; /* Passive */ break; - case 'w': - filter_policy = 0x01; /* Whitelist */ + case 'a': + filter_policy = 0x01; /* Accept list */ break; case 'd': filter_type = optarg[0]; @@ -2678,14 +2678,14 @@ static struct option lecc_options[] = { { "help", 0, 0, 'h' }, { "static", 0, 0, 's' }, { "random", 0, 0, 'r' }, - { "whitelist", 0, 0, 'w' }, + { "acceptlist", 0, 0, 'a' }, { 0, 0, 0, 0 } }; static const char *lecc_help = "Usage:\n" "\tlecc [--static] [--random] \n" - "\tlecc --whitelist\n"; + "\tlecc --acceptlist\n"; static void cmd_lecc(int dev_id, int argc, char **argv) { @@ -2707,8 +2707,8 @@ static void cmd_lecc(int dev_id, int argc, char **argv) case 'r': peer_bdaddr_type = LE_RANDOM_ADDRESS; break; - case 'w': - initiator_filter = 0x01; /* Use white list */ + case 'a': + initiator_filter = 0x01; /* Use accept list */ break; default: printf("%s", lecc_help); @@ -2753,34 +2753,34 @@ static void cmd_lecc(int dev_id, int argc, char **argv) hci_close_dev(dd); } -static struct option lewladd_options[] = { +static struct option lealall_options[] = { { "help", 0, 0, 'h' }, { "random", 0, 0, 'r' }, { 0, 0, 0, 0 } }; -static const char *lewladd_help = +static const char *lealall_help = "Usage:\n" - "\tlewladd [--random] \n"; + "\tlealall [--random] \n"; -static void cmd_lewladd(int dev_id, int argc, char **argv) +static void cmd_lealall(int dev_id, int argc, char **argv) { int err, opt, dd; bdaddr_t bdaddr; uint8_t bdaddr_type = LE_PUBLIC_ADDRESS; - for_each_opt(opt, lewladd_options, NULL) { + for_each_opt(opt, lealall_options, NULL) { switch (opt) { case 'r': bdaddr_type = LE_RANDOM_ADDRESS; break; default: - printf("%s", lewladd_help); + printf("%s", lealall_help); return; } } - helper_arg(1, 1, &argc, &argv, lewladd_help); + helper_arg(1, 1, &argc, &argv, lealall_help); if (dev_id < 0) dev_id = hci_get_route(NULL); @@ -2798,35 +2798,35 @@ static void cmd_lewladd(int dev_id, int argc, char **argv) if (err < 0) { err = -errno; - fprintf(stderr, "Can't add to white list: %s(%d)\n", + fprintf(stderr, "Can't add to accept list: %s(%d)\n", strerror(-err), -err); exit(1); } } -static struct option lewlrm_options[] = { +static struct option lealrm_options[] = { { "help", 0, 0, 'h' }, { 0, 0, 0, 0 } }; -static const char *lewlrm_help = +static const char *lealrm_help = "Usage:\n" - "\tlewlrm \n"; + "\tlealrm \n"; -static void cmd_lewlrm(int dev_id, int argc, char **argv) +static void cmd_lealrm(int dev_id, int argc, char **argv) { int err, opt, dd; bdaddr_t bdaddr; - for_each_opt(opt, lewlrm_options, NULL) { + for_each_opt(opt, lealrm_options, NULL) { switch (opt) { default: - printf("%s", lewlrm_help); + printf("%s", lealrm_help); return; } } - helper_arg(1, 1, &argc, &argv, lewlrm_help); + helper_arg(1, 1, &argc, &argv, lealrm_help); if (dev_id < 0) dev_id = hci_get_route(NULL); @@ -2844,35 +2844,35 @@ static void cmd_lewlrm(int dev_id, int argc, char **argv) if (err < 0) { err = errno; - fprintf(stderr, "Can't remove from white list: %s(%d)\n", + fprintf(stderr, "Can't remove from accept list: %s(%d)\n", strerror(err), err); exit(1); } } -static struct option lewlsz_options[] = { +static struct option lealsz_options[] = { { "help", 0, 0, 'h' }, { 0, 0, 0, 0 } }; -static const char *lewlsz_help = +static const char *lealsz_help = "Usage:\n" - "\tlewlsz\n"; + "\tlealsz\n"; -static void cmd_lewlsz(int dev_id, int argc, char **argv) +static void cmd_lealsz(int dev_id, int argc, char **argv) { int err, dd, opt; uint8_t size; - for_each_opt(opt, lewlsz_options, NULL) { + for_each_opt(opt, lealsz_options, NULL) { switch (opt) { default: - printf("%s", lewlsz_help); + printf("%s", lealsz_help); return; } } - helper_arg(0, 0, &argc, &argv, lewlsz_help); + helper_arg(0, 0, &argc, &argv, lealsz_help); if (dev_id < 0) dev_id = hci_get_route(NULL); @@ -2888,36 +2888,36 @@ static void cmd_lewlsz(int dev_id, int argc, char **argv) if (err < 0) { err = -errno; - fprintf(stderr, "Can't read white list size: %s(%d)\n", + fprintf(stderr, "Can't read accept list size: %s(%d)\n", strerror(-err), -err); exit(1); } - printf("White list size: %d\n", size); + printf("Accept list size: %d\n", size); } -static struct option lewlclr_options[] = { +static struct option lealclr_options[] = { { "help", 0, 0, 'h' }, { 0, 0, 0, 0 } }; -static const char *lewlclr_help = +static const char *lealclr_help = "Usage:\n" - "\tlewlclr\n"; + "\tlealclr\n"; -static void cmd_lewlclr(int dev_id, int argc, char **argv) +static void cmd_lealclr(int dev_id, int argc, char **argv) { int err, dd, opt; - for_each_opt(opt, lewlclr_options, NULL) { + for_each_opt(opt, lealclr_options, NULL) { switch (opt) { default: - printf("%s", lewlclr_help); + printf("%s", lealclr_help); return; } } - helper_arg(0, 0, &argc, &argv, lewlclr_help); + helper_arg(0, 0, &argc, &argv, lealclr_help); if (dev_id < 0) dev_id = hci_get_route(NULL); @@ -2933,7 +2933,7 @@ static void cmd_lewlclr(int dev_id, int argc, char **argv) if (err < 0) { err = -errno; - fprintf(stderr, "Can't clear white list: %s(%d)\n", + fprintf(stderr, "Can't clear accept list: %s(%d)\n", strerror(-err), -err); exit(1); } @@ -3287,7 +3287,7 @@ static const char *lecup_help = "\t --handle=<0xXXXX> LE connection handle\n" "\t --min= Range: 0x0006 to 0x0C80\n" "\t --max= Range: 0x0006 to 0x0C80\n" - "\t --latency= Slave latency. Range: 0x0000 to 0x03E8\n" + "\t --latency= Peripheral latency. Range: 0x0000 to 0x03E8\n" "\t --timeout=