Преглед на файлове

增加BM30广播模块

master
陈炫华 преди 9 месеца
родител
ревизия
254a84e1f8
променени са 3 файла, в които са добавени 54 реда и са изтрити 72 реда
  1. 1
    1
      ailink_demo/app.json
  2. 4
    3
      ailink_demo/pages/index/index.js
  3. 49
    68
      ailink_demo/project.config.json

+ 1
- 1
ailink_demo/app.json Целия файл

@@ -11,7 +11,7 @@
},
"plugins": {
"sdkPlugin": {
"version": "1.1.2",
"version": "2.4.0",
"provider": "wx17e93aad47cdae1a"
}
},

+ 4
- 3
ailink_demo/pages/index/index.js Целия файл

@@ -107,8 +107,9 @@ Page({
allowDuplicatesKey: true,
services: [
"FFE0",
// "F0A0", // BM30广播模块需加上,如使用连接模块可忽略
"F0A0", // BM30广播模块需加上,如使用连接模块可忽略
],
powerLevel: 'high',
success: (res) => {
console.log('startBluetoothDevicesDiscovery success', res)
this.onBluetoothDeviceFound()
@@ -142,7 +143,7 @@ Page({
device.analyzeDataText = analyzeData.text
}
} else {
let buff = device.advertisData.slice(-6)
let buff = device.advertisData.slice(8,14)
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
let tempMac = Array.from(device.mac)
tempMac.reverse()
@@ -325,7 +326,7 @@ Page({
} else {
// ... 其他单位
}
this.weight = weightValue / (decPoint * 10) // 除去小数点位数
this.weight = weightValue / (10 ** decPoint) // 除去小数点位数
break;
// ... 其他指令请根据协议解析
/**

+ 49
- 68
ailink_demo/project.config.json Целия файл

@@ -1,73 +1,54 @@
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
"description": "项目配置文件",
"packOptions": {
"ignore": [],
"include": []
},
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.14.1",
"appid": "wx17e93aad47cdae1a",
"projectname": "ailink_demo",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"list": []
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
"compileType": "miniprogram",
"libVersion": "2.14.1",
"appid": "wx17e93aad47cdae1a",
"projectname": "ailink_demo",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
}
}
}

Loading…
Отказ
Запис