device driver

Hi all,
i couldn’t able to connect usbd_connect, i am getting error on this api.
please suggest me to connect the USB stack. and i would like to develope a driver for usb bluetooth dongle. please give me some idea.

Thanks
Muthu

please give me some idea

Muthu,

First, Which version of QNX are you using?

Second, have you started the usb stack (io-usb is only automatically started on later versions of QNX).

Third, when you put in the USB doggle and then do a ‘usb -vv’ command is your dongle reported in the list of usb devices

Fourth, can you post your code or at least the usbd_connect code and the few lines proceeding it that fill out what you are trying to connect to.

Tim

Hi,

  1. i am using 6.3.2 latest version only but its evaluated version.

  2. yes its started automatically, when i insert the Bluetooth USB dongle it displays the information about the device.

  3. it is displaying the info about the device when i use ‘usb -vv’ command.

  4. i have mentioned below the code that i am using but it is showing error on ‘usbd_connect’ API.

int hci_usb_start_driver( int argc, char *argv[] )
{
struct usbd_connection *connection;
usbd_funcs_t funcs = { _USBDI_NFUNCS, usb_insertion, hci_usb_removal, NULL };
usbd_device_ident_t interest = { 0xe5e,0x6622,0xe0,0x01,0x01 };
usbd_connect_parm_t parm = { NULL, USB_VERSION, USBD_VERSION, 0, argc, argv, 0, &interest, &funcs, USBD_CONNECT_WAIT };
int status;
int opt;
sigset_t signals;

sigfillset( &signals );					// No signals to resmgr threads
pthread_sigmask( SIG_BLOCK, &signals, NULL );

TAILQ_INIT( &BtCtrl.dlist );
BtCtrl.prefix = "usbbt";

while( ( opt = getopt( argc, argv, "vn:s:w:" ) ) != -1 ) {
	switch( opt ) {
		case 'n':
			BtCtrl.prefix = optarg;
			break;

		case 'v':
			BtCtrl.verbose++;
			break;

		case 's':
			parm.path = optarg;
			break;

		case 'w':
			parm.connect_wait = strtol( optarg, 0, 0 );
			break;

		default:
			break;
	}
}

if( ( BtCtrl.chid = ChannelCreate( _NTO_CHF_DISCONNECT | _NTO_CHF_UNBLOCK ) ) == -1 ||
   ( BtCtrl.coid = ConnectAttach( 0, 0, BtCtrl.chid, _NTO_SIDE_CHANNEL, 0 ) ) == -1 ) {
	fprintf( stderr, "Unable to attach channel and connection\n" );
	return( errno );
}

if( hci_usb_resmgr_init( ) ) {
	fprintf( stderr, "bt:  Resmgr Init Failure\n" );
	return( errno );
}

if( ( status = [color=red]usbd_connect( &parm, &connection ) ) != EOK ) {
	fprintf( stderr, "Bt Class/init - %s\n", strerror( status ) );
	return( status );
}
return( status );

}


please let me get the solution
thanks
Muthu

undefine reference to usbd_connect ← your missing the library/header you should link to