FreeBSD/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
/* Send Read_Hold_Mode_Activity command to the unit */
Send Read_Hold_Mode_Activity command to the unit
Send Read_Hold_Mode_Activity command to the unit
static int
hci_read_hold_mode_activity(int s, int argc, char **argv)
{
	ng_hci_read_hold_mode_activity_rp	rp;
	int					n;
	char					buffer[1024];
	n = sizeof(rp);
	if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND,
			NG_HCI_OCF_READ_HOLD_MODE_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);
	}
	fprintf(stdout, "Hold Mode Activities: %#02x\n", rp.hold_mode_activity);
	if (rp.hold_mode_activity == 0)
		fprintf(stdout, "Maintain current Power State");
	else
		fprintf(stdout, "%s", hci_hmode2str(rp.hold_mode_activity,
				buffer, sizeof(buffer)));
	fprintf(stdout, "\n");
	return (OK);
}
static int hci_read_hold_mode_activity ( int s , int argc , char * * argv ) { ng_hci_read_hold_mode_activity_rp rp ; int n ; char buffer [ 1024 ] ; n = sizeof ( rp ) ; if ( hci_simple_request ( s , NG_HCI_OPCODE ( NG_HCI_OGF_HC_BASEBAND , NG_HCI_OCF_READ_HOLD_MODE_ACTIVITY ) , ( 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 . hold_mode_activity ) ; if ( rp . hold_mode_activity == 0 ) fprintf ( stdout , " " ) ; else fprintf ( stdout , " " , hci_hmode2str ( rp . hold_mode_activity , buffer , sizeof ( buffer ) ) ) ; fprintf ( stdout , " \n " ) ; return ( OK ) ; }
Send Read_Hold_Mode_Activity command to the unit
Send Read_Hold_Mode_Activity command to the unit