提交 f30edf2d 编写于 作者: Y Yangys

Update Table

Signed-off-by: NYangys <yangyousheng@huawei.com>
上级 2ae23693
......@@ -114,9 +114,9 @@ ethernet.setIfaceConfig("eth0", {
dnsServers: "1.1.1.1",
domain: "2.2.2.2"
}).then(() => {
console.log("setIfaceConfig promiss ok ");
console.log("setIfaceConfig promise ok ");
}).catch(error => {
console.log("setIfaceConfig promiss error = " + JSON.stringify(error));
console.log("setIfaceConfig promise error = " + JSON.stringify(error));
});
```
......@@ -207,15 +207,15 @@ getIfaceConfig(iface: string): Promise\<InterfaceConfiguration>
```js
ethernet.getIfaceConfig("eth0").then((data) => {
console.log("getIfaceConfig promiss mode = " + JSON.stringify(data.mode));
console.log("getIfaceConfig promiss ipAddr = " + JSON.stringify(data.ipAddr));
console.log("getIfaceConfig promiss route = " + JSON.stringify(data.route));
console.log("getIfaceConfig promiss gateway = " + JSON.stringify(data.gateway));
console.log("getIfaceConfig promiss netMask = " + JSON.stringify(data.netMask));
console.log("getIfaceConfig promiss dnsServers = " + JSON.stringify(data.dnsServers));
console.log("getIfaceConfig promiss domain = " + JSON.stringify(data.domain));
console.log("getIfaceConfig promise mode = " + JSON.stringify(data.mode));
console.log("getIfaceConfig promise ipAddr = " + JSON.stringify(data.ipAddr));
console.log("getIfaceConfig promise route = " + JSON.stringify(data.route));
console.log("getIfaceConfig promise gateway = " + JSON.stringify(data.gateway));
console.log("getIfaceConfig promise netMask = " + JSON.stringify(data.netMask));
console.log("getIfaceConfig promise dnsServers = " + JSON.stringify(data.dnsServers));
console.log("getIfaceConfig promise domain = " + JSON.stringify(data.domain));
}).catch(error => {
console.log("getIfaceConfig promiss error = " + JSON.stringify(error));
console.log("getIfaceConfig promise error = " + JSON.stringify(error));
});
```
......@@ -300,9 +300,9 @@ isIfaceActive(iface: string): Promise\<number>
```js
ethernet.isIfaceActive("eth0").then((data) => {
console.log("isIfaceActive promiss = " + JSON.stringify(data));
console.log("isIfaceActive promise = " + JSON.stringify(data));
}).catch(error => {
console.log("isIfaceActive promiss error = " + JSON.stringify(error));
console.log("isIfaceActive promise error = " + JSON.stringify(error));
});
```
......@@ -377,12 +377,12 @@ getAllActiveIfaces(): Promise\<Array\<string>>
```js
ethernet.getAllActiveIfaces().then((data) => {
console.log("getAllActiveIfaces promiss data.length = " + JSON.stringify(data.length));
console.log("getAllActiveIfaces promise data.length = " + JSON.stringify(data.length));
for (let i = 0; i < data.length; i++) {
console.log("getAllActiveIfaces promiss = " + JSON.stringify(data[i]));
console.log("getAllActiveIfaces promise = " + JSON.stringify(data[i]));
}
}).catch(error => {
console.log("getAllActiveIfaces promiss error = " + JSON.stringify(error));
console.log("getAllActiveIfaces promise error = " + JSON.stringify(error));
});
```
......
......@@ -23,7 +23,7 @@ fetch(Object): void
**系统能力:** SystemCapability.Communication.NetStack
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| url | string | 是 | 资源地址。 |
| data | string \| Object | 否 | 请求的参数,可选类型是字符串或者json对象。详见表 data与Content-Type关系。 |
......
......@@ -31,7 +31,7 @@ getType(Object): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| success | Function | 否 | 接口调用成功的回调函数,返回值为[NetworkResponse](#networkresponse) |
| fail | Function | 否 | 接口调用失败的回调函数。 |
......@@ -71,7 +71,7 @@ subscribe(Object): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| success | Function | 否 | 网络发生变化的回调函数,返回值为[NetworkResponse](#networkresponse) |
| fail | Function | 否 | 接口调用失败的回调函数。 |
......
......@@ -99,7 +99,7 @@ connect(url: string, callback: AsyncCallback\<boolean\>): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------ | ---- | ---------------------------- |
| url | string | 是 | 建立WebSocket连接的URL地址。 |
| callback | AsyncCallback\<boolean\> | 是 | 回调函数。 |
......@@ -138,7 +138,7 @@ connect(url: string, options: WebSocketRequestOptions, callback: AsyncCallback\<
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------ | ---- | ------------------------------------------------------- |
| url | string | 是 | 建立WebSocket连接的URL地址。 |
| options | WebSocketRequestOptions | 是 | 参考[WebSocketRequestOptions](#websocketrequestoptions)。 |
......@@ -183,7 +183,7 @@ connect(url: string, options?: WebSocketRequestOptions): Promise\<boolean\>
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ----------------------- | ---- | ------------------------------------------------------- |
| url | string | 是 | 建立WebSocket连接的URL地址。 |
| options | WebSocketRequestOptions | 否 | 参考[WebSocketRequestOptions](#websocketrequestoptions)。 |
......@@ -227,7 +227,7 @@ send(data: string | ArrayBuffer, callback: AsyncCallback\<boolean\>): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------ | ---- | ------------ |
| data | string \| ArrayBuffer | 是 | 发送的数据。<br>API 6及更早版本仅支持string类型。API 8起同时支持string和ArrayBuffer类型。 |
| callback | AsyncCallback\<boolean\> | 是 | 回调函数。 |
......@@ -268,7 +268,7 @@ send(data: string | ArrayBuffer): Promise\<boolean\>
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------------ |
| data | string \| ArrayBuffer | 是 | 发送的数据。<br>API 6及更早版本仅支持string类型。API 8起同时支持string和ArrayBuffer类型。 |
......@@ -313,7 +313,7 @@ close(callback: AsyncCallback\<boolean\>): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------ | ---- | ---------- |
| callback | AsyncCallback\<boolean\> | 是 | 回调函数。 |
......@@ -351,7 +351,7 @@ close(options: WebSocketCloseOptions, callback: AsyncCallback\<boolean\>): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------ | ---- | ----------------------------------------------------- |
| options | WebSocketCloseOptions | 是 | 参考[WebSocketCloseOptions](#websocketcloseoptions)。 |
| callback | AsyncCallback\<boolean\> | 是 | 回调函数。 |
......@@ -393,7 +393,7 @@ close(options?: WebSocketCloseOptions): Promise\<boolean\>
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------- | --------------------- | ---- | ----------------------------------------------------- |
| options | WebSocketCloseOptions | 否 | 参考[WebSocketCloseOptions](#websocketcloseoptions)。 |
......@@ -437,7 +437,7 @@ on(type: 'open', callback: AsyncCallback\<Object\>): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ----------------------------- |
| type | string | 是 | 'open':WebSocket的打开事件。 |
| callback | AsyncCallback\<Object\> | 是 | 回调函数。 |
......@@ -466,7 +466,7 @@ off(type: 'open', callback?: AsyncCallback\<Object\>): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ----------------------------- |
| type | string | 是 | 'open':WebSocket的打开事件。 |
| callback | AsyncCallback\<Object\> | 否 | 回调函数。 |
......@@ -497,7 +497,7 @@ on(type: 'message', callback: AsyncCallback\<string | ArrayBuffer\>): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | -------------------------------------------- |
| type | string | 是 | 'message':WebSocket的接收到服务器消息事件。 |
| callback | AsyncCallback\<string \| ArrayBuffer <sup>8+</sup>\> | 是 | 回调函数。 |
......@@ -526,7 +526,7 @@ off(type: 'message', callback?: AsyncCallback\<string | ArrayBuffer\>): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------------- | ---- | -------------------------------------------- |
| type | string | 是 | 'message':WebSocket的接收到服务器消息事件。 |
| callback | AsyncCallback\<string \|ArrayBuffer <sup>8+</sup>\> | 否 | 回调函数。 |
......@@ -549,7 +549,7 @@ on(type: 'close', callback: AsyncCallback\<{ code: number, reason: string }\>):
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------------- | ---- | ------------------------------ |
| type | string | 是 | 'close':WebSocket的关闭事件。 |
| callback | AsyncCallback\<{ code: number, reason: string }\> | 是 | 回调函数。<br>close:close错误码,reason:错误码说明 |
......@@ -577,7 +577,7 @@ off(type: 'close', callback?: AsyncCallback\<{ code: number, reason: string }\>)
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------------- | ---- | ------------------------------ |
| type | string | 是 | 'close':WebSocket的关闭事件。 |
| callback | AsyncCallback\<{ code: number, reason: string }\> | 否 | 回调函数。<br>close:close错误码,reason:错误码说明 |
......@@ -600,7 +600,7 @@ on(type: 'error', callback: ErrorCallback): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------- | ---- | ------------------------------- |
| type | string | 是 | 'error':WebSocket的Error事件。 |
| callback | ErrorCallback | 是 | 回调函数。 |
......@@ -628,7 +628,7 @@ off(type: 'error', callback?: ErrorCallback): void
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------- | ---- | ------------------------------- |
| type | string | 是 | 'error':WebSocket的Error事件。 |
| callback | ErrorCallback | 否 | 回调函数。 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册