FreeBSD/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
/* Send Read_Page_Scan_Activity command to the unit */
Send Read_Page_Scan_Activity command to the unit
Send Read_Page_Scan_Activity command to the unit
static int
hci_read_page_scan_activity(int s, int argc, char **argv)
{
	ng_hci_read_page_scan_activity_rp	rp;
	int					n;
	n = sizeof(rp);
	if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND,
			NG_HCI_OCF_READ_PAGE_SCAN_ACTIVITY),
			(char *) &rp, &n) == ERROR)
		return (ERROR);
	if (rp.status != 0x00) {
		fprintf(stdout, "Status: %s [%#02x]\n",
			hci_status2str(rp.status), rp.status);
		return (FAILED);
	}
	rp.page_scan_interval = le16toh(rp.page_scan_interval);
	rp.page_scan_window = le16toh(rp.page_scan_window);
	fprintf(stdout, "Page Scan Interval: %.2f msec [%d slots]\n",
		rp.page_scan_interval * 0.625, rp.page_scan_interval);
	fprintf(stdout, "Page Scan Window: %.2f msec [%d slots]\n",
		rp.page_scan_window * 0.625, rp.page_scan_window);
	return (OK);
}
static int hci_read_page_scan_activity ( int s , int argc , char * * argv ) { ng_hci_read_page_scan_activity_rp rp ; int n ; n = sizeof ( rp ) ; if ( hci_simple_request ( s , NG_HCI_OPCODE ( NG_HCI_OGF_HC_BASEBAND , NG_HCI_OCF_READ_PAGE_SCAN_ACTIVITY ) , ( char * ) & rp , & n ) == ERROR ) return ( ERROR ) ; if ( rp . status != 0x00 ) { fprintf ( stdout , " \n " , hci_status2str ( rp . status ) , rp . status ) ; return ( FAILED ) ; } rp . page_scan_interval = le16toh ( rp . page_scan_interval ) ; rp . page_scan_window = le16toh ( rp . page_scan_window ) ; fprintf ( stdout , " \n " , rp . page_scan_interval * 0.625 , rp . page_scan_interval ) ; fprintf ( stdout , " \n " , rp . page_scan_window * 0.625 , rp . page_scan_window ) ; return ( OK ) ; }
Send Read_Page_Scan_Activity command to the unit
Send Read_Page_Scan_Activity command to the unit