Hi,
I'm developing an Kivy application that uses a cash register printer
with a serial interface.
To connect to android I use a bluetooth-to-serial device via jnuis.
Everything works as expected, except, whenever a character is being send above
the value of 127 an exception is being thrown:
[WARNING ] stderr: File
"/mnt/sdcard/kivy/kassa/serialAndroid.py", line 88, in write
[WARNING ] stderr: self._outStream.write(data)
[WARNING ] stderr: File "jnius_export_class.pxi", line 827,
in jnius.jnius.JavaMultipleMethod.__call__ (jnius/jnius.c:18715)
[WARNING ] stderr: File "jnius_export_class.pxi", line 553,
in jnius.jnius.JavaMethod.__call__ (jnius/jnius.c:15573)
[WARNING ] stderr: File "jnius_conversion.pxi", line 94, in
jnius.jnius.populate_args (jnius/jnius.c:5181)
[WARNING ] stderr: File "jnius_conversion.pxi", line 434, in
jnius.jnius.convert_pyarray_to_java (jnius/jnius.c:8202)
[WARNING ] stderr: OverflowError: value too large to convert
to signed char
I'm testing this using Kivy Launcher 1.7.2 on Android 4.2
The data is being writen as a string like:
data = chr(100)+chr(28)+chr(128).
outStream.write(data)
It looks like the conversion of string data which contains a value over 127 to a java string is responsible for this.
Is this a programming error or a bug in pyjnius?
If this is a programming error then please tell me how do I send the data to pyjnius because the data for the printer contains can be in the range of 0 to 255?
Any help is appreciated.
Regards,
Willem