未验证 提交 fc90a039 编写于 作者: O openharmony_ci 提交者: Gitee

!12224 翻译完成 10362 DeviceProfile子系统

Merge pull request !12224 from ester.zhou/TR-10362
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
## Introduction<a name="section11660541593"></a> ## Introduction<a name="section11660541593"></a>
DeviceProfile is used to manage device hardware capabilities and system software features. A typical device profile includes the device type, device name, OS type, and OS version. By allowing quick access to local and remote device profiles, DeviceProfile lays the foundation for initiating distributed services. It provides the following features: DeviceProfile is used to manage device hardware capabilities and system software features. A typical device profile includes the device type, device name, OS type, and OS version.
By allowing quick access to local and remote device profiles, DeviceProfile lays the foundation for initiating distributed services. It provides the following features:
- Querying, inserting, and deleting local device profile information - Querying, inserting, and deleting local device profile information
- Querying remote device profile information - Querying remote device profile information
...@@ -23,28 +25,28 @@ The main code directory structure of DeviceProfile is as follows: ...@@ -23,28 +25,28 @@ The main code directory structure of DeviceProfile is as follows:
``` ```
├── interfaces ├── interfaces
   └── innerkits └── innerkits
│ └── distributeddeviceprofile // Internal APIs │ └── distributeddeviceprofile // innerkits APIs
├── ohos.build ├── ohos.build
├── sa_profile // SAID profile ├── sa_profile // SAID profile
   ├── 6001.xml ├── 6001.xml
   └── BUILD.gn └── BUILD.gn
── services ── services
│   └── distributeddeviceprofile └── distributeddeviceprofile
│   ├── BUILD.gn ├── BUILD.gn
│   ├── include ├── include
│ │ ├── contentsensor // Header file for content sensor data collection │ ├── authority // Permission verification
│ │ ├── dbstorage // Header file for database operations │ ├── contentsensor // Header file for content sensor data collection
│ │ ├── devicemanager // Header file for device management │ ├── dbstorage // Header file for database operations
│ │ └── subscribemanager // Header file for subscription management │ ├── devicemanager // Header file for device management
│   ├── src │ └── subscribemanager // Header file for subscription management
│ │ ├── contentsensor // Implementation of content sensor data collection ├── src
│ │ ├── dbstorage // Implementation of database operations │ ├── authority // Permission verification
│ │ ├── devicemanager // Implementation of device management │ ├── contentsensor // Implementation of content sensor data collection
│ │ ├── subscribemanager // Implementation of subscription management │ ├── dbstorage // Implementation of database operations
│ └── test // Test cases │ ├── devicemanager // Implementation of device management
└── tools │ └── subscribemanager // Implementation of subscription management
└── dp // Auxiliary test tool └── test // Test cases
``` ```
## Constraints<a name="section1718733212019"></a> ## Constraints<a name="section1718733212019"></a>
...@@ -58,11 +60,11 @@ The main code directory structure of DeviceProfile is as follows: ...@@ -58,11 +60,11 @@ The main code directory structure of DeviceProfile is as follows:
* Parameters of GetDeviceProfile * Parameters of GetDeviceProfile
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| --------- | ---------------------------- | ---- | ----------------------------------- | | --------- | ---------------------------- | ---- | ----------------------------------- |
| deviceId | std::string | Yes| ID of the device whose profile is to be queried. A null value indicates the local device.| | deviceId | std::string | Yes | ID of the device whose profile is to be queried. A null value indicates the local device.|
| serviceId | std::string | Yes| Service ID (ID of the service data record).| | serviceId | std::string | Yes | Service ID (ID of the service data record). |
| profile | ServiceCharacteristicProfile | Yes| Return value.| | profile | ServiceCharacteristicProfile | Yes | Return value. |
* Example * Example
...@@ -79,9 +81,9 @@ result.append("jsonData:" + jsonData + "\n"); ...@@ -79,9 +81,9 @@ result.append("jsonData:" + jsonData + "\n");
* Parameters of PutDeviceProfile * Parameters of PutDeviceProfile
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| --------- | ---------------------------- | ---- | ----------------------------------- | | --------- | ---------------------------- | ---- | ----------------------------------- |
| profile | ServiceCharacteristicProfile | Yes| Profile information to insert.| | profile | ServiceCharacteristicProfile | Yes | Profile information to insert. |
* Example * Example
...@@ -102,9 +104,9 @@ DistributedDeviceProfileClient::GetInstance().PutDeviceProfile(profile); ...@@ -102,9 +104,9 @@ DistributedDeviceProfileClient::GetInstance().PutDeviceProfile(profile);
* Parameters of DeleteDeviceProfile * Parameters of DeleteDeviceProfile
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| --------- | ---------------------------- | ---- | ----------------------------------- | | --------- | ---------------------------- | ---- | ----------------------------------- |
| serviceId | std::string | Yes| ID of the service record to delete.| | serviceId | std::string | Yes | ID of the service record to delete. |
* Example * Example
...@@ -119,10 +121,10 @@ DistributedDeviceProfileClient::GetInstance().DeleteDeviceProfile(serviceId); ...@@ -119,10 +121,10 @@ DistributedDeviceProfileClient::GetInstance().DeleteDeviceProfile(serviceId);
* Parameters of SyncDeviceProfile * Parameters of SyncDeviceProfile
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| --------- | ---------------------------- | ---- | ----------------------------------- | | --------- | ---------------------------- | ---- | ----------------------------------- |
| syncOption| SyncOption | Yes| Synchronization mode and range.| | syncOption| SyncOption | Yes | Synchronization mode and range. |
| syncCb | IProfileEventCallback | Yes| Callback used to return the synchronization result.| | syncCb | IProfileEventCallback | Yes | Callback used to return the synchronization result. |
* Example * Example
...@@ -142,11 +144,11 @@ DistributedDeviceProfileClient::GetInstance().SyncDeviceProfile(syncOption, ...@@ -142,11 +144,11 @@ DistributedDeviceProfileClient::GetInstance().SyncDeviceProfile(syncOption,
* Parameters of SubscribeProfileEvents * Parameters of SubscribeProfileEvents
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| -------------- | ---------------------------- | ---- | ----------------------------------- | | -------------- | ---------------------------- | ---- | ----------------------------------- |
| subscribeInfos | SubscribeInfo | Yes| Type of the event to subscribe to.| | subscribeInfos | SubscribeInfo | Yes | Type of the event to subscribe to. |
| eventCb | IProfileEventCallback | Yes| Callback for the subscribed event.| | eventCb | IProfileEventCallback | Yes | Callback for the subscribed event. |
| failedEvents | ProfileEvent | Yes| Failure event.| | failedEvents | ProfileEvent | Yes | Failure event. |
* Example * Example
...@@ -178,7 +180,6 @@ profileEvents.emplace_back(ProfileEvent::EVENT_PROFILE_CHANGED); ...@@ -178,7 +180,6 @@ profileEvents.emplace_back(ProfileEvent::EVENT_PROFILE_CHANGED);
failedEvents.clear(); failedEvents.clear();
// Cancel the subscription. // Cancel the subscription.
DistributedDeviceProfileClient::GetInstance().UnsubscribeProfileEvents(profileEvents, callback, failedEvents); DistributedDeviceProfileClient::GetInstance().UnsubscribeProfileEvents(profileEvents, callback, failedEvents);
callback, failedEvents);
``` ```
## Repositories Involved<a name="section176111311166"></a> ## Repositories Involved<a name="section176111311166"></a>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册