未验证 提交 4507b375 编写于 作者: O openharmony_ci 提交者: Gitee

!21014 fix:Document Format refresh

Merge pull request !21014 from 罗巍/master
...@@ -137,7 +137,7 @@ hasRight(deviceName: string): boolean ...@@ -137,7 +137,7 @@ hasRight(deviceName: string): boolean
**示例:** **示例:**
```js ```js
let devicesName="1-1"; let devicesName= "1-1";
let bool = usb.hasRight(devicesName); let bool = usb.hasRight(devicesName);
console.log(bool); console.log(bool);
``` ```
...@@ -165,7 +165,7 @@ requestRight(deviceName: string): Promise<boolean> ...@@ -165,7 +165,7 @@ requestRight(deviceName: string): Promise<boolean>
**示例:** **示例:**
```js ```js
let devicesName="1-1"; let devicesName= "1-1";
usb.requestRight(devicesName).then((ret) => { usb.requestRight(devicesName).then((ret) => {
console.log(`requestRight = ${ret}`); console.log(`requestRight = ${ret}`);
}); });
...@@ -375,7 +375,14 @@ controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout ?: ...@@ -375,7 +375,14 @@ controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout ?:
**示例:** **示例:**
```js ```js
let param = new usb.USBControlParams(); let param = {
request: 0,
reqType: 0,
target:0,
value: 0,
index: 0,
data: null
};
usb.controlTransfer(devicepipe, param).then((ret) => { usb.controlTransfer(devicepipe, param).then((ret) => {
console.log(`controlTransfer = ${ret}`); console.log(`controlTransfer = ${ret}`);
}) })
...@@ -500,7 +507,7 @@ usbFunctionsToString(funcs: FunctionType): string ...@@ -500,7 +507,7 @@ usbFunctionsToString(funcs: FunctionType): string
**示例:** **示例:**
```js ```js
let funcs = usb.ACM | usb.ECM; let funcs = usb.FunctionType.ACM | usb.FunctionType.ECM;
let ret = usb.usbFunctionsToString(funcs); let ret = usb.usbFunctionsToString(funcs);
``` ```
...@@ -529,8 +536,12 @@ setCurrentFunctions(funcs: FunctionType): Promise\<boolean\> ...@@ -529,8 +536,12 @@ setCurrentFunctions(funcs: FunctionType): Promise\<boolean\>
**示例:** **示例:**
```js ```js
let funcs = usb.HDC; let funcs = usb.FunctionType.HDC;
let ret = usb.setCurrentFunctions(funcs); usb.setCurrentFunctions(funcs).then(() => {
console.info('usb setCurrentFunctions successfully.');
}).catch(err => {
console.error('usb setCurrentFunctions failed: ' + err.code + ' message: ' + err.message);
});
``` ```
## usb.getCurrentFunctions<sup>9+</sup> ## usb.getCurrentFunctions<sup>9+</sup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册