IPCs

Last Updated on : 2024-11-18 11:33:14

A list of devices can be obtained based on homes. An IP camera (IPC) can be determined by device type. Then, an IPC object can be created with the information provided by DeviceBean.

Determine an IPC

Checks whether a device is an IPC.

API description

boolean isIPCDevice(String devId);

Example

ITuyaIPCCore cameraInstance = TuyaIPCSdk.getCameraInstance();
if (cameraInstance != null) {
    cameraInstance.isIPCDevice(devId)
}

Get the P2P type

IPCs support three P2P channel implementation solutions. The IPC SDK initializes different IPC implementation objects based on the P2P type. You can call the following API method to get the specific P2P type.

API description

int getP2PType(String devId);

Example

ITuyaIPCCore cameraInstance = TuyaIPCSdk.getCameraInstance();
if (cameraInstance != null) {
    cameraInstance.getP2PType(devId)
}