Skip to main content

Class SerialMessageData

Represents a SerialMessagePort message consisting of a byte[] of the actual message data.

Assembly: Meadow.Contracts.dll
View Source
Declaration
public class SerialMessageData : EventArgs

Inheritance: System.Object -> System.EventArgs

Properties

Message

A byte[] of the actual message data.

View Source
Declaration
public byte[] Message { get; set; }

Methods

GetMessageString(Encoding)

Returns a decoded version of the Meadow.Hardware.SerialMessageData.Message based on the specified <code class="paramref">encoding</code>.

View Source
Declaration
public string GetMessageString(Encoding encoding)
Returns

System.String: A string that contains the results of decoding the Meadow.Hardware.SerialMessageData.Message bytes.

Parameters
TypeNameDescription
System.Text.EncodingencodingThe character encoding used to interpret the message. (Usually System.Text.Encoding.ASCII)

FromString(string, Encoding)

Returns a Meadow.Hardware.SerialMessageData that represents <code class="paramref">message</code> encoded as bytes.

View Source
Declaration
public static SerialMessageData FromString(string message, Encoding encoding)
Returns

Meadow.Hardware.SerialMessageData

Parameters
TypeNameDescription
System.StringmessageThe message to be encoded
System.Text.EncodingencodingThe character encoding used to get the underlying bytes. (Usually System.Text.Encoding.ASCII)