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

[bluetooth-dev] Connection Problems / PALM port



Hello,

I am trying to port the code to PALM OS.  Right now I am still using a
PC to make sure I understand how the stack works.  I am compiling just
the hci and l2cap layers.  I am using two ericsson EBMKs (small dev.
kits).  For some reason I cannot get a connection going -- it gets
pretty far and then gets stuck.  Attached to this e-mail are the
transcripts from the master and from the slave.  Both of them indicate
an 'unrecognized' return param. Could someone familiar with the BT stack
please take a look and tell me what is wrong?

The relevant code for the master is:

hci_init(); l2cap_init(); write_scan_enable(SCAN_ENABLE_BOTH);

The relevant code for the slave is:
hci_init(); l2cap_init(); test_create_connection(master_bd,
RFCOMM_LAYER);

Now, just keep receiving serial port data and sending it to
hci_receive_data.  Note that I am not registering any upper layer
functions (but I don't even get that far since there are no 'not
registered' warnings)

Thanks


Eugene

P.S. The 'zero length array' trick used in most of the header structures
(e.g. 'u8 data[0]') is not valid ANSI C. I had to change it to 'u8 data'
and use '&tx->data' instead of 'tx->data'.
SLAVE

Initialising HCI
init_cmd_buf: Initializing
read_buffer_size()
send_cmd : cmd_num 1
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
send_cmd: Sucessfully sent HCI command
------------RECEIVED 14 BYTES -------------
hci_receive_data : got 14 bytes
hci_receive_data :  04 0E 0B 01 05 10 00 20 03 00 0A 00 00 00
hci-14
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 01 05 10 00 20 03 00 0A 00 00 00
process_event_packet: COMMAND_COMPLETE
 process_event_packet: now cmd_num = 1
 process_return_param: READ_BUFFER_SIZE
process_return_param: acl_len: 800, acl_nbr : 10
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
Initialising L2CAP
init_flow
l2ca_connect_req : sent to bd  00 D0 B7 03 1F 34
get_con : look for connections in state ANY_STATE (7)
get_con : bd  34 1F 03 B7 D0 00
get_con : connection not found
get_lcon : lcid 64 con_list.count = 0
get_lcon : connection lcid : 64 not found
Create_con rcid 0
insert_con() lcid:64, rcid:0, hci_hdl:0
state CLOSED psm:3  remote_mtu:672 initiator:1 link_up:0
insert_con : now 1 connections
l2ca_connect_req : create new baseband link
lp_connect_req to : bd  34 1F 03 B7 D0 00
create_connection
send_cmd : cmd_num 1
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
send_cmd: Sucessfully sent HCI command
------------RECEIVED 7 BYTES -------------
hci_receive_data : got 7 bytes
hci_receive_data :  04 0F 04 00 01 05 04
hci-7
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 00 01 05 04
process_event_packet: COMMAND_STATUS (status:0x0)
now cmd_num = 1
 send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
------------RECEIVED 14 BYTES -------------
hci_receive_data : got 14 bytes
hci_receive_data :  04 03 0B 00 01 00 34 1F 03 B7 D0 00 01 00
hci-14
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 00 01 00 34 1F 03 B7 D0 00 01 00
process_event_packet: CONNECTION_COMPLETE: Success!
lp_connect_cfm: Success! (hci_handle : 1)
get_con : look for connections in state CLOSED (0)
get_con : bd  34 1F 03 B7 D0 00
get_con : con_list bd  34 1F 03 B7 D0 00
we are client
lp_connect_cfm : HCI connected to  34 1F 03 B7 D0 00
Current state : W4_L2CAP_CONNECT_RSP
l2cap_connect_req: Connecting RFCOMM (rcid:0)
hci_send_data: 12 bytes 
hci_send_data : leave in queue, buffers 0, acl_num 10
change_connection_packet_type: for connnection handle 0x1
send_cmd : cmd_num 1
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
send_cmd: Sucessfully sent HCI command
------------RECEIVED 22 BYTES -------------
hci_receive_data : got 22 bytes
hci_receive_data :  04 0F 04 00 00 0F 04 04 1D 05 00 01 00 18 CC 04 0E 04 01 00 00 00
hci-22
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 00 00 0F 04
process_event_packet: COMMAND_STATUS (status:0x0)
now cmd_num = 0
 send_cmd_queue: start (cmd_num:0)
send_cmd_queue : 0 cmds left in queue
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 00 01 00 18 CC
process_event_packet: CHANGE_CONNECTION_PACKET_TYPE
CHANGE_CONNECTION_PACKET_TYPE: to cc18
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 01 00 00 00
process_event_packet: COMMAND_COMPLETE
 process_event_packet: now cmd_num = 1
 process_return_param : Not recognised! 
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue

MASTER

Initialising HCI
init_cmd_buf: Initializing
read_buffer_size()
send_cmd : cmd_num 1
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
send_cmd: Sucessfully sent HCI command
------------RECEIVED 14 BYTES -------------
hci_receive_data : got 14 bytes
hci_receive_data :  04 0E 0B 01 05 10 00 20 03 00 0A 00 00 00
hci-14
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 01 05 10 00 20 03 00 0A 00 00 00
process_event_packet: COMMAND_COMPLETE
 process_event_packet: now cmd_num = 1
 process_return_param: READ_BUFFER_SIZE
process_return_param: acl_len: 800, acl_nbr : 10
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
Initialising L2CAP
init_flow
send_cmd : cmd_num 1
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
send_cmd: Sucessfully sent HCI command
------------RECEIVED 7 BYTES -------------
hci_receive_data : got 7 bytes
hci_receive_data :  04 0E 04 01 1A 0C 00
hci-7
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 01 1A 0C 00
process_event_packet: COMMAND_COMPLETE
 process_event_packet: now cmd_num = 1
 process_return_param: WRITE_SCAN_ENABLE
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
------------RECEIVED 13 BYTES -------------
hci_receive_data : got 13 bytes
hci_receive_data :  04 04 0A 4A 17 03 B7 D0 00 00 00 00 01
hci-13
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 4A 17 03 B7 D0 00 00 00 00 01
process_event_packet: CONNECTION_REQUEST
lp_connect_ind from : 4A 17 03 B7 D0 00
lp_connect_ind: Accepting connection
l2cap_create_con : bd  4A 17 03 B7 D0 00
get_lcon : lcid 64 con_list.count = 0
get_lcon : connection lcid : 64 not found
Create_con rcid 0
insert_con() lcid:64, rcid:0, hci_hdl:0
state CLOSED psm:0  remote_mtu:672 initiator:0 link_up:1
insert_con : now 1 connections
lp_connect_rsp cfm 1 
accept_connection_request: bd_addr 4a 17 3 b7 d0 0
send_cmd : cmd_num 1
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
send_cmd: Sucessfully sent HCI command
------------RECEIVED 21 BYTES -------------
hci_receive_data : got 21 bytes
hci_receive_data :  04 0F 04 00 01 09 04 04 03 0B 00 01 00 4A 17 03 B7 D0 00 01 00
hci-21
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 00 01 09 04
process_event_packet: COMMAND_STATUS (status:0x0)
now cmd_num = 1
 send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 00 01 00 4A 17 03 B7 D0 00 01 00
process_event_packet: CONNECTION_COMPLETE: Success!
lp_connect_cfm: Success! (hci_handle : 1)
get_con : look for connections in state CLOSED (0)
get_con : bd  4A 17 03 B7 D0 00
get_con : con_list bd  4A 17 03 B7 D0 00
we are server
change_connection_packet_type: for connnection handle 0x1
send_cmd : cmd_num 1
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue
send_cmd: Sucessfully sent HCI command
------------RECEIVED 22 BYTES -------------
hci_receive_data : got 22 bytes
hci_receive_data :  04 0F 04 00 00 0F 04 04 1D 05 00 01 00 18 CC 04 0E 04 01 00 00 00
hci-22
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 00 00 0F 04
process_event_packet: COMMAND_STATUS (status:0x0)
now cmd_num = 0
 send_cmd_queue: start (cmd_num:0)
send_cmd_queue : 0 cmds left in queue
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 00 01 00 18 CC
process_event_packet: CHANGE_CONNECTION_PACKET_TYPE
CHANGE_CONNECTION_PACKET_TYPE: to cc18
hci_receive_data: WAIT_FOR_PACKET_TYPE
hci_receive_data: WAIT_FOR_EVENT_TYPE
hci_receive_data: WAIT_FOR_EVENT_LENGTH
process_event_packet 01 00 00 00
process_event_packet: COMMAND_COMPLETE
 process_event_packet: now cmd_num = 1
 process_return_param : Not recognised! 
send_cmd_queue: start (cmd_num:1)
send_cmd_queue : 0 cmds left in queue