mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-01 06:40:08 +00:00
tools/hci_throughput: fix supported octets info
This commit is contained in:
@@ -31,6 +31,8 @@ HCI_COMMAND_PACKET = 0x01
|
|||||||
HCI_ACL_DATA_PACKET = 0x02
|
HCI_ACL_DATA_PACKET = 0x02
|
||||||
HCI_EVENT_PACKET = 0x04
|
HCI_EVENT_PACKET = 0x04
|
||||||
|
|
||||||
|
L2CAP_HDR_BYTES = 4
|
||||||
|
|
||||||
HCI_EV_CODE_DISCONN_CMP = 0x05
|
HCI_EV_CODE_DISCONN_CMP = 0x05
|
||||||
HCI_EV_CODE_CMD_CMP = 0x0e
|
HCI_EV_CODE_CMD_CMP = 0x0e
|
||||||
HCI_EV_CODE_CMD_STATUS = 0x0f
|
HCI_EV_CODE_CMD_STATUS = 0x0f
|
||||||
|
|||||||
@@ -422,10 +422,11 @@ class HCI_Commands():
|
|||||||
hci.max_data_len.set(*struct.unpack("<BHHHH",
|
hci.max_data_len.set(*struct.unpack("<BHHHH",
|
||||||
current_ev.return_parameters))
|
current_ev.return_parameters))
|
||||||
logging.info(f"Suggested Max Data Len: {hci.max_data_len}")
|
logging.info(f"Suggested Max Data Len: {hci.max_data_len}")
|
||||||
if (hci.num_of_bytes_to_send > hci.max_data_len.supported_max_tx_octets - 4):
|
if (hci.num_of_bytes_to_send > hci.max_data_len.supported_max_tx_octets - hci.L2CAP_HDR_BYTES):
|
||||||
logging.critical(f"Number of bytes to send: {hci.num_of_bytes_to_send}\
|
logging.critical(f"Number of data bytes to send + 4 bytes of L2CAP header: {hci.num_of_bytes_to_send + 4} "
|
||||||
not supported. Closing.")
|
f"exceeds allowed value of: {hci.max_data_len.supported_max_tx_octets}. Closing.")
|
||||||
raise SystemExit("Number of bytes to send not supported. Closing.")
|
raise SystemExit(f"Number of data bytes to send + 4 bytes of L2CAP header: {hci.num_of_bytes_to_send + 4} "
|
||||||
|
f"exceeds allowed value of: {hci.max_data_len.supported_max_tx_octets}. Closing.")
|
||||||
|
|
||||||
return status()
|
return status()
|
||||||
elif ocf == hci.OCF_LE_READ_PHY:
|
elif ocf == hci.OCF_LE_READ_PHY:
|
||||||
|
|||||||
Reference in New Issue
Block a user