# enableGatewayProxy ^9.4.0
开启设备的网关代理(开启之后,设备会云端在线,可通过云端接口控制设备)
# 请求参数
| Prop | Type | Required | Default | Description | 
|---|---|---|---|---|
param |  Object |  Y |  {}属性: mac:{Type: String, Default: N/A, Description: 蓝牙mac地址 } applianceId:{Type: String, Default: N/A, Description: 设备id,(可以从getDeviceInfo中读取deviceId<) gateWayProxyType:Default: 0, Description: (^9.4.0) 0:无需代理,1:本地lua 代理,2:(^9.4.0)云端websocket代理 3:(^9.4.0)本地物模型代理 } optPermissionType:Default: 0, Description: (^10.1.0) 申请权限,2:强制申请权限(不传默认0) } }  |  请求参数 | 
# 接口调用示例
let param={
    mac:"xxxx", //蓝牙mac地址,从getDeviceInfo中读取mac
    applianceId:"xxx", //设备id, getDeviceInfo中读取deviceId
    gateWayProxyType: 0, // 0:无需代理 1:本地lua 代理 2:云端websocket代理  3:本地物模型代理
    optPermissionType: 0  // 0:申请权限,2:强制申请权限(不传默认0)}
}
this.$bridge
    .enableGatewayProxy(params)
    .then(res => {    
    this.$alert(res)
    })
    .catch(err => {
    this.$toast(err)
    })
 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 返回参数
通过监听 receiveMessageFromApp 获取
成功时返回
| Prop | Type | Default | Description | 
|---|---|---|---|
messageType |  String |  receiveProxyEnable |  H5用来判断消息类型 | 
messageBody |  String |  0/1/2/3/4 |  
TIP
该接口基于mSmart 协议,底层由singleBlueToothModule单蓝牙支持