Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows : must specify all com port settings with one command #4

Open
GoogleCodeExporter opened this issue Dec 1, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Call multiple "confxxx" functions in script
2. Run script on command line
3. run "mode COM1" on command line


What is the expected output? What do you see instead?
I'm doing this

$baud_rate = 9600;
$serial->confBaudRate($baud_rate); 
$serial->confParity("none");
$serial->confCharacterLength(8);
$serial->confStopBits(1);
$serial->confFlowControl("rts/cts");

However, I found out only last call takes effect, and verified on command line 
that when calling mode, it only puts into effect flags specified with that 
command, all other settings put back to default.

I had too collect the settings and specify them with single mode command "mode 
COM1 BAUD=96 parity=n stop=1 data=8 xon=off octs=on rts=hs"

You wouldnt notice this if your default settings where what you wanted.  I only 
noticed because for some reason it kept defaulting to even parity and 7 data 
bits.

What version of the product are you using? On what operating system?
Latest from svn read only, Win7 64 bit

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 Apr 2011 at 9:05

@GoogleCodeExporter
Copy link
Author

Attaching version of code I'm currently using, which has mostly untested code 
for windows mode fix, but it should work.  I have array of all mode settings 
with default values.  On each configuration function, i change value of 
respective value in array, then generate mode string from array, and use it.

This code also has other changes, not entirely sure how much it differs from 
base code.  I have function in there for use in non windows OS for setting some 
serial flags for ascii vs binary communication(things like ignbrk icrnl, etc).  
It also supports lockdev for serial port locking under linux.

I mainly use this in linux environment, but windows support is must.

Original comment by [email protected] on 8 Dec 2011 at 4:42

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant