NetBSD-Users archive

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

Bluetooth on current



My old Android phone which allowed writes to the removable sd card
was stolen and I had to get a new one, which only allows certain
things to be written there (not enough).

I can't find any MTP utilities that would allow access via usb that
work and I don't have wireless on the NetBSD box so have been
attempting to get bluetooth working (typically via OBEX).

I set up rc.d/bluetooth using a usb bt dongle and it is running on
NetBSD 8.99.17 amd64.

[ 244085.787580] ubt0 at uhub2 port 1
[ 244085.787580] ubt0: Broadcom Corp (0xa5c) BCM20702A0 (0x21e8), rev 2.00/1.12, addr 3
[ 244126.045324] bthub0 at ubt0 local-bdaddr xx:xx:xx:xx:xx:xx

root    11605  0.0  0.0   19712   1648 ?      Is    4:02PM  0:00.00 /usr/sbin/bthcid 
_sdpd    7869  0.0  0.0    9940   1372 ?      Is    4:02PM  0:00.01 /usr/sbin/sdpd 

I appear to have successfully paired and bthcid appears to be working :
$ btkey -a phone -d ubt0
    device: xx:xx:xx:xx:xx:xx (ubt0)
    bdaddr: xx:xx:xx:xx:xx:xx (phone)

$ sdpquery -a phone browse
etc. work as advertised

When I try to send a file from the phone, hcidump logs:

> HCI Event: Connect Request (0x04) plen 10
    bdaddr xx:xx:xx:xx:xx:xx class 0x5a020c type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr xx:xx:xx:xx:xx:xx role 0x00
    Role: Master
> HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Role Change (0x12) plen 8
    status 0x00 bdaddr xx:xx:xx:xx:xx:xx role 0x00
    Role: Master
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 11 bdaddr xx:xx:xx:xx:xx:xx type ACL encrypt 0x00
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
    handle 11 policy 0x05
    Link policy: RSWITCH SNIFF 
> HCI Event: Command Complete (0x0e) plen 6
    Write Link Policy Settings (0x02|0x000d) ncmd 1
    status 0x00 handle 11
< HCI Command: Read Clock Offset (0x01|0x001f) plen 2
    handle 11
> HCI Event: Command Status (0x0f) plen 4
    Read Clock Offset (0x01|0x001f) status 0x00 ncmd 1
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 11 slots 5
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr xx:xx:xx:xx:xx:xx mode 1
> ACL data: handle 11 flags 0x02 dlen 10
    L2CAP(s): Info req: type 2
< ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0080
        Fixed Channels
> HCI Event: Read Clock Offset Complete (0x1c) plen 5
    status 0x00 handle 11 clkoffset 0x3239
> ACL data: handle 11 flags 0x02 dlen 10
    L2CAP(s): Info req: type 3
< ACL data: handle 11 flags 0x02 dlen 20
    L2CAP(s): Info rsp: type 3 result 0
      Fixed channel list 0x00000002
        L2CAP Signalling Channel
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 672 
< ACL data: handle 11 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0047 flags 0x00 result 0 clen 0
      Success
> ACL data: handle 11 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
      Success
> ACL data: handle 11 flags 0x02 dlen 38
    L2CAP(d): cid 0x0040 len 34 [psm 0]
< ACL data: handle 11 flags 0x02 dlen 15
    L2CAP(d): cid 0x0047 len 11 [psm 0]
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0047
< ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0047
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 11 reason 0x13
    Reason: Remote User Terminated Connection

and the phone reports "Connection failed" - no file sent

obexftp, etc. also fail:

$ obexftp -b phone -l
Scanning for phone ...
Seen: xx:xx:xx:xx:xx:xx
Browsing phone ...
Connecting...failed: connect
unknown error on connect
Still trying to connect
Connecting...failed: connect
unknown error on connect
Still trying to connect
Connecting...failed: connect
unknown error on connect
Still trying to connect

What am I missing?
Anyone else able to transfer files with a recent Android phone these days?



Home | Main Index | Thread Index | Old Index