how to use the example rfcomm-cat, rfcomm-echo ???

320 views
Skip to first unread message

Xiang lentil

unread,
Dec 22, 2011, 5:10:27 AM12/22/11
to btstack-dev
I am trying to connect with rfcomm in iphone ios 4.3.

running rfcomm-cat -a xx:xx:xx:xx:xx (ipad device) on iphone 4.3.

received HCI_EVENT_PIN_CODE_REQUEST msg;

but not receive RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE;









Matthias Ringwald

unread,
Dec 22, 2011, 6:47:35 AM12/22/11
to btsta...@googlegroups.com
Hi

do you get a PIN request on the other device?

please check out /tmp/hci_dump.pklg on your iphone. you can open it with PacketLogger on Mac or Wireshark on all platforms.

Matthias

> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To post to this group, send email to btsta...@googlegroups.com.
> To unsubscribe from this group, send email to btstack-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/btstack-dev?hl=en.
>

Xiang lentil

unread,
Dec 22, 2011, 9:36:54 AM12/22/11
to btsta...@googlegroups.com
pin request is success

the Attachment is hci_dump.pklg .

2011/12/22, Matthias Ringwald <matthias...@gmail.com>:

hci_dump.pklg

Matthias Ringwald

unread,
Dec 22, 2011, 10:16:13 AM12/22/11
to btsta...@googlegroups.com
Hi Xiang

the log file looks fine. RFCOMM Channel #1 is opened, but closed by the remote side. Do you know if there is actually a server on channel #1. Please try other rfcomm channel numbers (1-31).

Also, you're getting SDP request from the other device and you said it's an iPad, so I assume the other side runs the regular iOS Bluetooth stack.
You could try connecting to an RFCOMM server on your Mac/PC/Linux..

Best
Matthias

> <hci_dump.pklg>

Xiang lentil

unread,
Dec 22, 2011, 10:32:06 AM12/22/11
to btsta...@googlegroups.com
rfcomm-echo run on ipad.

rfcomm-cat run on iphone 4.

rfcomm-echo and rfcomm-cat is from the example in btstack svn .

Matthias Ringwald

unread,
Dec 22, 2011, 10:37:58 AM12/22/11
to btsta...@googlegroups.com
Hi

The SDP request for Headset/Handsfere/Audio Sink isn't seny by BTstack. In fact, I still have to write the SDP client part. The example apps don't try to turn off iOS Bluetooth stack. Please turn it of yourself on the iPad before trying again.

Matthias

Xiang lentil

unread,
Dec 22, 2011, 10:40:35 AM12/22/11
to btstack-dev
the bluetooth stack on ipad is off.

On 12月22日, 下午11时37分, Matthias Ringwald <matthias.ringw...@gmail.com>
wrote:
> Hi
>
> The SDP request for Headset/Handsfere/Audio Sink isn't seny by BTstack. In fact, I still have to write the SDP client part. The example apps don't try to turn off iOS Bluetooth stack. Please turn it of yourself on the iPad before trying again.
>
> Matthias
>
> On 22.12.2011, at 16:32, Xiang lentil wrote:
>
>
>
> > rfcomm-echo run on ipad.
>
> > rfcomm-cat run on iphone 4.
>
> > rfcomm-echo and rfcomm-cat is from the example in btstack svn .
>
> > 2011/12/22, Matthias Ringwald <matthias.ringw...@gmail.com>:
> >> Hi Xiang
>
> >> the log file looks fine. RFCOMM Channel #1 is opened, but closed by the
> >> remote side. Do you know if there is actually a server on channel #1. Please
> >> try other rfcomm channel numbers (1-31).
>
> >> Also, you're getting SDP request from the other device and you said it's an
> >> iPad, so I assume the other side runs the regular iOS Bluetooth stack.
> >> You could try connecting to an RFCOMM server on your Mac/PC/Linux..
>
> >> Best
> >> Matthias
>
> >> On 22.12.2011, at 15:36, Xiang lentil wrote:
>
> >>> pin request is success
>
> >>> the Attachment is hci_dump.pklg .
>
> >>> 2011/12/22, Matthias Ringwald <matthias.ringw...@gmail.com>:
> > For more options, visit this group athttp://groups.google.com/group/btstack-dev?hl=en.- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Xiang lentil

unread,
Dec 22, 2011, 10:42:40 AM12/22/11
to btstack-dev
the bluetooh is off on ipad. I run BTdaemon on ipad
> > - 显示引用的文字 -- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Xiang lentil

unread,
Dec 22, 2011, 10:48:59 AM12/22/11
to btstack-dev
where am i modfiy RFCOMM channel # in the example rfcomm-cat?

where am i modify RFCOMM channel # int the example rfcomm-echo?



On 12月22日, 下午11时16分, Matthias Ringwald <matthias.ringw...@gmail.com>
wrote:
> Hi Xiang
>
> the log file looks fine. RFCOMM Channel #1 is opened, but closed by the remote side. Do you know if there is actually a server on channel #1. Please try other rfcomm channel numbers (1-31).
>
> Also, you're getting SDP request from the other device and you said it's an iPad, so I assume the other side runs the regular iOS Bluetooth stack.
> You could try connecting to an RFCOMM server on your Mac/PC/Linux..
>
> Best
> Matthias
>
> On 22.12.2011, at 15:36, Xiang lentil wrote:
>
>
>
> > pin request is success
>
> > the Attachment is hci_dump.pklg .
>
> > 2011/12/22, Matthias Ringwald <matthias.ringw...@gmail.com>:
> > <hci_dump.pklg>- 隐藏被引用文字 -
>
> - 显示引用的文字 -

lentilhfe

unread,
Dec 23, 2011, 6:46:10 AM12/23/11
to Matthias Ringwald, btstack-dev
can you help me?
      
 
 
 
2011-12-23
----------
相秀英
------------------------------------------------------------------- 
发件人: lentilhfe
发送时间: 2011-12-23  12:02:18
收件人: Matthias Ringwald
抄送:
主题: Re: Re: Re: how to use the example rfcomm-cat, rfcomm-echo ???
 
rfcomm-cat connect successfully android device, send data to android , is success,
 
but android replay data to iphone 4, iphone 4 do not revice data.
 
as follow is BTdaemon in btstack-0.4-1572. and the attach is hci_dump.pklg
 
iPhone-tescomm-gsm:~ root# BTdaemon 
BTdaemon started
read prefs for 2 devices
config.h: HAVE_RFCOMM
launch_msg("CheckIn") IPC failure: 1
      
 
 
 
2011-12-23
----------
相秀英
------------------------------------------------------------------- 
发件人: lentilhfe
发送时间: 2011-12-23  11:35:11
收件人: Matthias Ringwald
抄送:
主题: Re: Re: how to use the example rfcomm-cat, rfcomm-echo ???
 
Matthias Ringwald
 
rfcomm-cat connect android device,BTdaemon is err.
 
BTdaemon is the svn source .
 
as follow is BTdaemon log. the attach is hci_dump.pklg.
 
 
iPhone-tescomm-gsm:~ root# BTdaemon 
BTdaemon started
read prefs for 2 devices
config.h: HAVE_RFCOMM
Socket created at /tmp/BTstack
Server up and running ...



socket_connection_accept new connection 8
Nr Connections changed, new 1
hci_power_control: 1, current mode 0
iphone_on: entered
local-mac-address: 40:a6:d9:01:ec:32
transport-speed:   3000000
iphone_on: unload BTServer
Opening com.apple.uart.bluetooth @ 115200 baud.
bluetooth wake is now ON
bluetooth reset was pulsed 100 ms
Issued HCI Reset
DeviceTree speed = 3000000
Current Device: UART - com.apple.uart.bluetooth
Setting speed to 115200
DeviceTree speed = 3000000
Overriding BDADDR from environment variable: BT_DEVICE_ADDRESS = (null)
bcm returned -1
bluetooth power is now OFF

Welcome to BlueTool... Rev 0.1

Cannot read termcap database;
using dumb terminal settings.
DeviceTree speed = 3000000
Opening com.apple.uart.bluetooth @ 3000000 baud.
New state: 1
2011-12-23 11:24:48.352 BTdaemon[197:2303] Bluetooth status: OFF
Local Address, Status: 0x00: Addr: 40:a6:d9:01:ec:32
hci_read_buffer_size: used size 1021, count 7, packet types cc18
New state: 2
2011-12-23 11:24:48.438 BTdaemon[197:2303] Bluetooth status: ON
btstack_command_handler RFCOMM_CREATE_CHANNEL 15
rfcomm_create_channel_internal to f8:db:7f:d3:77:4b, at channel #0f, flow control 0, init credits 48
rfcomm_max_frame_size_for_l2cap_mtu:  1017 -> 1011
rfcomm_channel_create for service 0x0, channel 15 --- begin
Create_connection to f8:db:7f:d3:77:4b
Connection_complete (status=0) f8:db:7f:d3:77:4b
New connection: handle 12, f8:db:7f:d3:77:4b
New nr connections: 1
2011-12-23 11:24:50.285 BTdaemon[197:2303] Bluetooth status: ACTIVE
L2CAP signaling handler code 3, state 5
L2CAP signaling handler code 3, state 5
L2CAP signaling handler code 4, state 6
L2CAP signaling handler code 5, state 6
L2CAP_EVENT_CHANNEL_OPENED for PSM_RFCOMM
L2CAP_EVENT_CHANNEL_OPENED: outgoing connection
Sending SABM #0 - (multi 0x0x1678e0)
rfcomm_channel_state_machine: state 2, state_var 0000, event 13
rfcomm_channel_state_machine: state 2, state_var 0000, event 13
Received UA #0 
Multiplexer up and running
rfcomm_channel_state_machine: state 2, state_var 0000, event 12
Muliplexer opened, sending UIH PN next
rfcomm_channel_state_machine: state 3, state_var 0000, event 13
Sending UIH Parameter Negotiation Command for #30 (channel 0x0x1679f0)
rfcomm_channel_state_machine: state 4, state_var 0000, event 13
rfcomm_channel_state_machine: state 4, state_var 0000, event 13
rfcomm_channel_packet_handler 0xef
UIH Parameter Negotiation Response max frame 990, credits 7
rfcomm_channel_state_machine: state 4, state_var 0000, event 4
rfcomm_channel_state_machine: state 5, state_var 0000, event 13
Sending SABM #30
rfcomm_channel_state_machine: state 6, state_var 0000, event 13
rfcomm_channel_packet_handler 0x73
Received UA #30 - channel opened
rfcomm_channel_state_machine: state 6, state_var 0000, event 2
rfcomm_channel_state_machine: state 8, state_var 1400, event 13
Sending MSC CMD for #30
rfcomm_channel_state_machine: state 8, state_var 3000, event 13
Providing credits for #30
rfcomm_channel_state_machine: state 8, state_var a000, event 13
rfcomm_channel_packet_handler 0xef
Received MSC RSP for #30
rfcomm_channel_state_machine: state 8, state_var a000, event 8
rfcomm_channel_state_machine: state 8, state_var a020, event 13
rfcomm_channel_packet_handler 0xef
Received MSC CMD for #30, 
rfcomm_channel_state_machine: state 8, state_var a020, event 7
rfcomm_channel_state_machine: state 8, state_var a830, event 13
Sending MSC RSP for #30
rfcomm_channel_state_machine: state 8, state_var e030, event 13
rfcomm_channel_opened!
rfcomm_channel_state_machine: state 9, state_var e030, event 13
rfcomm_channel_opened!
rfcomm_channel_state_machine: state 9, state_var e030, event 13
rfcomm_send_internal cid 1, no rfcomm credits granted!
Daemon Handler: err 114
socket_connection_hci_process dispatch failed -> park connection
rfcomm_channel_state_machine: state 9, state_var e030, event 13
socket_connection_hci_process retry parked #0
rfcomm_channel_state_machine: state 9, state_var e030, event 13
socket_connection_hci_process retry parked #0
socket_connection_hci_process dispatch succeeded -> un-park connection
socket_connection_hci_process dispatch succeeded -> un-park connection
Bus error: 10
 
 
 
2011-12-23
----------
相秀英
------------------------------------------------------------------- 
发件人: Matthias Ringwald
发送时间: 2011-12-22  23:51:10
收件人: Xiang lentil
抄送:
主题: Re: how to use the example rfcomm-cat, rfcomm-echo ???
 
On 22.12.2011, at 16:48, Xiang lentil wrote:
> where am i modfiy RFCOMM channel #  in the example rfcomm-cat?
on the command line with -c (and you should be able to find that yourself right away)
> where am i modify RFCOMM channel # int the example rfcomm-echo?
you don't. The RFCOMM channel numbers are assigned by BTdaemon, but the example prints out the 'persistent' channel number on start.
Best
 Matthias
Reply all
Reply to author
Forward
0 new messages