O
Olav Tollefsen
I need to read messages from a device connected to a COM port with the
following format:
When the controller is configured to report events, it will transmit a new
message every time the event
occurs. The message follows the following format:
XX <Message> {CR} {LF} {Terminator}
.. "XX" is the Message ID Number. Each type of report message from the
controller has a unique ID
number in a 2-digit hexadecimal format. Each digit will be a hexadecimal
value (numbers 0-9 or
letters A-F). When converted to decimal format, they represent the numbers 0
through 255. By
reading these two bytes, a user program can quickly identify the type of
message from the
controller.
.. "<Message>" will contain a text description of the event.
.. {CR} signifies that a carriage return is sent.
.. {LF} signifies that a line feed is sent.
.. {Terminator} signifies that a single-byte terminator code is sent. The
byte has a value 1d, which is
the ASCII code SOH (this is NOT the number 1, which is ASCII value 49d). The
terminator is
provided to make it easier for a computer program to read and interpret the
messages from the
controller.
What framework clases are best suited for reading this kind of messages from
the device? Can you specify the terminator character which is at the end of
each message?
following format:
When the controller is configured to report events, it will transmit a new
message every time the event
occurs. The message follows the following format:
XX <Message> {CR} {LF} {Terminator}
.. "XX" is the Message ID Number. Each type of report message from the
controller has a unique ID
number in a 2-digit hexadecimal format. Each digit will be a hexadecimal
value (numbers 0-9 or
letters A-F). When converted to decimal format, they represent the numbers 0
through 255. By
reading these two bytes, a user program can quickly identify the type of
message from the
controller.
.. "<Message>" will contain a text description of the event.
.. {CR} signifies that a carriage return is sent.
.. {LF} signifies that a line feed is sent.
.. {Terminator} signifies that a single-byte terminator code is sent. The
byte has a value 1d, which is
the ASCII code SOH (this is NOT the number 1, which is ASCII value 49d). The
terminator is
provided to make it easier for a computer program to read and interpret the
messages from the
controller.
What framework clases are best suited for reading this kind of messages from
the device? Can you specify the terminator character which is at the end of
each message?