feat(lefu): 迁移乐福体脂秤 SDK,接入设备扫描连接与 WiFi 配网
- 新增 lefu 服务层(扫描/连接/断开/保活重连/测量回调/WiFi 配网),事件回调支持多监听 - connectedDevice 接入真实蓝牙扫描连接,修复断线重连 UI 未同步、蓝牙/定位开关误判 - connectedWifi 接入真实 WiFi 配网,补连接状态校验与退出配网模式 - 新增 5 张设备图标并调整应用入口 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
feb494080c
commit
f53f11e6e9
@@ -0,0 +1,90 @@
|
||||
/** ppScale-plugin 原始设备对象 */
|
||||
export type RawDevice = Record<string, any>
|
||||
|
||||
/** 乐福 SDK 插件对象(运行时由 requirePlugin 注入) */
|
||||
export type LeFuPlugin = Record<string, any>
|
||||
|
||||
|
||||
/** 设备配置(来自 master device.setting 列表) */
|
||||
export interface DeviceSetting {
|
||||
advLength: number
|
||||
calorieStatus: number
|
||||
deviceAccuracyType: number
|
||||
deviceCalcuteType: number
|
||||
deviceConnectType: number
|
||||
deviceFuncType: number
|
||||
deviceName: string
|
||||
devicePowerType: number
|
||||
deviceProtocolType: number
|
||||
deviceType: number
|
||||
deviceUnitType: string
|
||||
id: number
|
||||
macAddressStart: number
|
||||
sign: string
|
||||
status: number
|
||||
uhStatus: number
|
||||
createBy: null
|
||||
imgUrl: null
|
||||
remark: null
|
||||
updateBy: null
|
||||
}
|
||||
|
||||
/** 扫描到的设备(展示层使用) */
|
||||
export interface ScannedDevice {
|
||||
/** 设备名称 */
|
||||
name: string
|
||||
/** plugin 返回的原始设备对象,连接时传回给 SDK */
|
||||
raw: RawDevice
|
||||
/** 设备模型(含 deviceConnectType 等信息) */
|
||||
model: Record<string, any>
|
||||
}
|
||||
|
||||
/** WiFi 项 */
|
||||
export interface LeFuWifiItem {
|
||||
/** WiFi SSID */
|
||||
ssid: string
|
||||
/** 信号强度(部分设备上报) */
|
||||
signal?: number
|
||||
}
|
||||
|
||||
/** 测量进度数据(progressData 事件,测量过程中多次回调) */
|
||||
export interface ProgressData {
|
||||
/** 体重,单位:克 */
|
||||
weight: number
|
||||
/** 单位枚举值 */
|
||||
unit: number
|
||||
/** 是否正在心率测量 */
|
||||
isHeartRating: boolean
|
||||
}
|
||||
|
||||
/** 测量锁定数据(lockData 事件,测量完成时回调一次) */
|
||||
export interface LockData {
|
||||
/** 体重,单位:克 */
|
||||
weight: number
|
||||
/** 阻抗值(用于体成分分析) */
|
||||
resistance: number
|
||||
/** 心率(部分设备上报) */
|
||||
heartRate?: number
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/** 乐福服务配置 */
|
||||
export interface LeFuConfig {
|
||||
key: string
|
||||
secret: string
|
||||
/** 老协议域名(无鉴权) */
|
||||
domain1: string
|
||||
/** 新协议域名(有鉴权) */
|
||||
domain2: string
|
||||
}
|
||||
|
||||
/** 设备固件信息(deviceInfo 事件返回) */
|
||||
export interface DeviceInfo {
|
||||
/** 固件版本号,格式:mcu.ble.wifi.res,如 "006.005.004.305" */
|
||||
firmwareRevision: string
|
||||
/** 设备型号,用于请求服务端版本接口 */
|
||||
modelNumber: string
|
||||
/** 设备序列号 */
|
||||
serialNumber: string
|
||||
[key: string]: any
|
||||
}
|
||||
Reference in New Issue
Block a user