Skip to content

Commit

Permalink
Merge pull request #51 from GoogleChromeLabs/m121
Browse files Browse the repository at this point in the history
M121 (v1.3.8)
  • Loading branch information
cyhuang1230 authored Dec 21, 2023
2 parents 9f54383 + 459c4e7 commit 5164611
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 7 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down Expand Up @@ -562,3 +562,8 @@ Source:
| runBluetoothDiscoveryRoutine | () => Promise\<Routine\> | `os.diagnostics` | 1.3.7 |
| runBluetoothScanningRoutine | (params: BluetoothScanningRoutineParams) => Promise\<Routine\> | `os.diagnostics`, `os.bluetooth_peripherals_info` | 1.3.7 |
| runBluetoothPairingRoutine | (params: BluetoothPairingRoutineParams) => Promise\<Routine\> | `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\<Routine\> | `os.diagnostics` | 1.3.8 |
4 changes: 4 additions & 0 deletions src/__tests__/dpsl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,10 @@ describe('dpsl.diagnostics tests', () => {
.runBluetoothPairingRoutine,
'chromeOsRoutineFunction': 'runBluetoothPairingRoutine',
},
{
'dpslRoutineFunction': dpsl.diagnostics.fan.runFanRoutine,
'chromeOsRoutineFunction': 'runFanRoutine',
},
];

testCases.forEach((testCase) => {
Expand Down
27 changes: 27 additions & 0 deletions src/diagnostics_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<!Routine> }
* @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.
*/
Expand Down Expand Up @@ -749,6 +770,12 @@ class DPSLDiagnosticsManager {
* @public
*/
this.bluetooth = new BluetoothManager();

/**
* @type {!FanManager}
* @public
*/
this.fan = new FanManager();
}

/**
Expand Down

0 comments on commit 5164611

Please sign in to comment.