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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// This class defines the metadata for a characteristic. Metadata provides
/// further information about a characteristic’s value, which can be used
/// for presentation purposes.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadata?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct HMCharacteristicMetadata;
);
unsafe impl Send for HMCharacteristicMetadata {}
unsafe impl Sync for HMCharacteristicMetadata {}
extern_conformance!(
unsafe impl NSObjectProtocol for HMCharacteristicMetadata {}
);
impl HMCharacteristicMetadata {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// The minimum value for the characteristic if it has a format of "int" or "float".
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(minimumValue))]
#[unsafe(method_family = none)]
pub unsafe fn minimumValue(&self) -> Option<Retained<NSNumber>>;
/// The maximum value for the characteristic if it has a format of "int" or "float".
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(maximumValue))]
#[unsafe(method_family = none)]
pub unsafe fn maximumValue(&self) -> Option<Retained<NSNumber>>;
/// Step value for the characteristic that indicates the minimum step value allowed if it has a format of "int" or "float".
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(stepValue))]
#[unsafe(method_family = none)]
pub unsafe fn stepValue(&self) -> Option<Retained<NSNumber>>;
/// Max length value for the characteristic that indicates the maximum number of UTF-8 characters allowed if it has a format of "string".
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(maxLength))]
#[unsafe(method_family = none)]
pub unsafe fn maxLength(&self) -> Option<Retained<NSNumber>>;
/// The format of the value. Refer to HMCharacteristicMetadataFormat constants for supported units.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(format))]
#[unsafe(method_family = none)]
pub unsafe fn format(&self) -> Option<Retained<NSString>>;
/// The units of the value. Refer to HMCharacteristicMetadataUnits constants for supported units.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(units))]
#[unsafe(method_family = none)]
pub unsafe fn units(&self) -> Option<Retained<NSString>>;
/// Manufacturer provided description for the characteristic to present to the user.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(manufacturerDescription))]
#[unsafe(method_family = none)]
pub unsafe fn manufacturerDescription(&self) -> Option<Retained<NSString>>;
/// The subset of valid values supported by the characteristic when the format is unsigned integral type.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(validValues))]
#[unsafe(method_family = none)]
pub unsafe fn validValues(&self) -> Option<Retained<NSArray<NSNumber>>>;
);
}
/// Methods declared on superclass `NSObject`.
impl HMCharacteristicMetadata {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern "C" {
/// Describes that the value format is boolean.
///
///
/// The value is an NSNumber containing the boolean value.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatbool?language=objc)
pub static HMCharacteristicMetadataFormatBool: &'static NSString;
}
extern "C" {
/// Describes that the value format is an integer.
///
///
/// The value is an NSNumber containing a signed 32-bit integer with a range [-2147483648, 2147483647].
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatint?language=objc)
pub static HMCharacteristicMetadataFormatInt: &'static NSString;
}
extern "C" {
/// Describes that the value format is a float.
///
///
/// The value is an NSNumber containing a 32-bit float.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatfloat?language=objc)
pub static HMCharacteristicMetadataFormatFloat: &'static NSString;
}
extern "C" {
/// Describes that the value format is a string.
///
///
/// The value is an NSString.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatstring?language=objc)
pub static HMCharacteristicMetadataFormatString: &'static NSString;
}
extern "C" {
/// Describes that the value format is an array.
///
///
/// The value is an NSArray.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatarray?language=objc)
pub static HMCharacteristicMetadataFormatArray: &'static NSString;
}
extern "C" {
/// Describes that the value format is a dictionary.
///
///
/// The value is an NSDictionary.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatdictionary?language=objc)
pub static HMCharacteristicMetadataFormatDictionary: &'static NSString;
}
extern "C" {
/// Describes that the value format is an unsigned 8-bit integer.
///
///
/// The value is an NSNumber containing an unsigned 8-bit integer with a range [0, 255].
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint8?language=objc)
pub static HMCharacteristicMetadataFormatUInt8: &'static NSString;
}
extern "C" {
/// Describes that the value format is an unsigned 16-bit integer.
///
///
/// The value is an NSNumber containing an unsigned 16-bit integer with a range [0, 65535].
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint16?language=objc)
pub static HMCharacteristicMetadataFormatUInt16: &'static NSString;
}
extern "C" {
/// Describes that the value format is an unsigned 32-bit integer.
///
///
/// The value is an NSNumber containing an unsigned 32-bit integer with a range [0, 4294967295].
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint32?language=objc)
pub static HMCharacteristicMetadataFormatUInt32: &'static NSString;
}
extern "C" {
/// Describes that the value format is an unsigned 64-bit integer.
///
///
/// The value is an NSNumber containing an unsigned 64-bit integer with a range [0, 18446744073709551615].
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint64?language=objc)
pub static HMCharacteristicMetadataFormatUInt64: &'static NSString;
}
extern "C" {
/// Describes that the value format is a data blob.
///
///
/// The value is an NSData containing the bytes of data.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatdata?language=objc)
pub static HMCharacteristicMetadataFormatData: &'static NSString;
}
extern "C" {
/// Describes that the value format is a TLV8.
///
///
/// The value is an NSData containing a set of one or more TLV8's, which are packed type-length-value items with an 8-bit type, 8-bit length, and N-byte value.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformattlv8?language=objc)
pub static HMCharacteristicMetadataFormatTLV8: &'static NSString;
}
extern "C" {
/// Describes that the unit of the characteristic is in Celsius.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitscelsius?language=objc)
pub static HMCharacteristicMetadataUnitsCelsius: &'static NSString;
}
extern "C" {
/// Describes that the unit of the characteristic is in Fahrenheit.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsfahrenheit?language=objc)
pub static HMCharacteristicMetadataUnitsFahrenheit: &'static NSString;
}
extern "C" {
/// Describes that the unit of the characteristic is a percentage.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitspercentage?language=objc)
pub static HMCharacteristicMetadataUnitsPercentage: &'static NSString;
}
extern "C" {
/// Describes that the unit of the characteristic is arc degree.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsarcdegree?language=objc)
pub static HMCharacteristicMetadataUnitsArcDegree: &'static NSString;
}
extern "C" {
/// Describes that the unit of the characteristic is seconds.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsseconds?language=objc)
pub static HMCharacteristicMetadataUnitsSeconds: &'static NSString;
}
extern "C" {
/// Describes that the unit of the characteristic is Lux (illuminance).
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitslux?language=objc)
pub static HMCharacteristicMetadataUnitsLux: &'static NSString;
}
extern "C" {
/// Describes that the unit of the characteristic is parts per million.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitspartspermillion?language=objc)
pub static HMCharacteristicMetadataUnitsPartsPerMillion: &'static NSString;
}
extern "C" {
/// Describes that the unit of the characteristic is micrograms per cubic meter.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsmicrogramspercubicmeter?language=objc)
pub static HMCharacteristicMetadataUnitsMicrogramsPerCubicMeter: &'static NSString;
}