Class SerialMessageData
Represents a SerialMessagePort
message consisting of a byte[]
of the
actual message data.
Assembly: Meadow.Contracts.dll
View Source
public class SerialMessageData : EventArgs
Inheritance: System.Object
-> System.EventArgs
Properties
Message
A byte[]
of the actual message data.
View Source
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
public string GetMessageString(Encoding encoding)
Returns
System.String
: A string that contains the results of decoding the Meadow.Hardware.SerialMessageData.Message bytes.
Parameters
Type | Name | Description |
---|---|---|
System.Text.Encoding | encoding | The 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
public static SerialMessageData FromString(string message, Encoding encoding)
Returns
Meadow.Hardware.SerialMessageData
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to be encoded |
System.Text.Encoding | encoding | The character encoding used to get the underlying bytes. (Usually System.Text.Encoding.ASCII ) |