FreeBSD/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
/* Send Read_Class_Of_Device command to the unit */
Send Read_Class_Of_Device command to the unit
Send Read_Class_Of_Device command to the unit
static int
hci_read_class_of_device(int s, int argc, char **argv)
{
	ng_hci_read_unit_class_rp	rp;
	int				n;
	n = sizeof(rp);
	if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND,
			NG_HCI_OCF_READ_UNIT_CLASS),
			(char *) &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, "Class: %02x:%02x:%02x\n",
		rp.uclass[2], rp.uclass[1], rp.uclass[0]);
	return (0);
}
static int hci_read_class_of_device ( int s , int argc , char * * argv ) { ng_hci_read_unit_class_rp rp ; int n ; n = sizeof ( rp ) ; if ( hci_simple_request ( s , NG_HCI_OPCODE ( NG_HCI_OGF_HC_BASEBAND , NG_HCI_OCF_READ_UNIT_CLASS ) , ( char * ) & rp , & n ) == ERROR ) return ( ERROR ) ; if ( rp . status != 0x00 ) { fprintf ( stdout , " \n " , hci_status2str ( rp . status ) , rp . status ) ; return ( FAILED ) ; } fprintf ( stdout , " \n " , rp . uclass [ 2 ] , rp . uclass [ 1 ] , rp . uclass [ 0 ] ) ; return ( 0 ) ; }
Send Read_Class_Of_Device command to the unit
Send Read_Class_Of_Device command to the unit