feat:调整配网接口参数,增加说明文档
This commit is contained in:
parent
1cc4292cbb
commit
d465292fd7
4
env.js
4
env.js
@ -1,7 +1,7 @@
|
||||
// uni版本号
|
||||
export const uniVersion = '1.0.15'
|
||||
export const uniVersion = '1.0.16'
|
||||
// uni构建号
|
||||
export const uniBuildNumber = 16
|
||||
export const uniBuildNumber = 17
|
||||
|
||||
// web版本号
|
||||
export const webVersion = '1.0.1'
|
||||
|
||||
@ -9,10 +9,12 @@ import {searchAndConnectDevice, writeBLECharacteristicValue} from "../uni/basic.
|
||||
* 开始搜索wifi
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
export async function startSearchWiFi(params) {
|
||||
export async function startSearchWiFi(params = {}) {
|
||||
params.connected = typeof params.connected === 'boolean' ? params.connected : false;
|
||||
params.disconnect = typeof params.disconnect === 'boolean' ? params.disconnect : false;
|
||||
const uid = this.accountInfo.uid.toString()
|
||||
// 设置执行账号
|
||||
const result = await this.login(params.uid)
|
||||
const result = await this.login(uid)
|
||||
if (result.code !== Result.Success.code) {
|
||||
return result
|
||||
}
|
||||
|
||||
90
uni.md
90
uni.md
@ -616,7 +616,7 @@ removeBadLock(params)
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {refreshElecInfo} from 'star-cloud-web'
|
||||
import {refreshElecInfo} from 'star-cloud-uni'
|
||||
|
||||
refreshElecInfo(params)
|
||||
```
|
||||
@ -638,7 +638,7 @@ refreshElecInfo(params)
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {refreshColdWaterInfo} from 'star-cloud-web'
|
||||
import {refreshColdWaterInfo} from 'star-cloud-uni'
|
||||
|
||||
refreshColdWaterInfo(params)
|
||||
```
|
||||
@ -660,7 +660,7 @@ refreshColdWaterInfo(params)
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {refreshHotWaterInfo} from 'star-cloud-web'
|
||||
import {refreshHotWaterInfo} from 'star-cloud-uni'
|
||||
|
||||
refreshHotWaterInfo(params)
|
||||
```
|
||||
@ -714,7 +714,7 @@ uni.$on('registerFingerprintConfirm', async data => {
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {registerExtendedProducts} from 'star-cloud-web'
|
||||
import {registerExtendedProducts} from 'star-cloud-uni'
|
||||
|
||||
registerExtendedProducts(params)
|
||||
```
|
||||
@ -773,7 +773,7 @@ registerExtendedProducts(params)
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {registerExtendedProductsCancel} from 'star-cloud-web'
|
||||
import {registerExtendedProductsCancel} from 'star-cloud-uni'
|
||||
|
||||
registerExtendedProductsCancel(params)
|
||||
```
|
||||
@ -794,7 +794,7 @@ registerExtendedProductsCancel(params)
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {getIcCardList} from 'star-cloud-web'
|
||||
import {getIcCardList} from 'star-cloud-uni'
|
||||
|
||||
getIcCardList(params)
|
||||
```
|
||||
@ -824,7 +824,7 @@ getIcCardList(params)
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {getFingerprintList} from 'star-cloud-web'
|
||||
import {getFingerprintList} from 'star-cloud-uni'
|
||||
|
||||
getFingerprintList(params)
|
||||
```
|
||||
@ -854,7 +854,7 @@ getFingerprintList(params)
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {getFaceList} from 'star-cloud-web'
|
||||
import {getFaceList} from 'star-cloud-uni'
|
||||
|
||||
getFaceList(params)
|
||||
```
|
||||
@ -884,7 +884,7 @@ getFaceList(params)
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {getPalmVeinList} from 'star-cloud-web'
|
||||
import {getPalmVeinList} from 'star-cloud-uni'
|
||||
|
||||
getPalmVeinList(params)
|
||||
```
|
||||
@ -914,7 +914,7 @@ getPalmVeinList(params)
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {getRemoteList} from 'star-cloud-web'
|
||||
import {getRemoteList} from 'star-cloud-uni'
|
||||
|
||||
getRemoteList(params)
|
||||
```
|
||||
@ -937,4 +937,74 @@ getRemoteList(params)
|
||||
"pages": 0,
|
||||
"total": 0
|
||||
}
|
||||
```
|
||||
|
||||
# wifi配网
|
||||
|
||||
- 配网时确保锁板亮屏
|
||||
- 确保连接的wifi是2.4GHz的wifi
|
||||
|
||||
## 搜索wifi
|
||||
|
||||
> 搜索大约4秒返回结果
|
||||
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {startSearchWiFi} from 'star-cloud-uni'
|
||||
// 1.选择锁
|
||||
await selectLock(params)
|
||||
// 2.启动搜索wifi()
|
||||
await startSearchWiFi(params)
|
||||
```
|
||||
|
||||
**入参**
|
||||
|
||||
| 参数名称 | 数据类型 | 必须 | 描述 | 默认 |
|
||||
|------------|---------|----|---------------|---------|
|
||||
| connected | boolean | N | 是否已经连接 | `false` | |
|
||||
| disconnect | boolean | N | 应答成功后是否自动断开连接 | `false` | |
|
||||
|
||||
**返回**
|
||||
|
||||
> 通过事件监听搜索结果的返回值
|
||||
|
||||
```js
|
||||
// wifi搜索结果事件回调
|
||||
uni.$on('searchWiFiResult', async data => {
|
||||
// TODO
|
||||
})
|
||||
```
|
||||
|
||||
## 连接wifi
|
||||
|
||||
**调用方法**
|
||||
|
||||
```javascript
|
||||
import {connectWiFi} from 'star-cloud-uni'
|
||||
// 1.选择锁
|
||||
await selectLock(params)
|
||||
// 2.连接wifi
|
||||
const params = {
|
||||
ssid: 'wifi昵称',
|
||||
password: 'wifi密码',
|
||||
}
|
||||
await connectWiFi(params)
|
||||
```
|
||||
|
||||
**入参**
|
||||
|
||||
| 参数名称 | 数据类型 | 必须 | 描述 | 默认 |
|
||||
|----------|--------|----|--------|----|
|
||||
| ssid | String | Y | wifi昵称 | | |
|
||||
| password | String | Y | wifi密码 | | |
|
||||
|
||||
**返回**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 0,
|
||||
"data": null,
|
||||
"message": "配网成功"
|
||||
}
|
||||
```
|
||||
@ -363,7 +363,6 @@ export function writeBLECharacteristicValue(deviceId, serviceId, characteristicI
|
||||
if (successCount === count) {
|
||||
resolve(Result.Success)
|
||||
}
|
||||
console.log("writeBLECharacteristicValue res", res)
|
||||
},
|
||||
fail(err) {
|
||||
console.error("writeBLECharacteristicValue err", err)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user