1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// automatically generated by rust-bindgen 0.71.1
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::sensor_type::*;
extern "C" {
/// Obtains information about all sensors on the device.
///
/// # Arguments
///
/// * `infos` - - Double pointer to the information about all sensors on the device.
/// For details, see [`Sensor_Info`].
///
/// * `count` - - Pointer to the number of sensors on the device.
///
/// # Returns
///
/// * Returns <b>SENSOR_SUCCESS</b> if the operation is successful; returns the following error code otherwise.
/// [`SENSOR_PARAMETER_ERROR`] Parameter check failed. For example, the parameter is invalid,
/// or the parameter type passed in is incorrect.
///
/// [`SENSOR_SERVICE_EXCEPTION`] The sensor service is abnormal.
///
///
///
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Sensor_GetInfos(infos: *mut *mut Sensor_Info, count: *mut u32) -> Sensor_Result;
/// Subscribes to sensor data. The system will report sensor data to the subscriber at the specified frequency.
/// If you need to apply for the ohos.permission.ACCELEROMETER permission when subscribing to the accelerometer sensor,
/// you need to apply for the ohos.permission.GYROSCOPE permission when subscribing to the gyroscope sensor, and you need
/// to apply for the ohos.permission.ACTIVITY_MOTION permission when subscribing to the pedometer related sensor. Apply
/// for ohos.permission.READ_HEALTH_DATA permission when subscribing to health-related sensors, such as heart rate
/// sensors, otherwise the subscription fails. Other sensors do not require permissions.
///
/// # Arguments
///
/// * `id` - - Pointer to the sensor subscription ID. For details, see [`Sensor_SubscriptionId`].
///
/// * `attribute` - - Pointer to the subscription attribute, which is used to specify the data reporting frequency.
/// For details, see [`Sensor_SubscriptionAttribute`].
///
/// * `subscriber` - - Pointer to the subscriber information, which is used to specify the callback function for
/// reporting the sensor data. For details, see [`Sensor_Subscriber`].
///
/// # Returns
///
/// * Returns <b>SENSOR_SUCCESS</b> if the operation is successful; returns the following error code otherwise.
/// [`SENSOR_PERMISSION_DENIED`] Permission verification failed.
///
/// [`SENSOR_PARAMETER_ERROR`] Parameter check failed. For example, the parameter is invalid,
/// or the parameter type passed in is incorrect.
///
/// [`SENSOR_SERVICE_EXCEPTION`] The sensor service is abnormal.
///
/// ohos.permission.ACCELEROMETER or ohos.permission.GYROSCOPE or
/// ohos.permission.ACTIVITY_MOTION or ohos.permission.READ_HEALTH_DATA
///
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Sensor_Subscribe(
id: *const Sensor_SubscriptionId,
attribute: *const Sensor_SubscriptionAttribute,
subscriber: *const Sensor_Subscriber,
) -> Sensor_Result;
/// Unsubscribes from sensor data.
/// If you need to apply for the ohos.permission.ACCELEROMETER permission to unsubscribe from the accelerometer sensor,
/// you need to request the ohos.permission.GYROSCOPE permission to unsubscribe from the gyroscope sensor, and you need
/// to request the ohos.permission.ACTIVITY_MOTION permission to unsubscribe from the pedometer-related sensor. When you
/// unsubscribe from health-related sensors, such as heart rate sensors, apply for ohos.permission.READ_HEALTH_DATA
/// permissions, otherwise the subscription will fail. Other sensors do not require permissions.
///
/// # Arguments
///
/// * `id` - - Pointer to the sensor subscription ID. For details, see [`Sensor_SubscriptionId`].
///
/// * `subscriber` - - Pointer to the subscriber information, which is used to specify the callback function for
/// reporting the sensor data. For details, see [`Sensor_Subscriber`].
///
/// # Returns
///
/// * Returns <b>SENSOR_SUCCESS</b> if the operation is successful; returns the following error code otherwise.
/// [`SENSOR_PERMISSION_DENIED`] Permission verification failed.
///
/// [`SENSOR_PARAMETER_ERROR`] Parameter check failed. For example, the parameter is invalid,
/// or the parameter type passed in is incorrect.
///
/// [`SENSOR_SERVICE_EXCEPTION`] The sensor service is abnormal.
///
/// ohos.permission.ACCELEROMETER or ohos.permission.GYROSCOPE or
/// ohos.permission.ACTIVITY_MOTION or ohos.permission.READ_HEALTH_DATA
///
///
/// Available since API-level: 11
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_Sensor_Unsubscribe(
id: *const Sensor_SubscriptionId,
subscriber: *const Sensor_Subscriber,
) -> Sensor_Result;
}