---
name: "IpcPlayerContext.disconnect"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "IpcContext.disconnect - 断开 IPC 设备连接"
---

## IpcPlayerContext.disconnect

> [VERSION] Base Library >= 2.21.8

### Description

Disconnect from the IPC device

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `options` | `IpcCallbackOption` | No | Callback options |

### Return Value

None


### Referenced Types

##### `interface` IpcCallbackOption

| Property | Type | Description |
| --- | --- | --- |
| `success` | `() => void` | Callback invoked on successful API call |
| `fail` | `(result: IpcFailResult) => void` | Callback on failure |
| `complete` | `() => void` | Callback on complete (success or failure) |

##### `interface` IpcFailResult

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string` | Error code |
| `errorMsg` | `string` | Error message |


### Examples

#### Disconnect

```ts
const ipcCtx = ty.createIpcPlayerContext('deviceId');
ipcCtx.disconnect({
  success() {
    console.log('Disconnected');
  },
});
```
