Hi I want to send some command to my device which is connected via serial port. How to send it?
For example i found this on google search but for me it\'s useless.
What the previous answers have told you is how to send a NEWLINE character - this is not the same as "the enter key". If what you want to do is to actually indicate to the remote machine that the "enter key" on the keyboard has been pressed, that is entirely different, and may not be possible, depending on your operating system and hardware.
It depends on what is ENTER for your device. In Windows it is CRLF (13 and then 10), Linux is LF (only 10.) It's just a matter of what your device expects, because it can't see ENTER, just "byte 10, byte 13, byte whatever..."