java - Disable Parity Bit for serial Communication does not work -


i have problem sending bytes through comport. sends parity bit, although explicitly turned off (i need byte without parity communicate hardware). code simple:

process p = runtime.getruntime().exec("cmd.exe /c mode com1: baud=115200 parity=n data=8 stop=1 to=off xon=off rts=off dtr=off"); p.waitfor(); fp = new randomaccessfile("com1","rw"); fp.write((byte)0x21); 

i have oscillator connected port , whatever do, there 1 bit, appears parity bit. can see, disabled parity via code, , disabled via device manager. see on oscillator : 0 0010 0001 11 (start , stop bit incuded). can't figure out, parity or bit comes from... has idea?

while mode command 1 upon time intended used , did work, skeptical how effort microsoft has put maintaining kind of legacy support. first step open command prompt , run

c:\>mode c:\>rem above command display values configurable settings c:\>mode com1: baud=115200 parity=n data=8 stop=1 to=off xon=off rts=off dtr=off c:\>mode c:\>rem visible changes compared first mode command? c:\>echo u >> com1 c:\>rem check bits on oscilloscope 

if not work expected think should give on mode command. if of works, verify mode settings not properties within shell running mode command, e.g. after changing parameters, run mode in different shell check parameters changed there well.

additionally, according documentation microsoft, syntax baud=... parameter not numerical baud value 2 digit number mapped given baud rate (e.g. baud=96 -> 9600, see table in documentation). this site mentions alternative syntax, mode com1:9600,n,8,1 more in line remember being used, try well.

all of failing, try using java serial library. rxtx commonly used, although not likes it. this post recommends http://code.google.com/p/java-simple-serial-connector/ on rxtx. this post mentions http://code.google.com/p/jperipheral.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -