FreeBSD/usr.sbin/bluetooth/hccontrol/node.c
/* Send Write_Node_Role_Switch command to the node */
Send Write_Node_Role_Switch command to the node
Send Write_Node_Role_Switch command to the node
int
hci_write_node_role_switch(int s, int argc, char **argv)
{
	struct ng_btsocket_hci_raw_node_role_switch	r;
	int						m;
	memset(&r, 0, sizeof(r));
	switch (argc) {
	case 1:
		if (sscanf(argv[0], "%d", &m) != 1)
			return (USAGE);
		r.role_switch = m? 1 : 0;
		break;
	default:
		return (USAGE);
	}
	if (ioctl(s, SIOC_HCI_RAW_NODE_SET_ROLE_SWITCH, &r, sizeof(r)) < 0)
		return (ERROR);
	return (OK);
}
int hci_write_node_role_switch ( int s , int argc , char * * argv ) { struct ng_btsocket_hci_raw_node_role_switch r ; int m ; memset ( & r , 0 , sizeof ( r ) ) ; switch ( argc ) { case 1 : if ( sscanf ( argv [ 0 ] , " " , & m ) != 1 ) return ( USAGE ) ; r . role_switch = m ? 1 : 0 ; break ; default : return ( USAGE ) ; } if ( ioctl ( s , SIOC_HCI_RAW_NODE_SET_ROLE_SWITCH , & r , sizeof ( r ) ) < 0 ) return ( ERROR ) ; return ( OK ) ; }
Send Write_Node_Role_Switch command to the node
Send Write_Node_Role_Switch command to the node