diff --git a/OAT.xml b/OAT.xml old mode 100644 new mode 100755 index 63d6db0d996949d97aa23e700794ea21f2674d34..a3c8af187a381d63422ba4ec7803ca71f1879dd1 --- a/OAT.xml +++ b/OAT.xml @@ -60,6 +60,7 @@ Note:If the text contains special characters, please escape them according to th + diff --git a/api/@ohos.medical.d.ts b/api/@ohos.medical.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d5358d7b87081063283a0cfa076f7d417910102 --- /dev/null +++ b/api/@ohos.medical.d.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2022 Chipsea Technologies (Shenzhen) Corp., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Callback } from './basic'; + +/** + * This module provides the capability to subscribe to medical data. + * + * @since 8 + * @sysCap SystemCapability.Sensors.Medical_sensor + * @import import medical from '@ohos.medical' + * @permission ohos.permission.READ_HEALTH_DATA + */ +declare namespace medical { + /** + * Subscribe to medical sensor data, If the API is called multiple times, the last call takes effect. + * @param type Indicate the medical type to listen for, {@code MedicalSensorType.TYPE_ID_PHOTOPLETHYSMOGRAPH}. + * @param options Optional parameters specifying the interval at which medical sensor data is reported, {@code Options}. + * @permission ohos.permission.READ_HEALTH_DATA + * @since 8 + */ + function on(type: MedicalSensorType, callback: Callback, options?: Options): void; + + /** + * Unsubscribe to medical sensor data once. + * @param type Indicate the medical sensor type to listen for, {@code MedicalSensorType}. + * @permission ohos.permission.READ_HEALTH_DATA + * @since 8 + */ + function off(type: MedicalSensorType, callback?: Callback): void; + + /** + * Subscribe to the medical sensor's optional parameters. + * @sysCap SystemCapability.Sensors.Medical_sensor + */ + interface Options { + interval?: number; /**< Sensor event reporting event interval */ + } + + /** + * The type of medical sensor. + * @sysCap SystemCapability.Sensors.Medical_sensor + */ + enum MedicalSensorType { + TYPE_ID_PHOTOPLETHYSMOGRAPH = 129, /**< Photoplethysmography */ + } + + interface PpgResponse { + dataArray: Array; /**< Photoplethysmography data */ + } + } + + export default medical;