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.
Control + E is a keyboard shortcut for 5, so:
serial.Write(new byte[]{ 5 }, 0, 1);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The microsoft version of enter or new line is
\r\nwhich is0x0d 0x0ain hex.\ris the carriage returnIn a shell or a printer this would put the cursor back to the beginning of the line.
\nis the line feedPuts the cursor one line below, in some shells this also puts the cursor to the beginning of the next line. a printer would simply scroll the paper a bit.
So much for the history lesson. Current windows systems still use these characters to indicate a line ending. Dos generated this code when pressing enter.
The key code is a bit different. Beginning with the esc key being the 1. Enter is 28.
Source: linux hlkeycodes from http://www.comptechdoc.org