@@ -11,6 +11,8 @@ | |||
78350BB729D282A300456695 /* libBhBodyComposition120.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78350BB429D282A300456695 /* libBhBodyComposition120.a */; }; | |||
78350BBB29D2869000456695 /* BodyScaleVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 78350BB929D2869000456695 /* BodyScaleVC.m */; }; | |||
78350BBD29D28C1200456695 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 78350BBC29D28C1200456695 /* README.md */; }; | |||
78B153AD2AD16A5000C81229 /* ELWIFIBloodPressureVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78B153AB2AD16A5000C81229 /* ELWIFIBloodPressureVC.xib */; }; | |||
78B153AE2AD16A5000C81229 /* ELWIFIBloodPressureVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 78B153AC2AD16A5000C81229 /* ELWIFIBloodPressureVC.m */; }; | |||
78DC4DE32990FB2E006C6911 /* ELDemoScanVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78DC4DDE2990FB2E006C6911 /* ELDemoScanVC.xib */; }; | |||
78DC4DE42990FB2E006C6911 /* ELDemoDeviceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 78DC4DDF2990FB2E006C6911 /* ELDemoDeviceModel.m */; }; | |||
78DC4DE52990FB2E006C6911 /* ELDemoScanVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 78DC4DE02990FB2E006C6911 /* ELDemoScanVC.m */; }; | |||
@@ -123,6 +125,9 @@ | |||
78350BB929D2869000456695 /* BodyScaleVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BodyScaleVC.m; sourceTree = "<group>"; }; | |||
78350BBA29D2869000456695 /* BodyScaleVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BodyScaleVC.h; sourceTree = "<group>"; }; | |||
78350BBC29D28C1200456695 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; }; | |||
78B153AA2AD16A5000C81229 /* ELWIFIBloodPressureVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELWIFIBloodPressureVC.h; sourceTree = "<group>"; }; | |||
78B153AB2AD16A5000C81229 /* ELWIFIBloodPressureVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ELWIFIBloodPressureVC.xib; sourceTree = "<group>"; }; | |||
78B153AC2AD16A5000C81229 /* ELWIFIBloodPressureVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELWIFIBloodPressureVC.m; sourceTree = "<group>"; }; | |||
78DC4DDE2990FB2E006C6911 /* ELDemoScanVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ELDemoScanVC.xib; sourceTree = "<group>"; }; | |||
78DC4DDF2990FB2E006C6911 /* ELDemoDeviceModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDemoDeviceModel.m; sourceTree = "<group>"; }; | |||
78DC4DE02990FB2E006C6911 /* ELDemoScanVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDemoScanVC.m; sourceTree = "<group>"; }; | |||
@@ -330,6 +335,7 @@ | |||
children = ( | |||
955725E0276C38CC003BFBAC /* 04_BabyScale */, | |||
955725BA276C38CC003BFBAC /* 05_BloodPressure */, | |||
78B153A92AD16A5000C81229 /* 05B_WIFI_BLE_BloodPressure */, | |||
955725E5276C38CC003BFBAC /* 06_HeightGuage */, | |||
78E07B662A49663F00E68200 /* 06B_BroadcastHeightGuage */, | |||
9557261E276C38CD003BFBAC /* 07_RemoteControl */, | |||
@@ -382,6 +388,16 @@ | |||
name = SDK; | |||
sourceTree = "<group>"; | |||
}; | |||
78B153A92AD16A5000C81229 /* 05B_WIFI_BLE_BloodPressure */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
78B153AA2AD16A5000C81229 /* ELWIFIBloodPressureVC.h */, | |||
78B153AB2AD16A5000C81229 /* ELWIFIBloodPressureVC.xib */, | |||
78B153AC2AD16A5000C81229 /* ELWIFIBloodPressureVC.m */, | |||
); | |||
path = 05B_WIFI_BLE_BloodPressure; | |||
sourceTree = "<group>"; | |||
}; | |||
78DC38C329278F790080E0D9 /* BhBodyComposition120 */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
@@ -935,6 +951,7 @@ | |||
isa = PBXResourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
78B153AD2AD16A5000C81229 /* ELWIFIBloodPressureVC.xib in Resources */, | |||
78DC4DF42990FB40006C6911 /* ELDeviceTypeCell.xib in Resources */, | |||
E622E287243F1D41003C319D /* Main.storyboard in Resources */, | |||
78E07B7E2A49664E00E68200 /* MeatProbeBoxVC.xib in Resources */, | |||
@@ -987,6 +1004,7 @@ | |||
9557262F276C38CD003BFBAC /* ELBfsWifiConnectTableViewCell.m in Sources */, | |||
95572623276C38CD003BFBAC /* BloodConnectViewController.m in Sources */, | |||
78350BBB29D2869000456695 /* BodyScaleVC.m in Sources */, | |||
78B153AE2AD16A5000C81229 /* ELWIFIBloodPressureVC.m in Sources */, | |||
95572649276C38CD003BFBAC /* ToothbrushScanViewController.m in Sources */, | |||
95572638276C38CD003BFBAC /* NutritionScaleScanViewController.m in Sources */, | |||
958B4EB5263C08E800476BAE /* MASViewConstraint.m in Sources */, | |||
@@ -1193,7 +1211,7 @@ | |||
buildSettings = { | |||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
CODE_SIGN_STYLE = Automatic; | |||
CURRENT_PROJECT_VERSION = 20230626; | |||
CURRENT_PROJECT_VERSION = 20231007; | |||
DEVELOPMENT_TEAM = YEU77XR292; | |||
FRAMEWORK_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1215,9 +1233,9 @@ | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | |||
); | |||
MARKETING_VERSION = 1.6.1; | |||
MARKETING_VERSION = 1.7.0; | |||
OTHER_LDFLAGS = "-ObjC"; | |||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AILinkBleSDKDemo; | |||
PRODUCT_BUNDLE_IDENTIFIER = com.ellinkthings.ailinksdk.app; | |||
PRODUCT_NAME = "$(TARGET_NAME)"; | |||
TARGETED_DEVICE_FAMILY = "1,2"; | |||
}; | |||
@@ -1228,7 +1246,7 @@ | |||
buildSettings = { | |||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
CODE_SIGN_STYLE = Automatic; | |||
CURRENT_PROJECT_VERSION = 20230626; | |||
CURRENT_PROJECT_VERSION = 20231007; | |||
DEVELOPMENT_TEAM = YEU77XR292; | |||
FRAMEWORK_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1250,9 +1268,9 @@ | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | |||
); | |||
MARKETING_VERSION = 1.6.1; | |||
MARKETING_VERSION = 1.7.0; | |||
OTHER_LDFLAGS = "-ObjC"; | |||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AILinkBleSDKDemo; | |||
PRODUCT_BUNDLE_IDENTIFIER = com.ellinkthings.ailinksdk.app; | |||
PRODUCT_NAME = "$(TARGET_NAME)"; | |||
TARGETED_DEVICE_FAMILY = "1,2"; | |||
}; |
@@ -28,6 +28,9 @@ | |||
#import "ELNoiseMeterBleStatusModel.h" | |||
#import "ELVictorLuxMeterBleModel.h" | |||
#import "ELVictorLuxMeterBleTool.h" | |||
#import "ELAIFitScaleBleDataModel.h" | |||
#import "ELAIFitScaleBleHeader.h" | |||
#import "ELAIFitScaleBleManager.h" | |||
#import "ELAiFreshNutritionScaleBleHeader.h" | |||
#import "ELAiFreshNutritionScaleBleManager.h" | |||
#import "ELAiFreshNutritionScaleDataModel.h" |
@@ -9,6 +9,6 @@ | |||
#define AILinkBleSDK_Version_h | |||
//版本号 SDK Version | |||
#define AiLinkBleSDKVersion @"1.6.1" //20230626 增加 广播身高仪 食物探针 食物探针盒子 支持 | |||
#define AiLinkBleSDKVersion @"1.7.0" // 20231007 增加 WIFI_BLE 血压计 支持 | |||
#endif /* AILinkBleSDK_Version_h */ |
@@ -0,0 +1,82 @@ | |||
// | |||
// ELAIFitScaleBleDataModel.h | |||
// Pods | |||
// | |||
// Created by LarryZhang on 2023/8/11. | |||
// | |||
#import <Foundation/Foundation.h> | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface ELAIFitScaleBleDataModel : NSObject | |||
//@property (nonatomic, assign) double weightTimeStamp; | |||
/// weight 565 | |||
@property (nonatomic, assign) float weightsum; | |||
@property (nonatomic, assign) NSUInteger weightPoint; | |||
/// TEMP | |||
@property (nonatomic, assign) float temperature; | |||
/// BMI | |||
@property (nonatomic, assign) float BMI; | |||
/// bfr | |||
@property (nonatomic, assign) float fatRate; | |||
/// rom | |||
@property (nonatomic, assign) float muscle; | |||
/// vwc | |||
@property (nonatomic, assign) float moisture; | |||
/// bm | |||
@property (nonatomic, assign) float boneMass; | |||
/// sfr | |||
@property (nonatomic, assign) float subcutaneousFat; | |||
/// bmr | |||
@property (nonatomic, assign) float BMR; | |||
/// pp | |||
@property (nonatomic, assign) float proteinRate; | |||
/// uvi | |||
@property (nonatomic, assign) float visceralFat; | |||
/// bodyAge | |||
@property (nonatomic, assign) float physicalAge; | |||
/// adc | |||
@property (nonatomic, assign) float adc; | |||
///Creation time with an accuracy of 1(创建时间,精度为1) | |||
@property (nonatomic, assign) long long createTime; | |||
///Algorithm ID(算法ID) | |||
@property (nonatomic, assign) NSUInteger algNum; | |||
@end | |||
NS_ASSUME_NONNULL_END | |||
/** | |||
APP下发当前用户或者用户列表前需要将appUser转换为如下bleUser | |||
*/ | |||
@interface ELAIFitScaleBleUserModel : NSObject | |||
@property (nonatomic, assign) long long createTime; | |||
@property (nonatomic, assign) NSUInteger usrID; | |||
@property (nonatomic, assign) NSUInteger sex; //性别 | |||
@property (nonatomic, assign) NSUInteger age; //Age 28 (only counts for the whole year)(年龄28(只算整年)) | |||
@property (nonatomic, assign) NSUInteger height; //Height 170 (Unit fixed to death: cm, accuracy 1)(身高170(单位定死:cm,精度1)) | |||
@property (nonatomic, assign) NSUInteger weight; //Weight 562 (Unit fixed death: kg, accuracy 0.1) 120lb-》 54.4lkg-》 545(体重562(单位定死:kg,精度0.1) 120lb-》54.4lkg-》545) | |||
@property (nonatomic, assign) NSUInteger adc;//Impedance 1230 (accuracy is 1Ω)(阻抗1230(精度为 1Ω)) | |||
@end |
@@ -0,0 +1,52 @@ | |||
// | |||
// ELAIFitScaleBleHeader.h | |||
// Pods | |||
// | |||
// Created by LarryZhang on 2023/8/11. | |||
// | |||
#ifndef ELAIFitScaleBleHeader_h | |||
#define ELAIFitScaleBleHeader_h | |||
typedef NS_ENUM(NSUInteger, AIFitScaleStatus) { //Byte[6] | |||
AIFitScaleStatusRealTime = 0xCE,//0xCE:实时重量,0xCA:稳定重量 | |||
AIFitScaleStatusStable = 0xCA,//0xCE:实时重量,0xCA:稳定重量 | |||
AIFitScaleStatusImpedance = 0xCB,//阻抗功能标识码 | |||
AIFitScaleStatusUniversal = 0xCC,//通用标识码 | |||
}; | |||
/*Weight unit(重量单位)*/ | |||
typedef NS_ENUM(NSInteger, AIFitScaleWeightUnit) { | |||
AIFitScaleWeightUnitKG = 0 , | |||
AIFitScaleWeightUnitLB = 1 , | |||
AIFitScaleWeightUnitSTLB = 2 , | |||
AIFitScaleWeightUnitJIN = 3 , | |||
}; | |||
typedef NS_ENUM(NSInteger, MeasureStatus) { | |||
MeasureStatus_Unstable = 0, | |||
MeasureStatus_Stable, | |||
MeasureStatus_Complete, | |||
}; | |||
typedef NS_ENUM(NSInteger, AdcMeasureStatus) { | |||
AdcMeasureStatus_Measuring, | |||
AdcMeasureStatus_Success, | |||
AdcMeasureStatus_Failed, | |||
}; | |||
typedef NS_ENUM(NSInteger, HistoryStatus) { | |||
HistoryStatus_NoHistory = 0, | |||
HistoryStatus_StartSendHistory, | |||
HistoryStatus_ReceiveOneHistory, | |||
HistoryStatus_EndSendHistory, | |||
}; | |||
#endif /* ELAIFitScaleBleHeader_h */ |
@@ -0,0 +1,85 @@ | |||
// | |||
// ELAIFitScaleBleManager.h | |||
// Pods | |||
// | |||
// Created by LarryZhang on 2023/8/11. | |||
// | |||
#import "ELBluetoothManager.h" | |||
#import "ELAIFitScaleBleHeader.h" | |||
NS_ASSUME_NONNULL_BEGIN | |||
@class ELAIFitScaleBleDataModel,ELAIFitScaleBleUserModel; | |||
@protocol AIFitScaleBleDelegate; | |||
@interface ELAIFitScaleBleManager : ELBluetoothManager | |||
@property(nonatomic, weak) id <AIFitScaleBleDelegate> aifitScaleBleDelegate; | |||
+ (instancetype)shareManager; | |||
@end | |||
@interface ELAIFitScaleBleManager () | |||
- (void)autoScan; | |||
- (void)stopAutoScan; | |||
- (void)checkStatus; | |||
@end | |||
@interface ELAIFitScaleBleManager () | |||
- (void)aIFitSendSwitUnit:(AIFitScaleWeightUnit)unit; | |||
- (void)aIFitSendRequestBMVer; | |||
- (void)aIFitSendSyncDateTime; | |||
- (void)aIFitSendCurrentUserInfoWithUserId:(NSInteger)userId Sex:(NSInteger)sex Age:(NSInteger)age Height:(NSInteger)height; | |||
- (void)aIFitSendCurrentUserInfoList:(NSArray *)userList; | |||
- (void)aIFitSendRequestHistory ; | |||
@end | |||
@protocol AIFitScaleBleDelegate <NSObject> | |||
@optional | |||
/// 蓝牙连接状态 | |||
/// @param state 连接状态 | |||
- (void)deviceBleReceiveState:(ELBluetoothState)state; | |||
/// @param result :秤进入低功耗模式(秤黑屏) | |||
- (void)deviceBleReceiveDevicesLightOff:(BOOL)result; | |||
/// 附近的设备 | |||
/// @param devices 设备列表 | |||
- (void)deviceBleReceiveDevices:(NSArray<ELPeripheralModel *> *_Nullable)devices; | |||
//正在连接中倒计时 | |||
- (void)deviceBleCountDown:(NSInteger)count; | |||
//ble version | |||
- (void)firmwareVersion:(NSString *)version; | |||
- (void)bluetoothReceivePassData:(NSData *)data; | |||
- (void)blueToothBackConnectScaleWeightData:(ELAIFitScaleBleDataModel *)model status:(MeasureStatus)status; | |||
- (void)blueToothBackAdc:(NSUInteger)adc status:(AdcMeasureStatus)status; | |||
- (void)blueToothBackHistoryDataModel:(ELAIFitScaleBleUserModel *)userModel bodyDataModel:(ELAIFitScaleBleDataModel*)dataModel status:(HistoryStatus)status; | |||
- (void)blueToothBackAlgorithmNumber:(NSUInteger)algorithmNo; | |||
- (void)blueToothBackWriteCurrentUserResult:(BOOL)result; | |||
- (void)blueToothBackChangeUnitResult:(BOOL)result; | |||
- (void)blueToothBackWriteAppTimeToBleResult:(BOOL)result; | |||
- (void)blueToothBackWriteOfflineUserListResult:(BOOL)result; | |||
- (void)blueToothBackUpdateOfflineSingleUserResult:(BOOL)result; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -149,6 +149,9 @@ NS_ASSUME_NONNULL_BEGIN | |||
///同步手机本地时间给mcu,每次连接成功后会自动调用 | |||
- (void)syncMCUNowDate; | |||
///同步手机时间戳给设备 //0x45 | |||
- (void)syncUnixTimestamp; | |||
///查询mqtt链接状态 CMD=0xC5 | |||
- (void)checkMqttState; | |||
@@ -53,17 +53,17 @@ NS_ASSUME_NONNULL_BEGIN | |||
//A7数据 payload | |||
- (void)aiLinkBleReceiveA7Data:(NSData *)payload; | |||
- (void)aiLinkBleReceiveA7Data:(NSData *)payload withMac:(NSData *)mac DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveA7Data:aILinkPeripheral' instead"); | |||
- (void)aiLinkBleReceiveA7Data:(NSData *)packet aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveA7Data:manager' instead"); | |||
- (void)aiLinkBleReceiveA7Data:(NSData *)packet aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral; | |||
- (void)aiLinkBleReceiveA7Data:(NSData *)rawData manager:(ELAILinkBleManager *)manager; | |||
//A6数据 packet | |||
- (void)aiLinkBleReceiveA6Data:(NSData *)packet; | |||
- (void)aiLinkBleReceiveA6Data:(NSData *)packet withMac:(NSData *)mac DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveA6Data:aILinkPeripheral' instead"); | |||
- (void)aiLinkBleReceiveA6Data:(NSData *)packet aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveA6Data:manager' instead"); | |||
- (void)aiLinkBleReceiveA6Data:(NSData *)packet aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral; | |||
- (void)aiLinkBleReceiveA6Data:(NSData *)rawData manager:(ELAILinkBleManager *)manager; | |||
//原始数据 | |||
- (void)aiLinkBleReceiveRawData:(NSData *)rawData aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveRawData:manager' instead"); | |||
- (void)aiLinkBleReceiveRawData:(NSData *)rawData aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral; | |||
- (void)aiLinkBleReceiveRawData:(NSData *)rawData manager:(ELAILinkBleManager *)manager; | |||
@end |
@@ -67,6 +67,10 @@ Callback WIFI password(回调WIFI密码) | |||
*/ | |||
-(void)bleWifiReceiveWifiPort:(int)port; | |||
//Returns the visited path(返回访问的path) | |||
- (void)bleWifiReceiveWifiPath:(NSString *)path; | |||
/** | |||
Set or query the callback of the instruction execution result(设置指令蓝牙WIFI响应回调方法) | |||
只支持蓝牙Wifi部分枚举 |
@@ -32,6 +32,10 @@ static NSString *GET_A7_DECRYPT_BLE_PAYLOAD_DATA_CONTENT = @"GET_A7_DECRYPT_BLE_ | |||
@property (nonatomic, assign, readonly) ELBluetoothState state; | |||
//version number(版本号) | |||
@property (nonatomic, copy, readonly) NSString *bmVersion; | |||
// 好身材秤 连接秤特有区分ac02和ac03 | |||
@property (nonatomic,assign) Byte acByte; | |||
/** | |||
Save the model corresponding to the currently connected device | |||
保存当前连接的设备对应的模型 | |||
@@ -48,9 +52,6 @@ static NSString *GET_A7_DECRYPT_BLE_PAYLOAD_DATA_CONTENT = @"GET_A7_DECRYPT_BLE_ | |||
/** 需要搜索与系统绑定的蓝牙设备 */ | |||
@property (nonatomic, assign) BOOL needScanBindSysDevice; | |||
//设置appkey和secret | |||
+(void)setAppKey:(NSString *)key appSecret:(NSString *)secret; | |||
//设置支持设备列表 - 扫描过滤 | |||
- (void)setSupportDeviceCids:(NSArray<NSNumber *> *)cids; | |||
@@ -77,6 +77,9 @@ NS_ASSUME_NONNULL_BEGIN | |||
/** 设备上发错误码 */ | |||
- (void)eightScaleBleReportErrorCode:(enum EightScaleErrorCodeType)type; | |||
//回调透传数 | |||
- (void)eightScaleBleReceivePassData:(NSData *)data; | |||
@end | |||
@interface ELEightScaleBleManager : ELBluetoothManager |
@@ -103,6 +103,8 @@ typedef NS_ENUM(NSUInteger, ELSupportDeviceType) { | |||
ELSupportDeviceTypeBodyScale = 0x0056, //Body scale(no body fat) 体重秤(无体脂) | |||
ELSupportDeviceTypeAIFitScale = 0x005E, //好身材体脂秤(蓝牙连接) | |||
ELSupportDeviceTypeBroadcastScale = (0xffff +0x01) , //655536 Broadcast body fat scale(AILink广播体脂秤) | |||
ELSupportDeviceTypeBroadcastHeightGauge = (0xffff + 0x03) , //65538 广播身高仪 | |||
ELSupportDeviceTypeBroadcastScale_Lingyang = (0xffff +0x16) , //65557 凌阳广播体脂秤 |
@@ -97,6 +97,8 @@ typedef NS_ENUM(NSUInteger, ELInetSetCmdType) { | |||
ELInetSetCmdTypeSetSmartLockA6Data = 0x34, //Door lock 0x34 represents the A6 protocol (see the second level command for details)(门锁0x34代表A6协议(具体见二级指令)) | |||
ELInetSetCmdTypeSetBasicInfoData = 0x35, //Obtain basic device information data(获取设备基本信息数据) | |||
ELInetSetCmdTypeSyncMCUNowDate = 0x37, //Sync the current time of the system(设置手机时间给MCU) | |||
ELInetSetCmdTypeDevcieRequestUnixTime = 0x44, //Device request the current time stamp(设备请求手机时间戳) | |||
ELInetSetCmdTypeSyncUnixTimeToDevice = 0x45, //Sync the current time stamp of the Device(同步手机时间戳给设备) | |||
#pragma mark ============ 蓝牙Wifi ============== | |||
ELInetSetCmdTypeBleWifiSetWifiMac = 0x84, //设置WIFI Mac地址 | |||
ELInetSetCmdTypeBleWifiSetWifiPwd = 0x86, //设置WIFI 密码 |
@@ -1,94 +1,9 @@ | |||
{ | |||
"images" : [ | |||
{ | |||
"idiom" : "iphone", | |||
"scale" : "2x", | |||
"size" : "20x20" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"scale" : "3x", | |||
"size" : "20x20" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"scale" : "2x", | |||
"size" : "29x29" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"scale" : "3x", | |||
"size" : "29x29" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"scale" : "2x", | |||
"size" : "40x40" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"scale" : "3x", | |||
"size" : "40x40" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"scale" : "2x", | |||
"size" : "60x60" | |||
}, | |||
{ | |||
"filename" : "logomaker.png", | |||
"idiom" : "iphone", | |||
"scale" : "3x", | |||
"size" : "60x60" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"scale" : "1x", | |||
"size" : "20x20" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"scale" : "2x", | |||
"size" : "20x20" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"scale" : "1x", | |||
"size" : "29x29" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"scale" : "2x", | |||
"size" : "29x29" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"scale" : "1x", | |||
"size" : "40x40" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"scale" : "2x", | |||
"size" : "40x40" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"scale" : "1x", | |||
"size" : "76x76" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"scale" : "2x", | |||
"size" : "76x76" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"scale" : "2x", | |||
"size" : "83.5x83.5" | |||
}, | |||
{ | |||
"idiom" : "ios-marketing", | |||
"scale" : "1x", | |||
"filename" : "logomaker (2).jpg", | |||
"idiom" : "universal", | |||
"platform" : "ios", | |||
"size" : "1024x1024" | |||
} | |||
], |
@@ -0,0 +1,23 @@ | |||
// | |||
// ELWIFIBloodPressureVC.h | |||
// AILinkBleSDK_Example | |||
// | |||
// Created by LarryZhang on 2023/10/6. | |||
// Copyright © 2023 zhengzida. All rights reserved. | |||
// | |||
#import <UIKit/UIKit.h> | |||
NS_ASSUME_NONNULL_BEGIN | |||
@class ELAILinkPeripheral; | |||
@class ELPeripheralModel; | |||
@interface ELWIFIBloodPressureVC : UIViewController | |||
@property (nonatomic, strong) ELAILinkPeripheral *per; | |||
@property (nonatomic, strong) ELPeripheralModel *p; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,563 @@ | |||
// | |||
// ELWIFIBloodPressureVC.m | |||
// AILinkBleSDK_Example | |||
// | |||
// Created by LarryZhang on 2023/10/6. | |||
// Copyright © 2023 zhengzida. All rights reserved. | |||
// | |||
#import "ELWIFIBloodPressureVC.h" | |||
#import <AILinkBleSDK/ELAILinkBleManager.h> | |||
#import <AILinkBleSDK/ELBluetoothManager+BleWifi.h> | |||
#import <AILinkBleSDK/ElBloodBleWifiManager.h> | |||
#import <AILinkBleSDK/ELbloodPresureBleWifiDataModel.h> | |||
#import "ELBfsWifiConnectTableViewCell.h" | |||
@interface ELWIFIBloodPressureVC () <ELBluetoothManagerDelegate, ElBleWifiDelegate, ELBloodBleWifiManagerDelegate, UITextFieldDelegate, UITableViewDelegate, UITableViewDataSource> | |||
@property (weak, nonatomic) IBOutlet UITextField *urlTexField; | |||
@property (weak, nonatomic) IBOutlet UITextField *portTexField; | |||
@property (weak, nonatomic) IBOutlet UITextField *pathTexField; | |||
@property (weak, nonatomic) IBOutlet UILabel *bleStatusLabel; | |||
@property (weak, nonatomic) IBOutlet UITextView *logTextView; | |||
@property (weak, nonatomic) IBOutlet UITableView *tableView; | |||
@property (nonatomic, strong) NSMutableArray<ELBleWifiDetailModel *> *dataSource; | |||
@end | |||
@implementation ELWIFIBloodPressureVC | |||
- (void)viewDidLoad { | |||
[super viewDidLoad]; | |||
// Do any additional setup after loading the view from its nib. | |||
[ElBloodBleWifiManager shareManager].delegate = self; | |||
[ElBloodBleWifiManager shareManager].bleWifiDelegate = self; | |||
[ElBloodBleWifiManager shareManager].bloodDelegate = self; | |||
[[ElBloodBleWifiManager shareManager] startScanFilterCids:@[@(ELSupportDeviceTypeBLE_WIFIBlood)]]; | |||
NSString *log = @"开始扫描"; | |||
[self addLog:log]; | |||
self.urlTexField.text = @"iot.elink.com"; | |||
self.portTexField.text = @"80"; | |||
self.pathTexField.text = @""; | |||
self.dataSource = [NSMutableArray array]; | |||
} | |||
-(void)viewDidDisappear:(BOOL)animated{ | |||
[super viewDidDisappear:animated]; | |||
[[ElBloodBleWifiManager shareManager] stopScan]; | |||
[[ElBloodBleWifiManager shareManager] disconnectPeripheral]; | |||
[ElBloodBleWifiManager shareManager].delegate = nil; | |||
[ElBloodBleWifiManager shareManager].bleWifiDelegate = nil; | |||
[ElBloodBleWifiManager shareManager].bloodDelegate = nil; | |||
} | |||
#pragma mark - Action | |||
- (IBAction)requestWifiListAction:(id)sender { | |||
[self.dataSource removeAllObjects]; | |||
[self.tableView reloadData]; | |||
[[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiGetNearbyWifi]; | |||
NSString *log = @"获取 附近的 WIFI 列表"; | |||
[self addLog:log]; | |||
} | |||
- (IBAction)setupServerInfoAcion:(id)sender { | |||
NSString *url = self.urlTexField.text; | |||
NSString *port = self.portTexField.text; | |||
NSString *path = self.pathTexField.text; | |||
[[ElBloodBleWifiManager shareManager] setDevAccessIpAddress:url portNumber:port.intValue path:path]; | |||
NSString *log = @"设置 服务器信息"; | |||
[self addLog:log]; | |||
} | |||
- (IBAction)requestServerInfoAcion:(id)sender { | |||
[[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiGetURL]; | |||
[[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiGetPort]; | |||
[[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiGetPathAddress]; | |||
NSString *log = @"获取 服务器信息"; | |||
[self addLog:log]; | |||
} | |||
- (IBAction)switchUintAction:(id)sender { | |||
static BOOL value = YES; | |||
if (value) { | |||
[[ElBloodBleWifiManager shareManager] changeUnit:ELDeviceBloodPressureUnit_mmhg]; | |||
NSString *log = @"设置单位 mmhg"; | |||
[self addLog:log]; | |||
} else { | |||
[[ElBloodBleWifiManager shareManager] changeUnit:ELDeviceBloodPressureUnit_kPa]; | |||
NSString *log = @"设置单位 kPa"; | |||
[self addLog:log]; | |||
} | |||
value = !value; | |||
} | |||
- (IBAction)switchSpeechAtion:(id)sender { | |||
static BOOL value = YES; | |||
if (value) { | |||
[[ElBloodBleWifiManager shareManager] sendSwitchVoice:ELBloodBleSwitchVoiceTypeOn]; | |||
NSString *log = @"打开 语音"; | |||
[self addLog:log]; | |||
} else { | |||
[[ElBloodBleWifiManager shareManager] sendSwitchVoice:ELBloodBleSwitchVoiceTypeOff]; | |||
NSString *log = @"关闭 语音"; | |||
[self addLog:log]; | |||
} | |||
value = !value; | |||
} | |||
- (IBAction)startMeasureAction:(id)sender { | |||
[[ElBloodBleWifiManager shareManager] sendInteractiveInstructions:ELBloodInteractionTypeStartTest]; | |||
NSString *log = @"开始 测量"; | |||
[self addLog:log]; | |||
} | |||
- (IBAction)stopMeasureAction:(id)sender { | |||
[[ElBloodBleWifiManager shareManager] sendInteractiveInstructions:ELBloodInteractionTypeStopTest]; | |||
NSString *log = @"停止 测量"; | |||
[self addLog:log]; | |||
} | |||
- (IBAction)clearAction:(id)sender { | |||
self.logTextView.text = @""; | |||
} | |||
- (IBAction)shareLogAction:(id)sender { | |||
} | |||
#pragma mark - textField Delegate | |||
- (void)textFieldDidEndEditing:(UITextField *)textField { | |||
if (textField.tag == 119) { | |||
NSLog(@"%@",textField.text); | |||
//MARK:7.再发送配置wifi的密码的指令 | |||
[[ElBloodBleWifiManager shareManager] bleWifiSetWifiPwd:textField.text]; | |||
} | |||
} | |||
#pragma mark - tableView Delegate And DataSource | |||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | |||
return 1; | |||
} | |||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |||
return self.dataSource.count; | |||
} | |||
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { | |||
return 0.f; | |||
} | |||
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { | |||
return nil; | |||
} | |||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |||
static NSString *cellId = @"ELBfsWifiConnectTableViewCell"; | |||
ELBfsWifiConnectTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; | |||
if (!cell) { | |||
cell = [[ELBfsWifiConnectTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; | |||
} | |||
ELBleWifiDetailModel *model = self.dataSource[indexPath.row]; | |||
cell.wifiName = model.wifiName; | |||
if (model.wifiState == ELBleWifiUseStateConnected) { | |||
cell.isLink = YES; | |||
} else { | |||
cell.isLink = NO; | |||
} | |||
return cell; | |||
} | |||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |||
[tableView deselectRowAtIndexPath:indexPath animated:YES]; | |||
ELBleWifiDetailModel *model = self.dataSource[indexPath.row]; | |||
//MARK:5.先发送配置wifi的mac地址的指令 | |||
[[ElBloodBleWifiManager shareManager] bleWifiSetConnectWifiMac:model.macData]; | |||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"请输入wifi密码" message:model.wifiName preferredStyle:UIAlertControllerStyleAlert]; | |||
UIAlertAction *conform = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { | |||
NSLog(@"点击了确认按钮"); | |||
}]; | |||
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { | |||
NSLog(@"点击了取消按钮"); | |||
}]; | |||
//MARK:6.输入wifi密码 | |||
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { | |||
textField.placeholder = @"密码"; | |||
textField.delegate = self; | |||
textField.tag = 119; | |||
}]; | |||
[alert addAction:conform]; | |||
[alert addAction:cancel]; | |||
[self presentViewController:alert animated:YES completion:nil]; | |||
} | |||
#pragma mark - ELBluetoothManagerDelegate | |||
/** | |||
Callback Bluetooth status(回调蓝牙状态) | |||
@param state Bluetooth status(蓝牙状态) | |||
*/ | |||
-(void)bloodBleManagerUpdateBleState:(ELBluetoothState)state { | |||
NSLog(@"## bluetoothManagerUpdateBleState = %ld", state); | |||
if (state == ELBluetoothStateScaning) { | |||
self.bleStatusLabel.text = @"正在连接..."; | |||
// NSString *log = @"正在连接..."; | |||
// [self addLog:log]; | |||
} else if (state == ELBluetoothStateDidValidationPass) { | |||
self.bleStatusLabel.text = @"连接成功"; | |||
NSString *log = @"连接成功"; | |||
[self addLog:log]; | |||
} else if (state == ELBluetoothStateDidDisconnect) { | |||
self.bleStatusLabel.text = @"连接已断开"; | |||
NSString *log = @"连接已断开"; | |||
[self addLog:log]; | |||
} else { | |||
// self.bleStatusLabel.text = @""; | |||
} | |||
} | |||
/** | |||
Callback scanned device(回调扫描到的设备) | |||
@param devices 设备 | |||
*/ | |||
- (void)bloodBleManagerScanDevices:(NSArray<ELPeripheralModel *> *_Nullable)devices { | |||
NSLog(@"## bloodBleManagerScanDevices = %@", devices); | |||
for (int i = 0; i < devices.count; i++) { | |||
ELPeripheralModel *device = devices[i]; | |||
if ([device.macAddress isEqualToString:self.per.macAddressString]) { | |||
[[ElBloodBleWifiManager shareManager] stopScan]; | |||
[[ElBloodBleWifiManager shareManager] connectPeripheral:device]; | |||
return; | |||
} | |||
} | |||
} | |||
#pragma mark - ElBleWifiDelegate | |||
/** | |||
Callback Wifi details(回调Wifi详情) | |||
@param model 模型 | |||
*/ | |||
- (void)bleWifiReceiveWifiDetailModel:(ELBleWifiDetailModel *)model { | |||
NSLog(@"## bleWifiReceiveWifiDetailModel"); | |||
// [self addLog:[NSString stringWithFormat:@"wifi type---%lu name---%@ link state--%zd",(unsigned long)model.wifiState,model.wifiName,model.wifiState]]; | |||
// MARK:3.WiFi配置得到Wifi列表 | |||
if (model.wifiName.length > 0) { | |||
[self.dataSource addObject:model]; | |||
} | |||
[self.tableView reloadData]; | |||
} | |||
/** | |||
Scan nearby wifi results(扫描附近wifi结果) | |||
@param count Number of nearby wifi(附近wifi数量) | |||
*/ | |||
- (void)bleWifiReceiveScanedWifiCount:(int)count { | |||
NSLog(@"## bleWifiReceiveScanedWifiCount() count:%@", @(count)); | |||
//MARK:4.WiFi配置得到一个附近wifi的列表,点击选择一个wifi,进行配置 | |||
[self.tableView reloadData]; | |||
} | |||
/** | |||
Callback Wifi MAC address(回调Wifi MAC地址) | |||
@param macData mac | |||
*/ | |||
- (void)bleWifiReceiveWifiMacData:(NSData *_Nullable)macData { | |||
NSLog(@"## bleWifiReceiveWifiMacData"); | |||
} | |||
/** | |||
Callback WIFI password(回调WIFI密码) | |||
@param pwd password(密码) | |||
*/ | |||
- (void)bleWifiReceiveWifiPwd:(NSString *_Nonnull)pwd { | |||
NSLog(@"## bleWifiReceiveWifiPwd"); | |||
} | |||
/** | |||
Get DTIM interval (unit: ms)(获取DTIM间隔(单位:ms)) | |||
@param interval Interval (unit: ms)(间隔(单位:ms)) | |||
*/ | |||
- (void)bleWifiReceiveWifiDTIMInterval:(NSInteger)interval { | |||
NSLog(@"## bleWifiReceiveWifiDTIMInterval"); | |||
} | |||
/** | |||
Returns the visited URL(返回访问的url) | |||
@param url url | |||
*/ | |||
- (void)bleWifiReceiveWifiAccessURL:(NSString *)url { | |||
NSLog(@"## bleWifiReceiveWifiAccessURL() url:%@", url); | |||
NSString *log = [NSString stringWithFormat:@"url:%@", url]; | |||
[self addLog:log]; | |||
} | |||
/** | |||
Call back wifi port number(回调wifi的端口号) | |||
@param port 端口号 | |||
*/ | |||
- (void)bleWifiReceiveWifiPort:(int)port { | |||
NSLog(@"## bleWifiReceiveWifiPort() port:%@", @(port)); | |||
NSString *log = [NSString stringWithFormat:@"port:%@", @(port)]; | |||
[self addLog:log]; | |||
} | |||
//Returns the visited path(返回访问的path) | |||
- (void)bleWifiReceiveWifiPath:(NSString *)path { | |||
NSLog(@"## bleWifiReceiveWifiPath() path:%@", path); | |||
NSString *log = [NSString stringWithFormat:@"path:%@", path]; | |||
[self addLog:log]; | |||
} | |||
/** | |||
Set or query the callback of the instruction execution result(设置指令蓝牙WIFI响应回调方法) | |||
只支持蓝牙Wifi部分枚举 | |||
@param type Type of setting (设置的类型) | |||
@param result Set result(设置的结果) | |||
*/ | |||
- (void)bleWifiReceiceResponseType:(ELInetSetCmdType)type result:(ELSetBluetoothResponseType)result { | |||
NSLog(@"## bleWifiReceiceResponseType"); | |||
if (result == ELSetBluetoothResponseTypeSuccess) { | |||
//设置WiFi结果 | |||
if (type == ELInetSetCmdTypeBleWifiSetWifiMac) { | |||
} else if (type == ELInetSetCmdTypeBleWifiSetWifiPwd){ | |||
//MARK:8.然后发起连接Wifi | |||
[[ElBloodBleWifiManager shareManager] bleWifiSetupWifiConnect:YES]; | |||
} else if (type == ELInetSetCmdTypeBleWifiSetConnectWifi){ | |||
//获取连接状态,更新Wi-Fi列表 | |||
[self.dataSource removeAllObjects]; | |||
[self.tableView reloadData]; | |||
[[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiGetNearbyWifi]; | |||
} | |||
} else { | |||
//TODO:Wifi配置过程中失败的情况自行处理 | |||
} | |||
} | |||
/** | |||
获取会话码(deviceId) | |||
@param code (deviceId) deviceId(0 means no:为0时表示不存在) | |||
*/ | |||
- (void)bleWifiReceiveWifiSNCode:(int)code { | |||
NSLog(@"## bleWifiReceiveWifiSNCode() code:%@", @(code)); | |||
if (code == 0) { | |||
//失败 | |||
} | |||
NSString *log = [NSString stringWithFormat:@"bleWifiReceiveWifiSNCode :%@", @(code)]; | |||
[self addLog:log]; | |||
} | |||
/** 返回wifi名称 */ | |||
- (void)bleWifiName:(NSString *)wifiName { | |||
NSLog(@"## bleWifiName() wifiName:%@", wifiName); | |||
NSString *log = [NSString stringWithFormat:@"bleWifiName:%@", wifiName]; | |||
[self addLog:log]; | |||
} | |||
- (void)bluetoothManagerReceiveMCUConnectedState:(struct ELMCUStateStruct)stateStrct { | |||
NSLog(@"## bluetoothManagerReceiveMCUConnectedState"); | |||
BleWiFiConnectState wifiState = stateStrct.wifiState; | |||
//请求会话码 | |||
[[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiGetSNNumber]; | |||
//MARK:1.WiFi配置提示用户配网 | |||
//TODO:注意:wifi配置过程必须保持蓝牙与设备的连接 | |||
if (wifiState == BleWiFiConnectStateNoWiFi) { | |||
//1.如果没有配网,则提示用户去配网 | |||
//MARK:2.WiFi配置先获取wifi列表 | |||
[self.dataSource removeAllObjects]; | |||
[self.tableView reloadData]; | |||
[[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiGetNearbyWifi]; | |||
NSString *log = @"获取附近 wifi 列表"; | |||
[self addLog:log]; | |||
} else if (wifiState == BleWiFiConnectStateSuccess) { | |||
[[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiName]; | |||
NSString *log = @"获取当前 wifi 名称"; | |||
[self addLog:log]; | |||
} else { | |||
// //MARK:2.没网也可以获取Wi-Fi列表,如果需要更新Wi-Fi的话 | |||
// [self.dataSource removeAllObjects]; | |||
// [self.tableView reloadData]; | |||
// [[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiGetNearbyWifi]; | |||
} | |||
///MARK:9.wifi配置结果 | |||
//wifi相关的其他指令和数据接收,请查看ELBluetoothManager.h文件 | |||
if (stateStrct.wifiState == BleWiFiConnectStateSuccess) { | |||
//成功 | |||
//MARK:10.获取wifi设备的SN号,即设备id | |||
[[ElBloodBleWifiManager shareManager] getBluetoothInfoWithELInetGetCmdType:ELInetGetCmdTypeBleWifiGetSNNumber]; | |||
} | |||
} | |||
-(void)bluetoothManagerReceiveWMState:(ELWMStateStruct)stateStrct { | |||
NSLog(@"## bluetoothManagerReceiveMCUConnectedState"); | |||
} | |||
-(void)bluetoothManagerReceiveWMStateFailCode:(WMWorkStateFailCode)failCode { | |||
NSLog(@"## bluetoothManagerReceiveMCUConnectedState"); | |||
} | |||
#pragma mark - ELBloodBleWifiManagerDelegate | |||
/** | |||
Call back real-time, stable data(回调实时、稳定数据) | |||
@param model 数据 | |||
@param type 类型 | |||
*/ | |||
- (void)bloodBleManagerReceiceTestData:(ELbloodPresureBleWifiDataModel *)model type:(ELBloodBleDataModelType)type { | |||
NSLog(@"## bloodBleManagerReceiceTestData"); | |||
static BOOL testEnd = NO; | |||
if (type == ELBloodBleDataModelTypeStable) { | |||
if (testEnd == NO) { | |||
testEnd = YES; | |||
} | |||
NSString *log = [NSString stringWithFormat:@"收缩压:%@, 舒张压:%@, ", model.sys, model.dia]; | |||
[self addLog:log]; | |||
} else if (type == ELBloodBleDataModelTypeRealTime) { | |||
testEnd = NO; | |||
NSString *log = [NSString stringWithFormat:@"压力:%@", model.dia]; | |||
[self addLog:log]; | |||
} | |||
} | |||
/** | |||
Set unit callback(设置单位回调) | |||
@param type 结果 | |||
*/ | |||
- (void)bloodBleManagerReceiveSetUnitResult:(ELSetBluetoothResponseType)type { | |||
NSLog(@"## bloodBleManagerReceiveSetUnitResult() type:%@", @(type)); | |||
if (type == ELSetBluetoothResponseTypeSuccess) { | |||
NSString *log = @"切换单位 成功"; | |||
[self addLog:log]; | |||
} else if (type == ELSetBluetoothResponseTypeFailure) { | |||
NSString *log = @"切换单位 失败"; | |||
[self addLog:log]; | |||
} else if (type == ELSetBluetoothResponseTypeNoSupport) { | |||
NSString *log = @"切换单位 不支持"; | |||
[self addLog:log]; | |||
} | |||
} | |||
/** | |||
Set the interaction type(设置交互类型) | |||
@param type 结果 | |||
*/ | |||
- (void)bloodBleManagerReceiveInteractionType:(ELBloodInteractionType)type { | |||
NSLog(@"## bloodBleManagerReceiveInteractionType"); | |||
if (type == ELBloodInteractionTypeStartTest) { | |||
NSString *log = @"设备状态 已开始测量"; | |||
[self addLog:log]; | |||
} else if (type == ELBloodInteractionTypeStopTest) { | |||
NSString *log = @"设备状态 已停止测量"; | |||
[self addLog:log]; | |||
} else if (type == ELBloodInteractionTypeShutdown) { | |||
NSString *log = @"设备状态 已关机"; | |||
[self addLog:log]; | |||
} else if (type == ELBloodInteractionTypeBoot) { | |||
NSString *log = @"设备状态 已开机"; | |||
[self addLog:log]; | |||
} | |||
} | |||
/** | |||
Error code sent on the device(设备上发错误码) | |||
@param code error code(错误码) | |||
*/ | |||
- (void)bloodBleManagerReceiveFailCode:(ELBloodFailCode)code { | |||
NSLog(@"## bloodBleManagerReceiveFailCode"); | |||
} | |||
/** | |||
Send voice alarm setting result(下发语音报警设置结果) | |||
@param type 操作类型 | |||
@param result 结果 | |||
*/ | |||
- (void)bloodBleManagerReceiveSetSwitchVoiceOperationType:(ELBloodBleSwitchVoiceType)type result:(ELSetBluetoothResponseType)result { | |||
NSLog(@"## bloodBleManagerReceiveSetSwitchVoiceOperationType"); | |||
if (result == ELSetBluetoothResponseTypeSuccess) { | |||
if (type == ELBloodBleSwitchVoiceTypeOn) { | |||
NSString *log = @"语音 打开 成功"; | |||
[self addLog:log]; | |||
}else if (type == ELBloodBleSwitchVoiceTypeOff){ | |||
NSString *log = @"语音 关闭 成功"; | |||
[self addLog:log]; | |||
} | |||
} else { | |||
NSString *log = @"语音 设置 失败"; | |||
[self addLog:log]; | |||
} | |||
} | |||
//获取版本号 | |||
- (void)bluetoothManagerReceiveBMVersion:(NSString *)bmVersion { | |||
NSLog(@"%@", bmVersion); | |||
NSString *log = [NSString stringWithFormat:@"模块版本: %@", bmVersion]; | |||
[self addLog:log]; | |||
} | |||
#pragma mark - addLog | |||
- (void)addLog:(NSString *)log { | |||
[self addLog:log newline:YES]; | |||
} | |||
- (void)addWithoutNewlineLog:(NSString *)log { | |||
[self addLog:log newline:NO]; | |||
} | |||
- (void)addLog:(NSString *)log newline:(BOOL)newline { | |||
NSDateFormatter *format = [[NSDateFormatter alloc] init]; | |||
format.dateFormat = @"HH:mm:ss.SSS"; | |||
NSString *time = [format stringFromDate:[NSDate date]]; | |||
if (newline) { | |||
self.logTextView.text = [self.logTextView.text stringByAppendingFormat:@"%@ %@\n", time, log]; | |||
} else { | |||
self.logTextView.text = [self.logTextView.text stringByAppendingFormat:@"%@ %@", time, log]; | |||
} | |||
[self.logTextView scrollRangeToVisible:NSMakeRange(self.logTextView.text.length, 1)]; | |||
} | |||
@end |
@@ -0,0 +1,305 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | |||
<device id="retina6_12" orientation="portrait" appearance="light"/> | |||
<dependencies> | |||
<deployment version="4352" identifier="iOS"/> | |||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/> | |||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | |||
<capability name="System colors in document resources" minToolsVersion="11.0"/> | |||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |||
</dependencies> | |||
<objects> | |||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ELWIFIBloodPressureVC"> | |||
<connections> | |||
<outlet property="bleStatusLabel" destination="oZm-Vw-d5J" id="Urh-Jg-TIO"/> | |||
<outlet property="logTextView" destination="Bwz-4s-ft4" id="94s-oR-Vjb"/> | |||
<outlet property="pathTexField" destination="54X-qt-4AG" id="K1i-e6-qTx"/> | |||
<outlet property="portTexField" destination="yit-et-mIS" id="SsA-6i-Ybh"/> | |||
<outlet property="tableView" destination="29h-tk-062" id="0GK-4o-yV8"/> | |||
<outlet property="urlTexField" destination="qEW-eA-90Z" id="JJe-7C-0Vo"/> | |||
<outlet property="view" destination="9c0-OE-f3B" id="U8J-mV-hbk"/> | |||
</connections> | |||
</placeholder> | |||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="9c0-OE-f3B"> | |||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/> | |||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |||
<subviews> | |||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jAP-Jq-ntW"> | |||
<rect key="frame" x="16" y="580" width="31" height="30"/> | |||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> | |||
<state key="normal" title="清空"/> | |||
<connections> | |||
<action selector="clearAction:" destination="-1" eventType="touchUpInside" id="shH-bo-AjD"/> | |||
</connections> | |||
</button> | |||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dF6-ID-6hg"> | |||
<rect key="frame" x="346" y="580" width="31" height="30"/> | |||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> | |||
<state key="normal" title="分享"/> | |||
<connections> | |||
<action selector="shareLogAction:" destination="-1" eventType="touchUpInside" id="b3u-Fz-Few"/> | |||
</connections> | |||
</button> | |||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Stauts" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oZm-Vw-d5J"> | |||
<rect key="frame" x="0.0" y="63" width="393" height="21"/> | |||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | |||
<nil key="textColor"/> | |||
<nil key="highlightedColor"/> | |||
</label> | |||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NlR-FO-hv7"> | |||
<rect key="frame" x="8" y="618" width="377" height="200"/> | |||
<subviews> | |||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" indicatorStyle="white" editable="NO" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bwz-4s-ft4"> | |||
<rect key="frame" x="0.0" y="0.0" width="377" height="200"/> | |||
<color key="backgroundColor" systemColor="labelColor"/> | |||
<color key="textColor" systemColor="opaqueSeparatorColor"/> | |||
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="10"/> | |||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/> | |||
</textView> | |||
</subviews> | |||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | |||
<constraints> | |||
<constraint firstItem="Bwz-4s-ft4" firstAttribute="top" secondItem="NlR-FO-hv7" secondAttribute="top" id="4mG-TR-hS7"/> | |||
<constraint firstAttribute="bottom" secondItem="Bwz-4s-ft4" secondAttribute="bottom" id="FFV-09-GwE"/> | |||
<constraint firstAttribute="height" constant="200" id="O63-6W-V9z"/> | |||
<constraint firstItem="Bwz-4s-ft4" firstAttribute="leading" secondItem="NlR-FO-hv7" secondAttribute="leading" id="P0I-hq-Etx"/> | |||
<constraint firstAttribute="trailing" secondItem="Bwz-4s-ft4" secondAttribute="trailing" id="Umb-ir-Zkd"/> | |||
</constraints> | |||
<userDefinedRuntimeAttributes> | |||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> | |||
<real key="value" value="8"/> | |||
</userDefinedRuntimeAttribute> | |||
</userDefinedRuntimeAttributes> | |||
</view> | |||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qJ1-lY-A1x"> | |||
<rect key="frame" x="8" y="84" width="377" height="496"/> | |||
<subviews> | |||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D9P-H7-Map"> | |||
<rect key="frame" x="0.0" y="0.0" width="377" height="700"/> | |||
<subviews> | |||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="31J-19-s41"> | |||
<rect key="frame" x="8" y="8" width="361" height="360"/> | |||
<subviews> | |||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="29h-tk-062"> | |||
<rect key="frame" x="0.0" y="0.0" width="361" height="360"/> | |||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | |||
<connections> | |||
<outlet property="dataSource" destination="-1" id="ggQ-bh-QLA"/> | |||
<outlet property="delegate" destination="-1" id="dnB-TL-dMo"/> | |||
</connections> | |||
</tableView> | |||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mMG-sS-kXc"> | |||
<rect key="frame" x="229.33333333333334" y="317" width="123.66666666666666" height="35"/> | |||
<state key="normal" title="Button"/> | |||
<buttonConfiguration key="configuration" style="filled" title="获取wifi 列表"/> | |||
<connections> | |||
<action selector="requestWifiListAction:" destination="-1" eventType="touchUpInside" id="kAf-G6-Pi8"/> | |||
</connections> | |||
</button> | |||
</subviews> | |||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | |||
<constraints> | |||
<constraint firstAttribute="height" constant="360" id="8u9-ew-SWT"/> | |||
<constraint firstAttribute="trailing" secondItem="mMG-sS-kXc" secondAttribute="trailing" constant="8" id="DhH-2G-SjA"/> | |||
<constraint firstItem="29h-tk-062" firstAttribute="leading" secondItem="31J-19-s41" secondAttribute="leading" id="RvA-4i-asg"/> | |||
<constraint firstAttribute="bottom" secondItem="29h-tk-062" secondAttribute="bottom" id="fTi-ml-ReU"/> | |||
<constraint firstAttribute="bottom" secondItem="mMG-sS-kXc" secondAttribute="bottom" constant="8" id="jRj-dV-3d6"/> | |||
<constraint firstAttribute="trailing" secondItem="29h-tk-062" secondAttribute="trailing" id="lCG-By-MxX"/> | |||
<constraint firstItem="29h-tk-062" firstAttribute="top" secondItem="31J-19-s41" secondAttribute="top" id="wL3-qe-aqD"/> | |||
</constraints> | |||
</view> | |||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="t03-yu-cqg"> | |||
<rect key="frame" x="8" y="376" width="361" height="200"/> | |||
<subviews> | |||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="URL:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mec-fH-uxd"> | |||
<rect key="frame" x="8" y="24" width="36.666666666666664" height="21"/> | |||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | |||
<nil key="textColor"/> | |||
<nil key="highlightedColor"/> | |||
</label> | |||
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="qEW-eA-90Z"> | |||
<rect key="frame" x="52.666666666666657" y="17.666666666666686" width="300.33333333333337" height="34"/> | |||
<fontDescription key="fontDescription" type="system" pointSize="14"/> | |||
<textInputTraits key="textInputTraits"/> | |||
</textField> | |||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Port:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TV8-xg-2Rl"> | |||
<rect key="frame" x="8.0000000000000036" y="69" width="49.333333333333343" height="21"/> | |||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | |||
<nil key="textColor"/> | |||
<nil key="highlightedColor"/> | |||
</label> | |||
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="yit-et-mIS"> | |||
<rect key="frame" x="65.333333333333343" y="62.666666666666629" width="287.66666666666663" height="34"/> | |||
<fontDescription key="fontDescription" type="system" pointSize="14"/> | |||
<textInputTraits key="textInputTraits"/> | |||
</textField> | |||
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="54X-qt-4AG"> | |||
<rect key="frame" x="68" y="107.66666666666663" width="285" height="34"/> | |||
<fontDescription key="fontDescription" type="system" pointSize="14"/> | |||
<textInputTraits key="textInputTraits"/> | |||
</textField> | |||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="r1G-Pa-LaR"> | |||
<rect key="frame" x="7.9999999999999964" y="157" width="58.666666666666657" height="35"/> | |||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> | |||
<state key="normal" title="Button"/> | |||
<buttonConfiguration key="configuration" style="filled" title="配置"/> | |||
<connections> | |||
<action selector="setupServerInfoAcion:" destination="-1" eventType="touchUpInside" id="hKg-i4-hC4"/> | |||
</connections> | |||
</button> | |||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hu4-ND-jL9"> | |||
<rect key="frame" x="294.33333333333331" y="157" width="58.666666666666686" height="35"/> | |||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> | |||
<state key="normal" title="Button"/> | |||
<buttonConfiguration key="configuration" style="filled" title="读取"/> | |||
<connections> | |||
<action selector="requestServerInfoAcion:" destination="-1" eventType="touchUpInside" id="9sH-7O-oVc"/> | |||
</connections> | |||
</button> | |||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Path:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jUZ-AG-RFL"> | |||
<rect key="frame" x="8" y="114" width="52" height="21"/> | |||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | |||
<nil key="textColor"/> | |||
<nil key="highlightedColor"/> | |||
</label> | |||
</subviews> | |||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | |||
<constraints> | |||
<constraint firstAttribute="trailing" secondItem="Hu4-ND-jL9" secondAttribute="trailing" constant="8" id="7MZ-xz-dwV"/> | |||
<constraint firstItem="TV8-xg-2Rl" firstAttribute="top" secondItem="Mec-fH-uxd" secondAttribute="bottom" constant="24" id="Aq2-tv-HYZ"/> | |||
<constraint firstItem="Mec-fH-uxd" firstAttribute="top" secondItem="t03-yu-cqg" secondAttribute="top" constant="24" id="BIV-xf-Hfq"/> | |||
<constraint firstItem="qEW-eA-90Z" firstAttribute="leading" secondItem="Mec-fH-uxd" secondAttribute="trailing" constant="8" id="Bx8-zO-Nfq"/> | |||
<constraint firstItem="54X-qt-4AG" firstAttribute="leading" secondItem="jUZ-AG-RFL" secondAttribute="trailing" constant="8" id="CZU-eG-SQd"/> | |||
<constraint firstItem="Mec-fH-uxd" firstAttribute="leading" secondItem="t03-yu-cqg" secondAttribute="leading" constant="8" id="ClW-d0-IID"/> | |||
<constraint firstAttribute="bottom" secondItem="Hu4-ND-jL9" secondAttribute="bottom" constant="8" id="D0L-sA-LgN"/> | |||
<constraint firstAttribute="trailing" secondItem="54X-qt-4AG" secondAttribute="trailing" constant="8" id="Fav-VF-WnQ"/> | |||
<constraint firstItem="qEW-eA-90Z" firstAttribute="centerY" secondItem="Mec-fH-uxd" secondAttribute="centerY" id="HD5-LO-W1B"/> | |||
<constraint firstAttribute="bottom" secondItem="r1G-Pa-LaR" secondAttribute="bottom" constant="8" id="I4c-gG-kk7"/> | |||
<constraint firstItem="54X-qt-4AG" firstAttribute="centerY" secondItem="jUZ-AG-RFL" secondAttribute="centerY" id="J2t-rF-Qen"/> | |||
<constraint firstItem="yit-et-mIS" firstAttribute="centerY" secondItem="TV8-xg-2Rl" secondAttribute="centerY" id="JZp-UT-ceZ"/> | |||
<constraint firstItem="TV8-xg-2Rl" firstAttribute="leading" secondItem="t03-yu-cqg" secondAttribute="leading" constant="8" id="NMo-nC-T3p"/> | |||
<constraint firstItem="r1G-Pa-LaR" firstAttribute="leading" secondItem="t03-yu-cqg" secondAttribute="leading" constant="8" id="R7K-1y-jZW"/> | |||
<constraint firstAttribute="trailing" secondItem="yit-et-mIS" secondAttribute="trailing" constant="8" id="bXo-XR-uvU"/> | |||
<constraint firstAttribute="trailing" secondItem="qEW-eA-90Z" secondAttribute="trailing" constant="8" id="fTu-II-Jt5"/> | |||
<constraint firstItem="yit-et-mIS" firstAttribute="leading" secondItem="TV8-xg-2Rl" secondAttribute="trailing" constant="8" id="ou3-vt-M7k"/> | |||
<constraint firstAttribute="height" constant="200" id="uDP-93-x7c"/> | |||
<constraint firstItem="jUZ-AG-RFL" firstAttribute="top" secondItem="TV8-xg-2Rl" secondAttribute="bottom" constant="24" id="w43-3H-5c6"/> | |||
<constraint firstItem="jUZ-AG-RFL" firstAttribute="leading" secondItem="t03-yu-cqg" secondAttribute="leading" constant="8" id="yw1-mI-4IX"/> | |||
</constraints> | |||
</view> | |||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Or7-ND-XyK"> | |||
<rect key="frame" x="8" y="584" width="361" height="108"/> | |||
<subviews> | |||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0Vr-iT-QuB"> | |||
<rect key="frame" x="8" y="8" width="93.333333333333329" height="35"/> | |||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> | |||
<state key="normal" title="Button"/> | |||
<buttonConfiguration key="configuration" style="filled" title="切换单位"/> | |||
<connections> | |||
<action selector="switchUintAction:" destination="-1" eventType="touchUpInside" id="WTA-fY-LqY"/> | |||
</connections> | |||
</button> | |||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Nt-Z0-hPE"> | |||
<rect key="frame" x="109.33333333333331" y="8" width="128" height="35"/> | |||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> | |||
<state key="normal" title="Button"/> | |||
<buttonConfiguration key="configuration" style="filled" title="切换语音播报"/> | |||
<connections> | |||
<action selector="switchSpeechAtion:" destination="-1" eventType="touchUpInside" id="No5-ou-AYf"/> | |||
</connections> | |||
</button> | |||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Xk8-z8-roi"> | |||
<rect key="frame" x="109.33333333333334" y="59" width="93.333333333333343" height="35"/> | |||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> | |||
<state key="normal" title="Button"/> | |||
<buttonConfiguration key="configuration" style="filled" title="停止测量"/> | |||
<connections> | |||
<action selector="stopMeasureAction:" destination="-1" eventType="touchUpInside" id="544-Zk-s6x"/> | |||
</connections> | |||
</button> | |||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DgV-dr-yv8"> | |||
<rect key="frame" x="8" y="59" width="93.333333333333329" height="35"/> | |||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> | |||
<state key="normal" title="Button"/> | |||
<buttonConfiguration key="configuration" style="filled" title="开始测量"/> | |||
<connections> | |||
<action selector="startMeasureAction:" destination="-1" eventType="touchUpInside" id="7kX-En-EC0"/> | |||
</connections> | |||
</button> | |||
</subviews> | |||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | |||
<constraints> | |||
<constraint firstItem="6Nt-Z0-hPE" firstAttribute="leading" secondItem="0Vr-iT-QuB" secondAttribute="trailing" constant="8" id="690-Mf-kcl"/> | |||
<constraint firstItem="Xk8-z8-roi" firstAttribute="leading" secondItem="DgV-dr-yv8" secondAttribute="trailing" constant="8" id="7rS-QI-z1z"/> | |||
<constraint firstItem="0Vr-iT-QuB" firstAttribute="leading" secondItem="Or7-ND-XyK" secondAttribute="leading" constant="8" id="7xy-l9-G4l"/> | |||
<constraint firstItem="Xk8-z8-roi" firstAttribute="leading" secondItem="DgV-dr-yv8" secondAttribute="trailing" constant="8" id="EKs-cF-wGF"/> | |||
<constraint firstItem="DgV-dr-yv8" firstAttribute="leading" secondItem="Or7-ND-XyK" secondAttribute="leading" constant="8" id="GJN-8E-Dpd"/> | |||
<constraint firstAttribute="height" constant="108" id="QS8-L3-8uv"/> | |||
<constraint firstItem="DgV-dr-yv8" firstAttribute="top" secondItem="0Vr-iT-QuB" secondAttribute="bottom" constant="16" id="TAP-ER-p9t"/> | |||
<constraint firstItem="Xk8-z8-roi" firstAttribute="top" secondItem="6Nt-Z0-hPE" secondAttribute="bottom" constant="16" id="WTW-9s-pwH"/> | |||
<constraint firstItem="6Nt-Z0-hPE" firstAttribute="top" secondItem="Or7-ND-XyK" secondAttribute="top" constant="8" id="oJ9-I1-mlF"/> | |||
<constraint firstItem="0Vr-iT-QuB" firstAttribute="top" secondItem="Or7-ND-XyK" secondAttribute="top" constant="8" id="zAf-d1-0ZK"/> | |||
</constraints> | |||
</view> | |||
</subviews> | |||
<color key="backgroundColor" systemColor="opaqueSeparatorColor"/> | |||
<constraints> | |||
<constraint firstAttribute="height" constant="700" id="FFh-bL-MN7"/> | |||
<constraint firstItem="t03-yu-cqg" firstAttribute="top" secondItem="31J-19-s41" secondAttribute="bottom" constant="8" id="LY4-W7-rR5"/> | |||
<constraint firstItem="31J-19-s41" firstAttribute="leading" secondItem="D9P-H7-Map" secondAttribute="leading" constant="8" id="MY5-ZB-55q"/> | |||
<constraint firstItem="Or7-ND-XyK" firstAttribute="top" secondItem="t03-yu-cqg" secondAttribute="bottom" constant="8" id="Tm0-OO-9rU"/> | |||
<constraint firstAttribute="trailing" secondItem="t03-yu-cqg" secondAttribute="trailing" constant="8" id="UVG-Ie-g3n"/> | |||
<constraint firstItem="Or7-ND-XyK" firstAttribute="leading" secondItem="D9P-H7-Map" secondAttribute="leading" constant="8" id="etx-eZ-Iil"/> | |||
<constraint firstItem="t03-yu-cqg" firstAttribute="leading" secondItem="D9P-H7-Map" secondAttribute="leading" constant="8" id="ief-ak-rrW"/> | |||
<constraint firstAttribute="trailing" secondItem="31J-19-s41" secondAttribute="trailing" constant="8" id="jYM-NU-h4c"/> | |||
<constraint firstAttribute="trailing" secondItem="Or7-ND-XyK" secondAttribute="trailing" constant="8" id="lFk-sh-QGg"/> | |||
<constraint firstItem="31J-19-s41" firstAttribute="top" secondItem="D9P-H7-Map" secondAttribute="top" constant="8" id="sGD-jt-e0I"/> | |||
</constraints> | |||
</view> | |||
</subviews> | |||
<constraints> | |||
<constraint firstItem="D9P-H7-Map" firstAttribute="trailing" secondItem="Cau-Oz-PF4" secondAttribute="trailing" id="5K5-FG-yJp"/> | |||
<constraint firstItem="D9P-H7-Map" firstAttribute="width" secondItem="NAw-ZO-N9d" secondAttribute="width" id="MhM-7E-iEr"/> | |||
<constraint firstItem="D9P-H7-Map" firstAttribute="top" secondItem="Cau-Oz-PF4" secondAttribute="top" id="c06-Hq-uE1"/> | |||
<constraint firstItem="D9P-H7-Map" firstAttribute="leading" secondItem="Cau-Oz-PF4" secondAttribute="leading" id="mSQ-KY-a8z"/> | |||
<constraint firstItem="D9P-H7-Map" firstAttribute="bottom" secondItem="Cau-Oz-PF4" secondAttribute="bottom" id="n2O-1J-pnU"/> | |||
</constraints> | |||
<viewLayoutGuide key="contentLayoutGuide" id="Cau-Oz-PF4"/> | |||
<viewLayoutGuide key="frameLayoutGuide" id="NAw-ZO-N9d"/> | |||
</scrollView> | |||
</subviews> | |||
<viewLayoutGuide key="safeArea" id="mbr-Ru-wgu"/> | |||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | |||
<constraints> | |||
<constraint firstItem="NlR-FO-hv7" firstAttribute="top" secondItem="dF6-ID-6hg" secondAttribute="bottom" constant="8" symbolic="YES" id="3rb-6v-hz6"/> | |||
<constraint firstItem="jAP-Jq-ntW" firstAttribute="top" secondItem="qJ1-lY-A1x" secondAttribute="bottom" id="AYE-v4-CyT"/> | |||
<constraint firstItem="qJ1-lY-A1x" firstAttribute="trailing" secondItem="mbr-Ru-wgu" secondAttribute="trailing" constant="-8" id="BcC-Uy-3wH"/> | |||
<constraint firstItem="NlR-FO-hv7" firstAttribute="top" secondItem="jAP-Jq-ntW" secondAttribute="bottom" constant="8" symbolic="YES" id="Llo-BF-ygW"/> | |||
<constraint firstItem="qJ1-lY-A1x" firstAttribute="top" secondItem="oZm-Vw-d5J" secondAttribute="bottom" id="Rsi-IC-HYg"/> | |||
<constraint firstItem="oZm-Vw-d5J" firstAttribute="leading" secondItem="mbr-Ru-wgu" secondAttribute="leading" id="Tga-Rx-bJH"/> | |||
<constraint firstItem="jAP-Jq-ntW" firstAttribute="leading" secondItem="mbr-Ru-wgu" secondAttribute="leading" constant="16" id="Ty8-p3-RQe"/> | |||
<constraint firstItem="mbr-Ru-wgu" firstAttribute="trailing" secondItem="dF6-ID-6hg" secondAttribute="trailing" constant="16" id="ePv-iG-tbc"/> | |||
<constraint firstItem="NlR-FO-hv7" firstAttribute="leading" secondItem="mbr-Ru-wgu" secondAttribute="leading" constant="8" id="ln0-Zi-aZS"/> | |||
<constraint firstItem="oZm-Vw-d5J" firstAttribute="centerX" secondItem="9c0-OE-f3B" secondAttribute="centerX" id="s6o-lO-fyd"/> | |||
<constraint firstItem="mbr-Ru-wgu" firstAttribute="bottom" secondItem="NlR-FO-hv7" secondAttribute="bottom" id="sLD-Q8-kps"/> | |||
<constraint firstItem="qJ1-lY-A1x" firstAttribute="leading" secondItem="mbr-Ru-wgu" secondAttribute="leading" constant="8" id="sn3-TU-DD0"/> | |||
<constraint firstItem="mbr-Ru-wgu" firstAttribute="trailing" secondItem="oZm-Vw-d5J" secondAttribute="trailing" id="uyN-Wq-oxc"/> | |||
<constraint firstItem="oZm-Vw-d5J" firstAttribute="top" secondItem="mbr-Ru-wgu" secondAttribute="top" constant="4" id="yBT-EM-EYg"/> | |||
<constraint firstItem="mbr-Ru-wgu" firstAttribute="trailing" secondItem="NlR-FO-hv7" secondAttribute="trailing" constant="8" id="ybL-YB-NQg"/> | |||
</constraints> | |||
<point key="canvasLocation" x="52.671755725190835" y="19.718309859154932"/> | |||
</view> | |||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | |||
</objects> | |||
<resources> | |||
<systemColor name="labelColor"> | |||
<color red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |||
</systemColor> | |||
<systemColor name="opaqueSeparatorColor"> | |||
<color red="0.77647058823529413" green="0.77647058823529413" blue="0.78431372549019607" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |||
</systemColor> | |||
<systemColor name="systemBackgroundColor"> | |||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | |||
</systemColor> | |||
</resources> | |||
</document> |
@@ -20,10 +20,14 @@ | |||
<string>$(MARKETING_VERSION)</string> | |||
<key>CFBundleVersion</key> | |||
<string>$(CURRENT_PROJECT_VERSION)</string> | |||
<key>ITSAppUsesNonExemptEncryption</key> | |||
<false/> | |||
<key>LSRequiresIPhoneOS</key> | |||
<true/> | |||
<key>NSBluetoothAlwaysUsageDescription</key> | |||
<string>Bluetooth Always Usage Description</string> | |||
<string>Request for Bluetooth for device connection</string> | |||
<key>NSBluetoothPeripheralUsageDescription</key> | |||
<string>Request for Bluetooth for device connection</string> | |||
<key>UILaunchStoryboardName</key> | |||
<string>LaunchScreen</string> | |||
<key>UIMainStoryboardFile</key> | |||
@@ -36,6 +40,13 @@ | |||
<array> | |||
<string>UIInterfaceOrientationPortrait</string> | |||
</array> | |||
<key>UISupportedInterfaceOrientations~ipad</key> | |||
<array> | |||
<string>UIInterfaceOrientationLandscapeLeft</string> | |||
<string>UIInterfaceOrientationLandscapeRight</string> | |||
<string>UIInterfaceOrientationPortrait</string> | |||
<string>UIInterfaceOrientationPortraitUpsideDown</string> | |||
</array> | |||
<key>UIUserInterfaceStyle</key> | |||
<string>Light</string> | |||
</dict> |
@@ -19,6 +19,7 @@ | |||
#import "InheritScanViewController.h" | |||
#import "BabyScaleViewController.h" | |||
#import "BloodScanViewController.h" | |||
#import "ELWIFIBloodPressureVC.h" | |||
#import "HeightGuageScanViewController.h" | |||
#import "BroadcastHeightGuage.h" | |||
#import "RemoteControlScanViewController.h" | |||
@@ -71,6 +72,9 @@ | |||
[ELDemoDeviceModel modelWithIndex:@"-" imageName:@"ailink_connected_ic" title:@"Parse data yourself" subtitle:@"有AILink协议自己解析数据" entryVCName:NSStringFromClass(InheritScanViewController.class)], | |||
[ELDemoDeviceModel modelWithIndex:@"04" imageName:@"type_baby_scale_ic" title:@"Baby Scale" subtitle:@"婴儿秤" entryVCName:NSStringFromClass(BabyScaleViewController.class)], | |||
[ELDemoDeviceModel modelWithIndex:@"05" imageName:@"type_sphygmomanometer_ic" title:@"Sphygmomanometer" subtitle:@"血压计" entryVCName:NSStringFromClass(BloodScanViewController.class)], | |||
[ELDemoDeviceModel modelWithIndex:@"05B" imageName:@"type_sphygmomanometer_ic" title:@"WIFI_BLE Sphygmomanometer" subtitle:@"血压计_WIFI_BLE" entryVCName:NSStringFromClass(ELWIFIBloodPressureVC.class) cids:@[@(ELSupportDeviceTypeBLE_WIFIBlood)]], | |||
[ELDemoDeviceModel modelWithIndex:@"06" imageName:@"type_height_measuring_instrument" title:@"Height Guage" subtitle:@"身高仪" entryVCName:NSStringFromClass(HeightGuageScanViewController.class)], | |||
[ELDemoDeviceModel modelWithIndex:@"06B" imageName:@"type_height_measuring_instrument" title:@"Broadcast Height Guage" subtitle:@"广播身高仪" entryVCName:NSStringFromClass(BroadcastHeightGuage.class)], |
@@ -11,4 +11,5 @@ | |||
| 1.5.11 | 20230327 | larry | 增加 蓝牙体重秤 | | |||
| 1.5.15 | 20230427 | larry | 修改 增加 蓝牙牙刷防飞溅 | | |||
| 1.6.1 | 20230626 | larry | 修改 增加 广播身高仪 食物探针 食物探针盒子 支持 | | |||
| 1.7.0 | 20231007 | larry | 修改 增加 WIFI_BLE 血压计 支持 | | |||