---
name: "isP2PActiveSync"
mode: "kit"
versionRequirements:
  - { name: "P2PKit", version: "2.0.3" }
platform:
  - "iOS"
  - "Android"
title: "ty.p2p.isP2PActiveSync - Synchronously check the P2P connection"
---

## isP2PActiveSync

> [VERSION] P2PKit >= 2.0.3

> [PLATFORM] iOS, Android

### Description

Check P2P status

### Parameters

`Params`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `params` | `ThingP2PConnectionParams` | No | - | Parameter object |

### Referenced Types

##### `interface` ThingP2PConnectionParams

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `deviceId` | `string` | `2.0.3` | Device ID |
| `mode` | `number` | `2.0.3` | Connection mode: 0 = INTERNET, 1 = LAN |
| `timeout` | `number` | `2.0.3` | timeout (ms); defaults: INTERNET 15000 ms, LAN 3000 ms. |


### Examples

```tsx
ty.p2p.isP2PActive({
  deviceId: "xx",
  mode: 0,
  timeout: 0,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
