[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [bluetooth-dev] Enable pthread support..!



Hello,

pthread has nothing to do with your kernel, linking your application
with -lpthread shall
do it.

Best Regards,
Anders



> -----Original Message-----
> From: owner-bluetooth-dev On Behalf Of axis
> Sent: den 11 januari 2004 14:50
> To: Bluetooth-dev
> Subject: [bluetooth-dev] Enable pthread support..!
> 
> Sir,
>     How can I enable pthread support on my linux version 
> running on axis access point.I want to use pthreads in my 
> application,and by default this support is not enabled in my 
> 2.4.19 version.Could you please tell me how I can accompilsh this.
>     And I request you to explain me what exactly is 
> BT_control device and how BT_CTRL_TTY & /dev/ttyBTx differ.
>     Thank you.
> 
> --- axis <axis2list@xxxxxxx.com> wrote:
> > Sir,
> >      Could anyone please tell me the difference between BT_CTRL_TTY 
> > and /dev/ttyBTx.Do we need to use both at the same time?
> >      And is "line" the "x" in /dev/ttyBTx ? If so is the following 
> > code correct for opening the tty and sending the data to my device 
> > from access point.
> >      Please have a look at lines marked ****** and your 
> help in this 
> > regard will be very helpful for my Masters Thesis.
> > Thank you
> > 
> >   while(1){
> > 
> > ****** if((bt_cfd = bt_openctrl()) < 0)
> >        {
> >         perror("Could not open BT Control device");
> >         exit(1);
> >        }
> > 
> >     if(!bt_isinitiated(bt_cfd))
> >       {
> >         printf("Stack not initianted ,exit\n");
> >         exit(1);
> >       }
> >         printf("Reading proc file\n");
> > ******  pFile = fopen("/proc/bt_channel_con","r");
> >         if(pFile == 0)
> >                 perror("fopen");
> > ******  temp = fread(buffer, 5, 1, pFile);
> >         printf("Connect on bt_cfd %d,temp %d buffer %s line %c\n", 
> > bt_cfd,temp,buffer,buffer[0]);
> >         fclose(pFile);
> >         t1 = (char *)malloc(sizeof(char));
> >         t2 = (char *)malloc(sizeof(char));
> >         sprintf(t1,"%c",buffer[0]);
> >         sprintf(t2,"%c",buffer[2]);
> > *****   line = atoi(t1);
> > *****   srv_ch = atoi(t2);
> > *****   if(bt_isconnected(bt_cfd,line))
> >         {
> >      *(int*)bd_addr = line;
> >      if(ioctl(bt_cfd, BTREADREMOTEBDADDR, bd_addr) <
> > 0)
> >                 {
> >                        
> > perror("BTREADREMOTEBDADDR");
> >                 }
> > 
> >         tty[10] = buffer[0];
> >         printf("The tty is %s\n",tty);
> > *****   fd = open_device(tty,O_RDWR,0);
> >         printf("Device file descriptor %d\n",fd);
> > 
> >         for(i=0;i<20000;i++)
> >         {
> > *****         if(write(fd,buffer,5) != 5)
> >                         perror("write");
> >         }
> >                 close_device(fd);
> >      }
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Hotjobs: Enter the "Signing Bonus"
> > Sweepstakes
> > http://hotjobs.sweepstakes.yahoo.com/signingbonus
> > -
> > To unsubscribe from this list: send the line "unsubscribe 
> > bluetooth-dev" in the body of a message to majordomo@xxxxxxx.com
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
> -
> To unsubscribe from this list: send the line "unsubscribe 
> bluetooth-dev" in
> the body of a message to majordomo@xxxxxxx.com
> 

-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com