Low Power Camera

Last Updated on : 2024-06-17 08:46:10download

Determine if it is a low power camera

Declaration

Determine if it is a low-power camera.

boolean isLowPowerDevice(String devId);

Example

IThingIPCCore cameraInstance = ThingIPCSdk.getCameraInstance();
if (cameraInstance != null) {
    cameraInstance.isLowPowerDevice(devId));
}

Wake up a low power camera from sleep mode

A low power camera is powered by batteries. This device runs in sleep mode to minimize power consumption if peer-to-peer (P2P) connections are not used within a certain period. P2P connections are unavailable in sleep mode. They can be used only after the device is woken up.

API description

void wirelessWake(String devId);

Example

IThingIPCDoorbell doorbell = ThingIPCSdk.getDoorbell();
if (doorbell != null) {
    doorbell.wirelessWake(devId);
}

You can query DP 149 (DP Code: wireless_awake) status to check whether the low power camera device is awake. For more information about how to query DP status, see Device Control.

Battery management

A lower power camera can be connected to mains power or powered by batteries. You can call the IPC SDK to query the power mode and the current battery level of the device. A threshold can be set to generate low battery alerts conditionally.

Lock or unlock a battery

Locks a battery or releases the battery lock based on the DP ID 153(DP Code: wireless_batterylock).

Value Description
true Lock
false Unlock

Query battery level and device status

Returns the battery level and device status based on the DP ID 145(DP Code: wireless_electricity). The battery level is reported with an integer ranging from 0 to 100.

To send the DP data, pass in null without a parameter.

Set a threshold for low battery alerts

Sets a threshold to generate low battery alerts conditionally based on the DP ID 147(DP Code: wireless_lowpower). If the battery is lower than the threshold, an alert will be generated.

Query power supply mode

Returns the current power supply mode based on the DP ID 146(DP Code: wireless_powermode). When the power supply mode is changed, the device reports the DP status.

Value Description
0 Powered by batteries
1 Connected to mains power

To send the DP data, pass in null without a parameter.