dexapier / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

bluetoothWrite doesn't accept binary data #445

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think bluetoothWrite is trying to interpret its input as UTF8 at some point. 
Or maybe I'm doing something wrong.

Also reported by Ryan Hickman here:

http://groups.google.com/group/android-scripting/browse_frm/thread/d3f549f0c7309
47f/aa3e41e7fe1180fc

Traceback (most recent call last):
  File "/mnt/sdcard/sl4a/scripts/nxt.py", line 9, in <module>
    droid.bluetoothWrite("\x0c\x00\x80\x04\x00\x32\x03\x00\x00\x20\x00\x00\x00\x00")
  File "/mnt/sdcard/com.googlecode.pythonforandroid/extras/python/android.py", line 57, in rpc_call
    return self._rpc(name, *args)
  File "/mnt/sdcard/com.googlecode.pythonforandroid/extras/python/android.py", line 43, in _rpc
    request = json.dumps(data)
  File "/home/damonkohler/ase_src/python/src/android/python/lib/python2.6/json/__init__.py", line 230, in dumps
  File "/home/damonkohler/ase_src/python/src/android/python/lib/python2.6/json/encoder.py", line 367, in encode
  File "/home/damonkohler/ase_src/python/src/android/python/lib/python2.6/json/encoder.py", line 309, in _iterencode
  File "/home/damonkohler/ase_src/python/src/android/python/lib/python2.6/json/encoder.py", line 275, in _iterencode_dict
  File "/home/damonkohler/ase_src/python/src/android/python/lib/python2.6/json/encoder.py", line 306, in _iterencode
  File "/home/damonkohler/ase_src/python/src/android/python/lib/python2.6/json/encoder.py", line 204, in _iterencode_list
  File "/home/damonkohler/ase_src/python/src/android/python/lib/python2.6/json/encoder.py", line 294, in _iterencode
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 2: 
unexpected code byte

Original issue reported on code.google.com by jfe...@gmail.com on 23 Sep 2010 at 5:53

GoogleCodeExporter commented 9 years ago
Issue 446 has been merged into this issue.

Original comment by damonkoh...@gmail.com on 25 Sep 2010 at 9:36

GoogleCodeExporter commented 9 years ago
Binary read/write for Bluetooth was added in r3.

Original comment by damonkoh...@gmail.com on 6 Nov 2010 at 9:34

GoogleCodeExporter commented 9 years ago
Hi guys, 
did you find a solution for this issue???
Thanks
Lio

Original comment by lio.chi...@gmail.com on 20 Nov 2011 at 10:43