Return-Path: Message-ID: <049f01c65cb0$0d478bf0$0300a8c0@akira> From: "Sir Graham (Terra)" To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0490_01C65CC0.A0E81B80" Subject: [Bluez-devel] Selection of Local module.... Sender: bluez-devel-admin@lists.sourceforge.net Errors-To: bluez-devel-admin@lists.sourceforge.net Reply-To: bluez-devel@lists.sourceforge.net List-Unsubscribe: , List-Id: BlueZ development List-Post: List-Help: List-Subscribe: , List-Archive: Date: Mon, 10 Apr 2006 17:03:02 +0200 This is a multi-part message in MIME format. ------=_NextPart_000_0490_01C65CC0.A0E81B80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I need to use two bluetooth devices in the same computer with BlueZ. How can I select (with socket) the device local that I like make a = conexion? If I make a simple conexion... Can I select what of my local modules = (HCI0 or HCI1) makes this conexion? #include #include #include #include #include int main(int argc, char **argv) { struct sockaddr_rc addr =3D { 0 }; int s, status; char dest[18] =3D "01:23:45:67:89:AB"; // allocate a socket s =3D socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); // set the connection parameters (who to connect to) addr.rc_family =3D AF_BLUETOOTH; addr.rc_channel =3D (uint8_t) 1; str2ba( dest, &addr.rc_bdaddr ); // connect to server status =3D connect(s, (struct sockaddr *)&addr, sizeof(addr)); // send a message if( status =3D=3D 0 ) { status =3D write(s, "hello!", 6); } if( status < 0 ) perror("uh oh"); close(s); return 0; } Can I select what of my local modules (HCI0 or HCI1) makes this = conexion? =20 Where can I select (in the example) what local module use? =BF=BF=BF??? Regards, Sir Graham. ------=_NextPart_000_0490_01C65CC0.A0E81B80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I need to use two bluetooth = devices in the=20 same computer with BlueZ.
 
How  can I select (with = socket) the=20 device local that I like make a conexion?
 
 
If I make a simple conexion... = Can I select=20 what of my local modules (HCI0 or HCI1) makes this=20 conexion?
 
 
#include = <stdio.h>
#include=20 <unistd.h>
#include <sys/socket.h>
#include=20 <bluetooth/bluetooth.h>
#include = <bluetooth/rfcomm.h>

int=20 main(int argc, char **argv)
{
    struct = sockaddr_rc addr =3D=20 { 0 };
    int s, status;
    char = dest[18]=20 =3D "01:23:45:67:89:AB";

    // allocate a=20 socket
    s =3D socket(AF_BLUETOOTH, SOCK_STREAM,=20 BTPROTO_RFCOMM);

    // set the connection = parameters (who=20 to connect to)
    addr.rc_family =3D=20 AF_BLUETOOTH;
    addr.rc_channel =3D (uint8_t)=20 1;
    str2ba( dest, &addr.rc_bdaddr=20 );

    // connect to server
    = status =3D=20 connect(s, (struct sockaddr *)&addr,=20 sizeof(addr));

    // send a = message
   =20 if( status =3D=3D 0 ) {
        = status =3D=20 write(s, "hello!", 6);
    }

    = if(=20 status < 0 ) perror("uh oh");

   =20 close(s);
    return 0;
}
 
Can I select what of my local = modules (HCI0=20 or HCI1) makes this conexion? 
 
Where can I select (in = the example)=20 what local module use?  =BF=BF=BF???
 
Regards,
Sir=20 Graham.
 

 
 
------=_NextPart_000_0490_01C65CC0.A0E81B80-- ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel