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

RE: [bluetooth-dev] Inbuffers and generic mode



Hello Alain,

It seems like the module acts a bit weird. Under normal operation we don't tell
the module how many inbuffers we have in the stack and therefore, according
to the specifications, it is assumed that the data buffers in the host are
unlimited and the data can come in any size from the module. In the stack
we have a define called HCI_IN_SIZE which is the size of our inbuffer (not
to be mixed up with the inbuffers used for the ttyBTx:s). I'm not sure how
the hci command host_buffer_size will affect your module but you can always
try to set thoose parameters to match our inbuffers. 

The message "BT DATA bt_receive_top: (50) line 0 not active yet... silent discard!"
will appear if you don't have anything running on top of the ttyBTx, i.e. you
haven't open the tty for reading and therefore the stack can't send the data.

The HCI discard messages may be a result of corrupted data from the module. There
should be no problem with the state machine in hci_receive_data even if the
data received comes in small pieces but if nothing else help have a look
at it and make sure it can handle small portions of data and assemble it
into a complete packet for processing (process_acl_data).

Best Regards
Anders Johansson 

-----Original Message-----
From: Alain Paschoud [mailto:alain.paschoud@xxxxxxx.ch]
Sent: den 27 mars 2002 11:26
To: bluetooth-dev@xxxxxxx.com
Subject: [bluetooth-dev] Inbuffers and generic mode


Hi all,

I'm using a hardware that is not in the config (TI), so I use the stack in generic mode, communicating with UART.

I'm able to do an inquiry and a connection between two devices. But I've a problem when sending data from the remote device to my hardware.
On the remote device, I use bt_send -d /dev/ttsBT0 -r 50 -s 50.

Note that on local device, I don't use inbuffers, because I got errors when activating inbuffers.

On the local device, I recieve bytes by pairs, I've next logs (... means a log of debug of the same type) :

*****

BT DATA -->|X|      2

hci_receive_data:  (2):
0x02 0x01 
BT DATA -->|X|      2

hci_receive_data:  (2):
0x10 0x00 
BT DATA -->|X|      2

hci_receive_data:  (2):
0x00 0x02 
BT DATA -->|X|      2

hci_receive_data:  (2):
0x01 0x10 
BT DATA -->|X|      2

hci_receive_data:  (2):
0x00 0x00 
BT DATA -->|X|      2

.
.
.

hci_receive_data:  (2):
0x41 0x42 
BT DATA -->|X|      2

hci_receive_data:  (2):
0x43 0x44 
BT DATA -->|X|      2

hci_receive_data:  (2):
0x45 0x46 
BT DATA -->|X|      2

hci_receive_data:  (2):
0x47 0x48 
BT DATA -->|X|      2

.
.
.

hci_receive_data:  (2):
0x58 0x59 
BT DATA -->|X|      2

hci_receive_data:  (2):
0xbf 0x02 
BT DATA    |X|-->  50 [0]
BT DATA bt_receive_top: (50) line 0 not active yet... silent discard!

*******

---> Then, this complete sequence begin again.

Question : Why do I always recieve byte by pair ? why don't I recieve more bytes at the same time ?

But from time to time, something goes wrong. I've next logs :

*****

hci_receive_data:  (2):
0x4d 0x4e 
BT DATA -->|X|      2

hci_receive_data:  (2):
0x4f 0x50 
BT SYS: ERROR: hci_receive_data: discarding 2 bytes
BT DATA -->|X|      2

hci_receive_data:  (2):
0x51 0x52 
BT SYS: ERROR: hci_receive_data: discarding 2 bytes
BT DATA -->|X|      2

hci_receive_data:  (2):
0x53 0x54 
BT SYS: ERROR: hci_receive_data: discarding 2 bytes
BT DATA -->|X|      2

hci_receive_data:  (2):
0x55 0x56 
BT SYS: ERROR: hci_receive_data: discarding 2 bytes
BT DATA -->|X|      2

hci_receive_data:  (2):
0x57 0x58 
BT SYS: ERROR: hci_receive_data: discarding 2 bytes
BT DATA -->|X|      2

hci_receive_data:  (2):
0x59 0xbf 
BT SYS: ERROR: hci_receive_data: discarding 2 bytes
BT DATA -->|X|      2

hci_receive_data:  (2):
0x02 0x01 
BT DATA -->|X|      2

hci_receive_data:  (2):
0x10 0x00 
BT DATA -->|X|      2

*****

---> Then, the data are recieved correctly again...

And at the end, I have recieved 6 times the message "BT DATA bt_receive_top: (50) line 0 not active yet... silent discard!". I think I should recieve this message 50 times... where are the other bytes ? (of course, the remote device told me that it sent every bytes).


The result of this problem is that some bytes are logs (because of the discarding), and when I try  to use ppp on the serial line, the ppp negociation never works (of course because some bytes are lost).


Please is someone can give me some gidelines how to track the problem, what I could do, please tell me !

Best regards. 

-- 
Alain Paschoud                      SMARTDATA SA
alain.paschoud@xxxxxxx.ch         PSE-A
http://www.smartdata.ch             1015 Lausanne
Phone +41-21-693'84'98              
Fax   +41-27-693'84'91              
-
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