Menu

How to send CRLF in ioport

Jani
2012-10-13
2013-02-18
  • Jani

    Jani - 2012-10-13

    Hi for all!

    Is there any way to send CRLF in ioport?

    BR,
    James

     
  • jef2000

    jef2000 - 2012-10-17

    Not straightforward, because newline is not allowed in xml attribute value if I remember well.
    You can send it using hexadecimal value of CR LF ( 0x0d 0x0a) like this:

    <action type="ioport-tx" ioport="xyz" hex="true" data="0d0a"/>

     
  • jef2000

    jef2000 - 2013-02-18

    Hi,

    There is also an easier solution for this, without the hex="true" flag. You can simply insert "&#xA;" for "\n" and "&#xD;" for "\r" in your text string, or any other ascii code (in hex format, preceded by ampersand, hash sign and followed by semicolon). That's the standard way to escape special characters in XML.
    http://www.w3.org/TR/REC-xml/#sec-references

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.