Menu

obex.sendfile doesn't work

Help
aptc
2007-10-04
2013-04-25
  • aptc

    aptc - 2007-10-04

    I used the example on your website to test send file function:

    from lightblue import *
    obex.sendfile("00:1A:16:BE:50:66",3 , "MyFile.txt")

    my cell phone responsed by asking me to accept the connection, when I say yes, something happened like this:

    wujunbao@ubuntu:~/Desktop$ python sendtest.py
    [btobexclient_connect] Connecting transport...
    [btobexclient_connect] Connecting OBEX session...
    [btobexclient_event] Transport link broken, terminating connection!
    [btobexclient_request] OBEX_HandleInput() error!
    [btobexserver_cleanup] entry.
    Traceback (most recent call last):
      File "sendtest.py", line 2, in <module>
        obex.sendfile("00:1A:16:BE:50:66", 1, "MyFile.txt")
      File "/usr/lib/python2.5/site-packages/lightblue/_obex.py", line 47, in sendfile
        fileobj, os.stat(source)[stat.ST_SIZE])
      File "/usr/lib/python2.5/site-packages/lightblue/_obex.py", line 62, in _sendfile
        raise _lightbluecommon.BluetoothError(str(exc))
    lightblue._lightbluecommon.BluetoothError: Error connecting to server

    I printed the information to ease your debug by adding following lines in _obex.py:

            print address
            print channel
            print name
            print fileobj
            print filesize

    it returned this result:

    wujunbao@ubuntu:~/Desktop$ python sendtest.py
    00:1A:16:BE:50:66
    3
    MyFile.txt
    <open file 'MyFile.txt', mode 'rb' at 0xb7ce9650>
    34
    [btobexclient_connect] Connecting transport...
    [btobexclient_connect] Connecting OBEX session...
    [btobexclient_event] Transport link broken, terminating connection!
    [btobexclient_request] OBEX_HandleInput() error!
    [btobexserver_cleanup] entry.
    Traceback (most recent call last):
      File "sendtest.py", line 2, in <module>
        obex.sendfile("00:1A:16:BE:50:66",3 , "MyFile.txt")
      File "/usr/lib/python2.5/site-packages/lightblue/_obex.py", line 47, in sendfile
        fileobj, os.stat(source)[stat.ST_SIZE])
      File "/usr/lib/python2.5/site-packages/lightblue/_obex.py", line 69, in _sendfile
        raise _lightbluecommon.BluetoothError(str(exc))
    lightblue._lightbluecommon.BluetoothError: Error connecting to server

    Hope this can help you imporving lightblue.

     
    • aptc

      aptc - 2007-10-04

      Hi, I'm sorry, I just read the thread "lightblue.obex.sendfile() : Error", the problem was same, so maybe I have to find the solution myself.

      Thank you, anyway, you can delete this thread if you think that's right. I don't mean to cause you this inconvenience.

       
    • aptc

      aptc - 2007-10-05

      I have made a test.

      From "bluetooth file sharing" of ubuntu, I can send any file to my two phones, Nokia 7500 and nokia 6670 without any problem.
      Ubuntu could only receive the file sent by 7500 but not the 6670.

      When I use lightblue (or openobex), no one succeed. both got above error.

      How can I figure out the problem if it exists in openobex or bluez stack? give me some hints if it's possible.

      Thank you!

       
    • blam

      blam - 2007-10-05

      Hi,

      Try reinstalling openobex - I've had a similar problem myself and that worked for me. (Could be something to do with the version of openobex as well - I installed the latest 1.3 version and the previously installed version was 1.0.0.)

      >> How can I figure out the problem if it exists in openobex or bluez stack?

      Ubuntu would be using the bluez stack, so if you can send files from the built-in apps, it must be openobex. You can check the bluetooth activity using 'hcidump -X -V', to see if any obex commands are actually being sent, and turn on the openobex debug messages as well.

       
    • aptc

      aptc - 2007-10-05

      Hi, blammit

      You are so kind, thank you!

      I have run obex_test in openobex-apps to see what happen, and it showed that it's openobex's problem.

      Probably there is a problem related with lightblue, everything was OK with my Nokia 6670 when I was running obex_test, but in python, bluelight couldn't receive the file from 6670, the odd thing is that Nokia 5700 could do it well. obex.recvfile(s, "MyFile.txt") didn't say anything and 6670 said: "connecting..."   and then "sending failed" when I pushed file from ubuntu to 6670!

      I don't know, I am not sure, I am puzzled by waht happened to me :)

      Thank you blammit!

       
      • blam

        blam - 2007-10-06

        No problems, glad you were able to sort it out.

        Are you saying you can't use lightblue to send files from ubuntu to the 6670, and you can't use it to receive files from the 6670 either?  But you can do both successfully with the 5700?  That's really strange. Could you please post or email me the hcidump output and/or openobex debug messages that you get when you use lightblue with the 6670?

         
    • aptc

      aptc - 2007-10-07

      My 6670 can receive files when i sent them from the lightblue, but the lightblue couldn't receive the files sent from 6670. I'm not sure whether this is the problem of lightblue or not.

      I try to turn on dubug on openobex by installing a new openobex-1.3 but failed to catch library libopenobex.so.1, so I just provide the hcidump output here.

      Nokia 6670
      wujunbao@ubuntu:~$ sudo hcidump -X -V
      HCI sniffer - Bluetooth packet analyzer ver 1.33
      device: hci0 snap_len: 1028 filter: 0xffffffff
      > HCI Event: Connect Request (0x04) plen 10
          bdaddr 00:0E:ED:F6:D3:5F class 0x50020c type ACL
      < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
          bdaddr 00:0E:ED:F6:D3:5F role 0x01
          Role: Slave
      > HCI Event: Command Status (0x0f) plen 4
          Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
      > HCI Event: Connect Complete (0x03) plen 11
          status 0x00 handle 42 bdaddr 00:0E:ED:F6:D3:5F type ACL encrypt 0x00
      < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
          handle 42
      > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
          bdaddr 00:0E:ED:F6:D3:5F mode 1
      > HCI Event: Max Slots Change (0x1b) plen 3
          handle 42 slots 5
      > HCI Event: Command Status (0x0f) plen 4
          Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 0
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Connect req: psm 1 scid 0x0048
      < ACL data: handle 42 flags 0x02 dlen 16
          L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0048 result 0 status 0
            Connection successful
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Command Status (0x0f) plen 4
          Unknown (0x00|0x0000) status 0x00 ncmd 1
      < HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
          handle 42 policy 0x0f
          Link policy: RSWITCH HOLD SNIFF PARK
      > HCI Event: Command Complete (0x0e) plen 6
          Write Link Policy Settings (0x02|0x000d) ncmd 1
          status 0x00 handle 42
      < HCI Command: Change Connection Packet Type (0x01|0x000f) plen 4
          handle 42 ptype 0xcc18
          Packet type: DM1 DM3 DM5 DH1 DH3 DH5
      > HCI Event: Command Status (0x0f) plen 4
          Change Connection Packet Type (0x01|0x000f) status 0x00 ncmd 1
      > HCI Event: Connection Packet Type Changed (0x1d) plen 5
          status 0x00 handle 42 ptype 0xff1e
          Packet type: DM1 DM3 DM5 DH1 DH3 DH5 2-DH1 2-DH3 2-DH5 3-DH1 3-DH3 3-DH5
      > HCI Event: Read Remote Supported Features (0x0b) plen 11
          status 0x00 handle 42
          Features: 0xbf 0xfe 0x0f 0x00 0x00 0x00 0x00 0x00
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
      < ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(s): Config rsp: scid 0x0048 flags 0x00 result 0 clen 4
            Success
            MTU 672
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Config req: dcid 0x0048 flags 0x00 clen 0
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 14
          L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
            Success
      > ACL data: handle 42 flags 0x02 dlen 17
          L2CAP(d): cid 0x0040 len 13 [psm 1]
              SDP SS Req: tid 0x1 len 0x8
                pat uuid-16 0x1105 (OBEXObjPush)
                max 65535
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(d): cid 0x0048 len 14 [psm 1]
              SDP SS Rsp: tid 0x1 len 0x9
                count 1
                handle 0x10000
                cont 00
      > ACL data: handle 42 flags 0x02 dlen 17
      > ACL data: handle 42 flags 0x01 dlen 4
          L2CAP(d): cid 0x0040 len 17 [psm 1]
              SDP SA Req: tid 0x2 len 0xc
                handle 0x10000
                max 1024
                aid(s) 0x0004 (ProtocolDescList)
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 36
          L2CAP(d): cid 0x0048 len 32 [psm 1]
              SDP SA Rsp: tid 0x2 len 0x1b
                count 24
                aid 0x0004 (ProtocolDescList)
                   < < uuid-16 0x0100 (L2CAP) > <
                   uuid-16 0x0003 (RFCOMM) uint 0x1 > <
                   uuid-16 0x0008 (OBEX) > >
                cont 00
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn req: dcid 0x0040 scid 0x0048
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0048
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      < HCI Command: Disconnect (0x01|0x0006) plen 3
          handle 42 reason 0x13
          Reason: Remote User Terminated Connection
      > HCI Event: Command Status (0x0f) plen 4
          Disconnect (0x01|0x0006) status 0x00 ncmd 1
      > HCI Event: Disconn Complete (0x05) plen 4
          status 0x00 handle 42 reason 0x16
          Reason: Connection Terminated by Local Host
      > HCI Event: Connect Request (0x04) plen 10
          bdaddr 00:0E:ED:F6:D3:5F class 0x50020c type ACL
      < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
          bdaddr 00:0E:ED:F6:D3:5F role 0x01
          Role: Slave
      > HCI Event: Command Status (0x0f) plen 4
          Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
      > HCI Event: Connect Complete (0x03) plen 11
          status 0x00 handle 42 bdaddr 00:0E:ED:F6:D3:5F type ACL encrypt 0x00
      < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
          handle 42
      > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
          bdaddr 00:0E:ED:F6:D3:5F mode 1
      > HCI Event: Max Slots Change (0x1b) plen 3
          handle 42 slots 5
      > HCI Event: Command Status (0x0f) plen 4
          Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 0
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Connect req: psm 1 scid 0x0049
      < ACL data: handle 42 flags 0x02 dlen 16
          L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0049 result 0 status 0
            Connection successful
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Command Status (0x0f) plen 4
          Unknown (0x00|0x0000) status 0x00 ncmd 1
      < HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
          handle 42 policy 0x0f
          Link policy: RSWITCH HOLD SNIFF PARK
      > HCI Event: Command Complete (0x0e) plen 6
          Write Link Policy Settings (0x02|0x000d) ncmd 1
          status 0x00 handle 42
      < HCI Command: Change Connection Packet Type (0x01|0x000f) plen 4
          handle 42 ptype 0xcc18
          Packet type: DM1 DM3 DM5 DH1 DH3 DH5
      > HCI Event: Read Remote Supported Features (0x0b) plen 11
          status 0x00 handle 42
          Features: 0xbf 0xfe 0x0f 0x00 0x00 0x00 0x00 0x00
      > HCI Event: Command Status (0x0f) plen 4
          Change Connection Packet Type (0x01|0x000f) status 0x00 ncmd 1
      > HCI Event: Connection Packet Type Changed (0x1d) plen 5
          status 0x00 handle 42 ptype 0xff1e
          Packet type: DM1 DM3 DM5 DH1 DH3 DH5 2-DH1 2-DH3 2-DH5 3-DH1 3-DH3 3-DH5
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
      < ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(s): Config rsp: scid 0x0049 flags 0x00 result 0 clen 4
            Success
            MTU 672
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Config req: dcid 0x0049 flags 0x00 clen 0
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 14
          L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
            Success
      > ACL data: handle 42 flags 0x02 dlen 23
          L2CAP(d): cid 0x0040 len 19 [psm 1]
              SDP SS Req: tid 0x1 len 0xe
                pat uuid-16 0x0003 (RFCOMM) uuid-16 0x0100 (L2CAP) uuid-16 0x1105 (OBEXObjPush)
                max 65535
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(d): cid 0x0049 len 14 [psm 1]
              SDP SS Rsp: tid 0x1 len 0x9
                count 1
                handle 0x10000
                cont 00
      > ACL data: handle 42 flags 0x02 dlen 21
          L2CAP(d): cid 0x0040 len 17 [psm 1]
              SDP SA Req: tid 0x2 len 0xc
                handle 0x10000
                max 1024
                aid(s) 0x0001 (SrvClassIDList)
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 22
          L2CAP(d): cid 0x0049 len 18 [psm 1]
              SDP SA Rsp: tid 0x2 len 0xd
                count 10
                aid 0x0001 (SrvClassIDList)
                   < uuid-16 0x1105 (OBEXObjPush) >
                cont 00
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 21
          L2CAP(d): cid 0x0040 len 17 [psm 1]
              SDP SA Req: tid 0x3 len 0xc
                handle 0x10000
                max 1024
                aid(s) 0x0004 (ProtocolDescList)
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 36
          L2CAP(d): cid 0x0049 len 32 [psm 1]
              SDP SA Rsp: tid 0x3 len 0x1b
                count 24
                aid 0x0004 (ProtocolDescList)
                   < < uuid-16 0x0100 (L2CAP) > <
                   uuid-16 0x0003 (RFCOMM) uint 0x1 > <
                   uuid-16 0x0008 (OBEX) > >
                cont 00
      > ACL data: handle 42 flags 0x02 dlen 21
          L2CAP(d): cid 0x0040 len 17 [psm 1]
              SDP SA Req: tid 0x4 len 0xc
                handle 0x10000
                max 1024
                aid(s) 0x0009 (BTProfileDescList)
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 27
          L2CAP(d): cid 0x0049 len 23 [psm 1]
              SDP SA Rsp: tid 0x4 len 0x12
                count 15
                aid 0x0009 (BTProfileDescList)
                   < < uuid-16 0x1105 (OBEXObjPush) uint 0x100 > >
                cont 00
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 21
          L2CAP(d): cid 0x0040 len 17 [psm 1]
              SDP SA Req: tid 0x5 len 0xc
                handle 0x10000
                max 1024
                aid(s) 0x0303 (SuppFormatsList)
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 14
          L2CAP(d): cid 0x0049 len 10 [psm 1]
              SDP SA Rsp: tid 0x5 len 0x5
                count 2
                cont 00
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn req: dcid 0x0040 scid 0x0049
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0049
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      < HCI Command: Disconnect (0x01|0x0006) plen 3
          handle 42 reason 0x13
          Reason: Remote User Terminated Connection
      > HCI Event: Command Status (0x0f) plen 4
          Disconnect (0x01|0x0006) status 0x00 ncmd 1
      > HCI Event: Disconn Complete (0x05) plen 4
          status 0x00 handle 42 reason 0x16
          Reason: Connection Terminated by Local Host

      5700's information
      wujunbao@ubuntu:~$ sudo hcidump -X -V
      HCI sniffer - Bluetooth packet analyzer ver 1.33
      device: hci0 snap_len: 1028 filter: 0xffffffff
      > HCI Event: Connect Request (0x04) plen 10
          bdaddr 00:1A:16:BE:50:66 class 0x5a020c type ACL
      < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
          bdaddr 00:1A:16:BE:50:66 role 0x01
          Role: Slave
      > HCI Event: Command Status (0x0f) plen 4
          Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
      > HCI Event: Connect Complete (0x03) plen 11
          status 0x00 handle 42 bdaddr 00:1A:16:BE:50:66 type ACL encrypt 0x00
      < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
          handle 42
      > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
          bdaddr 00:1A:16:BE:50:66 mode 1
      > HCI Event: Max Slots Change (0x1b) plen 3
          handle 42 slots 5
      > HCI Event: Command Status (0x0f) plen 4
          Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 0
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Connect req: psm 1 scid 0x0040
      < ACL data: handle 42 flags 0x02 dlen 16
          L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
            Connection successful
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 10
          L2CAP(s): Info req: type 2
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Info rsp: type 2 result 1
            Not supported
      > HCI Event: Command Status (0x0f) plen 4
          Unknown (0x00|0x0000) status 0x00 ncmd 1
      < HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
          handle 42 policy 0x0f
          Link policy: RSWITCH HOLD SNIFF PARK
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Command Complete (0x0e) plen 6
          Write Link Policy Settings (0x02|0x000d) ncmd 1
          status 0x00 handle 42
      < HCI Command: Change Connection Packet Type (0x01|0x000f) plen 4
          handle 42 ptype 0xcc18
          Packet type: DM1 DM3 DM5 DH1 DH3 DH5
      > HCI Event: Read Remote Supported Features (0x0b) plen 11
          status 0x00 handle 42
          Features: 0xbf 0xee 0x0f 0x46 0x98 0x19 0x00 0x00
      > HCI Event: Command Status (0x0f) plen 4
          Change Connection Packet Type (0x01|0x000f) status 0x00 ncmd 1
      > HCI Event: Connection Packet Type Changed (0x1d) plen 5
          status 0x00 handle 42 ptype 0xcc18
          Packet type: DM1 DM3 DM5 DH1 DH3 DH5
      > ACL data: handle 42 flags 0x02 dlen 16
          L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
            MTU 65535
      < ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
            Success
            MTU 65535
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
            Success
            MTU 672
      > ACL data: handle 42 flags 0x02 dlen 17
          L2CAP(d): cid 0x0040 len 13 [psm 1]
              SDP SS Req: tid 0x1 len 0x8
                pat uuid-16 0x1105 (OBEXObjPush)
                max 65535
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(d): cid 0x0040 len 14 [psm 1]
              SDP SS Rsp: tid 0x1 len 0x9
                count 1
                handle 0x10000
                cont 00
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 21
          L2CAP(d): cid 0x0040 len 17 [psm 1]
              SDP SA Req: tid 0x2 len 0xc
                handle 0x10000
                max 1024
                aid(s) 0x0004 (ProtocolDescList)
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 36
          L2CAP(d): cid 0x0040 len 32 [psm 1]
              SDP SA Rsp: tid 0x2 len 0x1b
                count 24
                aid 0x0004 (ProtocolDescList)
                   < < uuid-16 0x0100 (L2CAP) > <
                   uuid-16 0x0003 (RFCOMM) uint 0x1 > <
                   uuid-16 0x0008 (OBEX) > >
                cont 00
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Connect req: psm 3 scid 0x0041
      < ACL data: handle 42 flags 0x02 dlen 16
          L2CAP(s): Connect rsp: dcid 0x0041 scid 0x0041 result 0 status 0
            Connection successful
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 16
          L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 4
            MTU 32772
      < ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 4
            Success
            MTU 32772
      < ACL data: handle 42 flags 0x02 dlen 16
          L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 4
            MTU 1013
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 4
            Success
            MTU 672
      > ACL data: handle 42 flags 0x02 dlen 8
          L2CAP(d): cid 0x0041 len 4 [psm 3]
            RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c
      < ACL data: handle 42 flags 0x02 dlen 8
          L2CAP(d): cid 0x0041 len 4 [psm 3]
            RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(d): cid 0x0041 len 14 [psm 3]
            RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8
            dlci 2 frame_type 0 credit_flow 15 pri 0 ack_timer 0
            frame_size 667 max_retrans 0 credits 3
      < ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(d): cid 0x0041 len 14 [psm 3]
            RFCOMM(s): PN RSP: cr 0 dlci 0 pf 0 ilen 10 fcs 0xaa mcc_len 8
            dlci 2 frame_type 0 credit_flow 14 pri 0 ack_timer 0
            frame_size 667 max_retrans 0 credits 7
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 8
          L2CAP(d): cid 0x0041 len 4 [psm 3]
            RFCOMM(s): SABM: cr 1 dlci 2 pf 1 ilen 0 fcs 0x59
      < ACL data: handle 42 flags 0x02 dlen 8
          L2CAP(d): cid 0x0041 len 4 [psm 3]
            RFCOMM(s): UA: cr 1 dlci 2 pf 1 ilen 0 fcs 0x92
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(d): cid 0x0041 len 8 [psm 3]
            RFCOMM(s): MSC CMD: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2
            dlci 2 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(d): cid 0x0041 len 8 [psm 3]
            RFCOMM(s): MSC CMD: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2
            dlci 2 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(d): cid 0x0041 len 8 [psm 3]
            RFCOMM(s): MSC RSP: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2
            dlci 2 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(d): cid 0x0041 len 8 [psm 3]
            RFCOMM(s): MSC RSP: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2
            dlci 2 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
      < ACL data: handle 42 flags 0x02 dlen 9
          L2CAP(d): cid 0x0041 len 5 [psm 3]
            RFCOMM(d): UIH: cr 0 dlci 2 pf 1 ilen 0 fcs 0x5c credits 33
      > ACL data: handle 42 flags 0x02 dlen 16
          L2CAP(d): cid 0x0041 len 12 [psm 3]
            RFCOMM(d): UIH: cr 1 dlci 2 pf 1 ilen 7 fcs 0x86 credits 4
              OBEX: Connect cmd(f): len 7 version 1.0 flags 0 mtu 65535
      < ACL data: handle 42 flags 0x02 dlen 15
          L2CAP(d): cid 0x0041 len 11 [psm 3]
            RFCOMM(d): UIH: cr 0 dlci 2 pf 0 ilen 7 fcs 0x40
              OBEX: Connect rsp(f): status 200 len 7 version 1.0 flags 0 mtu 256
              Status 200 = Success
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 85
          L2CAP(d): cid 0x0041 len 81 [psm 3]
            RFCOMM(d): UIH: cr 1 dlci 2 pf 1 ilen 76 fcs 0x86 credits 1
              OBEX: Put cmd(c): len 76
              Name (0x01) = Unicode length 32
              0000: 00 62 00 6f 00 6e 00 64  00 20 00 31 00 32 00 33  .b.o.n.d. .1.2.3
              0010: 00 34 00 35 00 36 00 2e  00 74 00 78 00 74 00 00  .4.5.6...t.x.t..
              Length (0xc3) = 24
              Type (0x42) = Sequence length 11
              0000: 74 65 78 74 2f 70 6c 61  69 6e 00                 text/plain.
              Time (0x44) = Sequence length 16
              0000: 32 30 30 37 31 30 30 37  54 31 31 33 31 30 36 5a  20071007T113106Z
      < ACL data: handle 42 flags 0x02 dlen 11
          L2CAP(d): cid 0x0041 len 7 [psm 3]
            RFCOMM(d): UIH: cr 0 dlci 2 pf 0 ilen 3 fcs 0x40
              OBEX: Put rsp(f): status 100 len 3
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 39
          L2CAP(d): cid 0x0041 len 35 [psm 3]
            RFCOMM(d): UIH: cr 1 dlci 2 pf 1 ilen 30 fcs 0x86 credits 1
              OBEX: Put cmd(f): len 30 (continue)
              End of Body (0x49) = Sequence length 24
              0000: ff fe 62 00 6f 00 6e 00  64 00 20 00 31 00 32 00  ..b.o.n.d. .1.2.
              0010: 33 00 34 00 35 00 36 00                           3.4.5.6.
      < ACL data: handle 42 flags 0x02 dlen 11
          L2CAP(d): cid 0x0041 len 7 [psm 3]
            RFCOMM(d): UIH: cr 0 dlci 2 pf 0 ilen 3 fcs 0x40
              OBEX: Put rsp(f): status 200 len 3
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(d): cid 0x0041 len 8 [psm 3]
            RFCOMM(d): UIH: cr 1 dlci 2 pf 1 ilen 3 fcs 0x86 credits 1
              OBEX: Disconnect cmd(f): len 3
      < ACL data: handle 42 flags 0x02 dlen 11
          L2CAP(d): cid 0x0041 len 7 [psm 3]
            RFCOMM(d): UIH: cr 0 dlci 2 pf 0 ilen 3 fcs 0x40
              OBEX: Disconnect rsp(f): status 200 len 3
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Connect req: psm 1 scid 0x0042
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 8
          L2CAP(d): cid 0x0041 len 4 [psm 3]
            RFCOMM(s): DISC: cr 1 dlci 2 pf 1 ilen 0 fcs 0xb8
      < ACL data: handle 42 flags 0x02 dlen 8
          L2CAP(d): cid 0x0041 len 4 [psm 3]
            RFCOMM(s): UA: cr 1 dlci 2 pf 1 ilen 0 fcs 0x92
      > ACL data: handle 42 flags 0x02 dlen 28
          L2CAP(s): Connect rsp: dcid 0x0042 scid 0x0042 result 1 status 2
            Connection pending - Authorization pending
          L2CAP(s): Connect rsp: dcid 0x0042 scid 0x0042 result 0 status 0
            Connection successful
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Config req: dcid 0x0042 flags 0x00 clen 0
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(s): Config rsp: scid 0x0042 flags 0x00 result 0 clen 4
            Success
            MTU 672
      > ACL data: handle 42 flags 0x02 dlen 16
          L2CAP(s): Config req: dcid 0x0042 flags 0x00 clen 4
            MTU 65535
      < ACL data: handle 42 flags 0x02 dlen 18
          L2CAP(s): Config rsp: scid 0x0042 flags 0x00 result 0 clen 4
            Success
            MTU 65535
      < ACL data: handle 42 flags 0x02 dlen 24
          L2CAP(d): cid 0x0042 len 20 [psm 1]
              SDP SSA Req: tid 0x0 len 0xf
                pat uuid-16 0x1105 (OBEXObjPush)
                max 65535
                aid(s) 0x0000 - 0xffff
                cont 00
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 125
          L2CAP(d): cid 0x0042 len 121 [psm 1]
              SDP SSA Rsp: tid 0x0 len 0x74
                count 113
                record #0
                    aid 0x0000 (SrvRecHndl)
                       uint 0x1001a
                    aid 0x0001 (SrvClassIDList)
                       < uuid-16 0x1105 (OBEXObjPush) >
                    aid 0x0002 (SrvRecState)
                       uint 0x7
                    aid 0x0004 (ProtocolDescList)
                       < < uuid-16 0x0100 (L2CAP) > <
                       uuid-16 0x0003 (RFCOMM) uint 0x9 > <
                       uuid-16 0x0008 (OBEX) > >
                    aid 0x0005 (BrwGrpList)
                       < uuid-16 0x1002 (PubBrwsGrp) >
                    aid 0x0006 (LangBaseAttrIDList)
                       < uint 0x454e uint 0x6a uint 0x100 >
                    aid 0x0009 (BTProfileDescList)
                       < < uuid-16 0x1105 (OBEXObjPush) uint 0x100 > >
                    aid 0x0100 (SrvName)
                       str "OBEX Object Push"
                    aid 0x0303 (SuppFormatsList)
                       < uint 0xff >
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn req: dcid 0x0042 scid 0x0042
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn rsp: dcid 0x0042 scid 0x0042
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn req: dcid 0x0041 scid 0x0041
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn rsp: dcid 0x0041 scid 0x0041
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      > ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
      < ACL data: handle 42 flags 0x02 dlen 12
          L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 42 packets 1
      < HCI Command: Disconnect (0x01|0x0006) plen 3
          handle 42 reason 0x13
          Reason: Remote User Terminated Connection
      > HCI Event: Command Status (0x0f) plen 4
          Disconnect (0x01|0x0006) status 0x00 ncmd 1
      > HCI Event: Disconn Complete (0x05) plen 4
          status 0x00 handle 42 reason 0x16
          Reason: Connection Terminated by Local Host

      You are so helpful, I really appreciate what you have done here, thank you!

       
      • blam

        blam - 2007-10-08

        No worries :) And thanks for sending that, I'll check it out.

         
    • aptc

      aptc - 2007-11-15

      I use the command "obexpushd -B" to test if openobex is ok in this case, the result is positive, openobex functions very well with my 6670.

      But the 6670 dosen't work with lightblue.

      I compared the difference between two above hcidump data, found it's the "SDP SA Rsp:" which caused problem.

      I also find the custom transport but not the bluetooth transport is used in lightblue as function btobexserver_init in btobexserver.c indicated.

      Maybe above information can help you, they all related with SDP, is it possible that custom transport isn't perfact as bluetooth transport?

      I think lightblue will support multi-byte character file name in near future, is that right?

      Lightblue is great, I am using it to desigen prototype bluetooth products with python, it's really convenient, I like it!

      It will be more great if lightblue can be used to built up real products when it's mature.

       
      • blam

        blam - 2007-11-15

        I didn't think the custom transport would cause problems, and the Bluetooth transport shouldn't be doing anything with SDP. But I'll try and test it with obexpushd. Thanks for checking it out.

        > I think lightblue will support multi-byte character file name in near future, is that right?

        I'm not sure what you mean?

         
    • aptc

      aptc - 2007-11-15

      I think the problem is caused by parameter SDP_ATTR_SUPPORTED_FORMATS_LIST or SuppFormatsList, which may not be registered on service discovery database by pybluez or other later program. look the difference in the dumped data:

      bad connection:
      > ACL data: handle 42 flags 0x02 dlen 21
          L2CAP(d): cid 0x0040 len 17 [psm 1]
              SDP SA Req: tid 0x7 len 0xc
                handle 0x10000
                max 1024
                aid(s) 0x0303 (SuppFormatsList)
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 14
          L2CAP(d): cid 0x0043 len 10 [psm 1]
              SDP SA Rsp: tid 0x7 len 0x5
                count 2
                cont 00

      Good connection:
      > ACL data: handle 42 flags 0x02 dlen 21
          L2CAP(d): cid 0x0040 len 17 [psm 1]
              SDP SA Req: tid 0x7 len 0xc
                handle 0x10000
                max 1024
                aid(s) 0x0303 (SuppFormatsList)
                cont 00
      < ACL data: handle 42 flags 0x02 dlen 33
          L2CAP(d): cid 0x0046 len 29 [psm 1]
              SDP SA Rsp: tid 0x7 len 0x18
                count 21
                aid 0x0303 (SuppFormatsList)
                   < uint 0x1 uint 0x2 uint 0x3 uint 0x4 uint 0x5 uint 0x6 uint 0xff >
                cont 00

      Bad connection couldn't response the SuppFormatsList data what remote device required.

       
    • aptc

      aptc - 2007-11-16

      The connection problem disappeared after I registered the SuppFormatsList data in pyblue.

      > I think lightblue will support multi-byte character file name in near future, is that right? 
      I'm not sure what you mean?

      when the bluetooth device's name or the file's name is multi-byte character like chinese, something like this will be displayed:

      Traceback (most recent call last):
        File "main.py", line 5, in <module>
          main_loop.do()
        File "/home/teller/reception.py", line 96, in do
          self.prepare_user()
        File "/home/teller/reception.py", line 33, in __prepare_user
          self.user=User(user_addr)
        File "/home/teller/user.py", line 20, in __init__
          self.bd_name=finddevicename(in_data, usecache=True)
        File "/usr/lib/python2.5/site-packages/lightblue/_lightblue.py", line 102, in finddevicename
          return unicode(name)
      UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 11: ordinal not in range(128)

       
      • blam

        blam - 2007-11-17

        > The connection problem disappeared after I registered the SuppFormatsList data
        > in pyblue.

        How did you register the SuppFormatsList?

        > when the bluetooth device's name or the file's name is multi-byte character
        > like chinese, something like this will be displayed:

        That's a bad bug, thanks, that will be fixed.

         
    • aptc

      aptc - 2007-11-17

      >How did you register the SuppFormatsList?

      Add following lines in program /pybluez/bluez/btmodule.c

        uint8_t formats[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0xFF };
        uint8_t fdtd = SDP_UINT8;
        void* dtds[sizeof(formats)];
        void* values[sizeof(formats)];
        sdp_data_t* list_formats = NULL;

        for (i = 0; i < sizeof(formats); ++i) {
          dtds[i] = &fdtd;
          values[i] = formats+i;
        }
        list_formats = sdp_seq_alloc(dtds,values,sizeof(formats));
        sdp_attr_add(&record,SDP_ATTR_SUPPORTED_FORMATS_LIST,list_formats);

       
      • blam

        blam - 2007-11-18

        Yeah, the Push server really should publish the Supported Formats List. It would be great to be able to do this through PyBluez, without modifying the source. Do you think you can use this code to submit a patch to the PyBluez project to configure the Supported Formats List when advertising a service? (Just like how you can configure the UUIDs for service classes and profiles when calling advertise_service().)

         
    • aptc

      aptc - 2007-11-18

      I think it works. first, I copy these code from obexpushd; second,it made my cell phone work after modification; and third, I have checked the dump data and saw the right response has displayed.

       
      • blam

        blam - 2007-11-19

        Oh, yes, I can see that it does work, and it does solve the problem. What I meant was, can you submit a patch to PyBluez so that the Supported Formats List can be configured through the advertise_service() function in the PyBluez library? If that functionality is added to PyBluez, then LightBlue's advertise() function would be able to use PyBluez to include the correct Supported Formats List when it advertises a service. And I'm sure PyBluez users would be pretty happy to have that extra functionality too.

         
    • aptc

      aptc - 2007-11-19

      Ok, I see, I'll try it. thank you.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.