# MTCMSMessage Class Methods

This class allows building MagTek CMS messages to be used in communications with MagTek CMS devices.

#### MTCMSMessage <a href="#toc_250037" id="toc_250037"></a>

This constructor method builds an MTCMSMessage instance with the provided values.

```
public void MTCMSMessage(int messageType, int applicationID, int commandID, int dataTag, byte[] data)
```

Parameters:

<table data-header-hidden><thead><tr><th width="198" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">messageType</td><td valign="top">MessageType value</td></tr><tr><td valign="top">applicationID</td><td valign="top">ApplicationID value</td></tr><tr><td valign="top">commandID</td><td valign="top">CommandID value</td></tr><tr><td valign="top">dataTag</td><td valign="top">Data Tag value</td></tr><tr><td valign="top">data</td><td valign="top">Data value</td></tr></tbody></table>

Return Value: None

#### MTCMSMessage <a href="#toc_250036" id="toc_250036"></a>

This constructor method builds an MTCMSMessage instance with the provided byte array value.

```
public void MTCMSMessage(byte[] messageBytes)
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">messageBytes</td><td valign="top">Message byte array value</td></tr></tbody></table>

Return Value: None

#### setMessageType <a href="#toc_250035" id="toc_250035"></a>

This method sets the value of MessageType.

```
public void setMessageType(int messageType)
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">messageType</td><td valign="top">MessageType value</td></tr></tbody></table>

Return Value: None

#### setApplicationID <a href="#toc_250034" id="toc_250034"></a>

This method sets the value of ApplciationID.

```
public void setMessageType(int messageType)
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">applicationID</td><td valign="top">ApplicationID value</td></tr></tbody></table>

Return Value: None

#### setCommandID <a href="#toc_250033" id="toc_250033"></a>

This method sets the value of CommandID.

```
public void setCommandID(int commandID)
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">commandID</td><td valign="top">CommandID value</td></tr></tbody></table>

Return Value: None

#### setResultCode <a href="#toc_250032" id="toc_250032"></a>

This method sets the value of ResultCode.

```
public void setResultCode (int resultCode)
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">resultCode</td><td valign="top">ResultCode value</td></tr></tbody></table>

Return Value: None

#### setData <a href="#toc_250031" id="toc_250031"></a>

This method sets the value of Data Tag and the value of Data.

```
public void setData (int dataTag, byte[] data)
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">dataTag</td><td valign="top">Data Tag value</td></tr><tr><td valign="top">data</td><td valign="top">Data value</td></tr></tbody></table>

Return Value: None

#### getMessageType <a href="#toc_250030" id="toc_250030"></a>

This method returns the value of MessageType.

```
public int getMessageType()
```

Return Value: MessageType value.

#### getApplicationID <a href="#toc_250029" id="toc_250029"></a>

This method returns the value of ApplicationID.

```
public int getApplciationID()
```

Return Value: ApplicationID value.

#### getCommandID <a href="#toc_250028" id="toc_250028"></a>

This method returns the value of CommandID.

```
public int getCommandID()
```

Return Value: CommandID value.

#### getResultCode <a href="#toc_250027" id="toc_250027"></a>

This method returns the value of ResultCode.

```
public int getResultCode()
```

Return Value: ResultCode value.

#### getDataTag <a href="#toc_250026" id="toc_250026"></a>

This method returns the value of Data Tag.

```
public int getDataTag()
```

Return Value: Data Tag value.

#### getData <a href="#toc_250025" id="toc_250025"></a>

This method returns the value of Data.

```
public byte[] getData()
```

Return Value: Data value.

#### getMessageBytes <a href="#toc_250024" id="toc_250024"></a>

This method returns the message bytes.

```
public byte[] getMessageBytes()
```

Return Value: Message bytes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.magtek.com/hardware/oem-readers-and-components/oem-readers/odynamo/documentation/programmers-manuals/common-message-structure-mtcms-microsoft-.net-java-applet/mtcmsmessage-class-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
