简体   繁体   中英

C# send data over serial port in binary mode

TeraTerm can transmit files using "Binary mode". Can someone please let me know what is the difference between "Binary mode" and "Not-binary mode"?

I have to do the same on a C# project and I'm not really sure if I need something special to send a file in "Binary mode", its a case of lack of knowledge.

Thank you in advance!

Can someone please let me know what is the difference between "Binary mode" and "Not-binary mode"?

"Binary mode" traditionally will transfer the file without any processing nor use any protocol. The data from the file will be transferred byte for byte: nothing will be inserted or removed or translated.

For TeraTerm, binary sending is described in its documentation as

If you select this option, received characters are sent without any modifications.
Otherwise, new-line codes are converted and control characters (except TAB, LF and
CR) are stripped out. 

For TeraTerm the opposite of this "binary mode" could be called (ASCII) text mode.


The alternative to binary/text modes for file transmission by a terminal emulator program would employ a file transfer protocol such as kermit, xmodem, ymodem, or zmodem.

I don't know what TeraTerm is but my guess is that binary-mode is there to send binary files over the serial port. Also it could be that the input-dialog is now in bin not hex format. Like writing "0x00" is now "00000000".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM