> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mink Communication

**Header:** `libminkadaptor/include/MinkCom.h`

## Functions

### `MinkCom_getRootEnvObject`

Get a RootEnv object which can be used to initiate MINK-IPC based communication with QTEE.

```cpp theme={null}
int MinkCom_getRootEnvObject(Object *obj)
```

**Parameters**

<ParamField path="obj" type="Object *">
  The RootEnv object requested by the client.
</ParamField>

**Returns**

Object\_OK on success. Object\_ERROR on failure.

### `MinkCom_getClientEnvObject`

Get a ClientEnv object that is registered with QTEE with client's auto-generated credentials.

```cpp theme={null}
int MinkCom_getClientEnvObject(Object root, Object *obj)
```

**Parameters**

<ParamField path="root" type="Object">
  The RootEnv object for initiating MINK-IPC based communication.
</ParamField>

<ParamField path="obj" type="Object *">
  The ClientEnv object requested by the client.
</ParamField>

**Returns**

Object\_OK on success. Object\_ERROR\_\* on failure.

### `MinkCom_getClientEnvObjectWithCreds`

Get a ClientEnv object that is registered with QTEE with client's self-generated credentials.

```cpp theme={null}
int MinkCom_getClientEnvObjectWithCreds(Object root, Object creds, Object *obj)
```

**Parameters**

<ParamField path="root" type="Object">
  The RootEnv object for initiating MINK-IPC based communication.
</ParamField>

<ParamField path="creds" type="Object">
  The credentials object self-generated by the client.
</ParamField>

<ParamField path="obj" type="Object *">
  The ClientEnv object requested by the client.
</ParamField>

**Returns**

Object\_OK on success. Object\_ERROR\_\* on failure.

### `MinkCom_getMemoryObject`

Get a Memory object representing physically contiguous memory shared with QTEE.

```cpp theme={null}
int MinkCom_getMemoryObject(Object rootObj, size_t size, Object *memObj)
```

**Parameters**

<ParamField path="root" type="">
  The RootEnv object for initiating MINK-IPC based communication.
</ParamField>

<ParamField path="size" type="size_t">
  Size of the memory represented by the Memory object.
</ParamField>

<ParamField path="memObj" type="Object *">
  The Memory object requested by the client.
</ParamField>

**Returns**

Object\_OK on success. Object\_ERROR\_\* on failure.

### `MinkCom_getMemoryObjectInfo`

Get the virtual address and size of the memory represented by a Memory object.

```cpp theme={null}
int MinkCom_getMemoryObjectInfo(Object memObj, void **address, size_t *size)
```

**Parameters**

<ParamField path="memObj" type="Object">
  The Memory object for which information is requested.
</ParamField>

<ParamField path="address" type="void **">
  Virtual address of the memory represented by the Memory object.
</ParamField>

<ParamField path="size" type="size_t *">
  Actual size of the memory represented by the Memory object.
</ParamField>

**Returns**

Object\_OK on success. Object\_ERROR\_\* on failure.
