microsoft / vscode-serial-monitor

Serial Monitor that allows for reading and writing to serial ports. Official issue tracking repository for Microsoft's Serial Monitor VS Code extension.
MIT License
60 stars 8 forks source link

Mixed View / Mixed Input #202

Open damienbutt opened 1 month ago

damienbutt commented 1 month ago

Type: Feature Request

Hi,

Would it be possible to get a mixed view and mixed input?

Currently, you can view in either hex or text (ASCII). It would be nice if we could have a mixed mode where data is displayed in ASCII wherever possible, otherwise display the character in hex.

With the input for sending data, currently you can send as either hex, binary, text. Again, it would be helpful if there was mixed mode, or a way to work in text mode with the ability to escape and send hex characters in and around the ASCII ones.

For context, I work a lot with RS232 control protocols, both via serial and IP to control various pieces of equipment. A lot of protocols use a mix of ASCII and hex characters.

For example, in the RS232 protocol for a Panasonic LCD screen, all commands start with an STX (02), and end with an ETX (03). The command to query the power state of a Panasonic LCD screen is:

\x02QPW\x03

The screen will reply with:

\x02QPW:1\x03   // On
// or
\x02QPW:0\x03   // Off

In other protocols, it is also very common that commands are terminated with a carriage return (0D) and/or line feed (0A) as a delimiter.

Thanks, D

gcampbell-msft commented 1 month ago

Thanks for the feature request! I will mark this as an enhancement and will use community upvotes to track it's priority, thanks!

EGOKM commented 2 weeks ago

well, I've requested similar month ago ;-), and also today I think this will be a very good enhancement, I wanted to extend that ( beside the output ) to the input also ... the "view mode" maybe called "mixed" --- meaning some non-printable chars will be shown as "\xXX" [XX is the %02x formatted byte] AND the input also accepts those writings:

EGOKM commented 2 weeks ago

for example, writing AB\x02XY will send: (byte)0x41, (byte)0x42, (byte)0x02, (byte)0x58 and (byte)0x59 ... while doing this it would be also fine if '\n' , or '\r' , etc. is accepted and sent ;-)