当前仅显示指定条件回帖 [ 展开查看全部 ]
文件名称:
power.md
所在目录:
Openharmony v1.0 / docs / docs-en / api / api-LinkIoT
文件大小:
18.55 KB
下载地址:
文本预览:
# Power
## **Overview**
Provides device power management functions.
This module is used to reboot the device and set low power consumption for the device.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Files
## Enumerations
## Functions
## **Details**
## **Enumeration Type Documentation**
## LpcType
```
enum [LpcType](power.md#gaa6139ca73fa81742134fe74345ccb748)
```
**Description:**
Enumerates low power consumption modes.
## RebootCause
```
enum [RebootCause](power.md#gaeac1b873015f5b0a8aa7f3c068507426)
```
**Description:**
Enumerates reboot causes.
## **Function Documentation**
## LpcInit\(\)
```
unsigned int LpcInit (void )
```
**Description:**
Initializes low power consumption.
**Returns:**
Returns [WIFI\_IOT\_SUCCESS](wifiiot.md#gae70eaf627c0370cc271dcb8060aee861) if the operation is successful; Returns an error code defined in [wifiiot\_errno.h](wifiiot_errno-h.md) otherwise.
## LpcSetType\(\)
```
unsigned int LpcSetType ([LpcType](power.md#gaa6139ca73fa81742134fe74345ccb748) type)
```
**Description:**
Sets low power consumption for the device.
**Parameters:**
**Returns:**
Returns [WIFI\_IOT\_SUCCESS](wifiiot.md#gae70eaf627c0370cc271dcb8060aee861) if the operation is successful; Returns an error code defined in [wifiiot\_errno.h](wifiiot_errno-h.md) otherwise.
## RebootDevice\(\)
```
void RebootDevice ([RebootCause](power.md#gaeac1b873015f5b0a8aa7f3c068507426) cause)
```
**Description:**
Reboots the device using different causes.
**Parameters:**
## **Overview**
Provides device power management functions.
This module is used to reboot the device and set low power consumption for the device.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Files
Sets low power consumption for the device. | |
## Enumerations
LpcType { NO_SLEEP, LIGHT_SLEEP, DEEP_SLEEP } | Enumerates low power consumption modes. |
RebootCause { SYS_REBOOT_CAUSE_UNKNOWN = 0, SYS_REBOOT_CAUSE_CMD, SYS_REBOOT_CAUSE_UPG, SYS_REBOOT_CAUSE_UPG_B, SYS_REBOOT_CAUSE_WIFI_MODE, SYS_REBOOT_CAUSE_USR_NORMAL_REBOOT, SYS_REBOOT_CAUSE_USR0, SYS_REBOOT_CAUSE_USR1, SYS_REBOOT_CAUSE_AT_BUSY, SYS_REBOOT_CAUSE_MAX } |
## Functions
LpcInit (void) | Initializes low power consumption. |
LpcSetType (LpcType type) | Sets low power consumption for the device. |
RebootDevice (RebootCause cause) | Reboots the device using different causes. |
## **Details**
## **Enumeration Type Documentation**
## LpcType
```
enum [LpcType](power.md#gaa6139ca73fa81742134fe74345ccb748)
```
**Description:**
Enumerates low power consumption modes.
NO_SLEEP | |
LIGHT_SLEEP | |
DEEP_SLEEP |
## RebootCause
```
enum [RebootCause](power.md#gaeac1b873015f5b0a8aa7f3c068507426)
```
**Description:**
Enumerates reboot causes.
## **Function Documentation**
## LpcInit\(\)
```
unsigned int LpcInit (void )
```
**Description:**
Initializes low power consumption.
**Returns:**
Returns [WIFI\_IOT\_SUCCESS](wifiiot.md#gae70eaf627c0370cc271dcb8060aee861) if the operation is successful; Returns an error code defined in [wifiiot\_errno.h](wifiiot_errno-h.md) otherwise.
## LpcSetType\(\)
```
unsigned int LpcSetType ([LpcType](power.md#gaa6139ca73fa81742134fe74345ccb748) type)
```
**Description:**
Sets low power consumption for the device.
**Parameters:**
type | Indicates the low power consumption mode to set. |
**Returns:**
Returns [WIFI\_IOT\_SUCCESS](wifiiot.md#gae70eaf627c0370cc271dcb8060aee861) if the operation is successful; Returns an error code defined in [wifiiot\_errno.h](wifiiot_errno-h.md) otherwise.
## RebootDevice\(\)
```
void RebootDevice ([RebootCause](power.md#gaeac1b873015f5b0a8aa7f3c068507426) cause)
```
**Description:**
Reboots the device using different causes.
**Parameters:**
cause | Indicates the reboot cause. |
点赞
回复
X