FreeBSD Bugzilla – Attachment 216259 Details for
Bug 247808
Add le_rand command
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to add le_rand command
le_rand.diff (text/plain), 1.77 KB, created by
Marc Veldman
on 2020-07-06 16:14:31 UTC
(
hide
)
Description:
Patch to add le_rand command
Filename:
MIME Type:
Creator:
Marc Veldman
Created:
2020-07-06 16:14:31 UTC
Size:
1.77 KB
patch
obsolete
>Index: usr.sbin/bluetooth/hccontrol/hccontrol.8 >=================================================================== >--- usr.sbin/bluetooth/hccontrol/hccontrol.8 (revision 362951) >+++ usr.sbin/bluetooth/hccontrol/hccontrol.8 (working copy) >@@ -164,6 +164,7 @@ > .It Cm LE_Connect > .It Cm LE_Read_Channel_Map > .It Cm LE_Read_Remote_Features >+.It Cm LE_Rand > .El > .Pp > The currently supported node commands in >Index: usr.sbin/bluetooth/hccontrol/le.c >=================================================================== >--- usr.sbin/bluetooth/hccontrol/le.c (revision 362951) >+++ usr.sbin/bluetooth/hccontrol/le.c (working copy) >@@ -71,6 +71,7 @@ > static void handle_le_connection_event(ng_hci_event_pkt_t* e, bool verbose); > static int le_read_channel_map(int s, int argc, char *argv[]); > static void handle_le_remote_features_event(ng_hci_event_pkt_t* e); >+static int le_rand(int s, int argc, char *argv[]); > > static int > le_set_scan_param(int s, int argc, char *argv[]) >@@ -1211,8 +1212,33 @@ > return; > } /* handle_le_remote_features_event */ > >+static int le_rand(int s, int argc, char *argv[]) >+{ >+ ng_hci_le_rand_rp rp; >+ int n; > >+ n = sizeof(rp); > >+ if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, >+ NG_HCI_OCF_LE_RAND), >+ (void *)&rp, &n) == ERROR) >+ return (ERROR); >+ >+ if (rp.status != 0x00) { >+ fprintf(stdout, "Status: %s [%#02x]\n", >+ hci_status2str(rp.status), rp.status); >+ return (FAILED); >+ } >+ >+ fprintf(stdout, >+ "Random number : %08llx\n", >+ (unsigned long long)le64toh(rp.random_number)); >+ >+ return (OK); >+} >+ >+ >+ > struct hci_command le_commands[] = { > { > "le_enable", >@@ -1336,4 +1362,10 @@ > "identified by the connection handle", > &le_read_remote_features > }, >+ { >+ "le_rand", >+ "le_rand\n" >+ "Generate 64 bits of random data", >+ &le_rand >+ }, > };
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 247808
: 216259