xiaofans / android-serialport-api

Automatically exported from code.google.com/p/android-serialport-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set parity and data bits

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. How set parity and data bits on serial port ?
2. On 2.3.6 in class SerialPortFinderFile 
   dev = new File("/dev");
   File[] files = dev.listFiles(); 
   files have a null value;
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
Samsung Galaxy Note, 2.3.6

Please provide any additional information below.


Original issue reported on code.google.com by slawomir...@gmail.com on 19 Dec 2011 at 3:35

An evolution of the API is needed, probably in the next version.

Original comment by cedric.p...@gmail.com on 25 Jan 2012 at 5:44

  • Changed state: Accepted
Issue 23 has been merged into this issue.

Original comment by cedric.p...@gmail.com on 25 Jan 2012 at 5:51

Hi all,

I searched buf couldn't find the defaults for parity, data bits and stop bits...
Can anyone please provide the link to the document where I can find this info? 
Thanks!

Is there any way to add this to the project's documentation? I'd be happy to 
help...

By the way, this is an awesome project! Kudos to all the developers.

Original comment by nimshk...@gmail.com on 26 Feb 2012 at 1:52

Hi nimshk, 
I recently had the same problem, i found these parameters to work:
DATABITS = 8, 
STOPBITS = 1, 
PARITY = NONE

Original comment by felipeko@gmail.com on 1 Nov 2012 at 5:48

Hi felipeko,

How did you set the databits, stopbits and parity?
Which files did you modify?

Original comment by onin2...@gmail.com on 13 Dec 2012 at 10:42

I didn't find any solution. How set "even parity" on serial port? 

Original comment by xemrekil...@gmail.com on 19 Feb 2013 at 8:11

Sorry, didn't have much time to update the project.

The port is configured as 8 bits per character, 1 stop bit, no parity bit.

To modify this default setting, you have to modify the native code as explained 
in this comment:
http://code.google.com/p/android-serialport-api/source/browse/trunk/android-seri
alport-api/project/jni/SerialPort.c

Original comment by cedric.p...@gmail.com on 20 Feb 2013 at 5:09

I also want to know how to setup stop bit and parity bit, but I did find this 
code in  SerialPort.c

Original comment by suncanso...@gmail.com on 31 Mar 2014 at 6:53

Your client has issued a malformed or illegal request. 

Original comment by suncanso...@gmail.com on 31 Mar 2014 at 6:55