FreeBSD/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
/* Send Read_Voice_Settings command to the unit */
Send Read_Voice_Settings command to the unit
Send Read_Voice_Settings command to the unit
static int
hci_read_voice_settings(int s, int argc, char **argv)
{
	ng_hci_read_voice_settings_rp	rp;
	int				n,
					input_coding,
					input_data_format,
					input_sample_size;
	n = sizeof(rp);
	if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND,
			NG_HCI_OCF_READ_VOICE_SETTINGS),
			(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.settings = le16toh(rp.settings);
	input_coding      = (rp.settings & 0x0300) >> 8;
	input_data_format = (rp.settings & 0x00c0) >> 6;
	input_sample_size = (rp.settings & 0x0020) >> 5;
	fprintf(stdout, "Voice settings: %#04x\n", rp.settings);
	fprintf(stdout, "Input coding: %s [%d]\n",
		hci_coding2str(input_coding), input_coding);
	fprintf(stdout, "Input data format: %s [%d]\n",
		hci_vdata2str(input_data_format), input_data_format);
	if (input_coding == 0x00) 
		fprintf(stdout, "Input sample size: %d bit [%d]\n",
			input_sample_size? 16 : 8, input_sample_size);
	return (OK);
}
static int hci_read_voice_settings ( int s , int argc , char * * argv ) { ng_hci_read_voice_settings_rp rp ; int n , input_coding , input_data_format , input_sample_size ; n = sizeof ( rp ) ; if ( hci_simple_request ( s , NG_HCI_OPCODE ( NG_HCI_OGF_HC_BASEBAND , NG_HCI_OCF_READ_VOICE_SETTINGS ) , ( char * ) & rp , & n ) == ERROR ) return ( ERROR ) ; if ( rp . status != 0x00 ) { fprintf ( stdout , " \n " , hci_status2str ( rp . status ) , rp . status ) ; return ( FAILED ) ; } rp . settings = le16toh ( rp . settings ) ; input_coding = ( rp . settings & 0x0300 ) >> 8 ; input_data_format = ( rp . settings & 0x00c0 ) >> 6 ; input_sample_size = ( rp . settings & 0x0020 ) >> 5 ; fprintf ( stdout , " \n " , rp . settings ) ; fprintf ( stdout , " \n " , hci_coding2str ( input_coding ) , input_coding ) ; fprintf ( stdout , " \n " , hci_vdata2str ( input_data_format ) , input_data_format ) ; if ( input_coding == 0x00 ) fprintf ( stdout , " \n " , input_sample_size ? 16 : 8 , input_sample_size ) ; return ( OK ) ; }
Send Read_Voice_Settings command to the unit
Send Read_Voice_Settings command to the unit
/* Only for Linear PCM */