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 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526
|
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Use the <code>chrome.os.telemetry</code> API to get telemetry data.
[implemented_in = "chrome/browser/chromeos/extensions/telemetry/api/telemetry/telemetry_api.h"]
namespace os.telemetry {
// Note: Please update documentation as well when this interface is changed.
// The documentation lives here: //docs/telemetry_extension/api_overview.md.
// LINT.IfChange
dictionary AudioInputNodeInfo {
double? id;
DOMString? name;
DOMString? deviceName;
boolean? active;
long? nodeGain;
};
dictionary AudioOutputNodeInfo {
double? id;
DOMString? name;
DOMString? deviceName;
boolean? active;
long? nodeVolume;
};
dictionary AudioInfo {
boolean? outputMute;
boolean? inputMute;
long? underruns;
long? severeUnderruns;
AudioOutputNodeInfo[] outputNodes;
AudioInputNodeInfo[] inputNodes;
};
callback AudioInfoCallback = void (AudioInfo audioInfo);
dictionary BatteryInfo {
double? cycleCount;
double? voltageNow;
DOMString? vendor;
DOMString? serialNumber;
double? chargeFullDesign;
double? chargeFull;
double? voltageMinDesign;
DOMString? modelName;
double? chargeNow;
double? currentNow;
DOMString? technology;
DOMString? status;
DOMString? manufactureDate;
double? temperature;
};
callback BatteryInfoCallback = void (BatteryInfo batteryInfo);
dictionary NonRemovableBlockDeviceInfo {
DOMString? name;
DOMString? type;
double? size;
};
dictionary NonRemovableBlockDeviceInfoResponse {
NonRemovableBlockDeviceInfo[] deviceInfos;
};
callback NonRemovableBlockDevicesInfoCallback = void (
NonRemovableBlockDeviceInfoResponse deviceInfoResponse);
enum CpuArchitectureEnum {
unknown,
x86_64,
aarch64,
armv7l
};
dictionary CpuCStateInfo {
// Name of the state.
DOMString? name;
// Time spent in the state since the last reboot, in microseconds.
double? timeInStateSinceLastBootUs;
};
dictionary LogicalCpuInfo {
// The max CPU clock speed in kHz.
long? maxClockSpeedKhz;
// Maximum frequency the CPU is allowed to run at, by policy.
long? scalingMaxFrequencyKhz;
// Current frequency the CPU is running at.
long? scalingCurrentFrequencyKhz;
// Idle time since last boot, in milliseconds.
double? idleTimeMs;
// Information about the logical CPU's time in various C-states.
CpuCStateInfo[] cStates;
// The core number this logical CPU corresponds to.
long? coreId;
};
dictionary PhysicalCpuInfo {
DOMString? modelName;
LogicalCpuInfo[] logicalCpus;
};
dictionary CpuInfo {
long? numTotalThreads;
CpuArchitectureEnum architecture;
PhysicalCpuInfo[] physicalCpus;
};
callback CpuInfoCallback = void (CpuInfo cpuInfo);
// An enumeration of display input type.
enum DisplayInputType {
// Unknown enum value.
unknown,
// Digital input.
digital,
// Analog input.
analog
};
dictionary EmbeddedDisplayInfo {
// Privacy screen is supported or not.
boolean? privacyScreenSupported;
// Privacy screen is enabled or not.
boolean? privacyScreenEnabled;
// Display width in millimeters.
long? displayWidth;
// Display height in millimeters.
long? displayHeight;
// Horizontal resolution.
long? resolutionHorizontal;
// Vertical resolution.
long? resolutionVertical;
// Refresh rate.
double? refreshRate;
// Three letter manufacturer ID.
DOMString? manufacturer;
// Manufacturer product code.
long? modelId;
// 32 bits serial number.
long? serialNumber;
// Week of manufacture.
long? manufactureWeek;
// Year of manufacture.
long? manufactureYear;
// EDID version.
DOMString? edidVersion;
// Digital or analog input.
DisplayInputType inputType;
// Name of display product.
DOMString? displayName;
};
dictionary ExternalDisplayInfo {
// Display width in millimeters.
long? displayWidth;
// Display height in millimeters.
long? displayHeight;
// Horizontal resolution.
long? resolutionHorizontal;
// Vertical resolution.
long? resolutionVertical;
// Refresh rate.
double? refreshRate;
// Three letter manufacturer ID.
DOMString? manufacturer;
// Manufacturer product code.
long? modelId;
// 32 bits serial number.
long? serialNumber;
// Week of manufacture.
long? manufactureWeek;
// Year of manufacture.
long? manufactureYear;
// EDID version.
DOMString? edidVersion;
// Digital or analog input.
DisplayInputType inputType;
// Name of display product.
DOMString? displayName;
};
dictionary DisplayInfo {
// Embedded display info.
EmbeddedDisplayInfo embeddedDisplay;
// External display info.
ExternalDisplayInfo[] externalDisplays;
};
callback DisplayInfoCallback = void (DisplayInfo displayInfo);
dictionary MarketingInfo {
DOMString? marketingName;
};
callback MarketingInfoCallback = void (MarketingInfo marketingInfo);
dictionary MemoryInfo {
long? totalMemoryKiB;
long? freeMemoryKiB;
long? availableMemoryKiB;
double? pageFaultsSinceLastBoot;
};
callback MemoryInfoCallback = void (MemoryInfo cpuInfo);
enum NetworkType {
cellular,
ethernet,
tether,
vpn,
wifi
};
enum NetworkState {
// The network type is available but not yet initialized.
uninitialized,
// The network type is available but disabled or disabling.
disabled,
// The network type is prohibited by policy.
prohibited,
// The network type is available and enabled or enabling, but no network
// connection has been established.
not_connected,
// The network type is available and enabled, and a network connection is in
// progress.
connecting,
// The network is in a portal state.
portal,
// The network is in a connected state, but connectivity is limited.
connected,
// The network is connected and online.
online
};
dictionary NetworkInfo {
NetworkType? type;
NetworkState? state;
DOMString? macAddress;
DOMString? ipv4Address;
DOMString[] ipv6Addresses;
double? signalStrength;
};
dictionary InternetConnectivityInfo {
NetworkInfo[] networks;
};
callback InternetConnectivityInfoCallback = void (
InternetConnectivityInfo networkInfo);
dictionary OemData {
// OEM data. This field used to store battery serial number by some OEMs.
DOMString? oemData;
};
callback OemDataCallback = void (OemData oemData);
dictionary OsVersionInfo {
DOMString? releaseMilestone;
DOMString? buildNumber;
DOMString? patchNumber;
DOMString? releaseChannel;
};
callback OsVersionInfoCallback = void (OsVersionInfo osVersionInfo);
// The info related to usb interfaces.
dictionary UsbBusInterfaceInfo {
// The zero-based number (index) of the interface.
double? interfaceNumber;
// These fields can be used to classify / identify the usb interfaces. See
// the usb.ids database for the values. (https://github.com/gentoo/hwids)
double? classId;
double? subclassId;
double? protocolId;
// The driver used by the device. This is the name of the matched driver
// which is registered in the kernel. See "{kernel root}/drivers/" for the
// list of the built in drivers.
DOMString? driver;
};
// An enumeration of the formats of firmware version in fwpud. See the fwupd
// repo for the values. (https://github.com/fwupd/fwupd)
enum FwupdVersionFormat {
// An unidentified format text string.
plain,
// A single integer version number.
number,
// Two AABB.CCDD version numbers.
pair,
// Microsoft-style AA.BB.CCDD version numbers.
triplet,
// UEFI-style AA.BB.CC.DD version numbers.
quad,
// Binary coded decimal notation.
bcd,
// Intel ME-style bitshifted notation.
intelMe,
// Intel ME-style A.B.CC.DDDD notation.
intelMe2,
// Legacy Microsoft Surface 10b.12b.10b.
surfaceLegacy,
// Microsoft Surface 8b.16b.8b.
surface,
// Dell BIOS BB.CC.DD style.
dellBios,
// Hexadecimal 0xAABCCDD style.
hex
};
// The info related to a firmware version obtained from fwupd.
dictionary FwupdFirmwareVersionInfo {
// The string form of the firmware version.
DOMString? version;
// The format for parsing the version string.
FwupdVersionFormat? version_format;
};
enum UsbVersion {
// Can't determine the usb version.
unknown,
// Usb 1.
usb1,
// Usb 2.
usb2,
// Usb 3.
usb3
};
// An enumeration of the usb spec speed in Mbps.
// Source:
// - https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-usb
// - https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-bus-usb
// - https://en.wikipedia.org/wiki/USB
//
enum UsbSpecSpeed {
// Unknown speed.
unknown,
// Low speed.
n1_5Mbps,
// Full speed.
n12Mbps,
// High Speed.
n480Mbps,
// Super Speed.
n5Gbps,
// Super Speed+.
n10Gbps,
// Super Speed+ Gen 2x2.
n20Gbps
};
// The info related to usb.
dictionary UsbBusInfo {
// These fields can be used to classify / identify the usb devices. See the
// usb.ids database for the values. (https://github.com/gentoo/hwids)
double? classId;
double? subclassId;
double? protocolId;
double? vendorId;
double? productId;
// The usb interfaces under the device. A usb device has at least one
// interface. Each interface may or may not work independently, based on
// each device. This allows a usb device to provide multiple features.
// The interfaces are sorted by the `interface_number` field.
UsbBusInterfaceInfo[] interfaces;
// The firmware version obtained from fwupd.
FwupdFirmwareVersionInfo? fwupdFirmwareVersionInfo;
// The recognized usb version. It may not be the highest USB version
// supported by the hardware.
UsbVersion? version;
// The spec usb speed.
UsbSpecSpeed? spec_speed;
};
dictionary UsbBusDevices {
UsbBusInfo[] devices;
};
callback UsbBusDevicesCallback = void (UsbBusDevices UsbBusDevices);
dictionary VpdInfo {
// Device activate date. Format: YYYY-WW.
DOMString? activateDate;
// Device model name.
DOMString? modelName;
// Device serial number.
DOMString? serialNumber;
// Device SKU number, a.k.a. model number.
DOMString? skuNumber;
};
callback VpdInfoCallback = void (VpdInfo vpdInfo);
dictionary StatefulPartitionInfo {
double? availableSpace;
double? totalSpace;
};
callback StatefulPartitionInfoCallback = void (
StatefulPartitionInfo statefulPartitionInfo);
enum ThermalSensorSource {
unknown,
ec,
sysFs
};
dictionary ThermalSensorInfo {
// Name of the thermal sensor.
DOMString? name;
// Temperature detected by the thermal sensor in celsius.
double? temperatureCelsius;
// Where the thermal sensor is detected from.
ThermalSensorSource? source;
};
dictionary ThermalInfo {
// An array containing all the information retrieved for thermal sensors.
ThermalSensorInfo[] thermalSensors;
};
callback ThermalInfoCallback = void (ThermalInfo thermalInfo);
enum TpmGSCVersion {
not_gsc,
cr50,
ti50
};
dictionary TpmVersion {
// GSC version.
TpmGSCVersion? gscVersion;
// TPM family. We use the TPM 2.0 style encoding, e.g.:
// * TPM 1.2: "1.2" -> 0x312e3200
// * TPM 2.0: "2.0" -> 0x322e3000
long? family;
// TPM spec level.
double? specLevel;
// Manufacturer code.
long? manufacturer;
// TPM model number.
long? tpmModel;
// Firmware version.
double? firmwareVersion;
// Vendor specific information.
DOMString? vendorSpecific;
};
dictionary TpmStatus {
// Whether a TPM is enabled on the system.
boolean? enabled;
// Whether the TPM has been owned.
boolean? owned;
// Whether the owner password is still retained.
boolean? ownerPasswordIsPresent;
};
dictionary TpmDictionaryAttack {
// The current dictionary attack counter value.
long? counter;
// The current dictionary attack counter threshold.
long? threshold;
// Whether the TPM is in some form of dictionary attack lockout.
boolean? lockoutInEffect;
// The number of seconds remaining in the lockout.
long? lockoutSecondsRemaining;
};
dictionary TpmInfo {
// TPM version related information.
TpmVersion version;
// TPM status related information.
TpmStatus status;
// TPM dictionary attack (DA) related information.
TpmDictionaryAttack dictionaryAttack;
};
callback TpmInfoCallback = void (TpmInfo tpmInfo);
interface Functions {
static void getAudioInfo(AudioInfoCallback callback);
static void getBatteryInfo(BatteryInfoCallback callback);
static void getNonRemovableBlockDevicesInfo(
NonRemovableBlockDevicesInfoCallback callback);
static void getCpuInfo(CpuInfoCallback callback);
static void getInternetConnectivityInfo(
InternetConnectivityInfoCallback callback);
static void getMarketingInfo(MarketingInfoCallback callback);
static void getMemoryInfo(MemoryInfoCallback callback);
static void getOemData(OemDataCallback callback);
static void getOsVersionInfo(OsVersionInfoCallback callback);
static void getUsbBusInfo(UsbBusDevicesCallback callback);
static void getVpdInfo(VpdInfoCallback callback);
static void getStatefulPartitionInfo(
StatefulPartitionInfoCallback callback);
static void getTpmInfo(TpmInfoCallback callback);
static void getDisplayInfo(DisplayInfoCallback callback);
static void getThermalInfo(ThermalInfoCallback callback);
};
// LINT.ThenChange(//docs/telemetry_extension/api_overview.md)
// The following is an empty definition, since the IDL compiler only accepts
// comments over valid definitions.
callback EOF = void();
};
|