Lines 52-58
Link Here
|
52 |
static int le_set_scan_enable(int s, int argc, char *argv[]); |
52 |
static int le_set_scan_enable(int s, int argc, char *argv[]); |
53 |
static int parse_param(int argc, char *argv[], char *buf, int *len); |
53 |
static int parse_param(int argc, char *argv[], char *buf, int *len); |
54 |
static int le_set_scan_response(int s, int argc, char *argv[]); |
54 |
static int le_set_scan_response(int s, int argc, char *argv[]); |
55 |
static int le_read_supported_status(int s, int argc, char *argv[]); |
55 |
static int le_read_supported_states(int s, int argc, char *argv[]); |
56 |
static int le_read_local_supported_features(int s, int argc ,char *argv[]); |
56 |
static int le_read_local_supported_features(int s, int argc ,char *argv[]); |
57 |
static int set_le_event_mask(int s, uint64_t mask); |
57 |
static int set_le_event_mask(int s, uint64_t mask); |
58 |
static int set_event_mask(int s, uint64_t mask); |
58 |
static int set_event_mask(int s, uint64_t mask); |
Lines 259-278
Link Here
|
259 |
} |
259 |
} |
260 |
|
260 |
|
261 |
static int |
261 |
static int |
262 |
le_read_supported_status(int s, int argc, char *argv[]) |
262 |
le_read_supported_states(int s, int argc, char *argv[]) |
263 |
{ |
263 |
{ |
264 |
ng_hci_le_read_supported_status_rp rp; |
264 |
ng_hci_le_read_supported_states_rp rp; |
265 |
int e; |
|
|
266 |
int n = sizeof(rp); |
265 |
int n = sizeof(rp); |
267 |
|
266 |
|
268 |
e = hci_simple_request(s, NG_HCI_OPCODE( |
267 |
if (hci_simple_request(s, NG_HCI_OPCODE( |
269 |
NG_HCI_OGF_LE, |
268 |
NG_HCI_OGF_LE, |
270 |
NG_HCI_OCF_LE_READ_SUPPORTED_STATUS), |
269 |
NG_HCI_OCF_LE_READ_SUPPORTED_STATES), |
271 |
(void *)&rp, &n); |
270 |
(void *)&rp, &n) == ERROR) |
|
|
271 |
return (ERROR); |
272 |
|
272 |
|
273 |
printf("LE_STATUS: %d %d %jx\n", e, rp.status, (uintmax_t)rp.le_status); |
273 |
if (rp.status != 0x00) { |
|
|
274 |
fprintf(stdout, "Status: %s [%#02x]\n", |
275 |
hci_status2str(rp.status), rp.status); |
276 |
return (FAILED); |
277 |
} |
274 |
|
278 |
|
275 |
return 0; |
279 |
fprintf(stdout, "LE States: %jx\n", rp.le_states); |
|
|
280 |
|
281 |
return (OK); |
276 |
} |
282 |
} |
277 |
|
283 |
|
278 |
static int |
284 |
static int |
Lines 347-357
Link Here
|
347 |
&le_read_local_supported_features, |
353 |
&le_read_local_supported_features, |
348 |
}, |
354 |
}, |
349 |
{ |
355 |
{ |
350 |
"le_read_supported_status", |
356 |
"le_read_supported_states", |
351 |
"le_read_supported_status\n" |
357 |
"le_read_supported_states\n" |
352 |
"read supported status" |
358 |
"read supported status" |
353 |
, |
359 |
, |
354 |
&le_read_supported_status, |
360 |
&le_read_supported_states, |
355 |
}, |
361 |
}, |
356 |
{ |
362 |
{ |
357 |
"le_set_scan_response", |
363 |
"le_set_scan_response", |