View | Details | Raw Unified | Return to bug 247808
Collapse All | Expand All

(-)usr.sbin/bluetooth/hccontrol/hccontrol.8 (+1 lines)
Lines 164-169 Link Here
164
.It Cm LE_Connect
164
.It Cm LE_Connect
165
.It Cm LE_Read_Channel_Map
165
.It Cm LE_Read_Channel_Map
166
.It Cm LE_Read_Remote_Features
166
.It Cm LE_Read_Remote_Features
167
.It Cm LE_Rand
167
.El
168
.El
168
.Pp
169
.Pp
169
The currently supported node commands in
170
The currently supported node commands in
(-)usr.sbin/bluetooth/hccontrol/le.c (+32 lines)
Lines 71-76 Link Here
71
static void handle_le_connection_event(ng_hci_event_pkt_t* e, bool verbose);
71
static void handle_le_connection_event(ng_hci_event_pkt_t* e, bool verbose);
72
static int le_read_channel_map(int s, int argc, char *argv[]);
72
static int le_read_channel_map(int s, int argc, char *argv[]);
73
static void handle_le_remote_features_event(ng_hci_event_pkt_t* e);
73
static void handle_le_remote_features_event(ng_hci_event_pkt_t* e);
74
static int le_rand(int s, int argc, char *argv[]);
74
75
75
static int
76
static int
76
le_set_scan_param(int s, int argc, char *argv[])
77
le_set_scan_param(int s, int argc, char *argv[])
Lines 1211-1218 Link Here
1211
	return;
1212
	return;
1212
} /* handle_le_remote_features_event */
1213
} /* handle_le_remote_features_event */
1213
1214
1215
static int le_rand(int s, int argc, char *argv[])
1216
{
1217
	ng_hci_le_rand_rp rp;
1218
	int n;
1214
1219
1220
	n = sizeof(rp);
1215
1221
1222
	if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE,
1223
		NG_HCI_OCF_LE_RAND), 
1224
		(void *)&rp, &n) == ERROR)
1225
		return (ERROR);
1226
			
1227
	if (rp.status != 0x00) {
1228
		fprintf(stdout, "Status: %s [%#02x]\n", 
1229
			hci_status2str(rp.status), rp.status);
1230
		return (FAILED);
1231
	}
1232
1233
	fprintf(stdout,
1234
		"Random number : %08llx\n",
1235
		(unsigned long long)le64toh(rp.random_number));
1236
1237
	return (OK);
1238
}
1239
1240
1241
1216
struct hci_command le_commands[] = {
1242
struct hci_command le_commands[] = {
1217
{
1243
{
1218
	"le_enable",
1244
	"le_enable",
Lines 1336-1339 Link Here
1336
	  "identified by the connection handle",
1362
	  "identified by the connection handle",
1337
	  &le_read_remote_features
1363
	  &le_read_remote_features
1338
  },
1364
  },
1365
  {
1366
	  "le_rand",
1367
	  "le_rand\n"
1368
	  "Generate 64 bits of random data",
1369
	  &le_rand
1370
  },
1339
};
1371
};

Return to bug 247808