-
Notifications
You must be signed in to change notification settings - Fork 0
/
IOPSKeysPrivate.h
292 lines (256 loc) · 10.8 KB
/
IOPSKeysPrivate.h
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
/*
* Copyright (c) 2002-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOPSKEYSPRIVATE_H_
#define _IOPSKEYSPRIVATE_H_
/*!
* @define kAppleRawCurrentCapacityKey
* @abstract CFDictionary key for the current power source's raw capacity, unaltered by any smoothing algorithms.
*
* @discussion
* <ul>
* <li> Apple-defined power sources will publish this key in units of percent or mAh.
* <li> The power source's software may specify the units for this key.
* The units must be consistent for all capacities reported by this power source.
* The power source will usually define this number in units of percent, or mAh.
* <li> Clients may derive a raw percentage of power source battery remaining by dividing "AppleRawCurrentCapacity" by "Max Capacity"
* <li> Type CFNumber kCFNumberIntType (signed integer)
* </ul>
*/
#ifndef kAppleRawCurrentCapacityKey
#define kAppleRawCurrentCapacityKey "AppleRawCurrentCapacity"
#endif
/*
* kIOPSVendorIDSourceKey holds CFNumberRef data. Used to differentiate
* between various vendor id sources.
*/
#define kIOPSVendorIDSourceKey "Vendor ID Source"
/* Internal values for kIOPSTypeKey */
#define kIOPSAccessoryType "Accessory Source"
#if TARGET_OS_IPHONE
/* kIOPSRawExternalConnectivityKey specifies if device is receiving power from
* an external power source. In some cases, kIOPSPowerSourceStateKey may not
* show the external power source, if that external source is a battery
*/
#define kIOPSRawExternalConnectivityKey "Raw External Connected"
/* kIOPSShowChargingUIKey specifies whether the UI should treat the device
* as charging or not. This represents whether the device is connected to
* any external power source capable of charging the device's battery. This is
* differentiated from kIOPSRawExternalConnectivityKey, in that the external
* power source may not be currently providing power.
*/
#define kIOPSShowChargingUIKey "Show Charging UI"
/*
* kIOPSAccessoryIdentifierKey -
* Accessory Identifier key. This key holds identifier key for each accessory power source.
* This could be different for each part of an accessory with multiple parts.
*
* Holds a CFStringRef
*/
#define kIOPSAccessoryIdentifierKey "Accessory Identifier"
/*
* kIOPSGroupIdentifierKey -
*
* Accessories with multiple parts report each part as a separate power source to powerd.
* These individual parts of the accessory will have the same 'Group Identifier'.
*
* Holds a CFStringRef
*/
#define kIOPSGroupIdentifierKey "Group Identifier"
/*
* kIOPSPartNameKey -
* User friendly name for each part of an accessory.
*
* Accessories with multiple parts report each part as a separate power source to powerd.
* 'kIOPSPartNameKey' will hold a user friendly name for each of these parts.
* 'kIOPSNameKey' will be common for all the parts of the accessory
*
* Holds a CFStringRef
*/
#define kIOPSPartNameKey "Part Name"
/*
* kIOPSPartIdentifierKey -
* Identity for each part of an accessory.
*
* Accessories with multiple parts report each part as a separate power source to powerd.
* Unlike kIOPSAccessoryIdentifierKey, which carries identification numbers like UUID, serial numbers etc.,
* kIOPSPartIdentifierKey is used to hold the identity of the part in relation to other parts of the
* accessory.
*
* Holds a CFStringRef, with the possible values defined below.
*/
#define kIOPSPartIdentifierKey "Part Identifier"
/*
* Possible values for Part Identifier(kIOPSPartIdentifierKey)
*/
#define kIOPSPartIdentifierLeft "Left"
#define kIOPSPartIdentifierRight "Right"
#define kIOPSPartIdentifierCase "Case"
#define kIOPSPartIdentifierSingle "Single"
#define kIOPSPartIdentifierOther "Other"
/* Internal transport types */
#define kIOPSAIDTransportType "AID"
#define kIOPSTransportTypeBluetooth "Bluetooth"
#define kIOPSTransportTypeBluetoothLowEnergy "Bluetooth LE"
/*
* Invalid ProductId & VendorId values are used in cases when there are no
* product/vendor ids assigned. In such cases, kIOPSNameKey can be used to
* identify the power source.
*/
#define kIOPSInvalidProductID 0xffff
#define kIOPSInvalidVendorID 0xffff
/*
* kIOPSAccessoryCategoryKey -
* Classifies the accessory in to one of the pre-defined categories
*
* Holds a CFStringRef, with the possible values defined below.
*/
#define kIOPSAccessoryCategoryKey "Accessory Category"
/*
* Possible Categories of accessories(kIOPSAccessoryCategoryKey)
*/
#define kIOPSAccessoryCategorySpeaker "Speaker"
#define kIOPSAccessoryCategoryHeadphone "Headphone"
#define kIOPSAccessoryCategoryWatch "Watch"
#define kIOPSAccessoryCategoryBatteryCase "Battery Case"
#define kIOPSAccessoryCategoryKeyboard "Keyboard"
#define kIOPSAccessoryCategoryUnknown "Unknown"
#endif
/*
* Power adapter related internal keys
*/
/*!
* @define kIOPSPowerAdapterSerialStringKey
*
* @abstract The power adapter's serial string.
* The value associated with this key is a CFString value
*
* @discussion This key may be present in the dictionary returned from
* @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link
* This key might not be defined in the adapter details dictionary.
*/
#define kIOPSPowerAdapterSerialStringKey "SerialString"
/*!
* @define kIOPSPowerAdapterNameKey
*
* @abstract The power adapter's name.
* The value associated with this key is a CFString value
*
* @discussion This key may be present in the dictionary returned from
* @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link
* This key might not be defined in the adapter details dictionary.
*/
#define kIOPSPowerAdapterNameKey "Name"
/*!
* @define kIOPSPowerAdapterNameKey
*
* @abstract The power adapter's manufacturer's id.
* The value associated with this key is a CFNumber kCFNumberIntType integer value
*
* @discussion This key may be present in the dictionary returned from
* @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link
* This key might not be defined in the adapter details dictionary.
*/
#define kIOPSPowerAdapterManufacturerIDKey "Manufacturer"
/*!
* @define kIOPSPowerAdapterHardwareVersionKey
*
* @abstract The power adapter's hardware version.
* The value associated with this key is a CFString value
*
* @discussion This key may be present in the dictionary returned from
* @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link
* This key might not be defined in the adapter details dictionary.
*/
#define kIOPSPowerAdapterHardwareVersionKey "HwVersion"
/*!
* @define kIOPSPowerAdapterFirmwareVersionKey
*
* @abstract The power adapter's firmware version.
* The value associated with this key is a CFString value
*
* @discussion This key may be present in the dictionary returned from
* @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link
* This key might not be defined in the adapter details dictionary.
*/
#define kIOPSPowerAdapterFirmwareVersionKey "FwVersion"
/*
* Battery case related internal keys
*/
/*!
* @define kIOPSAppleBatteryCaseCumulativeCurrentKey
* @abstract CFDictionary key for a battery case's cumulative current flow
* through its battery since its last reset.
*
* @discussion
* <ul>
* <li> Apple-defined power sources may publish this key in units amp-seconds.
* <li> Type CFNumber kCFNumberIntType (signed integer)
* </ul>
*/
#define kIOPSAppleBatteryCaseCumulativeCurrentKey "Battery Case Cumulative Current"
/*!
* @define kAppleBatteryCaseAvailableCurrentKey
* @abstract CFDictionary key for a battery case's available current for host.
*
* @discussion
* <ul>
* <li> Apple-defined power sources will publish this key in units mA.
* <li> Type CFNumber kCFNumberIntType (signed integer)
* </ul>
*/
#define kIOPSAppleBatteryCaseAvailableCurrentKey "Battery Case Available Current"
/*!
* @define kIOPSAppleBatteryCaseChemIDKey
* @abstract CFDictionary key for a battery case's battery's Chem ID.
*
* @discussion
* <ul>
* <li> Apple-defined power sources may publish this key.
* <li> Type CFNumber kCFNumberIntType (integer)
* <li> Note that this value does not have any physical unit.
* </ul>
*/
#define kIOPSAppleBatteryCaseChemIDKey "Battery Case Chem ID"
/*!
* @define kIOPSAppleBatteryCaseCommandSetCurrentLimitBackOffKey
*
* @abstract Tell the battery case of a PMU imposed back off in current limit.
* @discussion
* <ul>
* <li> The matching argument should be a CFNumber of kCFNumberIntType
* <li> specifying the amount the PMU has reduced incoming current limit in mA.
* </ul>
*/
#define kIOPSAppleBatteryCaseCommandSetCurrentLimitBackOffKey "Current Limit Back Off"
/*!
* @define kIOPSAppleBatteryCaseCommandEnableChargingKey
*
* @abstract Tell the battery case of whether it should enable its boost to enable charging.
* @discussion
* <ul>
* <li>The matching argument should be a CFBooleanRef where kCFBooleanTrue enables charging and
* <li>kCFBooleanFalse diables it.
* </ul>
*/
#define kIOPSAppleBatteryCaseCommandEnableChargingKey "Enable Charging"
#endif /* defined(_IOPSKEYSPRIVATE_H_) */