diff --git a/package.json b/package.json index b454fef..74a3afd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cros-dpsl-js", - "version": "1.3.7", + "version": "1.3.8", "description": "Diagnostics processor support library for Chrome OS", "main": "./src/dpsl.js", "exports": "./src/dpsl.js", diff --git a/src/README.md b/src/README.md index 01c0912..e73187a 100644 --- a/src/README.md +++ b/src/README.md @@ -428,7 +428,7 @@ Source: | refreshRate | number | Refresh rate | | manufacturer | string | Three letter manufacturer ID | | modelId | number | Manufacturer product code | -| serialNumber | number | 32 bits serial number | +| serialNumber | number | 32 bits serial number. Starting from M120, this field is always empty due to privacy requirements. | | manufactureWeek | number | Week of manufacture | | manufactureYear | number | Year of manufacture | | edidVersion | string | EDID version | @@ -445,7 +445,7 @@ Source: | refreshRate | number | Refresh rate | | manufacturer | string | Three letter manufacturer ID | | modelId | number | Manufacturer product code | -| serialNumber | number | 32 bits serial number | +| serialNumber | number | 32 bits serial number. Starting from M120, this field is always empty due to privacy requirements. | | manufactureWeek | number | Week of manufacture | | manufactureYear | number | Year of manufacture | | edidVersion | string | EDID version | @@ -562,3 +562,8 @@ Source: | runBluetoothDiscoveryRoutine | () => Promise\ | `os.diagnostics` | 1.3.7 | | runBluetoothScanningRoutine | (params: BluetoothScanningRoutineParams) => Promise\ | `os.diagnostics`, `os.bluetooth_peripherals_info` | 1.3.7 | | runBluetoothPairingRoutine | (params: BluetoothPairingRoutineParams) => Promise\ | `os.diagnostics`, `os.bluetooth_peripherals_info` | 1.3.7 | + +### dpsl.diagnostics.fan.* +| Function Name | Definition | Permission needed to access | Released in `dpsl` version | +------------ | ------------- | ------------- | ------------- | +| runFanRoutine | () => Promise\ | `os.diagnostics` | 1.3.8 | diff --git a/src/__tests__/dpsl.test.js b/src/__tests__/dpsl.test.js index 4951e35..725810e 100644 --- a/src/__tests__/dpsl.test.js +++ b/src/__tests__/dpsl.test.js @@ -683,6 +683,10 @@ describe('dpsl.diagnostics tests', () => { .runBluetoothPairingRoutine, 'chromeOsRoutineFunction': 'runBluetoothPairingRoutine', }, + { + 'dpslRoutineFunction': dpsl.diagnostics.fan.runFanRoutine, + 'chromeOsRoutineFunction': 'runFanRoutine', + }, ]; testCases.forEach((testCase) => { diff --git a/src/diagnostics_manager.js b/src/diagnostics_manager.js index 028ee77..301a94b 100644 --- a/src/diagnostics_manager.js +++ b/src/diagnostics_manager.js @@ -664,6 +664,27 @@ class BluetoothManager { } } +/** + * Diagnostics fan Manager for dpsl.diagnostics.fan.* APIs. + */ +class FanManager { + /** + * Runs fan test. This routine checks whether the fan can be controlled. + * @return { !Promise } + * @public + */ + async runFanRoutine() { + const functionName = 'runFanRoutine'; + if (!isSupported(functionName)) { + throw new MethodNotFoundError(API_NAME, functionName, + /* chromeVersion */ 121); + } + + return chrome.os.diagnostics.runFanRoutine().then( + (response) => new Routine(response.id)); + } +} + /** * DPSL Diagnostics Manager for dpsl.diagnostics.* APIs. */ @@ -749,6 +770,12 @@ class DPSLDiagnosticsManager { * @public */ this.bluetooth = new BluetoothManager(); + + /** + * @type {!FanManager} + * @public + */ + this.fan = new FanManager(); } /**