| @@ -1353,7 +1353,7 @@ | |||
| buildSettings = { | |||
| ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
| CODE_SIGN_STYLE = Automatic; | |||
| CURRENT_PROJECT_VERSION = 20260715; | |||
| CURRENT_PROJECT_VERSION = 20261009; | |||
| DEVELOPMENT_TEAM = YEU77XR292; | |||
| FRAMEWORK_SEARCH_PATHS = ( | |||
| "$(inherited)", | |||
| @@ -1375,7 +1375,7 @@ | |||
| "$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | |||
| "$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | |||
| ); | |||
| MARKETING_VERSION = 1.12.6; | |||
| MARKETING_VERSION = 1.12.11; | |||
| OTHER_LDFLAGS = "-ObjC"; | |||
| PRODUCT_BUNDLE_IDENTIFIER = com.ellinkthings.ailinksdk.app; | |||
| PRODUCT_NAME = "$(TARGET_NAME)"; | |||
| @@ -1388,7 +1388,7 @@ | |||
| buildSettings = { | |||
| ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
| CODE_SIGN_STYLE = Automatic; | |||
| CURRENT_PROJECT_VERSION = 20260715; | |||
| CURRENT_PROJECT_VERSION = 20261009; | |||
| DEVELOPMENT_TEAM = YEU77XR292; | |||
| FRAMEWORK_SEARCH_PATHS = ( | |||
| "$(inherited)", | |||
| @@ -1410,7 +1410,7 @@ | |||
| "$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | |||
| "$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | |||
| ); | |||
| MARKETING_VERSION = 1.12.6; | |||
| MARKETING_VERSION = 1.12.11; | |||
| OTHER_LDFLAGS = "-ObjC"; | |||
| PRODUCT_BUNDLE_IDENTIFIER = com.ellinkthings.ailinksdk.app; | |||
| PRODUCT_NAME = "$(TARGET_NAME)"; | |||
| @@ -86,9 +86,11 @@ | |||
| #import "ELPeripheralModel.h" | |||
| #import "ELTempAlgorithmusModel.h" | |||
| #import "ELWeightAlgorithmusModel.h" | |||
| #import "ELEightScaleBadyInfo.h" | |||
| #import "ELEightScaleBleBfrDataModel.h" | |||
| #import "ELEightScaleBleDataModel.h" | |||
| #import "ELEightScaleBleManager.h" | |||
| #import "ELEightScaleHistoryRecord.h" | |||
| #import "ELEightScaleSDKHeader.h" | |||
| #import "ELFaceMaskBleDataModel.h" | |||
| #import "ELFaceMaskBleHeader.h" | |||
| @@ -9,6 +9,6 @@ | |||
| #define AILinkBleSDK_Version_h | |||
| //版本号 SDK Version | |||
| #define AiLinkBleSDKVersion @"1.12.6" // 20260715 | |||
| #define AiLinkBleSDKVersion @"1.12.11" // 20261009 | |||
| #endif /* AILinkBleSDK_Version_h */ | |||
| @@ -172,6 +172,16 @@ NS_ASSUME_NONNULL_BEGIN | |||
| */ | |||
| -(void)bluetoothManagerReceiveBMVersion:(NSString *_Nonnull)bmVersion; | |||
| /** | |||
| Query the callback of the software and hardware version number of the BM module with cmd type(查询BM模块软硬件版本号的回调,包含指令类型) | |||
| @param bmVersion BM module software and hardware version | |||
| @param cmdType (指令类型) | |||
| */ | |||
| -(void)bluetoothManagerReceiveBMVersion:(NSString *_Nonnull)bmVersion | |||
| cmdType:(NSUInteger)cmdType; | |||
| /** | |||
| Query the callback of the MCU software and hardware version number(查询MCU软硬件版本号的回调) | |||
| @@ -0,0 +1,31 @@ | |||
| // | |||
| // ELEightScaleBadyInfo.h | |||
| // AILinkBleSDK | |||
| // | |||
| // Created by RedmiK90 on 2026/10/9. | |||
| // | |||
| #import <Foundation/Foundation.h> | |||
| NS_ASSUME_NONNULL_BEGIN | |||
| @class ELEightScaleBleDataModel; | |||
| @class ELPeripheralModel; | |||
| typedef void (^ELEightScaleBadySuccessBlock)(NSDictionary *data); | |||
| typedef void (^ELEightScaleBadyFailureBlock)(id error); | |||
| @interface ELEightScaleBadyInfo : NSObject | |||
| /// 双频八电极,请求后台算法。成功时返回 data 字典,由外部再转成记录模型 | |||
| + (void)getDoubleEightDataWithBleDataModel:(ELEightScaleBleDataModel *)dataModel | |||
| peripheral:(ELPeripheralModel *)peripheral | |||
| withUserSex:(NSInteger)sex | |||
| height:(NSInteger)height | |||
| age:(NSInteger)age | |||
| success:(ELEightScaleBadySuccessBlock)success | |||
| failure:(ELEightScaleBadyFailureBlock)failure; | |||
| @end | |||
| NS_ASSUME_NONNULL_END | |||
| @@ -153,9 +153,12 @@ NS_ASSUME_NONNULL_BEGIN | |||
| /** 八电极需要用户数据对象模型 */ | |||
| @interface ELEightScaleBleUserModel : NSObject | |||
| /** 用户特征 */ | |||
| /** 旧用户特征 */ | |||
| @property (nonatomic, assign) enum EightScaleRole role; | |||
| /** 新用户特征 */ | |||
| @property (nonatomic, assign) int userMode; | |||
| /** 当前用户所属好身材用户编号 */ | |||
| @property (nonatomic, assign) int number; | |||
| @@ -168,7 +171,217 @@ NS_ASSUME_NONNULL_BEGIN | |||
| /** 身高 cm */ | |||
| @property (nonatomic, assign) int height; | |||
| /** 当前体重重量 0.1kg 需要转成整数*/ | |||
| @property (nonatomic, assign) int currentWeight; | |||
| /** 初始体重重量 0.1kg 需要转成整数*/ | |||
| @property (nonatomic, assign) int initialWeight; | |||
| /** 目标体重重量 0.1kg 需要转成整数*/ | |||
| @property (nonatomic, assign) int targetWeight; | |||
| /** 用户ID */ | |||
| @property (nonatomic, assign) NSInteger userId; | |||
| @end | |||
| // ========== 定义协议 ========== | |||
| @protocol ELEightScaleHistoryRecordProtocol <NSObject> | |||
| /**记录时间戳**/ | |||
| @property (nonatomic, assign) long long createTime; | |||
| /** 当前用户所属好身材用户编号 */ | |||
| @property (nonatomic, assign) int number; | |||
| /**用户模式**/ | |||
| @property (nonatomic, assign) int userMode; | |||
| /**性别**/ | |||
| @property (nonatomic, assign) ELBluetoothUserSex sex; | |||
| /**年龄**/ | |||
| @property (nonatomic, assign) NSUInteger age; | |||
| /**身高(1cm)**/ | |||
| @property (nonatomic, assign) int height; | |||
| /**Kg初始重量数据低字节(0.1kg)**/ | |||
| @property (nonatomic, assign) float initialWeight; | |||
| /** 目标体重重量 0.1kg */ | |||
| @property (nonatomic, assign) float targetWeight; | |||
| /** 用户ID */ | |||
| @property (nonatomic, assign) NSInteger userID; | |||
| /** 当前体重重量 **/ | |||
| @property (nonatomic, assign) float currentWeight; | |||
| /** 重量数据精度 **/ | |||
| @property (nonatomic, assign) int weightPoint; | |||
| /** 当前单位: | |||
| 0:kg | |||
| 1:斤 | |||
| 4:st:lb | |||
| 6:lb **/ | |||
| @property (nonatomic, assign) int weightUnit; | |||
| @end | |||
| /** 八电极MCU算法历史记录数据对象模型 */ | |||
| @interface ELEightScaleMCUAlgorithmHistoryDataModel: ELEightScaleBleBfrDataModel <ELEightScaleHistoryRecordProtocol> | |||
| /**记录时间戳**/ | |||
| @property (nonatomic, assign) long long createTime; | |||
| /** 当前用户所属好身材用户编号 */ | |||
| @property (nonatomic, assign) int number; | |||
| /**用户模式**/ | |||
| @property (nonatomic, assign) int userMode; | |||
| /**性别**/ | |||
| @property (nonatomic, assign) ELBluetoothUserSex sex; | |||
| /**年龄**/ | |||
| @property (nonatomic, assign) NSUInteger age; | |||
| /**Kg初始重量数据低字节(0.1kg)**/ | |||
| @property (nonatomic, assign) float initialWeight; | |||
| /** 目标体重重量 0.1kg */ | |||
| @property (nonatomic, assign) float targetWeight; | |||
| /** 用户ID */ | |||
| @property (nonatomic, assign) NSInteger userID; | |||
| /** 当前体重重量 **/ | |||
| @property (nonatomic, assign) float currentWeight; | |||
| /** 重量数据精度 **/ | |||
| @property (nonatomic, assign) int weightPoint; | |||
| /** 当前单位: | |||
| 0:kg | |||
| 1:斤 | |||
| 4:st:lb | |||
| 6:lb **/ | |||
| @property (nonatomic, assign) int weightUnit; | |||
| @end | |||
| /** 八电极APP算法单频历史记录数据对象模型 */ | |||
| @interface ELEightScaleAPPAlgorithmSingleFrequencyHistoryDataModel: NSObject <ELEightScaleHistoryRecordProtocol> | |||
| /**记录时间戳**/ | |||
| @property (nonatomic, assign) long long createTime; | |||
| /** 当前用户所属好身材用户编号 */ | |||
| @property (nonatomic, assign) int number; | |||
| /**用户模式**/ | |||
| @property (nonatomic, assign) int userMode; | |||
| /**性别**/ | |||
| @property (nonatomic, assign) ELBluetoothUserSex sex; | |||
| /**年龄**/ | |||
| @property (nonatomic, assign) NSUInteger age; | |||
| /**身高(1cm)**/ | |||
| @property (nonatomic, assign) int height; | |||
| /**Kg初始重量数据低字节(0.1kg)**/ | |||
| @property (nonatomic, assign) float initialWeight; | |||
| /** 目标体重重量 0.1kg */ | |||
| @property (nonatomic, assign) float targetWeight; | |||
| /** 用户ID */ | |||
| @property (nonatomic, assign) NSInteger userID; | |||
| /** 当前体重重量 **/ | |||
| @property (nonatomic, assign) float currentWeight; | |||
| /** 重量数据精度 **/ | |||
| @property (nonatomic, assign) int weightPoint; | |||
| /** 当前单位: | |||
| 0:kg | |||
| 1:斤 | |||
| 4:st:lb | |||
| 6:lb **/ | |||
| @property (nonatomic, assign) int weightUnit; | |||
| #pragma mark 阻抗 单电极体脂秤的阻抗数据(只有这一条阻抗数据),双电极体脂秤的20kHZ频率的阻抗数据) | |||
| /**0x00 阻抗值1(双脚阻抗)**/ | |||
| @property (nonatomic, assign) int footImpedanceAt20kHz; | |||
| /**双脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger footImpedanceAt20kHzValue; | |||
| /**0x01 阻抗值2(双手阻抗)**/ | |||
| @property (nonatomic, assign) int handImpedanceAt20kHz; | |||
| /**双手阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger handImpedanceAt20kHzValue; | |||
| /**0x02 阻抗值3(左手阻抗)**/ | |||
| @property (nonatomic, assign) int leftHandImpedanceAt20kHz; | |||
| /**左手阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger leftHandImpedanceAt20kHzValue; | |||
| /**0x03 阻抗值4(右手阻抗)**/ | |||
| @property (nonatomic, assign) int rightHandImpedanceAt20kHz; | |||
| /**左手阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger rightHandImpedanceAt20kHzValue; | |||
| /**0x04 阻抗值5(左脚阻抗)**/ | |||
| @property (nonatomic, assign) int leftFootImpedanceAt20kHz; | |||
| /**左脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger leftFootImpedanceAt20kHzValue; | |||
| /**0x05 阻抗值6(右脚阻抗)**/ | |||
| @property (nonatomic, assign) int rightFootImpedanceAt20kHz; | |||
| /**右脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger rightFootImpedanceAt20kHzValue; | |||
| /**0x06 阻抗值7(左全身阻抗)**/ | |||
| @property (nonatomic, assign) int leftFullBodyImpedanceAt20kHz; | |||
| /**左全身阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger leftFullBodyImpedanceAt20kHzValue; | |||
| /**0x07 阻抗值8(右全身阻抗)**/ | |||
| @property (nonatomic, assign) int rightFullBodyImpedanceAt20kHz; | |||
| /**右全身阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger rightFullBodyImpedanceAt20kHzValue; | |||
| /**0x08 阻抗值9(右手左脚阻抗)**/ | |||
| @property (nonatomic, assign) int rightHandLeftFootImpedanceAt20kHz; | |||
| /**右手左脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger rightHandLeftFootImpedanceAt20kHzValue; | |||
| /**0x09 阻抗值10(左手右脚阻抗)**/ | |||
| @property (nonatomic, assign) int leftHandRightFootImpedanceAt20kHz; | |||
| /**左手右脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger leftHandRightFootImpedanceAt20kHzValue; | |||
| /**0x0A 阻抗值11(躯干阻抗)**/ | |||
| @property (nonatomic, assign) int trunkImpedanceAt20kHz; | |||
| /**躯干阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger trunkImpedanceAt20kHzValue; | |||
| /**算法标识**/ | |||
| @property (nonatomic, assign) int algorithmID; | |||
| @end | |||
| /** 八电极APP算法双频历史记录数据对象模型 */ | |||
| @interface ELEightScaleAPPAlgorithmDoubleFrequencyHistoryDataModel: ELEightScaleAPPAlgorithmSingleFrequencyHistoryDataModel <ELEightScaleHistoryRecordProtocol> | |||
| #pragma mark -数据部分3(双电极体脂秤的100kHZ频率的阻抗数据,单电极没有这条指令) | |||
| /**0x00 阻抗值1(双脚阻抗)**/ | |||
| @property (nonatomic, assign) int footImpedanceAt100kHz; | |||
| /**双脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger footImpedanceAt100kHzValue; | |||
| /**0x01 阻抗值2(双手阻抗)**/ | |||
| @property (nonatomic, assign) int handImpedanceAt100kHz; | |||
| /**双手阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger handImpedanceAt100kHzValue; | |||
| /**0x02 阻抗值3(左手阻抗)**/ | |||
| @property (nonatomic, assign) int leftHandImpedanceAt100kHz; | |||
| /**左手阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger leftHandImpedanceAt100kHzValue; | |||
| /**0x03 阻抗值4(右手阻抗)**/ | |||
| @property (nonatomic, assign) int rightHandImpedanceAt100kHz; | |||
| /**左手阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger rightHandImpedanceAt100kHzValue; | |||
| /**0x04 阻抗值5(左脚阻抗)**/ | |||
| @property (nonatomic, assign) int leftFootImpedanceAt100kHz; | |||
| /**左脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger leftFootImpedanceAt100kHzValue; | |||
| /**0x05 阻抗值6(右脚阻抗)**/ | |||
| @property (nonatomic, assign) int rightFootImpedanceAt100kHz; | |||
| /**右脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger rightFootImpedanceAt100kHzValue; | |||
| /**0x06 阻抗值7(左全身阻抗)**/ | |||
| @property (nonatomic, assign) int leftFullBodyImpedanceAt100kHz; | |||
| /**左全身阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger leftFullBodyImpedanceAt100kHzValue; | |||
| /**0x07 阻抗值8(右全身阻抗)**/ | |||
| @property (nonatomic, assign) int rightFullBodyImpedanceAt100kHz; | |||
| /**右全身阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger rightFullBodyImpedanceAt100kHzValue; | |||
| /**0x08 阻抗值9(右手左脚阻抗)**/ | |||
| @property (nonatomic, assign) int rightHandLeftFootImpedanceAt100kHz; | |||
| /**右手左脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger rightHandLeftFootImpedanceAt100kHzValue; | |||
| /**0x09 阻抗值10(左手右脚阻抗)**/ | |||
| @property (nonatomic, assign) int leftHandRightFootImpedanceAt100kHz; | |||
| /**左手右脚阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger leftHandRightFootImpedanceAt100kHzValue; | |||
| /**0x0A 阻抗值11(躯干阻抗)**/ | |||
| @property (nonatomic, assign) int trunkImpedanceAt100kHz; | |||
| /**躯干阻抗值**/ | |||
| @property (nonatomic, assign) NSInteger trunkImpedanceAt100kHzValue; | |||
| @end | |||
| NS_ASSUME_NONNULL_END | |||
| @@ -67,6 +67,8 @@ NS_ASSUME_NONNULL_BEGIN | |||
| ///MCU请求用户信息 | |||
| - (void)eightScaleBleGetUserData; | |||
| //新格式 | |||
| - (void)eightScaleBleNewGetUserData; | |||
| ///MCU返回设备测量信息(测量完成的时候才会回调该方法) | |||
| - (void)eightScaleBleReportTestData:(ELEightScaleBleDataModel *)dataModle bfrData:(ELEightScaleBleBfrDataModel *)bfrDataModle; | |||
| @@ -91,6 +93,46 @@ NS_ASSUME_NONNULL_BEGIN | |||
| @param status 阻抗测量状态 | |||
| */ | |||
| -(void)eightScaleScaleManagerCallBackAdcMeasureStatus:(DualBandEightScaleAdcMeasureStatus)status; | |||
| /** | |||
| MCU回复回复支持的功能 | |||
| @param offlineRecordValue 离线记录 | |||
| @param modeValue 用户模式 | |||
| */ | |||
| - (void)eightScaleMCUReportSupportFunction:(NSInteger)offlineRecordValue mode:(NSInteger)modeValue; | |||
| /** | |||
| BM回复更新状态 | |||
| @param status | |||
| 00:更新列表成功 | |||
| 01:更新个人用户成功 | |||
| 02:更新列表失败 | |||
| 03:更新个人用户失败 | |||
| */ | |||
| - (void)updateBMReplyStatus:(NSInteger)status; | |||
| /** | |||
| BM回复历史记录情况 | |||
| @param historyRecordStatus | |||
| 00:无历史记录 | |||
| 01:开始发送历史记录 | |||
| 02:结束发送历史记录 | |||
| */ | |||
| - (void)historyRecordBMReplyStatus:(EightScaleHistoryRecordCodeType)historyRecordStatus; | |||
| //mcu算法一条记录结束后回调 | |||
| - (void)mcuAlgorithmHistoryRecordBMReplyFinishRecord:(ELEightScaleMCUAlgorithmHistoryDataModel*)mcuAlgorithmHistoryRecordModel; | |||
| //单频app算法一条记录结束后回调 | |||
| - (void)appAlgorithmSingleFrequencyHistoryRecordBMReplyFinishRecord:(ELEightScaleAPPAlgorithmSingleFrequencyHistoryDataModel*)appAlgorithmSingleFrequencyHistoryRecordModel; | |||
| //双频app算法一条记录结束后回调 | |||
| - (void)appAlgorithmDoubleFrequencyHistoryRecordBMReplyFinishRecord:(ELEightScaleAPPAlgorithmDoubleFrequencyHistoryDataModel*)appAlgorithmDoubleFrequencyHistoryRecordModel; | |||
| @end | |||
| @interface ELEightScaleBleManager : ELBluetoothManager | |||
| @@ -128,6 +170,27 @@ NS_ASSUME_NONNULL_BEGIN | |||
| /** 下发操作指令 */ | |||
| - (void)eightScaleSendOperationWithType:(enum EightScaleOperationType)type unit:(NSInteger)unit; | |||
| /** 设置用户信息(新格式) */ | |||
| - (void)eightScaleNewSendUserDataWithUserModel:(ELEightScaleBleUserModel *)model; | |||
| /** 下发用户列表(APP更新用户列表给BM模块) */ | |||
| - (void)sendUpdateUserListWithUsers:(NSArray<ELEightScaleBleUserModel *> *)users; | |||
| /** 下发用户列表更新完成(通知BM模块) */ | |||
| - (void)sendUpdateUserListFinished; | |||
| /** 更新个人用户信息给BM模块 */ | |||
| - (void)sendUpdatePersonalInfoWithUserModel:(ELEightScaleBleUserModel *)model; | |||
| /** 请求同步历史记录 */ | |||
| - (void)sendSyncHistoryRequest; | |||
| /** APP/BM回复用户信息 */ | |||
| - (void)replyUserInformation:(ELEightScaleBleUserModel *)userInfo; | |||
| //APP获取MCU支持的模式 | |||
| - (void)eightScaleSendGetMcuSupportFunction; | |||
| @end | |||
| NS_ASSUME_NONNULL_END | |||
| @@ -0,0 +1,30 @@ | |||
| // | |||
| // ELEightScaleHistoryRecord.h | |||
| // AILinkBleSDK | |||
| // | |||
| // Created by RedmiK90 on 2026/7/21. | |||
| // | |||
| #import <Foundation/Foundation.h> | |||
| NS_ASSUME_NONNULL_BEGIN | |||
| @class ELEightScaleMCUAlgorithmHistoryDataModel; | |||
| @class ELEightScaleAPPAlgorithmSingleFrequencyHistoryDataModel; | |||
| @class ELEightScaleAPPAlgorithmDoubleFrequencyHistoryDataModel; | |||
| @interface ELEightScaleHistoryRecord : NSObject | |||
| /**mcu算法历史记录数据**/ | |||
| + (ELEightScaleMCUAlgorithmHistoryDataModel*)getHistoryRecord:(Byte *)payloadBytes record:(ELEightScaleMCUAlgorithmHistoryDataModel*)historyRecord dataLength:(NSInteger)length; | |||
| /**单频App算法历史记录数据**/ | |||
| + (ELEightScaleAPPAlgorithmSingleFrequencyHistoryDataModel*)getSingleFrequencyAppAlgorithmHistoryRecord:(Byte *)payloadBytes record:(ELEightScaleAPPAlgorithmSingleFrequencyHistoryDataModel*)historyRecord dataLength:(NSInteger)length; | |||
| /**双频App算法历史记录数据**/ | |||
| + (ELEightScaleAPPAlgorithmDoubleFrequencyHistoryDataModel*)getDoubleFrequencyAppAlgorithmHistoryRecord:(Byte *)payloadBytes record:(ELEightScaleAPPAlgorithmDoubleFrequencyHistoryDataModel*)historyRecord dataLength:(NSInteger)length; | |||
| @end | |||
| NS_ASSUME_NONNULL_END | |||
| @@ -117,6 +117,9 @@ typedef NS_ENUM(NSUInteger, EightScale_MCU_HeadType) { | |||
| /** 发送体脂数据 */ | |||
| EightScale_MCU_HeadType_ReportBodyFatData = 0x09 , | |||
| /** 请求用户信息(新格式) */ | |||
| EightScale_MCU_HeadType_New_RequestUserData = 0x0A , | |||
| /** 发送请求补全体脂数据 */ | |||
| EightScale_MCU_HeadType_CompletionBodyFatData = 0x0E , | |||
| @@ -134,8 +137,12 @@ typedef NS_ENUM(NSUInteger, EightScale_MCU_HeadType) { | |||
| /** 设备上发错误码 */ | |||
| EightScale_MCU_HeadType_ReportErrorCode = 0xFF , | |||
| /** APP获取MCU支持的功能 */ | |||
| EightScale_MCU_SupportFunction = 0x29 , | |||
| /** MCU回复回复支持的功能 */ | |||
| EightScale_MCU_Report_SupportFunction = 0x2A , | |||
| /** Type:秤专用交互 */ | |||
| EightScale_MCU_Interactive_Command = 0x2B , | |||
| }; | |||
| //Character(角色) 同四电极体脂秤枚举 | |||
| @@ -173,4 +180,35 @@ typedef NS_ENUM(NSUInteger, DualBandEightScaleAdcMeasureStatus) { | |||
| DualBandEightScaleAdcMeasureStatus_SuccessCustom = 0x07,//The impedance measurement is successful, and the APP algorithm is used. The APP will identify the corresponding algorithm according to VID and PID(测阻抗成功,并使用 APP 算法,APP 会根据 VID,PID 来识 别对应算法) | |||
| }; | |||
| ///app下发交互指令操作枚举定义 | |||
| typedef NS_ENUM(NSUInteger, EightScaleInteractiveCommandType) { | |||
| /** 二级指令:APP更新用户列表给BM模块 */ | |||
| EightScaleInteractiveCommand_updateUserList = 0x01, | |||
| /** 二级指令:APP更新用户列表完成 */ | |||
| EightScaleInteractiveCommand_updateUserList_Finished = 0x02, | |||
| /** 二级指令:APP更新个人用户给BM模块 */ | |||
| EightScaleInteractiveCommand_UpdatePersonalInfo = 0x03, | |||
| /** 二级指令:BM回复更新状态 */ | |||
| EightScaleInteractiveCommand_UpdatePersonalInfo_Status = 0x04, | |||
| /** 二级指令:APP请求同步历史记录 */ | |||
| EightScaleInteractiveCommand_Request_Sync_History = 0x05, | |||
| /** 二级指令:历史记录数据(mcu算法) */ | |||
| EightScaleInteractiveCommand_MCUAlgorithm_History_Data = 0x06, | |||
| /** 二级指令:历史记录数据(App算法) */ | |||
| EightScaleInteractiveCommand_APPAlgorithm_History_Data = 0x07, | |||
| }; | |||
| ///BM回复历史记录情况 | |||
| typedef NS_ENUM(NSUInteger, EightScaleHistoryRecordCodeType) { | |||
| /** 无历史记录 */ | |||
| EightScaleHistoryRecordCodeType_NO_Record = 0x00, | |||
| /** 开始发送历史记录 */ | |||
| EightScaleHistoryRecordCodeType_StartSend_Record = 0x01, | |||
| /** 结束发送历史记录 */ | |||
| EightScaleHistoryRecordCodeType_EndSend_Record = 0x02, | |||
| } ; | |||
| #endif /* ELEightScaleSDKHeader_h */ | |||
| @@ -11,6 +11,13 @@ | |||
| #import "ELSDKHeader.h" | |||
| /** 营养秤 A7 指令(payload[0]),新增同协议指令在此追加 */ | |||
| typedef NS_ENUM(NSUInteger, ELNutritionScaleCmd) { | |||
| ELNutritionScaleCmdWeight = 0x01, // MCU 上报重量 | |||
| ELNutritionScaleCmdSetUnit = 0x02, // APP 切换单位 | |||
| ELNutritionScaleCmdMakeZero = 0x04, // APP 下发归零 | |||
| ELNutritionScaleCmdError = 0x05, // MCU 上报异常(超载/低电) | |||
| }; | |||
| typedef NS_ENUM(NSUInteger, NutritionScaleTestStatus) { | |||
| //Real-time weight(实时重量) | |||
| @@ -47,6 +47,14 @@ NS_ASSUME_NONNULL_BEGIN | |||
| + (instancetype)shareManager; | |||
| /// 当前生效的 CID(SDK 内置 + App 传入) | |||
| - (NSArray<NSNumber *> *)supportCids; | |||
| - (BOOL)isSupportCid:(ELSupportDeviceType)cid; | |||
| /// 从 App 传入同协议额外 CID,扫描前调用。无需改 SDK。 | |||
| - (void)registerExtraCids:(NSArray<NSNumber *> *)cids; | |||
| @end | |||
| @interface ELNutritionScaleBleManager () | |||
| @@ -10,6 +10,10 @@ | |||
| @class ELEightScaleRecordModel; | |||
| @class ELEightScaleBleDataModel; | |||
| @class ELPeripheralModel; | |||
| typedef void (^ELEightScaleRecordSuccessBlock)(ELEightScaleRecordModel * _Nullable recordModel); | |||
| typedef void (^ELEightScaleRecordFailureBlock)(id _Nullable error); | |||
| NS_ASSUME_NONNULL_BEGIN | |||
| @@ -26,6 +30,21 @@ NS_ASSUME_NONNULL_BEGIN | |||
| //新算法 | |||
| +(ELEightScaleRecordModel *)getNewRecordModelWithBleDataModel:(ELEightScaleBleDataModel *)dataModel withUserSex:(NSInteger)sex height:(NSInteger)height age:(NSInteger)age; | |||
| /// 双频八电极后台算法:请求服务器并转成记录模型 | |||
| /// @param dataModel 八电极秤测量的数据 | |||
| /// @param peripheral 蓝牙外设,取 vid | |||
| /// @param sex 女性传0,男性传1 | |||
| /// @param height 身高,单位cm | |||
| /// @param age 年龄 | |||
| + (void)getDoubleEightRecordModelWithBleDataModel:(ELEightScaleBleDataModel *)dataModel | |||
| peripheral:(ELPeripheralModel *)peripheral | |||
| withUserSex:(NSInteger)sex | |||
| height:(NSInteger)height | |||
| age:(NSInteger)age | |||
| success:(ELEightScaleRecordSuccessBlock)success | |||
| failure:(ELEightScaleRecordFailureBlock)failure; | |||
| @end | |||
| NS_ASSUME_NONNULL_END | |||
| @@ -14,8 +14,27 @@ | |||
| #import <AILinkBleSDK/ELHeightAlgorithmusModel.h> | |||
| #import <AILinkBleSDK/ELWeightAlgorithmusModel.h> | |||
| #import <AILinkBleSDK/ELBodyIndexAlgorithmModel.h> | |||
| #import <AILinkBleSDK/ELEightScaleBadyInfo.h> | |||
| #import <AILinkBleSDK/ELPeripheralModel.h> | |||
| #import "BhBodyCompositionAllBody50KHz.h" | |||
| static NSString *ELEightScaleWeightShowString(id kgValue, ELDeviceWeightUnit weightUnit) { | |||
| return [ELWeightAlgorithmusModel getWeightShowStrWithTargetUnit:weightUnit bleWeightInt:[kgValue floatValue] * 10 bleWeightUnit:ELDeviceWeightUnit_KG bleWeightPoint:1]; | |||
| } | |||
| static NSString *ELEightScaleStringFromValue(id value) { | |||
| if (value == nil || value == [NSNull null]) { | |||
| return @""; | |||
| } | |||
| if ([value isKindOfClass:[NSString class]]) { | |||
| return value; | |||
| } | |||
| if ([value isKindOfClass:[NSArray class]]) { | |||
| return [(NSArray *)value componentsJoinedByString:@","]; | |||
| } | |||
| return [NSString stringWithFormat:@"%@", value]; | |||
| } | |||
| @implementation ELEightScaleAlgorithmTool | |||
| //新算法 | |||
| @@ -474,4 +493,133 @@ | |||
| } | |||
| + (void)getDoubleEightRecordModelWithBleDataModel:(ELEightScaleBleDataModel *)dataModel | |||
| peripheral:(ELPeripheralModel *)peripheral | |||
| withUserSex:(NSInteger)sex | |||
| height:(NSInteger)height | |||
| age:(NSInteger)age | |||
| success:(ELEightScaleRecordSuccessBlock)success | |||
| failure:(ELEightScaleRecordFailureBlock)failure { | |||
| [ELEightScaleBadyInfo getDoubleEightDataWithBleDataModel:dataModel | |||
| peripheral:peripheral | |||
| withUserSex:sex | |||
| height:height | |||
| age:age | |||
| success:^(NSDictionary *data) { | |||
| if (success) { | |||
| success([self recordModelWithServerData:data dataModel:dataModel withUserSex:sex height:height]); | |||
| } | |||
| } failure:failure]; | |||
| } | |||
| + (ELEightScaleRecordModel *)recordModelWithServerData:(NSDictionary *)dataDic | |||
| dataModel:(ELEightScaleBleDataModel *)dataModel | |||
| withUserSex:(NSInteger)sex | |||
| height:(NSInteger)height { | |||
| ELEightScaleRecordModel *recordModel = [[ELEightScaleRecordModel alloc] init]; | |||
| ELDeviceWeightUnit weightUnit = dataModel.weightUnit; | |||
| NSUInteger weightPoint = dataModel.weightPoint; | |||
| CGFloat kgWeight = [ELWeightAlgorithmusModel getKgWithWeightShowStr:dataModel.weight weightUnit:weightUnit weightPoint:weightPoint].floatValue; | |||
| CGFloat rightArmMuscle = [dataDic[@"muscleKgRightArm"] floatValue]; | |||
| CGFloat leftArmMuscle = [dataDic[@"muscleKgLeftArm"] floatValue]; | |||
| CGFloat rightLegMuscle = [dataDic[@"muscleKgRightLeg"] floatValue]; | |||
| CGFloat leftLegMuscle = [dataDic[@"muscleKgLeftLeg"] floatValue]; | |||
| CGFloat trunkMuscle = [dataDic[@"muscleKgTrunk"] floatValue]; | |||
| float muscleMass = rightArmMuscle + leftArmMuscle + rightLegMuscle + leftLegMuscle + trunkMuscle; | |||
| NSString *waterStr = ELEightScaleStringFromValue(dataDic[@"waterKg"]); | |||
| NSString *proteinMassStr = ELEightScaleWeightShowString(dataDic[@"proteinKg"], weightUnit); | |||
| float proteinKg = [ELWeightAlgorithmusModel getKgWithWeightShowStr:proteinMassStr weightUnit:weightUnit weightPoint:weightPoint].floatValue; | |||
| float numPoint = pow(10, weightPoint); | |||
| float standard = [ELBodyIndexAlgorithmModel getStandardWeight:sex andheight:height]; | |||
| CGFloat weightControl = kgWeight - standard; | |||
| NSUInteger weightContrlABS = roundf(fabs(weightControl * numPoint)); | |||
| NSString *weightContrlStr = [ELWeightAlgorithmusModel getWeightShowStrWithTargetUnit:weightUnit bleWeightInt:weightContrlABS bleWeightUnit:ELDeviceWeightUnit_KG bleWeightPoint:weightPoint]; | |||
| recordModel.bmi = ELEightScaleStringFromValue(dataDic[@"bMI"]); | |||
| recordModel.bfr = ELEightScaleStringFromValue(dataDic[@"bodyFatRate"]); | |||
| recordModel.sfr = ELEightScaleStringFromValue(dataDic[@"bodyFatSubCutRate"]); | |||
| recordModel.uvi = ELEightScaleStringFromValue(dataDic[@"vFAL"]); | |||
| recordModel.rom = muscleMass >= kgWeight ? @"" : [NSString stringWithFormat:@"%.1f", muscleMass / kgWeight * 100]; | |||
| recordModel.bmr = ELEightScaleStringFromValue(dataDic[@"bMR"]); | |||
| recordModel.bm = ELEightScaleWeightShowString(dataDic[@"boneKg"], weightUnit); | |||
| recordModel.vwc = [NSString stringWithFormat:@"%.1f", waterStr.floatValue / kgWeight * 100]; | |||
| recordModel.bodyAge = ELEightScaleStringFromValue(dataDic[@"bodyAge"]); | |||
| recordModel.pp = [NSString stringWithFormat:@"%.1f", proteinKg / kgWeight * 100]; | |||
| recordModel.adc = [NSString stringWithFormat:@"%d", dataModel.trunkAdc]; | |||
| recordModel.heartRate = dataModel.heartRate > 0 ? [NSString stringWithFormat:@"%d", dataModel.heartRate] : @""; | |||
| recordModel.createTime = dataModel.createTime; | |||
| recordModel.deviceAlgorithm = [NSString stringWithFormat:@"%d", dataModel.algorithmID]; | |||
| recordModel.standardWeight = [ELWeightAlgorithmusModel getWeightShowStrWithTargetUnit:weightUnit bleWeightInt:standard * numPoint bleWeightUnit:ELDeviceWeightUnit_KG bleWeightPoint:weightPoint]; | |||
| recordModel.weightControl = weightControl < 0 ? [NSString stringWithFormat:@"-%@", weightContrlStr] : weightContrlStr; | |||
| recordModel.fatMass = ELEightScaleWeightShowString(dataDic[@"bodyFatKg"], weightUnit); | |||
| recordModel.weightWithoutFat = ELEightScaleWeightShowString(dataDic[@"bodyFatFreeMassKg"], weightUnit); | |||
| if (muscleMass >= kgWeight) { | |||
| recordModel.musleMass = @""; | |||
| } else { | |||
| NSString *pointFormat = [NSString stringWithFormat:@"%%.%zdf", weightPoint]; | |||
| float muscleMassText = [[NSString stringWithFormat:pointFormat, muscleMass] floatValue]; | |||
| recordModel.musleMass = ELEightScaleWeightShowString(@(muscleMassText), weightUnit); | |||
| } | |||
| recordModel.proteinMass = proteinMassStr; | |||
| recordModel.fatLevel = [NSString stringWithFormat:@"%lu", (unsigned long)[ELBodyIndexAlgorithmModel getfatLevelWithweight:kgWeight andStandardWeight:[dataDic[@"idealWeightKg"] floatValue]]]; | |||
| recordModel.fatMassRightTop = ELEightScaleWeightShowString(dataDic[@"bodyFatKgRightArm"], weightUnit); | |||
| recordModel.fatMassRightBottom = ELEightScaleWeightShowString(dataDic[@"bodyFatKgRightLeg"], weightUnit); | |||
| recordModel.fatMassLeftTop = ELEightScaleWeightShowString(dataDic[@"bodyFatKgLeftArm"], weightUnit); | |||
| recordModel.fatMassLeftBottom = ELEightScaleWeightShowString(dataDic[@"bodyFatKgLeftLeg"], weightUnit); | |||
| recordModel.fatMassBody = ELEightScaleWeightShowString(dataDic[@"bodyFatKgTrunk"], weightUnit); | |||
| recordModel.musleMassRightTop = ELEightScaleWeightShowString(@(rightArmMuscle), weightUnit); | |||
| recordModel.musleMassRightBottom = ELEightScaleWeightShowString(@(rightLegMuscle), weightUnit); | |||
| recordModel.musleMassLeftTop = ELEightScaleWeightShowString(@(leftArmMuscle), weightUnit); | |||
| recordModel.musleMassLeftBottom = ELEightScaleWeightShowString(@(leftLegMuscle), weightUnit); | |||
| recordModel.musleMassBody = ELEightScaleWeightShowString(@(trunkMuscle), weightUnit); | |||
| CGFloat heightM = height / 100.0; | |||
| CGFloat limbsIndex = (rightArmMuscle + leftArmMuscle + rightLegMuscle + leftLegMuscle) / (heightM * heightM); | |||
| recordModel.musleMassLimbs = [NSString stringWithFormat:@"%.1f", limbsIndex]; | |||
| recordModel.fatMassRightTopRate = ELEightScaleStringFromValue(dataDic[@"bodyFatRateRightArm"]); | |||
| recordModel.fatMassRightBottomRate = ELEightScaleStringFromValue(dataDic[@"bodyFatRateRightLeg"]); | |||
| recordModel.fatMassLeftTopRate = ELEightScaleStringFromValue(dataDic[@"bodyFatRateLeftArm"]); | |||
| recordModel.fatMassLeftBottomRate = ELEightScaleStringFromValue(dataDic[@"bodyFatRateLeftLeg"]); | |||
| recordModel.fatMassBodyRate = ELEightScaleStringFromValue(dataDic[@"bodyFatRateTrunk"]); | |||
| recordModel.musleMassRightTopRate = ELEightScaleStringFromValue(dataDic[@"muscleRateRightArm"]); | |||
| recordModel.musleMassRightBottomRate = ELEightScaleStringFromValue(dataDic[@"muscleRateRightLeg"]); | |||
| recordModel.musleMassLeftTopRate = ELEightScaleStringFromValue(dataDic[@"muscleRateLeftArm"]); | |||
| recordModel.musleMassLeftBottomRate = ELEightScaleStringFromValue(dataDic[@"muscleRateLeftLeg"]); | |||
| recordModel.musleMassBodyRate = ELEightScaleStringFromValue(dataDic[@"muscleRateTrunk"]); | |||
| recordModel.mineralKg = ELEightScaleStringFromValue(dataDic[@"mineralKg"]); | |||
| recordModel.waterKg = waterStr; | |||
| recordModel.cellMassKg = ELEightScaleStringFromValue(dataDic[@"cellMassKg"]); | |||
| recordModel.waterECWKg = ELEightScaleStringFromValue(dataDic[@"waterECWKg"]); | |||
| recordModel.waterICWKg = ELEightScaleStringFromValue(dataDic[@"waterICWKg"]); | |||
| recordModel.muscleKgCon = ELEightScaleStringFromValue(dataDic[@"muscleKgCon"]); | |||
| recordModel.bodyFatKgCon = ELEightScaleStringFromValue(dataDic[@"bodyFatKgCon"]); | |||
| recordModel.whr = ELEightScaleStringFromValue(dataDic[@"wHR"]); | |||
| recordModel.bodyType = ELEightScaleStringFromValue(dataDic[@"bodyType"]); | |||
| recordModel.obesity = ELEightScaleStringFromValue(dataDic[@"obesity"]); | |||
| recordModel.bodyScore = ELEightScaleStringFromValue(dataDic[@"bodyScore"]); | |||
| recordModel.dci = ELEightScaleStringFromValue(dataDic[@"dCI"]); | |||
| recordModel.mineralKgStand = ELEightScaleStringFromValue(dataDic[@"mineralKgStand"]); | |||
| recordModel.waterECWKgStand = ELEightScaleStringFromValue(dataDic[@"waterECWKgStand"]); | |||
| recordModel.waterICWKgStand = ELEightScaleStringFromValue(dataDic[@"waterICWKgStand"]); | |||
| recordModel.cellMassKgStand = ELEightScaleStringFromValue(dataDic[@"cellMassKgStand"]); | |||
| recordModel.Z20KhzLeftArmDeCode = ELEightScaleStringFromValue(dataDic[@"z20KhzLeftArmDeCode"]); | |||
| recordModel.Z20KhzRightArmDeCode = ELEightScaleStringFromValue(dataDic[@"z20KhzRightArmDeCode"]); | |||
| recordModel.Z20KhzLeftLegDeCode = ELEightScaleStringFromValue(dataDic[@"z20KhzLeftLegDeCode"]); | |||
| recordModel.Z20KhzRightLegDeCode = ELEightScaleStringFromValue(dataDic[@"z20KhzRightLegDeCode"]); | |||
| recordModel.Z20KhzTrunkDeCode = ELEightScaleStringFromValue(dataDic[@"z20KhzTrunkDeCode"]); | |||
| recordModel.Z100KhzLeftArmDeCode = ELEightScaleStringFromValue(dataDic[@"z100KhzLeftArmDeCode"]); | |||
| recordModel.Z100KhzRightArmDeCode = ELEightScaleStringFromValue(dataDic[@"z100KhzRightArmDeCode"]); | |||
| recordModel.Z100KhzLeftLegDeCode = ELEightScaleStringFromValue(dataDic[@"z100KhzLeftLegDeCode"]); | |||
| recordModel.Z100KhzRightLegDeCode = ELEightScaleStringFromValue(dataDic[@"z100KhzRightLegDeCode"]); | |||
| recordModel.Z100KhzTrunkDeCode = ELEightScaleStringFromValue(dataDic[@"z100KhzTrunkDeCode"]); | |||
| return recordModel; | |||
| } | |||
| @end | |||
| @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN | |||
| ///水含量 | |||
| @property (nonatomic, copy) NSString *vwc; | |||
| ///身体年龄 | |||
| @property (nonatomic, assign) NSString *bodyAge; | |||
| @property (nonatomic, copy) NSString *bodyAge; | |||
| ///蛋白率 | |||
| @property (nonatomic, copy) NSString *pp; | |||
| ///躯干阻抗 | |||
| @@ -81,6 +81,84 @@ NS_ASSUME_NONNULL_BEGIN | |||
| @property (nonatomic, copy) NSString *musleMassLimbs; | |||
| #pragma mark - 新增指标 四肢肌肉和脂肪 占比 | |||
| //体脂率-右上 | |||
| @property (nonatomic, copy) NSString *fatMassRightTopRate; | |||
| //体脂率-右下 | |||
| @property (nonatomic, copy) NSString *fatMassRightBottomRate; | |||
| //体脂率-左上 | |||
| @property (nonatomic, copy) NSString *fatMassLeftTopRate; | |||
| //体脂率-左下 | |||
| @property (nonatomic, copy) NSString *fatMassLeftBottomRate; | |||
| //体脂率-躯干 | |||
| @property (nonatomic, copy) NSString *fatMassBodyRate; | |||
| //肌肉率-右上 | |||
| @property (nonatomic, copy) NSString *musleMassRightTopRate; | |||
| //肌肉率-右下 | |||
| @property (nonatomic, copy) NSString *musleMassRightBottomRate; | |||
| //肌肉率-左上 | |||
| @property (nonatomic, copy) NSString *musleMassLeftTopRate; | |||
| //肌肉率-左下 | |||
| @property (nonatomic, copy) NSString *musleMassLeftBottomRate; | |||
| //肌肉率-躯干 | |||
| @property (nonatomic, copy) NSString *musleMassBodyRate; | |||
| #pragma mark - 新增指标 | |||
| //矿物质重量-千克 | |||
| @property (nonatomic, copy)NSString *mineralKg; | |||
| //水分重量-千克 | |||
| @property (nonatomic, copy)NSString *waterKg; | |||
| //细胞质量重量-千克 | |||
| @property (nonatomic, copy)NSString *cellMassKg; | |||
| //细胞外水量-千克 | |||
| @property (nonatomic, copy)NSString *waterECWKg; | |||
| //细胞内水量-千克 | |||
| @property (nonatomic, copy)NSString *waterICWKg; | |||
| //肌肉控制量 | |||
| @property (nonatomic, copy)NSString *muscleKgCon; | |||
| //脂肪控制量-千克 | |||
| @property (nonatomic, copy)NSString *bodyFatKgCon; | |||
| //腰臀比 根据腰臀比可以计算出身体形态 | |||
| @property (nonatomic, copy)NSString *whr; | |||
| //身体类型 | |||
| @property (nonatomic, copy)NSString *bodyType; | |||
| //身体形态 | |||
| @property (nonatomic, copy)NSString *obesity; | |||
| //身体评分 | |||
| @property (nonatomic, copy)NSString *bodyScore; | |||
| //建议摄入量 | |||
| @property (nonatomic, copy)NSString *dci; | |||
| //矿物质重量 判断标准 | |||
| @property (nonatomic, copy)NSString *mineralKgStand; | |||
| //细胞外水量 判断标准 | |||
| @property (nonatomic, copy)NSString *waterECWKgStand; | |||
| //细胞内水分 判断标准 | |||
| @property (nonatomic, copy)NSString *waterICWKgStand; | |||
| //细胞质量 判断标准 | |||
| @property (nonatomic, copy)NSString *cellMassKgStand; | |||
| #pragma mark 阻抗 | |||
| //阻抗-20Khz-左臂 | |||
| @property (nonatomic, copy) NSString *Z20KhzLeftArmDeCode; | |||
| //阻抗-20Khz-右臂 | |||
| @property (nonatomic, copy) NSString *Z20KhzRightArmDeCode; | |||
| //阻抗-20Khz-左腿 | |||
| @property (nonatomic, copy) NSString *Z20KhzLeftLegDeCode; | |||
| //阻抗-20Khz-右腿 | |||
| @property (nonatomic, copy) NSString *Z20KhzRightLegDeCode; | |||
| //阻抗-20Khz-躯干 | |||
| @property (nonatomic, copy) NSString *Z20KhzTrunkDeCode; | |||
| //阻抗-100Khz-左臂 | |||
| @property (nonatomic, copy) NSString *Z100KhzLeftArmDeCode; | |||
| //阻抗-100Khz-右臂 | |||
| @property (nonatomic, copy) NSString *Z100KhzRightArmDeCode; | |||
| //阻抗-100Khz-左腿 | |||
| @property (nonatomic, copy) NSString *Z100KhzLeftLegDeCode; | |||
| //阻抗-100Khz-右腿 | |||
| @property (nonatomic, copy) NSString *Z100KhzRightLegDeCode; | |||
| //阻抗-100Khz-躯干 | |||
| @property (nonatomic, copy) NSString *Z100KhzTrunkDeCode; | |||
| @end | |||
| NS_ASSUME_NONNULL_END | |||
| @@ -12,7 +12,7 @@ | |||
| NS_ASSUME_NONNULL_BEGIN | |||
| @interface EightScaleConnectionViewController : UIViewController | |||
| @property (nonatomic, strong) ELPeripheralModel *p; | |||
| @property (nonatomic, strong) ELPeripheralModel *peripheralModel; | |||
| @end | |||
| NS_ASSUME_NONNULL_END | |||
| @@ -29,7 +29,7 @@ | |||
| [ELEightScaleBleManager shareManager].eightScaleDelegate = self; | |||
| [ELEightScaleBleManager shareManager].delegate =self; | |||
| [[ELEightScaleBleManager shareManager] connectPeripheral:self.p]; | |||
| [[ELEightScaleBleManager shareManager] connectPeripheral:self.peripheralModel]; | |||
| [self setupUIView]; | |||
| } | |||
| @@ -264,11 +264,20 @@ | |||
| #pragma mark ============ get all body fat data ============== | |||
| -(void)eightScaleBleReceiveTestData:(ELEightScaleBleDataModel *)dataModel{ | |||
| [self addLog:[NSString stringWithFormat:@"weight = %@%@",dataModel.weight,AiLinkBleWeightUnitDic[@(dataModel.weightUnit)]]]; | |||
| //Please input the correct height, age, gender of your app user | |||
| ELEightScaleRecordModel *bodyInfo = [ELEightScaleAlgorithmTool getRecordModelWithBleDataModel:dataModel withUserSex:1 height:175 age:25]; | |||
| [self addLog:[NSString stringWithFormat:@"---bodyInfo:%@",bodyInfo]]; | |||
| if (self.peripheralModel.cid == ELSupportDeviceType双频八电极体脂秤 | |||
| || self.peripheralModel.cid == ELSupportDeviceType_dualFrequencyEightelectrodeMCUAlgorithm) { | |||
| //Since the HTTP protocol is used, an exception needs to be added in Info.plist for app.api.elinkthings.com, allowing only this domain to use HTTP. Network permissions are also required. | |||
| //Please input the correct height, age, gender of your app user | |||
| [ELEightScaleAlgorithmTool getDoubleEightRecordModelWithBleDataModel:dataModel peripheral:self.peripheralModel withUserSex:1 height:175 age:25 success:^(ELEightScaleRecordModel *recordModel) { | |||
| } failure:^(id error) { | |||
| }]; | |||
| } else { | |||
| //Please input the correct height, age, gender of your app user | |||
| ELEightScaleRecordModel *bodyInfo = [ELEightScaleAlgorithmTool getRecordModelWithBleDataModel:dataModel withUserSex:1 height:175 age:25]; | |||
| [self addLog:[NSString stringWithFormat:@"---bodyInfo:%@",bodyInfo]]; | |||
| } | |||
| } | |||
| -(void)eightScaleBleReceiveErrorCode:(int)errorCode{ | |||
| @@ -316,7 +325,7 @@ | |||
| ELDeviceWeightUnit unit = ELDeviceWeightUnit_KG; | |||
| [[ELEightScaleBleManager shareManager] eightScaleSwitchWeightUnit:unit]; | |||
| if (self.p.deviceType == ELSupportDeviceTypeBLE_WIFIScale) { | |||
| if (self.peripheralModel.deviceType == ELSupportDeviceTypeBLE_WIFIScale) { | |||
| //获取蓝牙连接状态 | |||
| [[ELEightScaleBleManager shareManager] getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdTypeGetConnectState)]; | |||
| } | |||
| @@ -74,7 +74,7 @@ | |||
| -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | |||
| ELPeripheralModel *p = self.devices[indexPath.row]; | |||
| EightScaleConnectionViewController *vc = [[EightScaleConnectionViewController alloc] init]; | |||
| vc.p = p; | |||
| vc.peripheralModel = p; | |||
| [self.navigationController pushViewController:vc animated:YES]; | |||
| } | |||
| -(UITableView *)tableView{ | |||
| @@ -22,6 +22,19 @@ | |||
| <string>$(CURRENT_PROJECT_VERSION)</string> | |||
| <key>ITSAppUsesNonExemptEncryption</key> | |||
| <false/> | |||
| <key>NSAppTransportSecurity</key> | |||
| <dict> | |||
| <key>NSExceptionDomains</key> | |||
| <dict> | |||
| <key>app.api.elinkthings.com</key> | |||
| <dict> | |||
| <key>NSExceptionAllowsInsecureHTTPLoads</key> | |||
| <true/> | |||
| <key>NSIncludesSubdomains</key> | |||
| <true/> | |||
| </dict> | |||
| </dict> | |||
| </dict> | |||
| <key>LSRequiresIPhoneOS</key> | |||
| <true/> | |||
| <key>NSBluetoothAlwaysUsageDescription</key> | |||
| @@ -18,3 +18,4 @@ | |||
| | 1.10.0 | 20240910 | larry | 修改 增加 带屏食物探针盒 多探针盒子 | | |||
| | 1.11.0 | 20250305 | larry | WIFI 血压计 Demo 优化;SDK问题修复 | | |||
| | 1.12.6 | 20260715 | cyc | 优化温湿度计丢数据问题 修复温湿度校准设置协议解析问题 | | |||
| | 1.12.11 | 20261009 | cyc | 双频八电极增加服务器算法 | | |||