Created
March 18, 2013 02:01
-
-
Save changtimwu/5184510 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs =require( 'fs'); | |
| var devfn='/dev/ttyS1' | |
| var txFd = fs.openSync( devfn, 'w'); | |
| var rxfd = fs.openSync( devfn, 'r'); | |
| var txBuf = new Buffer('hello'); | |
| var txBytesWritten = fs.writeSync(txFd, txBuf, 0, txBuf.length, -1); | |
| console.log("written bytes=", txBytesWritten); | |
| fs.closeSync(txFd); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment