vault backup: 2025-12-04 09:12:56

This commit is contained in:
杜鹏飞
2025-12-04 09:12:56 +08:00
commit 71e83861de
300 changed files with 339584 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
# Vue 工程创建
1. 创建 Vue 需要用到的 cli 安装
npm install -g @vue/cli
2. 创建vue工程
vue create vue-app
3. 点击回车后,会进入选取项目特征页面,这里我们选择手动选取
Vue CLI v5.0.1
? Please pick a preset:
Default (\[Vue 3] babel, eslint)
Default (\[Vue 2] babel, eslint)
Manually select features
4. 配置特征
Vue CLI v5.0.1
? Please pick a preset: Manually select features
? Check the features needed for your project: (Press \<space> to select, <a> to toggle all, <i> to inv
ert selection, and \<enter> to proceed)
◉ Babel
◯ TypeScript
◯ Progressive Web App (PWA) Support
◉ Router
◉ Vuex
◯ CSS Pre-processors
❯◯ Linter / Formatter
◯ Unit Testing
◯ E2E Testing
5. 选择Vue的版本这里选择3.x
Vue CLI v5.0.1
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, Router, Vuex
? Choose a version of Vue.js that you want to start the project with (Use arrow keys)
3.x
2.x
6. ==下一项需要注意会提示我们是否使用history的路由形式如果是浏览器可以选择这种路由但是在cordova中并没有history对象所以这里需要输入 n 选择不适用history的模式==。
Vue CLI v5.0.1
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, Router, Vuex
? Choose a version of Vue.js that you want to start the project with 3.x
? Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n)
n
7. 选择配置文件位置,使用默认选项即可
? Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys)
In dedicated config files
In package.json
8. 对未来项目的预置
? Save this as a preset for future projects? (y/N) n
完成上述工作,等待项目自动初始化即可。
# Vue 工程改造
1. 在Vue的index.html中引入cordova.js这里的cordova.js是在cordova工程中生成的所以在vue项目中是找不到这个文件的。
```html
// vue/public/index.html
<script src="cordova.js"></script>
```
1. 修改Vue默认打包位置创建或者修改 Vue 根目录下的 vue.config.js 文件(默认为 dist改成cordova工程目录中的前端源码目录 www。
```javaScript
// const { defineConfig } = require('@vue/cli-service')
// module.exports = defineConfig({
// transpileDependencies: true
// })
module.exports={
outputDir:'../myCordovaApp/www'
// 指定加载路径
publicPath:'./'
}
```
1. 在Vue 的index.html 中引入Cordova 的 meta 标签
```html
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- 与 cordova 工程中重复的注释掉使用cordova中的meta标签 -->
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover">
<meta name="color-scheme" content="light dark">
```
1. 为 index.html 添加 deviceready 事件vue/src/main.js
```javaScript
// createApp(App).use(store).use(router).mount('#app')
const app = createApp(App)
app.use(store).use(router)
// 这里添加 deviceready 事件
document.addEventListener('deviceready',function(){
// 将挂载过程放入回调方法中
app.mount('#app')
},false)
```
# 打包测试
创建cordova工程
` cordova create myCordovaApp com.insper.cordova myCordovaApp `
在vue工程中执行打包命令
`npm run build`
执行此命令后会将vue 工程打包后的 html、js、css 等文件 放入vue.config.js 文件中配置的指定位置,方便起见我们可以直接指定这个位置为 cordova 工程的 www 目录。
在cordova工程中执行编译打包命令
`cordova run android`
手机端安装成功后出现myCordovaApp启动出现 vue官方默认页面说明工程构建成功。

View File

@@ -0,0 +1,358 @@
| <font style="color:rgb(51, 51, 51);">版本记录</font> | <font style="color:rgb(51, 51, 51);">时间</font> | <font style="color:rgb(51, 51, 51);">修改者</font> | <font style="color:rgb(51, 51, 51);">日志</font> |
| :---: | :---: | :---: | :---: |
| <font style="color:rgb(51, 51, 51);">1.0.0</font> | <font style="color:rgb(51, 51, 51);">2025.01.07</font> | <font style="color:rgb(51, 51, 51);">陈强</font> | <font style="color:rgb(51, 51, 51);">初版</font> |
| <font style="color:rgb(51, 51, 51);">1.1.0</font> | <font style="color:rgb(51, 51, 51);">2025.02.08</font> | <font style="color:rgb(51, 51, 51);">陈强</font> | <font style="color:rgb(51, 51, 51);">移除部分描述</font> |
<h2 id="4b954e6d"><font style="color:rgb(0, 0, 0);">1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">前言</font>**</h2>
<font style="color:rgb(51, 51, 51);">针对现在公司现有的光交锁产品进行功能合并和兼容处理包含NFC、蓝牙读写器、蓝牙锁、USB锁等四种方式。</font>
<h2 id="1f6ee72f"><font style="color:rgb(0, 0, 0);">2.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">流程图</font>**</h2>
![](https://cdn.nlark.com/yuque/0/2025/png/600469/1736320210281-7cf87e30-06dc-4307-8a67-04bfc26d9217.png)
<h2 id="7fadd862"><font style="color:rgb(0, 0, 0);">3.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">配置</font>**</h2>
<h4 id="a285d945"><font style="color:rgb(0, 0, 0);">3.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">密钥、appID申请</font>**</h4>
<font style="color:rgb(51, 51, 51);">使用本SDK之前请开发联系商务并提供app的包名以便获取appID和密钥后续激活SDK使用</font>
<h4 id="b8ba0858"><font style="color:rgb(0, 0, 0);">3.2.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">权限配置</font>**</h4>
```java
<!-- 低版本蓝牙权限兼容 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- 蓝牙操作权限 -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<!-- Android11及以上需补充以下权限 -->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<!--NFC权限-->
<uses-permission android:name="android.permission.NFC" />
<uses-feature
android:name="android.hardware.nfc"
android:required="true" />
<!--USB权限-->
<uses-feature android:name="android.hardware.usb.host" />
<uses-permission android:name="android.permission.USB_PERMISSION" />
```
<h3 id="inchN">3.3. 开锁密码</h3>
开锁时需要对应的密码集成SDK时建议做好密码管理。开锁时传入对应的密码。
<h2 id="fad055a2"><font style="color:rgb(0, 0, 0);">4.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">参数说明</font>**</h2>
<h4 id="cb5b8a2b"><font style="color:rgb(0, 0, 0);">4.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">接口数据采用Map集合</font>**</h4>
| <font style="color:rgb(51, 51, 51);">键key</font> | <font style="color:rgb(51, 51, 51);">值value)</font> | <font style="color:rgb(51, 51, 51);">类型</font> | <font style="color:rgb(51, 51, 51);">备注</font> |
| :---: | :---: | :---: | :---: |
| <font style="color:rgb(51, 51, 51);">lockStatus</font> | <font style="color:rgb(51, 51, 51);">1或0</font> | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">1开启</font><br/><font style="color:rgb(51, 51, 51);">0关闭</font> |
| <font style="color:rgb(51, 51, 51);">nfcElectricity</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">NF电量</font> |
| <font style="color:rgb(51, 51, 51);">solarEnergyElectricity</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">太阳能电量</font> |
| <font style="color:rgb(51, 51, 51);">batteryElectricity</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">电池电量</font> |
| <font style="color:rgb(51, 51, 51);">lockBeamStatus</font> | <font style="color:rgb(51, 51, 51);">1或0</font> | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">锁梁状态(运营商锁)</font><br/><font style="color:rgb(51, 51, 51);">1已脱落</font><br/><font style="color:rgb(51, 51, 51);">0锁梁正常</font> |
| <font style="color:rgb(51, 51, 51);">lockTypeC</font> | <font style="color:rgb(51, 51, 51);">1或0</font> | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">TypeC状态运营商锁</font><br/><font style="color:rgb(51, 51, 51);">1已连接</font><br/><font style="color:rgb(51, 51, 51);">0未连接</font> |
| <font style="color:rgb(51, 51, 51);">lockBle</font> | <font style="color:rgb(51, 51, 51);">1或0</font> | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">蓝牙状态(运营商锁)</font><br/><font style="color:rgb(51, 51, 51);">1已连接</font><br/><font style="color:rgb(51, 51, 51);">0未连接</font> |
| <font style="color:rgb(51, 51, 51);">birth</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">出厂日期(运营商锁)</font> |
| <font style="color:rgb(51, 51, 51);">version</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">固件版本号</font> |
| <font style="color:rgb(51, 51, 51);">hardwareVersion</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">硬件版本号</font> |
| <font style="color:rgb(51, 51, 51);">sn</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">智能锁序号</font> |
| <font style="color:rgb(51, 51, 51);">unlockTimes</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">开锁次数</font> |
| <font style="color:rgb(51, 51, 51);">status</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">网络状态NB锁</font> |
| <font style="color:rgb(51, 51, 51);">pw</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">网络信号强度NB锁</font> |
| <font style="color:rgb(51, 51, 51);">read</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">读取MCU状态</font> |
| <font style="color:rgb(51, 51, 51);">open</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">读取传感器状态(门状态)</font> |
| <font style="color:rgb(51, 51, 51);">localStatus</font> | | <font style="color:rgb(51, 51, 51);">String</font> | <font style="color:rgb(51, 51, 51);">读取传感器状态(锁舌状态)</font> |
<h4 id="6d61a52c"><font style="color:rgb(0, 0, 0);">4.2.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">设备枚举类型</font>**</h4>
**<font style="color:rgb(0, 0, 0);">MkdLockTypeEnum设备类型</font>**
| <font style="color:rgb(51, 51, 51);">类型</font> | <font style="color:rgb(51, 51, 51);">说明</font> |
| --- | --- |
| **<font style="color:rgb(51, 51, 51);">MKD_LOCK_TYPE_NFC</font>** | <font style="color:rgb(51, 51, 51);">通过手机的NFC功能实现开锁适用于支持NFC功能的设备</font> |
| **<font style="color:rgb(51, 51, 51);">MKD_LOCK_TYPE_READER</font>** | <font style="color:rgb(51, 51, 51);">利用蓝牙读写器进行开锁,适合需要通过蓝牙连接的场景</font> |
| **<font style="color:rgb(51, 51, 51);">MKD_LOCK_TYPE_BLE</font>** | <font style="color:rgb(51, 51, 51);">通过手机蓝牙与锁具连接进行开锁</font> |
| **<font style="color:rgb(51, 51, 51);">MKD_LOCK_TYPE_USB</font>** | <font style="color:rgb(51, 51, 51);">通过手机外接USB设备实现开锁适用于需要物理连接的情况</font> |
<h2 id="349b2093"><font style="color:rgb(0, 0, 0);">5.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">接入流程</font>**</h2>
<h4 id="04d11cf5"><font style="color:rgb(0, 0, 0);">5.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">管理类-</font>****<font style="color:rgb(255, 0, 0);">MkdLockManagerNewer</font>**</h4>
<h4 id="d46d7388"><font style="color:rgb(0, 0, 0);">5.2.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">激活SDK</font>**</h4>
```java
/**
* 初始化鉴权
*
* @param appID AppID
* @param appSecret 密钥
* @return boolean true激活成功 false激活失败
*/
public boolean initWithAppID(String appID, String appSecret,Application application)
```
<h4 id="aed007a9"><font style="color:rgb(0, 0, 0);">5.3.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">设备类型设置</font>**</h4>
```java
/**
* 根据不同的锁类型切换当前的锁类型
* 此方法主要用于在应用中切换锁的类型,以便适应不同的安全或使用需求
*
* @param mkdLockTypeEnum 新的锁类型通过MkdLockTypeEnum枚举指定
*/
public void changeCurrentLockType(MkdLockTypeEnum mkdLockTypeEnum)
```
<h4 id="18518649"><font style="color:rgb(0, 0, 0);">5.4.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">蓝牙</font>**</h4>
<h5 id="af37e7fb"><font style="color:rgb(0, 0, 0);">5.4.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">设备搜索</font>**</h5>
```java
/**
* 开始搜索设备
*
* @param timeOut 超时设置
* @param scanListener 设备搜索回调
*/
void startScan(int timeOut, MkdScanListener scanListener);
```
```java
public interface MkdScanListener {
//开始扫描
void onScanStart();
//停止扫描
void onScanStop();
//获取扫描结果
void onScanResult(Device device, boolean isConnectedBySys);
//扫描错误
void onScanError(String errorMsg);
}
```
<h5 id="75329907"><font style="color:rgb(0, 0, 0);">5.4.2.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">停止搜索</font>**</h5>
```java
public void stopScan()
```
<h5 id="a67e0421"><font style="color:rgb(0, 0, 0);">5.4.3.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">设置搜索过滤条件</font>**</h5>
```java
public void setDeviceScanPrefix(String... prefix)
```
<h5 id="bcd86ed3"><font style="color:rgb(0, 0, 0);">5.4.4.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">设备连接</font>**</h5>
```java
/**
* 连接设备
* @param device 设备对象
* @param listener 连接监听器
*/
public void connectDevice(Device device, MkdBleConnectListener listener)
```
```java
/**
* 连接设备
* @param device 设备标识字符串
* @param listener 连接监听器
*/
public void connectDevice(String device, MkdBleConnectListener listener)
```
```java
public interface MkdBleConnectListener {
void connectSuccess (Device device);
void connectFailed(String msg);
void connectClose();
}
```
<h5 id="ab9c6740"><font style="color:rgb(0, 0, 0);">5.4.5.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">设备断开</font>**</h5>
```java
public void disConnectDevice()
```
<h5 id="11231a8b"><font style="color:rgb(0, 0, 0);">5.4.6.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">释放资源</font>**</h5>
```java
public void releaseAllConnection()
```
<h5 id="e39db310"><font style="color:rgb(0, 0, 0);">5.4.7.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">其他</font>**</h5>
```java
//是否真正扫描设备中
public boolean isScanning()
//移除扫描监听
public void removeScanListener()
//是否连接设备
public boolean isBleDeviceConnect()
```
<h4 id="5.5.-nfc"><font style="color:rgb(0, 0, 0);">5.5.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">NFC</font>**</h4>
<h5 id="cc4b5a42"><font style="color:rgb(0, 0, 0);">5.5.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">NFC Tag监听</font>**</h5>
```java
//注意此处未使用onNewIntent方式来获取NFC Tag的方式是由于在部分手机设备上
//存在Intent携带的Tag为null导致无法使用NFC
NfcAdapter mNfcAdapter = NfcAdapter.getDefaultAdapter(activity);
mNfcAdapter.enableReaderMode(activity, new NfcAdapter.ReaderCallback() {
@Override
public void onTagDiscovered(Tag tag) {
Log.e("onTagDiscovered", "tag = " + tag);
//接收获取的NFC 信息便于后续连接处理
}
}, NfcAdapter.FLAG_READER_NFC_A | NfcAdapter.FLAG_READER_NFC_B | NfcAdapter.FLAG_READER_NFC_F | NfcAdapter.FLAG_READER_NFC_V | NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK, null);
```
<h5 id="eb8ccd8e"><font style="color:rgb(0, 0, 0);">5.5.2.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">创建NFC意图</font>**</h5>
```java
public void createPendingIntent(Activity activity)
```
<h5 id="9f013c12"><font style="color:rgb(0, 0, 0);">5.5.3.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">开启NFC前台分发</font>**</h5>
```java
public void enableForegroundDispatch(Activity activity)
```
<h5 id="a321a077"><font style="color:rgb(0, 0, 0);">5.5.4.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">关闭NFC前台分发</font>**</h5>
```java
public void disableForegroundDispatch(Activity activity)
```
<h5 id="32489a7d"><font style="color:rgb(0, 0, 0);">5.5.5.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">连接NFC</font>**</h5>
```java
public void connectTag(Tag mTag, MkdNfcConnectStatusListener listener)
```
```java
public interface MkdNfcConnectStatusListener {
/**
* 连接状态
* @param status true已连接 false未连接
*/
void connectStatus(boolean status);
}
```
<h4 id="e22349ec"><font style="color:rgb(0, 0, 0);">5.6.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">API方法</font>**</h4>
<h5 id="5ac96d8d"><font style="color:rgb(0, 0, 0);">5.6.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">添加蓝牙读写器寻卡监听</font>**</h5>
```java
public void addReceiveRWSearchCardListener(MkdLockManagerListener listener)
```
<h6 id="7a81c120"><font style="color:rgb(0, 0, 0);">5.6.1.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">返回</font>****<font style="color:rgb(26, 26, 26);">数据</font>**</h6>
| <font style="color:rgb(51, 51, 51);">参数</font><font style="color:rgb(51, 51, 51);">key</font> | <font style="color:rgb(51, 51, 51);">类型</font> | <font style="color:rgb(51, 51, 51);">值</font> | <font style="color:rgb(51, 51, 51);">说明</font> |
| --- | --- | --- | --- |
| <font style="color:rgb(51, 51, 51);">hasCard</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | <font style="color:rgb(51, 51, 51);">“1”</font><font style="color:rgb(51, 51, 51);">or</font><font style="color:rgb(51, 51, 51);">"</font><font style="color:rgb(51, 51, 51);">0"</font> | <font style="color:rgb(51, 51, 51);">"</font><font style="color:rgb(51, 51, 51);">1"</font><font style="color:rgb(51, 51, 51);">:</font><font style="color:rgb(51, 51, 51);">有卡</font><br/><font style="color:rgb(51, 51, 51);">“0”</font><font style="color:rgb(51, 51, 51);">:</font><font style="color:rgb(51, 51, 51);">无卡</font> |
| <font style="color:rgb(51, 51, 51);">uid</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">锁</font><font style="color:rgb(51, 51, 51);">mac</font><font style="color:rgb(51, 51, 51);">地址</font> |
| <font style="color:rgb(51, 51, 51);">protocol</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">寻</font><font style="color:rgb(51, 51, 51);">卡</font><font style="color:rgb(51, 51, 51);">的</font><font style="color:rgb(51, 51, 51);">类型</font><font style="color:rgb(51, 51, 51);"></font><br/><font style="color:rgb(51, 51, 51);">“default”</font><font style="color:rgb(51, 51, 51);"></font><font style="color:rgb(51, 51, 51);">全部</font><br/><font style="color:rgb(51, 51, 51);">“ISO14443A”</font><font style="color:rgb(51, 51, 51);"></font><font style="color:rgb(51, 51, 51);">1</font><font style="color:rgb(51, 51, 51);">4</font><font style="color:rgb(51, 51, 51);">4</font><font style="color:rgb(51, 51, 51);">4</font><font style="color:rgb(51, 51, 51);">3</font><font style="color:rgb(51, 51, 51);">A</font><font style="color:rgb(51, 51, 51);"> N</font><font style="color:rgb(51, 51, 51);">F</font><font style="color:rgb(51, 51, 51);">C</font><font style="color:rgb(51, 51, 51);">协议</font><br/><font style="color:rgb(51, 51, 51);">“ISO14443B”</font><font style="color:rgb(51, 51, 51);"></font><font style="color:rgb(51, 51, 51);">1</font><font style="color:rgb(51, 51, 51);">4</font><font style="color:rgb(51, 51, 51);">4</font><font style="color:rgb(51, 51, 51);">4</font><font style="color:rgb(51, 51, 51);">3</font><font style="color:rgb(51, 51, 51);">B</font><font style="color:rgb(51, 51, 51);"> N</font><font style="color:rgb(51, 51, 51);">F</font><font style="color:rgb(51, 51, 51);">C</font><font style="color:rgb(51, 51, 51);">协议</font><br/><font style="color:rgb(51, 51, 51);">“ISO1</font><font style="color:rgb(51, 51, 51);">5</font><font style="color:rgb(51, 51, 51);">6</font><font style="color:rgb(51, 51, 51);">9</font><font style="color:rgb(51, 51, 51);">3</font><font style="color:rgb(51, 51, 51);">”</font><font style="color:rgb(51, 51, 51);">1</font><font style="color:rgb(51, 51, 51);">5</font><font style="color:rgb(51, 51, 51);">6</font><font style="color:rgb(51, 51, 51);">9</font><font style="color:rgb(51, 51, 51);">3</font><font style="color:rgb(51, 51, 51);"> N</font><font style="color:rgb(51, 51, 51);">F</font><font style="color:rgb(51, 51, 51);">C</font><font style="color:rgb(51, 51, 51);">协议</font> |
<h5 id="d5989665"><font style="color:rgb(0, 0, 0);">5.6.2.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">查询蓝牙读写器状态</font>**</h5>
```java
public void queryBleReaderWriterStatus(MkdLockManagerListener listener)
```
<h6 id="75566fd9"><font style="color:rgb(0, 0, 0);">5.6.2.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">返回</font>****<font style="color:rgb(26, 26, 26);">数据</font>**</h6>
| <font style="color:rgb(51, 51, 51);">参数</font><font style="color:rgb(51, 51, 51);">key</font> | <font style="color:rgb(51, 51, 51);">类型</font> | <font style="color:rgb(51, 51, 51);">值</font> | <font style="color:rgb(51, 51, 51);">说明</font> |
| --- | --- | :---: | --- |
| <font style="color:rgb(0, 0, 0);">rwPowerMV</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">读写器</font><font style="color:rgb(51, 51, 51);">电量</font> |
| <font style="color:rgb(0, 0, 0);">rwPowerPercent</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">读写器</font><font style="color:rgb(51, 51, 51);">电量</font><font style="color:rgb(51, 51, 51);">百分</font><font style="color:rgb(51, 51, 51);">比</font> |
| <font style="color:rgb(0, 0, 0);">rwHW</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">读写</font><font style="color:rgb(51, 51, 51);">硬件</font><font style="color:rgb(51, 51, 51);">版本</font> |
| <font style="color:rgb(0, 0, 0);">rwSW</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">读写器</font><font style="color:rgb(51, 51, 51);">软件</font><font style="color:rgb(51, 51, 51);">版本</font> |
<h5 id="d1f3bbdc"><font style="color:rgb(0, 0, 0);">5.6.3.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">读取锁的基本信息</font>**</h5>
```java
public void readLockBasicInfoSuccess(MkdLockManagerListener listener)
```
<h6 id="6c3764af"><font style="color:rgb(0, 0, 0);">5.6.3.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">返回</font>****<font style="color:rgb(26, 26, 26);">数据</font>**</h6>
| <font style="color:rgb(51, 51, 51);">参数</font><font style="color:rgb(51, 51, 51);">key</font> | <font style="color:rgb(51, 51, 51);">类型</font> | <font style="color:rgb(51, 51, 51);">值</font> | <font style="color:rgb(51, 51, 51);">说明</font> |
| --- | --- | :---: | --- |
| <font style="color:rgb(0, 0, 0);">sn</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">锁</font><font style="color:rgb(51, 51, 51);">序号</font> |
| <font style="color:rgb(0, 0, 0);">mac</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">锁</font><font style="color:rgb(51, 51, 51);">mac</font><font style="color:rgb(51, 51, 51);">地址</font> |
<h5 id="93b5a1c9"><font style="color:rgb(0, 0, 0);">5.6.4.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">读取锁的状态和电量</font>**</h5>
```java
public void readStatusAndElectricity( MkdLockManagerListener listener)
```
<h6 id="6b67d0d1"><font style="color:rgb(0, 0, 0);">5.6.4.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">返回</font>****<font style="color:rgb(26, 26, 26);">数据</font>**</h6>
| <font style="color:rgb(51, 51, 51);">参数</font><font style="color:rgb(51, 51, 51);">key</font> | <font style="color:rgb(51, 51, 51);">类型</font> | <font style="color:rgb(51, 51, 51);">值</font> | <font style="color:rgb(51, 51, 51);">说明</font> |
| --- | --- | --- | --- |
| <font style="color:rgb(51, 51, 51);">lockStatus</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | <font style="color:rgb(51, 51, 51);">1或0</font> | <font style="color:rgb(51, 51, 51);">1开启</font><br/><font style="color:rgb(51, 51, 51);">0关闭</font> |
| <font style="color:rgb(51, 51, 51);">nfcElectricity</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">NF电量</font> |
| <font style="color:rgb(51, 51, 51);">solarEnergyElectricity</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">太阳能电量</font> |
| <font style="color:rgb(51, 51, 51);">batteryElectricity</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">电池电量</font> |
| <font style="color:rgb(51, 51, 51);">lockBeamStatus</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | <font style="color:rgb(51, 51, 51);">1或0</font> | <font style="color:rgb(51, 51, 51);">锁梁状态LK02-BT运营商锁</font><br/><font style="color:rgb(51, 51, 51);">1已连接</font><br/><font style="color:rgb(51, 51, 51);">0未连接</font> |
| <font style="color:rgb(51, 51, 51);">lockTypeC</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | <font style="color:rgb(51, 51, 51);">1或0</font> | <font style="color:rgb(51, 51, 51);">TypeC状态LK02-BT运营商锁</font><br/><font style="color:rgb(51, 51, 51);">1已连接</font><br/><font style="color:rgb(51, 51, 51);">0未连接</font> |
| <font style="color:rgb(51, 51, 51);">lockBle</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | <font style="color:rgb(51, 51, 51);">1或0</font> | <font style="color:rgb(51, 51, 51);">蓝牙状态LK02-BT运营商锁</font><br/><font style="color:rgb(51, 51, 51);">1已连接</font><br/><font style="color:rgb(51, 51, 51);">0未连接</font> |
| <font style="color:rgb(51, 51, 51);">birth</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">出厂日期LK02-BT运营商锁</font> |
<h5 id="dc2cd2e5"><font style="color:rgb(0, 0, 0);">5.6.5.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">读取开锁次数</font>**</h5>
```java
public void readUnlockTimes(MkdLockManagerListener listener)
```
<h6 id="6a1d0416"><font style="color:rgb(0, 0, 0);">5.6.5.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">返回</font>****<font style="color:rgb(26, 26, 26);">数据</font>**</h6>
| <font style="color:rgb(51, 51, 51);">参数</font><font style="color:rgb(51, 51, 51);">key</font> | <font style="color:rgb(51, 51, 51);">类型</font> | <font style="color:rgb(51, 51, 51);">值</font> | <font style="color:rgb(51, 51, 51);">说明</font> |
| --- | --- | :---: | --- |
| <font style="color:rgb(0, 0, 0);">unlockTimes</font> | <font style="color:rgb(51, 51, 51);">S</font><font style="color:rgb(51, 51, 51);">tring</font> | | <font style="color:rgb(51, 51, 51);">累计</font><font style="color:rgb(51, 51, 51);">的</font><font style="color:rgb(51, 51, 51);">开锁</font><font style="color:rgb(51, 51, 51);">次数</font> |
<h5 id="2012032f"><font style="color:rgb(0, 0, 0);">5.6.6.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">读取锁的固件版本</font>**</h5>
```java
public void readFWVersion(MkdLockManagerListener listener)
```
<h6 id="2d83230a"><font style="color:rgb(0, 0, 0);">5.6.6.1.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">返回</font>****<font style="color:rgb(26, 26, 26);">数据</font>**</h6>
| <font style="color:rgb(51, 51, 51);">参数</font><font style="color:rgb(51, 51, 51);">key</font> | <font style="color:rgb(51, 51, 51);">类型</font> | <font style="color:rgb(51, 51, 51);">值</font> | <font style="color:rgb(51, 51, 51);">说明</font> |
| --- | --- | :---: | --- |
| <font style="color:rgb(51, 51, 51);">version</font> | <font style="color:rgb(51, 51, 51);">String</font> | | <font style="color:rgb(51, 51, 51);">固件版本号</font> |
| <font style="color:rgb(51, 51, 51);">hardwareVersion</font> | <font style="color:rgb(51, 51, 51);">String</font> | | <font style="color:rgb(51, 51, 51);">硬件版本号</font> |
<h5 id="3107205e"><font style="color:rgb(0, 0, 0);">5.6.7.</font><font style="color:rgb(0, 0, 0);"> </font>**<font style="color:rgb(26, 26, 26);">密钥开锁</font>**</h5>
```java
//encryptedPassword获取的开锁密钥
//listener开锁结果回调包含充电进度、开锁失败、开锁成功
public void unlockWithSecretKey(String encryptedPassword, MkdLockManagerProgressListener listener)
```
<h5 id="f1cf8f66"><font style="color:rgb(0, 0, 0);">5.6.8. </font>**<font style="color:rgb(26, 26, 26);">资源释放</font>**</h5>
```java
public void release()
```