This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC2652P:主机测试应用程序对于某些 HCI 命令无响应

Guru**** 2587345 points
Other Parts Discussed in Thread: CC2652P

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1206729/cc2652p-host-test-app-no-response-for-some-hci-commands

器件型号:CC2652P

您好!

我正在使用 CC2652P1F 芯片和 simplelink cc13xx/cc26xx SDK v6.40.00.13 BLE5 stack host_test 应用程序。

我的应用正在使用 BlueZ 工具运行。

我 在发送某些特定 HCI 命令后收到超时错误消息。 例如操作码 0x2006、0x2008和0x2009。

 这些命令似乎会被忽略、但会处理其他 HCI 命令。 测试日志已附加。

是否有办法让  host_test 应用程序处理被忽略的命令?

谢谢、West

root@OpenWrt:/# hciattach -s 115200 /dev/ttyMSM1 any 115200 noflow nosleep
Device setup complete
root@OpenWrt:/# btmon &
root@OpenWrt:/# Bluetooth monitor ver 5.64
= New Index: 74:D2:85:B7:AF:BF (Primary,UART,hci0)              [hci0] 0.657255

root@OpenWrt:/# hciconfig
hci0:   Type: Primary  Bus: UART
        BD Address: 74:D2:85:B7:AF:BF  ACL MTU: 255:5  SCO MTU: 0:0
        DOWN
        RX bytes:224 acl:0 sco:0 events:15 errors:0
        TX bytes:84 acl:0 sco:0 commands:15 errors:0

root@OpenWrt:/# hciconfig hci0 leadv
Can't set advertise mode on hci0: Network is down (100)
root@OpenWrt:/# hciconfig hci0 up
= Open Index: 74:D2:85:B7:AF:BF                                [hci0] 42.902542
< HCI Command: Read Local Supported.. (0x04|0x0003) plen 0  #1 [hci0] 42.902785
> HCI Event: Command Complete (0x0e) plen 12                #2 [hci0] 42.907142
      Read Local Supported Features (0x04|0x0003) ncmd 1
        Status: Success (0x00)
        Features: 0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00
          BR/EDR Not Supported
          LE Supported (Controller)
< HCI Command: Read Local Version I.. (0x04|0x0001) plen 0  #3 [hci0] 42.907178
> HCI Event: Command Complete (0x0e) plen 12                #4 [hci0] 42.912847
      Read Local Version Information (0x04|0x0001) ncmd 1
        Status: Success (0x00)
        HCI version: Bluetooth 5.0 (0x09) - Revision 531 (0x0213)
        LMP version: Bluetooth 5.1 (0x0a) - Subversion 531 (0x0213)
        Manufacturer: Texas Instruments Inc. (13)
< HCI Command: Read BD ADDR (0x04|0x0009) plen 0            #5 [hci0] 42.912873
> HCI Event: Command Complete (0x0e) plen 10                #6 [hci0] 42.918226
      Read BD ADDR (0x04|0x0009) ncmd 1
        Status: Success (0x00)
        Address: 74:D2:85:B7:AF:BF (OUI 74-D2-85)
< HCI Command: LE Read Buffer Size (0x08|0x0002) plen 0     #7 [hci0] 42.918283
> HCI Event: Command Complete (0x0e) plen 7                 #8 [hci0] 42.923778
      LE Read Buffer Size (0x08|0x0002) ncmd 1
        Status: Success (0x00)
        Data packet length: 255
        Num data packets: 5
< HCI Command: LE Read Local Suppor.. (0x08|0x0003) plen 0  #9 [hci0] 42.923802
> HCI Event: Command Complete (0x0e) plen 12               #10 [hci0] 42.929361
      LE Read Local Supported Features (0x08|0x0003) ncmd 1
        Status: Success (0x00)
        Features: 0xff 0x59 0x00 0x00 0x00 0x00 0x00 0x00
          LE Encryption
          Connection Parameter Request Procedure
          Extended Reject Indication
          Peripheral-initiated Features Exchange
          LE Ping
          LE Data Packet Length Extension
          LL Privacy
          Extended Scanner Filter Policies
          LE 2M PHY
          LE Coded PHY
          LE Extended Advertising
          Channel Selection Algorithm #2
< HCI Command: LE Read Supported S.. (0x08|0x001c) plen 0  #11 [hci0] 42.929389
> HCI Event: Command Complete (0x0e) plen 12               #12 [hci0] 42.934886
      LE Read Supported States (0x08|0x001c) ncmd 1
        Status: Success (0x00)
        States: 0x000003ffffffffff
          Non-connectable Advertising State
          Scannable Advertising State
          Connectable Advertising State
          High Duty Cycle Directed Advertising State
          Passive Scanning State
          Active Scanning State
          Initiating State
            and Connection State (Central Role)
          Connection State (Peripheral Role)
          Non-connectable Advertising State
            and Passive Scanning State
          Scannable Advertising State
            and Passive Scanning State
          Connectable Advertising State
            and Passive Scanning State
          High Duty Cycle Directed Advertising State
            and Passive Scanning State
          Non-connectable Advertising State
            and Active Scanning State
          Scannable Advertising State
            and Active Scanning State
          Connectable Advertising State
            and Active Scanning State
          High Duty Cycle Directed Advertising State
            and Active Scanning State
          Non-connectable Advertising State
            and Initiating State
          Scannable Advertising State
            and Initiating State
          Non-connectable Advertising State
            and Connection State (Central Role)
          Scannable Advertising State
            and Connection State (Central Role)
          Non-connectable Advertising State
            and Connection State (Peripheral Role)
          Scannable Advertising State
            and Connection State (Peripheral Role)
          Passive Scanning State
            and Initiating State
          Active Scanning State
            and Initiating State
          Passive Scanning State
            and Connection State (Central Role)
          Active Scanning State
            and Connection State (Central Role)
          Passive Scanning State
            and Connection State (Peripheral Role)
          Active Scanning State
            and Connection State (Peripheral Role)
          Initiating State
            and Connection State (Central Role)
            and Central Role & Central Role
          Low Duty Cycle Directed Advertising State
          Low Duty Cycle Directed Advertising State
            and Passive Scanning State
          Low Duty Cycle Directed Advertising State
            and Active Scanning State
          Connectable Advertising State
            and Initiating State
            and Central Role & Peripheral Role
          High Duty Cycle Directed Advertising State
            and Initiating State
            and Central Role & Peripheral Role
          Low Duty Cycle Directed Advertising State
            and Initiating State
            and Central Role & Peripheral Role
          Connectable Advertising State
            and Connection State (Central Role)
            and Central Role & Peripheral Role
          High Duty Cycle Directed Advertising State
            and Connection State (Central Role)
            and Central Role & Peripheral Role
          Low Duty Cycle Directed Advertising State
            and Connection State (Central Role)
            and Central Role & Peripheral Role
          Connectable Advertising State
            and Connection State (Peripheral Role)
            and Central Role & Peripheral Role
          High Duty Cycle Directed Advertising State
            and Connection State (Peripheral Role)
            and Peripheral Role & Peripheral Role
          Low Duty Cycle Directed Advertising State
            and Connection State (Peripheral Role)
            and Peripheral Role & Peripheral Role
          Initiating State
            and Connection State (Peripheral Role)
            and Central Role & Peripheral Role
< HCI Command: Read Local Supporte.. (0x04|0x0002) plen 0  #13 [hci0] 42.934911
> HCI Event: Command Complete (0x0e) plen 68               #14 [hci0] 42.946009
      Read Local Supported Commands (0x04|0x0002) ncmd 1
        Status: Success (0x00)
        Commands: 67 entries
          Disconnect (Octet 0 - Bit 5)
          Read Remote Version Information (Octet 2 - Bit 7)
          Set Event Mask (Octet 5 - Bit 6)
          Reset (Octet 5 - Bit 7)
          Read Transmit Power Level (Octet 10 - Bit 2)
          Set Controller To Host Flow Control (Octet 10 - Bit 5)
          Host Buffer Size (Octet 10 - Bit 6)
          Host Number of Completed Packets (Octet 10 - Bit 7)
          Read Local Version Information (Octet 14 - Bit 3)
          Read Local Supported Features (Octet 14 - Bit 5)
          Read BD ADDR (Octet 15 - Bit 1)
          Read RSSI (Octet 15 - Bit 5)
          Set Event Mask Page 2 (Octet 22 - Bit 2)
          LE Set Event Mask (Octet 25 - Bit 0)
          LE Read Buffer Size (Octet 25 - Bit 1)
          LE Read Local Supported Features (Octet 25 - Bit 2)
          LE Set Random Address (Octet 25 - Bit 4)
          LE Set Advertising Parameters (Octet 25 - Bit 5)
          LE Read Advertising Channel TX Power (Octet 25 - Bit 6)
          LE Set Advertising Data (Octet 25 - Bit 7)
          LE Set Scan Response Data (Octet 26 - Bit 0)
          LE Set Advertise Enable (Octet 26 - Bit 1)
          LE Set Scan Parameters (Octet 26 - Bit 2)
          LE Set Scan Enable (Octet 26 - Bit 3)
          LE Create Connection (Octet 26 - Bit 4)
          LE Create Connection Cancel (Octet 26 - Bit 5)
          LE Read Accept List Size (Octet 26 - Bit 6)
          LE Clear Accept List (Octet 26 - Bit 7)
          LE Add Device To Accept List (Octet 27 - Bit 0)
          LE Remove Device From Accept List (Octet 27 - Bit 1)
          LE Connection Update (Octet 27 - Bit 2)
          LE Set Host Channel Classification (Octet 27 - Bit 3)
          LE Read Channel Map (Octet 27 - Bit 4)
          LE Read Remote Used Features (Octet 27 - Bit 5)
          LE Encrypt (Octet 27 - Bit 6)
          LE Rand (Octet 27 - Bit 7)
          LE Start Encryption (Octet 28 - Bit 0)
          LE Long Term Key Request Reply (Octet 28 - Bit 1)
          LE Long Term Key Request Neg Reply (Octet 28 - Bit 2)
          LE Read Supported States (Octet 28 - Bit 3)
          LE Receiver Test (Octet 28 - Bit 4)
          LE Transmitter Test (Octet 28 - Bit 5)
          LE Test End (Octet 28 - Bit 6)
          Read Authenticated Payload Timeout (Octet 32 - Bit 4)
          Write Authenticated Payload Timeout (Octet 32 - Bit 5)
          LE Remote Connection Parameter Request Reply (Octet 33 - Bit 4)
          LE Remote Connection Parameter Request Negative Reply (Octet 33 - Bit 5)
          LE Set Data Length (Octet 33 - Bit 6)
          LE Read Suggested Default Data Length (Octet 33 - Bit 7)
          LE Write Suggested Default Data Length (Octet 34 - Bit 0)
          LE Read Local P-256 Public Key (Octet 34 - Bit 1)
          LE Generate DHKey (Octet 34 - Bit 2)
          LE Add Device To Resolving List (Octet 34 - Bit 3)
          LE Remove Device From Resolving List (Octet 34 - Bit 4)
          LE Clear Resolving List (Octet 34 - Bit 5)
          LE Read Resolving List Size (Octet 34 - Bit 6)
          LE Read Peer Resolvable Address (Octet 34 - Bit 7)
          LE Read Local Resolvable Address (Octet 35 - Bit 0)
          LE Set Address Resolution Enable (Octet 35 - Bit 1)
          LE Set Resolvable Private Address Timeout (Octet 35 - Bit 2)
          LE Read Maximum Data Length (Octet 35 - Bit 3)
          LE Read PHY (Octet 35 - Bit 4)
          LE Set Default PHY (Octet 35 - Bit 5)
          LE Set PHY (Octet 35 - Bit 6)
          LE Enhanced Receiver Test (Octet 35 - Bit 7)
          LE Enhanced Transmitter Test (Octet 36 - Bit 0)
          LE Set Privacy Mode (Octet 39 - Bit 2)
< HCI Command: Set Event Mask (0x03|0x0001) plen 8         #15 [hci0] 42.946059
        Mask: 0x200080000204e890
          Disconnection Complete
          Encryption Change
          Read Remote Version Information Complete
          Command Complete
          Command Status
          Hardware Error
          Number of Completed Packets
          Data Buffer Overflow
          Encryption Key Refresh Complete
          LE Meta
> HCI Event: Command Complete (0x0e) plen 4                #16 [hci0] 42.951557
      Set Event Mask (0x03|0x0001) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Event Mask (0x08|0x0001) plen 8      #17 [hci0] 42.951579
        Mask: 0x00000000000005ff
          LE Connection Complete
          LE Advertising Report
          LE Connection Update Complete
          LE Read Remote Used Features Complete
          LE Long Term Key Request
          LE Remote Connection Parameter Request
          LE Data Length Change
          LE Read Local P-256 Public Key Complete
          LE Generate DHKey Complete
          LE Direct Advertising Report
> HCI Event: Command Complete (0x0e) plen 4                #18 [hci0] 42.958842
      LE Set Event Mask (0x08|0x0001) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Read Advertising.. (0x08|0x0007) plen 0  #19 [hci0] 42.958872
> HCI Event: Command Complete (0x0e) plen 5                #20 [hci0] 42.964403
      LE Read Advertising Channel TX Power (0x08|0x0007) ncmd 1
        Status: Success (0x00)
        TX power: 6 dbm (0x06)
< HCI Command: LE Read Accept List.. (0x08|0x000f) plen 0  #21 [hci0] 42.964423
> HCI Event: Command Complete (0x0e) plen 5                #22 [hci0] 42.969959
      LE Read Accept List Size (0x08|0x000f) ncmd 1
        Status: Success (0x00)
        Size: 16
< HCI Command: LE Clear Accept List (0x08|0x0010) plen 0   #23 [hci0] 42.969979
> HCI Event: Command Complete (0x0e) plen 4                #24 [hci0] 42.975513
      LE Clear Accept List (0x08|0x0010) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0  #25 [hci0] 42.975534
> HCI Event: Command Complete (0x0e) plen 12               #26 [hci0] 42.981070
      LE Read Maximum Data Length (0x08|0x002f) ncmd 1
        Status: Success (0x00)
        Max TX octets: 251
        Max TX time: 17040
        Max RX octets: 251
        Max RX time: 17040
< HCI Command: LE Read Suggested D.. (0x08|0x0023) plen 0  #27 [hci0] 42.981092
> HCI Event: Command Complete (0x0e) plen 8                #28 [hci0] 42.986625
      LE Read Suggested Default Data Length (0x08|0x0023) ncmd 1
        Status: Success (0x00)
        TX octets: 27
        TX time: 328
< HCI Command: Set Event Mask Page 2 (0x03|0x0063) plen 8  #29 [hci0] 42.986664
        Mask: 0x0000000000800000
          Authenticated Payload Timeout Expired
> HCI Event: Command Complete (0x0e) plen 4                #30 [hci0] 42.992185
      Set Event Mask Page 2 (0x03|0x0063) ncmd 1
        Status: Success (0x00)
= Index Info: 74:D2:85:B7:AF:BF (Texas Instruments Inc.)       [hci0] 42.992211
< HCI Command: LE Set Advertising.. (0x08|0x0008) plen 32  #31 [hci0] 42.992237
        Length: 6
        Flags: 0x04
          BR/EDR Not Supported
        TX power: 6 dBm
root@OpenWrt:/# [  368.505319] Bluetooth: hci0 command 0x2008 tx timeout
< HCI Command: LE Set Scan Respon.. (0x08|0x0009) plen 32  #32 [hci0] 44.988765
        Length: 12
        Name (complete): BlueZ 5.64
[  370.505313] Bluetooth: hci0 command 0x2009 tx timeout

root@OpenWrt:/# hciconfig hci0 leadv
< HCI Command: LE Set Advertising.. (0x08|0x0006) plen 15  #33 [hci0] 61.030235
        Min advertising interval: 1280.000 msec (0x0800)
        Max advertising interval: 1280.000 msec (0x0800)
        Type: Connectable undirected - ADV_IND (0x00)
        Own address type: Public (0x00)
        Direct address type: Public (0x00)
        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
        Channel map: 37, 38, 39 (0x07)
        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
Can't set advertise mode on hci0: Operation timed out (110)
root@OpenWrt:/# [  386.545330] Bluetooth: hci0 command 0x2006 tx timeout

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、West:

    感谢您联系我们、您可以使用 SDK 中的 BTool 测试运行这些相同的命令吗

    C:\ti\simplelink_cc13xx_cc26xx_sdk_6_40_00_13\tools\ble5stack\btool

    此致、

    Rogelio

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    此处也是 BTool 指南的路径

    c:/ti/simplelink_cc13xx_cc26xx_sdk_6_40_00_13/docs/ble5stack/btool_user_guide/BTool_Users_Guide

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:Rogelio、

    感谢您的回应。

    无法在 BTool 中找到所需的 HCI 命令。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、West:

    您要查找哪些 HCI 命令是特定于供应商的命令还是通用 HCI 命令?

    此致、

    Rogelio

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:Rogelio、

    我想测试 操作码 0x2006、0x2008和0x2009等 HCI 命令、并弄清楚为什么芯片 CC2652P 忽略这些命令。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好: Rogelio、

    我是 West 的同事。 我认为 HCI 命令"0x2006、0x2008和0x2009"是常见的 HCI 命令。

    我 可以在特定于供应商的指南中找到这些命令、如下所示。

    但我们在 BTool 中找不到这些命令。

    您能否帮助检查这些命令是否受支持?

    此外、我们还有 BLE 功能请求、用于 BLE 连接和原始数据收集。

    我们知道 Bluez 堆栈已支持这些功能、但由于超时问题、我们现在无法通过 Bluez 堆栈连接到 CC2652P。

    对于在不使用 BlueZ 栈的情况下收集 BLE 原始数据、您有什么建议吗?

    此致、

    ROTE

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Rote 和 West:

    因此、更仔细地研究一下、似乎这些特定操作码不受支持、而是使用特定于供应商的命令来实现这些实现。  

    在本例中为 GapAdv_setParam

     

    和 GapAdv_loadData 命令

     

    *请注意,您需要指定连接句柄

    此外、cc2652并非需要主机的器件、因此 bluez 堆栈中使用的 host_test 示例并不支持所有 HCI 命令。 希望这有助于您的发展。

    此致、

    Rogelio

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好: Rogelio、

    感谢您的答复。

    如果 host_test 示例不能用于 BlueZ 栈。 您能告诉我们哪些示例可以支持 BlueZ 栈吗?

    此外、对于在不使用 BlueZ 栈的情况下收集 BLE 原始数据、您有什么建议吗?

    此致、

    ROTE

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Rote、您好!

    遗憾的是、我们的器件示例不支持 BlueZ 栈、我们建议使用 TI 在 SDK 中提供的 ble5栈。

    https://dev.ti.com/tirex/content/simplelink_cc13xx_cc26xx_sdk_6_40_00_13/docs/ble5stack/ble_user_guide/html/ble-stack-5.x-guide/index-cc13xx_cc26xx.html

    此致、

    Rogelio