* [Bluez-users] Can't able to send data in both direction
@ 2005-02-23 6:39 Mohan K
2005-02-23 7:03 ` [Bluez-users] " Sebastian Roth
0 siblings, 1 reply; 11+ messages in thread
From: Mohan K @ 2005-02-23 6:39 UTC (permalink / raw)
To: bluez-users
Hi all,
I am trying to send data at L2CAP level. I am using
"Silicon Wave (11)" USB dongle in one PC and "Cambridge Silicon Radio
(10)" USB dongle in another PC. Using my program I can able to send
data from "Cambridge Silicon Radio" dongle side PC to "Silicon Wave"
dongle side PC. But, vice-versa is not working. I am getting the
following error when I try to send data from "Silicon Wave dongle".
Can any one tell me why this is happenning.
Regards
Mohan
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bluez-users] Re: Can't able to send data in both direction
2005-02-23 6:39 [Bluez-users] Can't able to send data in both direction Mohan K
@ 2005-02-23 7:03 ` Sebastian Roth
2005-02-23 7:27 ` Mohan K
0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Roth @ 2005-02-23 7:03 UTC (permalink / raw)
To: bluez-users
Hi,
> I am trying to send data at L2CAP level. I am using
> "Silicon Wave (11)" USB dongle in one PC and "Cambridge Silicon Radio
> (10)" USB dongle in another PC. Using my program I can able to send
> data from "Cambridge Silicon Radio" dongle side PC to "Silicon Wave"
> dongle side PC. But, vice-versa is not working. I am getting the
> following error when I try to send data from "Silicon Wave dongle".
> Can any one tell me why this is happenning.
You've forgotten to paste the error message. I think no one will be
able to help you without it. Please capture the packets using
`hcidump -X' when trying to connect from SiW to CSR dongle and post it
including the error message(s) you see.
Best regards,
Sebastian
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Bluez-users] Re: Can't able to send data in both direction
2005-02-23 7:03 ` [Bluez-users] " Sebastian Roth
@ 2005-02-23 7:27 ` Mohan K
2005-02-23 7:45 ` [Bluez-users] pan and brctl addif question Jack Jia
2005-02-23 10:14 ` [Bluez-users] Re: Can't able to send data in both direction Sebastian Roth
0 siblings, 2 replies; 11+ messages in thread
From: Mohan K @ 2005-02-23 7:27 UTC (permalink / raw)
To: bluez-users, sebastian.roth
Hi,
When the sending program runs on the SiW dongle PC , HCI dump is
not displaying any thing and it is giving the following error.
Error message on the sending side:
[root@localhost ]# ./senddata
L2CAP socket opened successfully.
Can't connect: No route to host (113)
Can't send data.
: Bad file descriptor
When the same program is running on the CSR doungle side PC, I am
getting the following HCI dump and on the other side I can able to
receive data.
HCI dump of send prog on the CSR dongle side:
HCIDump - HCI packet analyzer ver 1.16
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Create Connection (0x01|0x0005) plen 13
F9 DA 33 0D 0B 00 18 CC 00 00 00 00 01
> HCI Event: Command Status (0x0f) plen 4
00 01 05 04
> HCI Event: Connect Complete (0x03) plen 11
00 28 00 F9 DA 33 0D 0B 00 01 00
< ACL data: handle 0x0028 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 10 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
01 28 00 01 00
> HCI Event: Max Slots Change (0x1b) plen 3
28 00 05
> ACL data: handle 0x0028 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
< ACL data: handle 0x0028 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x0000 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
01 28 00 01 00
> ACL data: handle 0x0028 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x0000 result 0 clen 0
> ACL data: handle 0x0028 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x0000 clen 0
< ACL data: handle 0x0028 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x0000 result 0 clen 0
< ACL data: handle 0x0028 flags 0x02 dlen 18
L2CAP(d): cid 0x0040 len 14 [psm 10]
7C 01 0A 61 62 63 64 65 66 7C 67 7C 69 7E
< ACL data: handle 0x0028 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
01 28 00 01 00
> HCI Event: Number of Completed Packets (0x13) plen 5
01 28 00 01 00
> HCI Event: Number of Completed Packets (0x13) plen 5
01 28 00 01 00
> ACL data: handle 0x0028 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
< HCI Command: Disconnect (0x01|0x0006) plen 3
28 00 13
> HCI Event: Command Status (0x0f) plen 4
00 01 06 04
> HCI Event: Disconn Complete (0x05) plen 4
00 28 00 16
Regards
Mohan
On Wed, 23 Feb 2005 08:03:43 +0100, Sebastian Roth
<sebastian.roth@esk.fhg.de> wrote:
> Hi,
>
> > I am trying to send data at L2CAP level. I am using
> > "Silicon Wave (11)" USB dongle in one PC and "Cambridge Silicon Radio
> > (10)" USB dongle in another PC. Using my program I can able to send
> > data from "Cambridge Silicon Radio" dongle side PC to "Silicon Wave"
> > dongle side PC. But, vice-versa is not working. I am getting the
> > following error when I try to send data from "Silicon Wave dongle".
> > Can any one tell me why this is happenning.
> You've forgotten to paste the error message. I think no one will be
> able to help you without it. Please capture the packets using
> `hcidump -X' when trying to connect from SiW to CSR dongle and post it
> including the error message(s) you see.
>
> Best regards,
> Sebastian
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bluez-users] pan and brctl addif question
2005-02-23 7:27 ` Mohan K
@ 2005-02-23 7:45 ` Jack Jia
2005-02-23 10:14 ` [Bluez-users] Re: Can't able to send data in both direction Sebastian Roth
1 sibling, 0 replies; 11+ messages in thread
From: Jack Jia @ 2005-02-23 7:45 UTC (permalink / raw)
To: bluez-users
Sorry to keep asking hciemu related question. The reason I like hciemu so
much is not only I am poor :-), but also I was supposed to set up a
virtual environment of multiple piconets, so my team members can play
around with some scatternet routing stuff. I've seen someone from this
list achieved that. Now, I am following the Pan Howto, but I have some
problems:
1. After running
#pand -s -r GN -i 7F:00:00:01:00:0A
#pand -i 7F:00:00:01:00:0B -c 7F:00:00:01:00:0A
I am hoping 7F:00:00:01:00:0A to be GN, and 7F:00:00:01:00:0B to be PANU,
but when I run pand -l, I got the following:
bnep1 7F:00:00:01:00:0B GN
bnep0 7F:00:00:01:00:0A PANU
So, it seems 7F:00:00:01:00:0B being GN
2. I cannot add bnepX to pan0 using brctl, although I can add my eth0 to
it. After running:
#brctl addif pan0 bnep0
I got:
can't add bnep0 to bridge pan0: Cannot assign requested address
Could you give me some hints about possible reasons for this? Is this
because that all the bnepX's are generated by hciemu, or of some firewall
setting issues?
Is this the right way to set up a piconet? I feel brctl shouldn't be
required for setting a piconet, and bnep0 should be reused for new
connections if it already exists as GN. Seems brctl is something for
scatternet.
Regards,
Jack
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bluez-users] Re: Can't able to send data in both direction
2005-02-23 7:27 ` Mohan K
2005-02-23 7:45 ` [Bluez-users] pan and brctl addif question Jack Jia
@ 2005-02-23 10:14 ` Sebastian Roth
2005-02-23 10:28 ` Mohan K
1 sibling, 1 reply; 11+ messages in thread
From: Sebastian Roth @ 2005-02-23 10:14 UTC (permalink / raw)
To: bluez-users
Hi,
> When the sending program runs on the SiW dongle PC , HCI dump is
> not displaying any thing and it is giving the following error.
>
> Error message on the sending side:
>
> [root@localhost ]# ./senddata
>
> L2CAP socket opened successfully.
>
> Can't connect: No route to host (113)
I have no clue why this happens. Please post the sourcecode of your
application.
> Can't send data.
> : Bad file descriptor
This happens because it can't connect.
No connection, not able to send data!
Maybe there is a problem in the program. Or the needed kernel modules
are not loaded (just a guess).
# lsmod | grep -e l2cap -e rfcomm
Best regards,
Sebastian
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Bluez-users] Re: Can't able to send data in both direction
2005-02-23 10:14 ` [Bluez-users] Re: Can't able to send data in both direction Sebastian Roth
@ 2005-02-23 10:28 ` Mohan K
2005-02-23 12:15 ` Sebastian Roth
0 siblings, 1 reply; 11+ messages in thread
From: Mohan K @ 2005-02-23 10:28 UTC (permalink / raw)
To: bluez-users, sebastian.roth
[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]
Hi Sebastian,
The same program works for CSR dongle. I derived the
function from l2test.c
Regards
Mohan
On Wed, 23 Feb 2005 11:14:06 +0100, Sebastian Roth
<sebastian.roth@esk.fhg.de> wrote:
> Hi,
>
> > When the sending program runs on the SiW dongle PC , HCI dump is
> > not displaying any thing and it is giving the following error.
> >
> > Error message on the sending side:
> >
> > [root@localhost ]# ./senddata
> >
> > L2CAP socket opened successfully.
> >
> > Can't connect: No route to host (113)
> I have no clue why this happens. Please post the sourcecode of your
> application.
>
> > Can't send data.
> > : Bad file descriptor
> This happens because it can't connect.
> No connection, not able to send data!
>
> Maybe there is a problem in the program. Or the needed kernel modules
> are not loaded (just a guess).
> # lsmod | grep -e l2cap -e rfcomm
>
> Best regards,
> Sebastian
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: recvdata.c --]
[-- Type: text/x-c; name="recvdata.c", Size: 11410 bytes --]
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2000-2001 Qualcomm Incorporated
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2002-2005 Marcel Holtmann <marcel@holtmann.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
* CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
* COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
* SOFTWARE IS DISCLAIMED.
*
*
* $Id: l2test.c,v 1.16 2005/01/11 21:42:38 holtmann Exp $
*/
/*Bluetooth Receive program*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
#include <syslog.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/l2cap.h>
static unsigned char *buf;
/* Default mtu */
static int imtu = 672;
static int omtu = 0;
/* Default data size */
static long data_size = 672;
/* Default addr and psm */
static bdaddr_t bdaddr;
static unsigned short psm = 10;
static int master = 0;
static int auth = 0;
static int encrypt = 0;
static int secure = 0;
static int socktype = SOCK_SEQPACKET;
static int linger = 0;
static int reliable = 0;
unsigned char packet[256];
unsigned char sbuf[256]={'a','b','c','d','e','f',0x7c,'g',0x7c,'i'};
unsigned char formpacket(unsigned char device, unsigned char len );
void send_data(int);
static void hexdump(unsigned char *s, unsigned long l)
{
unsigned long i;
unsigned char j,k;
unsigned char temp=0x00;
/*for(i=0;i<l;i++)
{
printf("\r\n0x");
printf("%x",s[i]);
}
printf("\r\n");*/
for(i=0;i<l;i++)
{
if((s[i]== 0x7C)) //&& (s[i+1] != 0x7C))
{
temp=temp ^ s[i];
temp=temp ^ s[i+1];
temp=temp ^ s[i+2];
for(k=i;k<(i+s[i+2]);k++)
temp=temp ^ s[k+3];
if(s[s[i+2]+3]==temp)
printf("\nPacket recevied correctly\n");
else
{
printf("\nPacket corrupted\n");
return;
}
if(s[i+1]==0x01)
{
printf("\nKeyboard data packet\n");
printf("\nNo. of bytes in Keyboard packet:%x\n",s[2]);
for(j=3;j<(s[i+2]+3);j++)
printf(" %x ",s[j]);
}
if(s[i+1]==0x02)
{
printf("\nMouse data packet\n");
printf("\nNo. of bytes in Mouse packet:%x\n",s[2]);
for(j=3;j<(s[i+2]+3);j++)
printf(" %x ",s[j]);
}
if(s[i+1]==0x03)
{
printf("\nFinger print data packet\n");
printf("\nNo. of bytes in Finger print packet:%x\n",s[2]);
for(j=3;j<(s[i+2]+3);j++)
printf(" %x ",s[j]);
}
if(s[i+1]==0x04)
{
printf("\nControl packet\n");
printf("\nNo. of bytes in Control packet:%x\n",s[2]);
for(j=3;j<(s[i+2]+3);j++)
printf(" %x ",s[j]);
}
break;
}
}
}
static void dump_mode(int s)
{
int len;
int opt, optl;
printf("\r\nReceiving ...\r\n");
while (1) {
fd_set rset;
FD_ZERO(&rset);
FD_SET(s, &rset);
if (select(s + 1, &rset, NULL, NULL, NULL) < 0)
return;
if (!FD_ISSET(s, &rset))
continue;
len = read(s, buf, data_size);
if (len <= 0) {
if (len < 0) { bacpy(&bdaddr, BDADDR_ANY);
if (reliable && (errno == ECOMM)) {
printf("\r\nL2CAP Error ECOMM - clearing error and continuing.\r\n");
optl = sizeof(opt);
if (getsockopt(s, SOL_SOCKET, SO_ERROR, &opt, &optl ) < 0) { // Clear error
printf("\r\nCouldn't getsockopt(SO_ERROR): %s (%d)\r\n",
strerror(errno), errno);
return;
}
continue;
} else {
printf("\r\nRead error: %s(%d)\n", strerror(errno), errno);
}
}
// return;
break;
// continue;
}
else if(len > 0)
{
printf("\nRecevied %d bytes\n", len);
static int omtu = 0;
hexdump(buf,len);
}
}
}
static void do_listen(void)
{
struct sockaddr_l2 loc_addr, rem_addr;
struct l2cap_options opts;
int s, s1, opt;
char ba[18];
if ((s = socket(PF_BLUETOOTH, socktype, BTPROTO_L2CAP)) < 0) {
printf("\nCan't create socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
loc_addr.l2_family = AF_BLUETOOTH;
bacpy(&loc_addr.l2_bdaddr, &bdaddr);
loc_addr.l2_psm = htobs(psm);
if (bind(s, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0) {
printf("\nCan't bind socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Set link mode */
opt = 0;
if (reliable)
opt |= L2CAP_LM_RELIABLE;
if (master)
opt |= L2CAP_LM_MASTER;
if (auth)
opt |= L2CAP_LM_AUTH;
if (encrypt)
opt |= L2CAP_LM_ENCRYPT;
if (secure)
opt |= L2CAP_LM_SECURE;
if (setsockopt(s, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) {
printf("\nCan't set L2CAP link mode: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Get default options */
opt = sizeof(opts);
if (getsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get default L2CAP options: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Set new options */
opts.imtu = imtu;
if (setsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, opt) < 0) {
printf("\nCan't set L2CAP options: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* if (socktype == SOCK_DGRAM) {
handler(s);
return;
}*/
if (listen(s, 10)) {
printf("\nCan not listen on the socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
printf("\nWaiting for connection on psm %d ...\n", psm);
while(1) {
opt = sizeof(rem_addr);
if ((s1 = accept(s, (struct sockaddr *) &rem_addr, &opt)) < 0) {
printf("\nAccept failed: %s (%d)\n", strerror(errno), errno);
exit(1);
}
opt = sizeof(opts);
if (getsockopt(s1, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get L2CAP options: %s (%d)\n", strerror(errno), errno);
exit(1);
}
ba2str(&rem_addr.l2_bdaddr, ba);
printf("\nConnect from %s [imtu %d, omtu %d, flush_to %d]\n",ba, opts.imtu, opts.omtu, opts.flush_to);
/* Enable SO_LINGER */
if (linger) {
struct linger l = { .l_onoff = 1, .l_linger = linger };
if (setsockopt(s, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0) {
printf("\nCan't enable SO_LINGER: %s (%d)\n",
strerror(errno), errno);
exit(1);
}
}
dump_mode(s1);
close(s1);
printf("\nDisconnect: %m\n");
}
}
// Sending part at the receving end
unsigned char formpacket(unsigned char device, unsigned char len )
{
unsigned char temp=0x00;
unsigned char i,j,pdlen;
packet[0]=0x7c;
switch(device)
{
case 1:
packet[1]=0x01;
break;
case 2:
packet[1]=0x02;
break;
case 3:
packet[1]=0x03;
break;
case 4:
packet[1]=0x04;
break;
}
pdlen=len;
for(i=3,j=0;j<len;i++,j++)
{
/*if(buf[j]==0x7c)
{
packet[i]=0x7c;
packet[++i]=buf[j];
pdlen++;
}
else*/
packet[i]=sbuf[j];
}
packet[2]=pdlen;
temp=temp ^ packet[0];
temp=temp ^ packet[1];
temp=temp ^ packet[2];
for(i=0;i<pdlen;i++)
temp=temp ^ packet[i+3];
packet[pdlen+3]=temp;
return pdlen;
}
void send_data(int s)
{
size_t datlen;
int i,nb;
datlen=formpacket(0x04,0x0a);
if ((nb=send(s,&packet[0],(datlen+4),MSG_DONTWAIT))< 0)
perror("\nCan't send data.\n");
else
{
printf("\nNo. of bytes sent=%d\n",nb);
printf("\nPacket:\n");
for(i=0;i<datlen+4;i++)
printf(" %x ",packet[i]);
printf("\n\n");
//return 0;
}
}
static int remote_connect(char *svr)
{
struct sockaddr_l2 rem_addr, loc_addr;
struct l2cap_options opts;
struct l2cap_conninfo conn;
int s, opt;
if ((s = socket(PF_BLUETOOTH, socktype, BTPROTO_L2CAP)) < 0) {
printf("\nCan't create socket: %s (%d)\n", strerror(errno), errno);
return -1;
}
else
printf("\nL2CAP socket opened successfully.\n");
memset(&loc_addr, 0, sizeof(loc_addr));
loc_addr.l2_family = AF_BLUETOOTH;
bacpy(&loc_addr.l2_bdaddr, &bdaddr);
if (bind(s, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0) {
printf("\nCan't bind socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Get default options */
memset(&opts, 0, sizeof(opts));
opt = sizeof(opts);
if (getsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get default L2CAP options: %s (%d)\n", strerror(errno), errno);
return -1;
}
/* Set new options */
opts.omtu = omtu;
opts.imtu = imtu;
if (setsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, opt) < 0) {
printf("\nCan't set L2CAP options: %s (%d)\n", strerror(errno), errno);
return -1;
}
/* Enable SO_LINGER */
if (linger) {
struct linger l = { .l_onoff = 1, .l_linger = linger };
if (setsockopt(s, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0) {
printf("\nCan't enable SO_LINGER: %s (%d)\n",
strerror(errno), errno);
return -1;
}
}
/* Set link mode */
opt = 0;
if (reliable)
opt |= L2CAP_LM_RELIABLE;
if (setsockopt(s, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) {
printf("\nCan't set L2CAP link mode: %s (%d)\n", strerror(errno), errno);
exit(1);
}
memset(&rem_addr, 0, sizeof(rem_addr));
rem_addr.l2_family = AF_BLUETOOTH;
str2ba(svr, &rem_addr.l2_bdaddr);
rem_addr.l2_psm = htobs(psm);
if (connect(s, (struct sockaddr *) &rem_addr, sizeof(rem_addr)) < 0 ) {
printf("\nCan't connect: %s (%d)\n", strerror(errno), errno);
close(s);
return -1;
}
memset(&opts, 0, sizeof(opts));
opt = sizeof(opts);
if (getsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get L2CAP options: %s (%d)\n", strerror(errno), errno);
close(s);
return -1;
}
memset(&conn, 0, sizeof(conn));
opt = sizeof(conn);
if (getsockopt(s, SOL_L2CAP, L2CAP_CONNINFO, &conn, &opt) < 0) {
printf("\nCan't get L2CAP connection information: %s (%d)\n", strerror(errno), errno);
close(s);
return -1;
}
printf("\nConnected [imtu %d, omtu %d, flush_to %d, mode %d, handle %d, class 0x%02x%02x%02x]\n",
opts.imtu, opts.omtu, opts.flush_to, opts.mode, conn.hci_handle,
conn.dev_class[2], conn.dev_class[1], conn.dev_class[0]);
return s;
}
int main(void)
{
int fd;
bacpy(&bdaddr, BDADDR_ANY);
if (!(buf = malloc(data_size))) {
perror("Can't allocate data buffer");
exit(1);
}
do_listen();
// fd=remote_connect("01:5A:4B:20:07:DB");
// send_data(fd);
return 0;
}
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: senddata.c --]
[-- Type: text/x-c; name="senddata.c", Size: 14099 bytes --]
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2000-2001 Qualcomm Incorporated
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2002-2005 Marcel Holtmann <marcel@holtmann.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
* CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
* COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
* SOFTWARE IS DISCLAIMED.
*
*
* $Id: l2test.c,v 1.16 2005/01/11 21:42:38 holtmann Exp $
*/
/*Send program*/
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/l2cap.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/l2cap.h>
#include <errno.h>
#include "csr.h"
unsigned char packet[256];
unsigned char buf[256]={'a','b','c','d','e','f',0x7c,'g',0x7c,'i'};
static unsigned char *rbuf;
static int master = 0;
static int auth = 0;
static int encrypt = 0;
static int secure = 0;
static int reliable = 0;
static int socktype = SOCK_SEQPACKET;
/* Default mtu */
static int imtu = 672;
static int omtu = 0;
static int linger = 0;
/* Default data size */
static long data_size = 672;
/* Default addr and psm */
static bdaddr_t bdaddr;
static unsigned short psm = 10;
//const char str[18]="00:0B:0D:33:DA:F9";
void dump_mode(int);
static int listen_connection(void);
void accept_connection(int);
static void do_listen(void);
unsigned char formpacket(unsigned char device, unsigned char len )
{
unsigned char temp=0x00;
unsigned char i,j,pdlen;
packet[0]=0x7c;
switch(device)
{
case 1:
packet[1]=0x01;
break;
case 2:
packet[1]=0x02;
break;
case 3:
packet[1]=0x03;
break;
case 4:
packet[1]=0x04;
break;
}
pdlen=len;
for(i=3,j=0;j<len;i++,j++)
{
/*if(buf[j]==0x7c)
{
packet[i]=0x7c;
packet[++i]=buf[j];
pdlen++;
}
else*/
packet[i]=buf[j];
}
packet[2]=pdlen;
temp=temp ^ packet[0];
temp=temp ^ packet[1];
temp=temp ^ packet[2];
for(i=0;i<pdlen;i++)
temp=temp ^ packet[i+3];
packet[pdlen+3]=temp;
return pdlen;
}
void send_data(int s)
{
size_t datlen;
int i,nb;
datlen=formpacket(0x01,0x0a);
if ((nb=send(s,&packet[0],(datlen+4),MSG_DONTWAIT))< 0)
perror("\nCan't send data.\n");
else
{
printf("\nNo. of bytes sent=%d\n",nb);
printf("\nPacket:\n");
for(i=0;i<datlen+4;i++)
printf(" %x ",packet[i]);
printf("\n\n");
//return 0;
}
}
static int remote_connect(char *svr)
{
struct sockaddr_l2 rem_addr, loc_addr;
struct l2cap_options opts;
struct l2cap_conninfo conn;
int s, opt;
if ((s = socket(PF_BLUETOOTH, socktype, BTPROTO_L2CAP)) < 0) {
printf("\nCan't create socket: %s (%d)\n", strerror(errno), errno);
return -1;
}
else
printf("\nL2CAP socket opened successfully.\n");
memset(&loc_addr, 0, sizeof(loc_addr));
loc_addr.l2_family = AF_BLUETOOTH;
bacpy(&loc_addr.l2_bdaddr, &bdaddr);
if (bind(s, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0) {
printf("\nCan't bind socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Get default options */
memset(&opts, 0, sizeof(opts));
opt = sizeof(opts);
if (getsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get default L2CAP options: %s (%d)\n", strerror(errno), errno);
return -1;
}
/* Set new options */
opts.omtu = omtu;
opts.imtu = imtu;
if (setsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, opt) < 0) {
printf("\nCan't set L2CAP options: %s (%d)\n", strerror(errno), errno);
return -1;
}
/* Enable SO_LINGER */
if (linger) {
struct linger l = { .l_onoff = 1, .l_linger = linger };
if (setsockopt(s, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0) {
printf("\nCan't enable SO_LINGER: %s (%d)\n",
strerror(errno), errno);
return -1;
}
}
/* Set link mode */
opt = 0;
if (reliable)
opt |= L2CAP_LM_RELIABLE;
if (setsockopt(s, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) {
printf("\nCan't set L2CAP link mode: %s (%d)\n", strerror(errno), errno);
exit(1);
}
memset(&rem_addr, 0, sizeof(rem_addr));
rem_addr.l2_family = AF_BLUETOOTH;
str2ba(svr, &rem_addr.l2_bdaddr);
rem_addr.l2_psm = htobs(psm);
if (connect(s, (struct sockaddr *) &rem_addr, sizeof(rem_addr)) < 0 ) {
printf("\nCan't connect: %s (%d)\n", strerror(errno), errno);
close(s);
return -1;
}
memset(&opts, 0, sizeof(opts));
opt = sizeof(opts);
if (getsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get L2CAP options: %s (%d)\n", strerror(errno), errno);
close(s);
return -1;
}
memset(&conn, 0, sizeof(conn));
opt = sizeof(conn);
if (getsockopt(s, SOL_L2CAP, L2CAP_CONNINFO, &conn, &opt) < 0) {
printf("\nCan't get L2CAP connection information: %s (%d)\n", strerror(errno), errno);
close(s);
return -1;
}
printf("\nConnected [imtu %d, omtu %d, flush_to %d, mode %d, handle %d, class 0x%02x%02x%02x]\n",
opts.imtu, opts.omtu, opts.flush_to, opts.mode, conn.hci_handle,
conn.dev_class[2], conn.dev_class[1], conn.dev_class[0]);
return s;
}
// Recevie part at the sending end
#if 0
static int listen_connection(void)
{
struct sockaddr_l2 loc_addr, rem_addr;
struct l2cap_options opts;
int s, s1, opt;
char ba[18];
bacpy(&bdaddr, BDADDR_ANY);
if ((s = socket(PF_BLUETOOTH, socktype, BTPROTO_L2CAP)) < 0) {
printf("\nCan't create socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
loc_addr.l2_family = AF_BLUETOOTH;
bacpy(&loc_addr.l2_bdaddr, &bdaddr);
loc_addr.l2_psm = htobs(psm);
if (bind(s, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0) {
printf("\nCan't bind socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Set link mode */
opt = 0;
if (reliable)
opt |= L2CAP_LM_RELIABLE;
if (master)
opt |= L2CAP_LM_MASTER;
if (auth)
opt |= L2CAP_LM_AUTH;
if (encrypt)
opt |= L2CAP_LM_ENCRYPT;
if (secure)
opt |= L2CAP_LM_SECURE;
if (setsockopt(s, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) {
printf("\nCan't set L2CAP link mode: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Get default options */
opt = sizeof(opts);
if (getsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get default L2CAP options: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Set new options */
opts.imtu = imtu;
if (setsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, opt) < 0) {
printf("\nCan't set L2CAP options: %s (%d)\n", strerror(errno), errno);
exit(1);
}
return s;
}
void accept_connection(int s)
{
struct sockaddr_l2 loc_addr, rem_addr;
struct l2cap_options opts;
int s1, opt;
char ba[18];
if (listen(s, 10)) {
printf("\nCan not listen on the socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
printf("\nWaiting for connection on psm %d ...\n", psm);
while(1) {
opt = sizeof(rem_addr);
if ((s1 = accept(s, (struct sockaddr *) &rem_addr, &opt)) < 0) {
printf("\nAccept failed: %s (%d)\n", strerror(errno), errno);
exit(1);
}
opt = sizeof(opts);
if (getsockopt(s1, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get L2CAP options: %s (%d)\n", strerror(errno), errno);
exit(1);
}
ba2str(&rem_addr.l2_bdaddr, ba);
printf("\nConnect from %s [imtu %d, omtu %d, flush_to %d]\n",ba, opts.imtu, opts.omtu, opts.flush_to);
/* Enable SO_LINGER */
if (linger) {
struct linger l = { .l_onoff = 1, .l_linger = linger };
if (setsockopt(s, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0) {
printf("\nCan't enable SO_LINGER: %s (%d)\n",
strerror(errno), errno);
exit(1);
}
}
dump_mode(s1);
close(s1);
printf("\nDisconnect: %m\n");
}
}
#endif
static void do_listen(void)
{
struct sockaddr_l2 loc_addr, rem_addr;
struct l2cap_options opts;
int s, s1, opt;
char ba[18];
if ((s = socket(PF_BLUETOOTH, socktype, BTPROTO_L2CAP)) < 0) {
printf("\nCan't create socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
loc_addr.l2_family = AF_BLUETOOTH;
bacpy(&loc_addr.l2_bdaddr, &bdaddr);
loc_addr.l2_psm = htobs(psm);
if (bind(s, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0) {
printf("\nCan't bind socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Set link mode */
opt = 0;
if (reliable)
opt |= L2CAP_LM_RELIABLE;
if (master)
opt |= L2CAP_LM_MASTER;
if (auth)
opt |= L2CAP_LM_AUTH;
if (encrypt)
opt |= L2CAP_LM_ENCRYPT;
if (secure)
opt |= L2CAP_LM_SECURE;
if (setsockopt(s, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) {
printf("\nCan't set L2CAP link mode: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Get default options */
opt = sizeof(opts);
if (getsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get default L2CAP options: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* Set new options */
opts.imtu = imtu;
if (setsockopt(s, SOL_L2CAP, L2CAP_OPTIONS, &opts, opt) < 0) {
printf("\nCan't set L2CAP options: %s (%d)\n", strerror(errno), errno);
exit(1);
}
/* if (socktype == SOCK_DGRAM) {
handler(s);
return;
}*/
if (listen(s, 10)) {
printf("\nCan not listen on the socket: %s (%d)\n", strerror(errno), errno);
exit(1);
}
printf("\nWaiting for connection on psm %d ...\n", psm);
while(1) {
opt = sizeof(rem_addr);
if ((s1 = accept(s, (struct sockaddr *) &rem_addr, &opt)) < 0) {
printf("\nAccept failed: %s (%d)\n", strerror(errno), errno);
exit(1);
}
opt = sizeof(opts);
if (getsockopt(s1, SOL_L2CAP, L2CAP_OPTIONS, &opts, &opt) < 0) {
printf("\nCan't get L2CAP options: %s (%d)\n", strerror(errno), errno);
exit(1);
}
ba2str(&rem_addr.l2_bdaddr, ba);
printf("\nConnect from %s [imtu %d, omtu %d, flush_to %d]\n",ba, opts.imtu, opts.omtu, opts.flush_to);
/* Enable SO_LINGER */
if (linger) {
struct linger l = { .l_onoff = 1, .l_linger = linger };
if (setsockopt(s, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0) {
printf("\nCan't enable SO_LINGER: %s (%d)\n",
strerror(errno), errno);
exit(1);
}
}
dump_mode(s1);
close(s1);
printf("\nDisconnect: %m\n");
}
}
static void hexdump(unsigned char *s, unsigned long l)
{
unsigned long i;
unsigned char j,k;
unsigned char temp=0x00;
/*for(i=0;i<l;i++)
{
printf("\r\n0x");
printf("%x",s[i]);
}
printf("\r\n");*/
for(i=0;i<l;i++)
{
if((s[i]== 0x7C)) //&& (s[i+1] != 0x7C))
{
temp=temp ^ s[i];
temp=temp ^ s[i+1];
temp=temp ^ s[i+2];
for(k=i;k<(i+s[i+2]);k++)
temp=temp ^ s[k+3];
if(s[s[i+2]+3]==temp)
printf("\nPacket recevied correctly\n");
else
{
printf("\nPacket corrupted\n");
return;
}
if(s[i+1]==0x01)
{
printf("\nKeyboard data packet\n");
printf("\nNo. of bytes in Keyboard packet:%x\n",s[2]);
for(j=3;j<(s[i+2]+3);j++)
printf(" %x ",s[j]);
}
if(s[i+1]==0x02)
{
printf("\nMouse data packet\n");
printf("\nNo. of bytes in Mouse packet:%x\n",s[2]);
for(j=3;j<(s[i+2]+3);j++)
printf(" %x ",s[j]);
}
if(s[i+1]==0x03)
{
printf("\nFinger print data packet\n");
printf("\nNo. of bytes in Finger print packet:%x\n",s[2]);
for(j=3;j<(s[i+2]+3);j++)
printf(" %x ",s[j]);
}
if(s[i+1]==0x04)
{
printf("\nControl packet\n");
printf("\nNo. of bytes in Control packet:%x\n",s[2]);
for(j=3;j<(s[i+2]+3);j++)
printf(" %x ",s[j]);
}
break;
}
}
}
void dump_mode(int s)
{
int len;
int opt, optl;
printf("\r\nReceiving ...\r\n");
while (1) {
fd_set rset;
FD_ZERO(&rset);
FD_SET(s, &rset);
if (select(s + 1, &rset, NULL, NULL, NULL) < 0)
return;
if (!FD_ISSET(s, &rset))
continue;
len = read(s, rbuf, data_size);
printf("\nRecevied %d bytes\n", len);
if (len <= 0) {
if (len < 0) {
if (reliable && (errno == ECOMM)) {
printf("\r\nL2CAP Error ECOMM - clearing error and continuing.\r\n");
optl = sizeof(opt);
if (getsockopt(s, SOL_SOCKET, SO_ERROR, &opt, &optl ) < 0) { // Clear error
printf("\r\nCouldn't getsockopt(SO_ERROR): %s (%d)\r\n",
strerror(errno), errno);
return;
}
continue;
} else {
printf("\r\nRead error: %s(%d)\n", strerror(errno), errno);
}
}
// return;
break;
// continue;
}
// else if(len > 0)
{
printf("\nRecevied %d bytes\n", len);
hexdump(rbuf,len);
}
}
close(s);
}
int main(void)
{
int fd;
fd=remote_connect("00:0B:0D:33:DA:F9");
send_data(fd);
//fd=listen_connection();
//accept_connection(fd);
// do_listen();
}
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bluez-users] Re: Can't able to send data in both direction
2005-02-23 10:28 ` Mohan K
@ 2005-02-23 12:15 ` Sebastian Roth
2005-02-23 12:35 ` Mohan K
2005-02-24 6:58 ` Mohan K
0 siblings, 2 replies; 11+ messages in thread
From: Sebastian Roth @ 2005-02-23 12:15 UTC (permalink / raw)
To: bluez-users
Hi,
I compiled and tested your applications. Had the (exact) same problem
when tried to send from a SiW dongle to one with CSR chip. But...
This was because I forgot to starup the interface. What does
`hciconfig -a' for the SiW dongle show? Is it up?
Best regards,
Sebastian
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Bluez-users] Re: Can't able to send data in both direction
2005-02-23 12:15 ` Sebastian Roth
@ 2005-02-23 12:35 ` Mohan K
2005-02-24 6:58 ` Mohan K
1 sibling, 0 replies; 11+ messages in thread
From: Mohan K @ 2005-02-23 12:35 UTC (permalink / raw)
To: bluez-users, sebastian.roth
Hi Sebastian,
Yes. hciconfig -a is showing up. The following is
the result I am getting for hciconfig -a. I can't move forward from
this problem.
SiW Dongle:
[root@localhost ~]# hciconfig -a
hci0: Type: USB
BD Address: 00:0B:0D:33:DA:F9 ACL MTU: 120:20 SCO MTU: 64:0
UP RUNNING PSCAN ISCAN
RX bytes:1679 acl:42 sco:0 events:98 errors:0
TX bytes:723 acl:30 sco:0 commands:29 errors:0
Features: 0xff 0xff 0x05 0x38 0x18 0x18 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: ''
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.2 (0x2) HCI Rev: 0x0 LMP Ver: 1.2 (0x2) LMP Subver: 0x757
Manufacturer: Silicon Wave (11)
CSR dongle:
[root@localhost root]# hciconfig -a
hci0: Type: USB
BD Address: 01:5A:4B:20:07:DB ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:273 acl:5 sco:0 events:24 errors:0
TX bytes:175 acl:6 sco:0 commands:11 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'BlueZ (0)'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x110 LMP Ver: 1.1 (0x1) LMP Subver: 0x110
Manufacturer: Cambridge Silicon Radio (10)
Regards
Mohan
On Wed, 23 Feb 2005 13:15:07 +0100, Sebastian Roth
<sebastian.roth@esk.fhg.de> wrote:
> Hi,
>
> I compiled and tested your applications. Had the (exact) same problem
> when tried to send from a SiW dongle to one with CSR chip. But...
> This was because I forgot to starup the interface. What does
> `hciconfig -a' for the SiW dongle show? Is it up?
>
> Best regards,
> Sebastian
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Bluez-users] Re: Can't able to send data in both direction
2005-02-23 12:15 ` Sebastian Roth
2005-02-23 12:35 ` Mohan K
@ 2005-02-24 6:58 ` Mohan K
2005-02-24 7:23 ` Sebastian Roth
1 sibling, 1 reply; 11+ messages in thread
From: Mohan K @ 2005-02-24 6:58 UTC (permalink / raw)
To: bluez-users, sebastian.roth
Hi Sebastian,
Can you tell me whether the send program is working
after making the device up using "hciconfig hci0 up" on the SiW dongle
side?
Regards
Mohan
On Wed, 23 Feb 2005 13:15:07 +0100, Sebastian Roth
<sebastian.roth@esk.fhg.de> wrote:
> Hi,
>
> I compiled and tested your applications. Had the (exact) same problem
> when tried to send from a SiW dongle to one with CSR chip. But...
> This was because I forgot to starup the interface. What does
> `hciconfig -a' for the SiW dongle show? Is it up?
>
> Best regards,
> Sebastian
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bluez-users] Re: Can't able to send data in both direction
2005-02-24 6:58 ` Mohan K
@ 2005-02-24 7:23 ` Sebastian Roth
2005-02-24 8:32 ` Mohan K
0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Roth @ 2005-02-24 7:23 UTC (permalink / raw)
To: bluez-users
Hi Mohan,
I'm sorry. I have not made this point clear!
> Can you tell me whether the send program is working
> after making the device up using "hciconfig hci0 up" on the SiW dongle
> side?
Yes, after starting `hcid' (or using `hciconfig hci0 up') I was able to
connect and send data in both directions.
Wugh? What's this? hciconfig shows a "Transilica, Inc." chip to me.
Don't know why but I thought that this dongle has a SiW chip in it.
Are you able to send data using another programm? Please try l2ping to
see if both directions work.
Best regards,
Sebastian
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Bluez-users] Re: Can't able to send data in both direction
2005-02-24 7:23 ` Sebastian Roth
@ 2005-02-24 8:32 ` Mohan K
0 siblings, 0 replies; 11+ messages in thread
From: Mohan K @ 2005-02-24 8:32 UTC (permalink / raw)
To: bluez-users, sebastian.roth
Hi Sebastian,
The l2ping is working on both side. I uncommented
the send functions in the recvdata.c and tried. That even not working
in SiW dongle and giving the same error.
Thanks & Regards
Mohan
On Thu, 24 Feb 2005 08:23:30 +0100, Sebastian Roth
<sebastian.roth@esk.fhg.de> wrote:
> Hi Mohan,
>
> I'm sorry. I have not made this point clear!
>
> > Can you tell me whether the send program is working
> > after making the device up using "hciconfig hci0 up" on the SiW dongle
> > side?
> Yes, after starting `hcid' (or using `hciconfig hci0 up') I was able to
> connect and send data in both directions.
>
> Wugh? What's this? hciconfig shows a "Transilica, Inc." chip to me.
> Don't know why but I thought that this dongle has a SiW chip in it.
>
> Are you able to send data using another programm? Please try l2ping to
> see if both directions work.
>
> Best regards,
> Sebastian
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2005-02-24 8:32 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-23 6:39 [Bluez-users] Can't able to send data in both direction Mohan K
2005-02-23 7:03 ` [Bluez-users] " Sebastian Roth
2005-02-23 7:27 ` Mohan K
2005-02-23 7:45 ` [Bluez-users] pan and brctl addif question Jack Jia
2005-02-23 10:14 ` [Bluez-users] Re: Can't able to send data in both direction Sebastian Roth
2005-02-23 10:28 ` Mohan K
2005-02-23 12:15 ` Sebastian Roth
2005-02-23 12:35 ` Mohan K
2005-02-24 6:58 ` Mohan K
2005-02-24 7:23 ` Sebastian Roth
2005-02-24 8:32 ` Mohan K
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox