Yes, you need to send a Target header if you're connecting to a File Transfer service. (I assume obexftp automatically sends this since that's specifically used for connecting to File Transfer services.)
The lightblue package includes an obex_ftp_client.py example that shows the special Target header that you have to send when you connect to File Transfer services. Basically, just replace
Hi,
When running this code i get the following error:
client = lightblue.obex.OBEXClient(address, 9)
client.connect()
<OBEXResponse reason='Bad Request' code=0x40 (0xc0) headers={'description': u'Target missing'}>
Should I supply a target header and what should it contain?
Sending files with obexftp works, so my bluetooth config should be ok.
Regards
Yes, you need to send a Target header if you're connecting to a File Transfer service. (I assume obexftp automatically sends this since that's specifically used for connecting to File Transfer services.)
The lightblue package includes an obex_ftp_client.py example that shows the special Target header that you have to send when you connect to File Transfer services. Basically, just replace
client.connect()
with
FTP_TARGET_UUID = '\xf9\xec{\xc4\x95<\x11\xd2\x98NRT\x00\xdc\x9e\t'
client.connect({'target': FTP_TARGET_UUID})
The obex_ftp_client.py example has some other code you might like to check out for sending the various FTP commands.
Thanks a lot! It works