If you're on linux or mac, you could use os.tmpfile() to get a file object, write your bytes to that file object, and then pass the file object to lightblue.obex.sendfile(). This way you don't have to save your data to file before passing it to sendfile().
Currently the file object passed to sendfile() has to be a proper file object with a real file descriptor, but this is pretty annoying, and will be changed in a future release.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
It would be possible to use the library lightblue obex to send Byte Array for a device, or it is only possible to send to file ?
Thanks
Addo
If you're on linux or mac, you could use os.tmpfile() to get a file object, write your bytes to that file object, and then pass the file object to lightblue.obex.sendfile(). This way you don't have to save your data to file before passing it to sendfile().
Currently the file object passed to sendfile() has to be a proper file object with a real file descriptor, but this is pretty annoying, and will be changed in a future release.
Hi,
Thanks your reply:D
I go to use tip on os.tmpfile ()!
Att,
Addo