FreeBSD Bugzilla – Attachment 213845 Details for
Bug 245964
[Patch] Add le_read_buffer_size command (v1 and v2)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add LE Read Buffer Size command, add to manpage
le_read_buffer_size.diff (text/plain), 3.18 KB, created by
Marc Veldman
on 2020-04-27 10:09:44 UTC
(
hide
)
Description:
Add LE Read Buffer Size command, add to manpage
Filename:
MIME Type:
Creator:
Marc Veldman
Created:
2020-04-27 10:09:44 UTC
Size:
3.18 KB
patch
obsolete
>Index: usr.sbin/bluetooth/hccontrol/hccontrol.8 >=================================================================== >--- usr.sbin/bluetooth/hccontrol/hccontrol.8 (revision 360368) >+++ usr.sbin/bluetooth/hccontrol/hccontrol.8 (working copy) >@@ -25,7 +25,7 @@ > .\" $Id: hccontrol.8,v 1.6 2003/08/06 21:26:38 max Exp $ > .\" $FreeBSD$ > .\" >-.Dd April 24, 2020 >+.Dd April 27, 2020 > .Dt HCCONTROL 8 > .Os > .Sh NAME >@@ -154,6 +154,7 @@ > .It Cm LE_Set_Scan_Parameters > .It Cm LE_Set_Scan_Enable > .It Cm LE_Read_Supported_States >+.It Cm LE_Read_Buffer_Size > .El > .Pp > The currently supported node commands in >Index: usr.sbin/bluetooth/hccontrol/le.c >=================================================================== >--- usr.sbin/bluetooth/hccontrol/le.c (revision 360368) >+++ usr.sbin/bluetooth/hccontrol/le.c (working copy) >@@ -507,7 +507,65 @@ > > return (OK); > } >+static int >+le_read_buffer_size(int s, int argc, char *argv[]) >+{ >+ union { >+ ng_hci_le_read_buffer_size_rp v1; >+ ng_hci_le_read_buffer_size_rp_v2 v2; >+ } rp; > >+ int n, ch; >+ uint8_t v; >+ uint16_t cmd; >+ >+ optreset = 1; >+ optind = 0; >+ >+ /* Default to version 1*/ >+ v = 1; >+ cmd = NG_HCI_OCF_LE_READ_BUFFER_SIZE; >+ >+ while ((ch = getopt(argc, argv , "v:")) != -1) { >+ switch(ch) { >+ case 'v': >+ v = (uint8_t)strtol(optarg, NULL, 16); >+ if (v == 2) >+ cmd = NG_HCI_OCF_LE_READ_BUFFER_SIZE_V2; >+ else if (v > 2) >+ return (USAGE); >+ break; >+ default: >+ v = 1; >+ } >+ } >+ >+ n = sizeof(rp); >+ if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, cmd), >+ (void *)&rp, &n) == ERROR) >+ return (ERROR); >+ >+ if (rp.v1.status != 0x00) { >+ fprintf(stdout, "Status: %s [%#02x]\n", >+ hci_status2str(rp.v1.status), rp.v1.status); >+ return (FAILED); >+ } >+ >+ fprintf(stdout, "ACL data packet length: %d\n", >+ rp.v1.hc_le_data_packet_length); >+ fprintf(stdout, "Number of ACL data packets: %d\n", >+ rp.v1.hc_total_num_le_data_packets); >+ >+ if (v == 2) { >+ fprintf(stdout, "ISO data packet length: %d\n", >+ rp.v2.hc_iso_data_packet_length); >+ fprintf(stdout, "Number of ISO data packets: %d\n", >+ rp.v2.hc_total_num_iso_data_packets); >+ } >+ >+ return (OK); >+} >+ > struct hci_command le_commands[] = { > { > "le_enable", >@@ -574,4 +632,10 @@ > "set LE device advertising packed data", > &le_set_advertising_data > }, >+ { >+ "le_read_buffer_size", >+ "le_read_buffer_size [-v 1|2]\n" >+ "Read the maximum size of ACL and ISO data packets", >+ &le_read_buffer_size >+ }, > }; >Index: sys/netgraph/bluetooth/include/ng_hci.h >=================================================================== >--- sys/netgraph/bluetooth/include/ng_hci.h (revision 360368) >+++ sys/netgraph/bluetooth/include/ng_hci.h (working copy) >@@ -1672,6 +1672,15 @@ > u_int16_t connection_handle; > }__attribute__ ((packed)) ng_hci_le_long_term_key_request_negative_reply_rp; > >+#define NG_HCI_OCF_LE_READ_BUFFER_SIZE_V2 0x0060 >+/*No command parameter */ >+typedef struct { >+ u_int8_t status; >+ u_int16_t hc_le_data_packet_length; >+ u_int8_t hc_total_num_le_data_packets; >+ u_int16_t hc_iso_data_packet_length; >+ u_int8_t hc_total_num_iso_data_packets; >+} __attribute__ ((packed)) ng_hci_le_read_buffer_size_rp_v2; > > #define NG_HCI_OCF_LE_READ_SUPPORTED_STATES 0x001c > /*No command parameter*/
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 245964
: 213845