# MCSDevice

The **MCSDevice** class creates device that can connect to specified MCS server. Also, send and receive data from the specified test device on MCS. Know more about MCS.

### Constructor <a href="#mcsdevice-constructor" id="mcsdevice-constructor"></a>

&#x20;MCSDevice()

{% tabs %}
{% tab title="MCSDevice()" %}
Creates a *device* that can connect to MCS server.

**Syntax**

**Parameters**

device\_id: The ID of the test device you created on MCS.

device\_key: The key of the test device you created on MCS.

mcs\_server\_url: Optional. If it is not provided, it connects to "[api.mediatek.com](http://api.mediatek.com/)" by default.

* * MCS Global: To access MCS Global, please browse [https://mcs.mediatek.com](https://mcs.mediatek.com/) and specify the MCS API Server URL as "[api.mediatek.com](http://api.mediatek.com/)".
  * MCS China: To access MCS in China, please browse [https://mcs.mediatek.cn](https://mcs.mediatek.cn/) and specify the MCS API Server URL as "[api.mediatek.cn](http://api.mediatek.cn/)".<br>

mcs\_server\_port: Optional. If it is not provided, it connects with port 80 by default.

**Returns**

*device* is an instance of the **MCSDevice** class
{% endtab %}
{% endtabs %}

### Methods <a href="#mcsdevice-methods" id="mcsdevice-methods"></a>

&#x20;addChannel()

&#x20;connect()

&#x20;connected()

&#x20;process()

&#x20;setDefaultTimeout()

{% tabs %}
{% tab title="addChannel()" %}
To add a data channel instance to a MCSDevice instance.

**Syntax**

**Parameters**

data\_channel\_instance: an instance of the MCSDataChannel extended classes

**Returns**

none
{% endtab %}

{% tab title="connect()" %}
**Description**

**Syntax**

**Parameters**

**Returns**
{% endtab %}

{% tab title="connected()" %}
**Description**

To check if the connection is still valid.

**Syntax**

**Parameters**

**Returns**
{% endtab %}

{% tab title="process()" %}
**Description**

**Syntax**

**Parameters**

timeout\_value: Optional. the number of milliseconds to start running loop() again. If not given, the timeout value set by setDefaultTimeout() is used. The default timeout is 30 seconds.

**Returns**

none
{% endtab %}

{% tab title="setDefaultTimeout()" %}
**Description**

**Syntax**

**Parameters**

**Returns**

none
{% endtab %}
{% endtabs %}
