Преглед изворни кода

增加: 温湿度计 Demo

tags/v1.9.2^0
larryzhang пре 10 месеци
родитељ
комит
51dfb21d43

+ 22
- 4
AILinkBleSDKDemo.xcodeproj/project.pbxproj Прегледај датотеку

@@ -15,6 +15,8 @@
78AC3B2D2C0D996A00A62C61 /* AILinkBleSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 78AC3B2C2C0D996A00A62C61 /* AILinkBleSDK.framework */; };
78B153AD2AD16A5000C81229 /* ELWIFIBloodPressureVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78B153AB2AD16A5000C81229 /* ELWIFIBloodPressureVC.xib */; };
78B153AE2AD16A5000C81229 /* ELWIFIBloodPressureVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 78B153AC2AD16A5000C81229 /* ELWIFIBloodPressureVC.m */; };
78CF43532C2EC21B00D0A165 /* HygrothermographVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 78CF43502C2EC21A00D0A165 /* HygrothermographVC.m */; };
78CF43542C2EC21B00D0A165 /* HygrothermographVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78CF43512C2EC21A00D0A165 /* HygrothermographVC.xib */; };
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 */; };
@@ -131,6 +133,9 @@
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>"; };
78CF434F2C2EC21A00D0A165 /* HygrothermographVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HygrothermographVC.h; sourceTree = "<group>"; };
78CF43502C2EC21A00D0A165 /* HygrothermographVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HygrothermographVC.m; sourceTree = "<group>"; };
78CF43512C2EC21A00D0A165 /* HygrothermographVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HygrothermographVC.xib; 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>"; };
@@ -362,6 +367,7 @@
78DC4DF72990FC10006C6911 /* 25_HeightBodyFatScale */,
78E07B6C2A49664D00E68200 /* 26_MeatProbe */,
78E07B702A49664E00E68200 /* 27_MeatProbeBox */,
78CF43522C2EC21A00D0A165 /* 28_Hygrothermograph */,
);
path = DeviceDemo;
sourceTree = "<group>";
@@ -401,6 +407,16 @@
path = 05B_WIFI_BLE_BloodPressure;
sourceTree = "<group>";
};
78CF43522C2EC21A00D0A165 /* 28_Hygrothermograph */ = {
isa = PBXGroup;
children = (
78CF434F2C2EC21A00D0A165 /* HygrothermographVC.h */,
78CF43502C2EC21A00D0A165 /* HygrothermographVC.m */,
78CF43512C2EC21A00D0A165 /* HygrothermographVC.xib */,
);
path = 28_Hygrothermograph;
sourceTree = "<group>";
};
78DC38C329278F790080E0D9 /* BhBodyComposition120 */ = {
isa = PBXGroup;
children = (
@@ -960,6 +976,7 @@
78E07B7E2A49664E00E68200 /* MeatProbeBoxVC.xib in Resources */,
78DC4DE32990FB2E006C6911 /* ELDemoScanVC.xib in Resources */,
E622E26E243F1CA6003C319D /* LaunchScreen.storyboard in Resources */,
78CF43542C2EC21B00D0A165 /* HygrothermographVC.xib in Resources */,
E622E26B243F1CA6003C319D /* Assets.xcassets in Resources */,
78AC3B2B2C0D994900A62C61 /* PrivacyInfo.bundle in Resources */,
78DC4DF62990FB40006C6911 /* ELDeviceScanCell.xib in Resources */,
@@ -1008,6 +1025,7 @@
9557262F276C38CD003BFBAC /* ELBfsWifiConnectTableViewCell.m in Sources */,
95572623276C38CD003BFBAC /* BloodConnectViewController.m in Sources */,
78350BBB29D2869000456695 /* BodyScaleVC.m in Sources */,
78CF43532C2EC21B00D0A165 /* HygrothermographVC.m in Sources */,
78B153AE2AD16A5000C81229 /* ELWIFIBloodPressureVC.m in Sources */,
95572649276C38CD003BFBAC /* ToothbrushScanViewController.m in Sources */,
95572638276C38CD003BFBAC /* NutritionScaleScanViewController.m in Sources */,
@@ -1215,7 +1233,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 20240323;
CURRENT_PROJECT_VERSION = 20240628;
DEVELOPMENT_TEAM = YEU77XR292;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -1237,7 +1255,7 @@
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK",
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120",
);
MARKETING_VERSION = 1.8.0;
MARKETING_VERSION = 1.9.2;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.ellinkthings.ailinksdk.app;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1250,7 +1268,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 20240323;
CURRENT_PROJECT_VERSION = 20240628;
DEVELOPMENT_TEAM = YEU77XR292;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -1272,7 +1290,7 @@
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK",
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120",
);
MARKETING_VERSION = 1.8.0;
MARKETING_VERSION = 1.9.2;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.ellinkthings.ailinksdk.app;
PRODUCT_NAME = "$(TARGET_NAME)";

+ 22
- 0
AILinkBleSDKDemo/Assets.xcassets/DeviceIcon/Hygrothermograph_add_icon2_100.imageset/Contents.json Прегледај датотеку

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "thermometer_add_icon2_100@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "thermometer_add_icon2_100@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

BIN
AILinkBleSDKDemo/Assets.xcassets/DeviceIcon/Hygrothermograph_add_icon2_100.imageset/thermometer_add_icon2_100@2x.png Прегледај датотеку


BIN
AILinkBleSDKDemo/Assets.xcassets/DeviceIcon/Hygrothermograph_add_icon2_100.imageset/thermometer_add_icon2_100@3x.png Прегледај датотеку


+ 19
- 0
AILinkBleSDKDemo/DeviceDemo/28_Hygrothermograph/HygrothermographVC.h Прегледај датотеку

@@ -0,0 +1,19 @@
//
// HygrothermographVC.h
// AILinkBleSDK_Example
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class ELAILinkPeripheral;

@interface HygrothermographVC : UIViewController

@property (nonatomic, strong) ELAILinkPeripheral *per;


@end

NS_ASSUME_NONNULL_END

+ 282
- 0
AILinkBleSDKDemo/DeviceDemo/28_Hygrothermograph/HygrothermographVC.m Прегледај датотеку

@@ -0,0 +1,282 @@
//
// HygrothermographVC.m
// AILinkBleSDK_Example
//

#import "HygrothermographVC.h"
#import <AILinkBleSDK/ELHygrothermographBleManager.h>
#import <AILinkBleSDK/ELHygrothermographBleRecordData.h>
#import <AILinkBleSDK/ELAILinkBleManager.h>
#import "ELDemoButton.h"

@interface HygrothermographVC () <ELBluetoothManagerDelegate, ELHygrothermographBleDelegate>

@property (weak, nonatomic) IBOutlet UILabel *bleStatusLabel;

@property (weak, nonatomic) IBOutlet UITextView *logTextView;


//work mode
@property (weak, nonatomic) IBOutlet ELDemoButton *weightModeButton;

@property (nonatomic, assign) ELBluetoothState state;

@end

@implementation HygrothermographVC

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self bleScan];
}

- (void)dealloc {
[ELHygrothermographBleManager shareManager].delegate = nil;
[ELHygrothermographBleManager shareManager].hygrothermographDelegate = nil;
[[ELHygrothermographBleManager shareManager] disconnectPeripheral];
}

- (void)bleScan {
//创建蓝牙
[ELHygrothermographBleManager shareManager].delegate = self;
[ELHygrothermographBleManager shareManager].hygrothermographDelegate = self;
[[ELHygrothermographBleManager shareManager] startScan];
}

#pragma mark -Actions

- (IBAction)getDevStateAction:(id)sender {
// /** 获取设备状态 */
[[ELHygrothermographBleManager shareManager] getDevStateWithCid:self.per.cid];
}

- (IBAction)getDevHisDataAction:(id)sender {
NSInteger maxDevTime = 0;
[[ELHygrothermographBleManager shareManager] getDevRecordDataWithDevTime:maxDevTime cid:self.per.cid];
}


#pragma mark - addLog

- (IBAction)clearAction:(id)sender {
self.logTextView.text = @"";
}

- (IBAction)shareLogAction:(id)sender {
}

- (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

#pragma mark - ble Delegate

@implementation HygrothermographVC (ble)

///返回设备连接状态
- (void)hygrothermographManagerUpdateState:(ELBluetoothState)state {
NSLog(@"hygrothermograph ManagerUpdateState() state:%@", @(state));
if (state == ELBluetoothStateDidValidationPass) {
[self deviceInit];
}
NSString *text = nil;
if (state == ELBluetoothStateScaning) {
text = @"BLE connecting";
} else if (state == ELBluetoothStateConnectFail) {
text = @"BLE failed";
} else if (state == ELBluetoothStateDidValidationPass) {
text = @"BLE connected";
} else if (state == ELBluetoothStateDidDisconnect) {
text = @"BLE did disconnect";
}
if (text) {
self.bleStatusLabel.text = text;
if (self.state != state) {
[self addLog:text];
}
}
self.state = state;
}

///回调扫描到的身高体脂秤
- (void)hygrothermographManagerScanDevices:(NSArray<ELPeripheralModel *> *)scanDevices {
for (ELPeripheralModel *model in scanDevices) {
if ([model.macAddress isEqualToString:self.per.macAddressString]) {
[[ELHygrothermographBleManager shareManager] stopScan];
[[ELHygrothermographBleManager shareManager] connectPeripheral:model];
}
}
}

- (void)deviceInit {
//同步时间
[[ELHygrothermographBleManager shareManager] setUnixTime:[[NSDate date] timeIntervalSince1970]];
// 获取设备支持的功能列表
[[ELHygrothermographBleManager shareManager] getDevSupportFeaturesWithCid:self.per.cid];
// APP获取设备报警功能
[[ELHygrothermographBleManager shareManager] getDevAlarmDataInfoWithCid:self.per.cid];
// 查询BM是否支持历史记录
[[ELHygrothermographBleManager shareManager] getSupportRecordDataWithCid:self.per.cid];
}

// 设备返回当前状态
- (void)hygrothermographManagerReturnDevStatePower:(NSInteger)power bootTime:(long long)time tem:(float)tem hum:(float)hum {
NSString *log = [NSString stringWithFormat:@"hygrothermograph power:%ld time:%lld tem:%f hum:%f", power, time, tem, hum];
NSLog(@"%@", log);
[self addLog:log];
}

// BM设备返回设备状态
- (void)newTHManagerReturnDevStatePower:(int)power bootTime:(long long)time tem:(float)tem unit:(enum ELDeviceTemperatureUnit)unit hum:(float)hum devState:(enum TH_DevStateType)state {
NSString *log = [NSString stringWithFormat:@"hygrothermograph power:%d time:%lld tem:%f unit:%ld hum:%f state:%ld", power, time, tem, (long)unit, hum, (long)state];
NSLog(@"%@", log);
[self addLog:log];
}

// 返回历史记录
- (void)hygrothermographManagerReturnRecordDataList:(NSArray<ELHygrothermographBleRecordData *> *)list allListNumber:(long long)allNumber getListNumber:(long long)getNumber {
NSString *log = [NSString stringWithFormat:@"hygrothermograph list:%@ allListNumber:%lld getListNumber:%lld", list, allNumber, getNumber];
NSLog(@"%@", log);
[self addLog:log];
}

// 回应是否支持历史记录
- (void)THManagerSupportRecordData:(BOOL)state {
NSString *log = state ? @"支持历史记录" : @"不支持历史记录";
NSLog(@"hygrothermograph %@", log);
[self addLog:log];
}

// 返回支持的功能列表
- (void)THManagerSuportList:(NSArray<NSNumber *> *)list {
[self addLog:@"返回支持的功能列表"];
for (NSNumber *number in list) {
switch (number.intValue) {
case TH_Dev_SupportFeatures_Calibration: {
// 获取温度校准状态
[[ELHygrothermographBleManager shareManager] setOrGetTemHumCalibrationValueWithSet:false cTem:0 fTem:0 hum:0 cid:self.per.cid];
}
break;
case TH_Dev_SupportFeatures_BuzzerAlarm: {
// 获取蜂鸣器报警状态,暂不支持
}
break;
case TH_Dev_SupportFeatures_AlarmClock: {
// 闹钟功能
[[ELHygrothermographBleManager shareManager] setOrGetAlarmClockWithState:TH_AlarmClockState_Get num:0 mode:TH_AlarmClockMode_Everyday timeStr:@"00:00:00" open:false cid:self.per.cid];
}
break;
case TH_Dev_SupportFeatures_ReportPunctually: {
// 整点报时,暂不支持
}
break;
case TH_Dev_SupportFeatures_NightLight: {
// 获取小夜灯
[[ELHygrothermographBleManager shareManager] setOrGetDevNightLightWithCmd:false open:false cid:self.per.cid];
}
break;
case TH_Dev_SupportFeatures_GroundLight: {
// 获取背光亮度
[[ELHygrothermographBleManager shareManager] setOrGetGroundLightWithCmd:false open:false brightness:0 cid:self.per.cid];
}
break;
case TH_Dev_SupportFeatures_Lost: {
// 寻物功能
}
break;
default:
break;
}
}
}

/// 返回蜂鸣器设置结果
- (void)THManagerBuzzerState:(BOOL)open {
NSString *log = open ? @"返回蜂鸣器: 开" : @"返回蜂鸣器: 关";
[self addLog:log];
}

/// 返回闹钟列表
- (void)THManagerAlarmLockState:(enum TH_AlarmClockState)state num:(int)num mode:(enum TH_AlarmClockMode)mode timeStr:(NSString *)timeStr open:(BOOL)open {
NSString *log = [NSString stringWithFormat:@"返回闹钟列表 %ld,%d,%ld,%@,%d", state, num, mode,timeStr, open ? 1 : 0];
[self addLog:log];
}

/// 返回小夜灯
- (void)THManagerNightLightState:(BOOL)open {
NSString *log = open ? @"返回小夜灯: 开" : @"返回小夜灯: 关";
[self addLog:log];
}

/// 返回背光亮度
- (void)THManagerGounrdLightState:(BOOL)open brightness:(int)brightness {
NSString *log = [NSString stringWithFormat:@"返回小夜灯: %@ brightness: %d", open ? @"开" : @"关", brightness];
[self addLog:log];
}

/// 返回整点报时
- (void)THManagerReportPunctuallyState:(BOOL)open {
NSString *log = open ? @"返回整点报时: 开" : @"返回整点报时: 关";
[self addLog:log];
}

/// 设备返回当前单位
- (void)THManagerUnitState:(enum ELDeviceTemperatureUnit)unit {
NSString *log = unit == 0 ? @"设备返回当前单位:℃" : @"设备返回当前单位:℉";
[self addLog:log];
}

/// 设备返回温度校准值
- (void)hygrothermographManagerReturnCalibrationValueWithTem:(float)tem hum:(float)hum {
NSString *log = [NSString stringWithFormat:@"设备返回温度校准值 tem: %f hum: %f", tem, hum];
[self addLog:log];
}

//返回阀值
- (void)hygrothermographManagerReturnThresholdTemThreshold:(float)tem humThreshold:(float)hum {
}

//返回设备信息
- (void)hygrothermographManagerReturnDevType:(enum Hygrothermograph_DevType)type version:(NSString *)version IMEI:(NSString *)IMEI {
}

//返回设备报警值
- (void)hygrothermographManagerReturnTemAlarmSwitch:(BOOL)temAlarm highTemAlarm:(float)highTem lowTemAlarm:(float)lowTem humAlarmSwitch:(BOOL)humAlarm highHumAlarm:(float)highHum lowHumAlarm:(float)lowHum {
NSString *log = [NSString stringWithFormat:@"返回设备报警值 temAlarm:%@ highTem:%f lowTem:%f humAlarm:%@ highHum:%f lowHum:%f", temAlarm ? @"开" : @"关", highTem, lowTem, humAlarm ? @"开" : @"关", highHum, lowHum];
[self addLog:log];
}


@end


+ 184
- 0
AILinkBleSDKDemo/DeviceDemo/28_Hygrothermograph/HygrothermographVC.xib Прегледај датотеку

@@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<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="HygrothermographVC">
<connections>
<outlet property="bleStatusLabel" destination="VwK-CG-OF6" id="EY5-XX-CAi"/>
<outlet property="logTextView" destination="GHh-c0-Wjg" id="xxs-jf-pcz"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="bleStatus" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VwK-CG-OF6">
<rect key="frame" x="171" y="56" width="72" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8z3-vr-ygd" userLabel="function View">
<rect key="frame" x="0.0" y="76.5" width="414" height="285.5"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U10-eG-SAM">
<rect key="frame" x="0.0" y="0.0" width="414" height="285.5"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mSN-7W-Qrz">
<rect key="frame" x="0.0" y="0.0" width="414" height="200"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NGc-b4-0nY">
<rect key="frame" x="0.0" y="0.0" width="414" height="200"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rXQ-CP-ESp">
<rect key="frame" x="8" y="8" width="93.5" 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="getDevStateAction:" destination="-1" eventType="touchUpInside" id="QPL-e7-DVe"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ihZ-N4-8OS">
<rect key="frame" x="109.5" y="8" width="93.5" 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="getDevHisDataAction:" destination="-1" eventType="touchUpInside" id="Jru-nr-M0j"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="200" id="2Si-L8-xuy"/>
<constraint firstItem="ihZ-N4-8OS" firstAttribute="top" secondItem="NGc-b4-0nY" secondAttribute="top" constant="8" id="FGG-iR-Eho"/>
<constraint firstItem="rXQ-CP-ESp" firstAttribute="leading" secondItem="NGc-b4-0nY" secondAttribute="leading" constant="8" id="YGz-dq-sxI"/>
<constraint firstItem="ihZ-N4-8OS" firstAttribute="leading" secondItem="rXQ-CP-ESp" secondAttribute="trailing" constant="8" id="jVR-Et-HJP"/>
<constraint firstItem="rXQ-CP-ESp" firstAttribute="top" secondItem="NGc-b4-0nY" secondAttribute="top" constant="8" id="s1S-0R-2qx"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" systemColor="opaqueSeparatorColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="NGc-b4-0nY" secondAttribute="trailing" id="ITL-E7-gcs"/>
<constraint firstItem="NGc-b4-0nY" firstAttribute="leading" secondItem="mSN-7W-Qrz" secondAttribute="leading" id="TI7-8S-nBa"/>
<constraint firstAttribute="bottom" secondItem="NGc-b4-0nY" secondAttribute="bottom" id="de7-8H-oe7"/>
<constraint firstItem="NGc-b4-0nY" firstAttribute="top" secondItem="mSN-7W-Qrz" secondAttribute="top" id="ocn-8d-8xz"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="mSN-7W-Qrz" firstAttribute="leading" secondItem="aZs-kl-ZHf" secondAttribute="leading" id="7tJ-GX-DNs"/>
<constraint firstItem="mSN-7W-Qrz" firstAttribute="bottom" secondItem="aZs-kl-ZHf" secondAttribute="bottom" id="Gs6-U2-hhM"/>
<constraint firstItem="mSN-7W-Qrz" firstAttribute="top" secondItem="aZs-kl-ZHf" secondAttribute="top" id="aZY-4I-yXu"/>
<constraint firstItem="mSN-7W-Qrz" firstAttribute="width" secondItem="wX6-lP-c3p" secondAttribute="width" id="abk-Nw-HNF"/>
<constraint firstItem="mSN-7W-Qrz" firstAttribute="trailing" secondItem="aZs-kl-ZHf" secondAttribute="trailing" id="phZ-AJ-avA"/>
</constraints>
<viewLayoutGuide key="contentLayoutGuide" id="aZs-kl-ZHf"/>
<viewLayoutGuide key="frameLayoutGuide" id="wX6-lP-c3p"/>
</scrollView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="U10-eG-SAM" firstAttribute="top" secondItem="8z3-vr-ygd" secondAttribute="top" id="S9W-Iq-00r"/>
<constraint firstItem="U10-eG-SAM" firstAttribute="leading" secondItem="8z3-vr-ygd" secondAttribute="leading" id="Xuh-Ie-dvi"/>
<constraint firstAttribute="bottom" secondItem="U10-eG-SAM" secondAttribute="bottom" id="dfh-bo-OHl"/>
<constraint firstAttribute="trailing" secondItem="U10-eG-SAM" secondAttribute="trailing" id="pGu-ep-cNI"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yl9-ZE-Kry" userLabel="log View">
<rect key="frame" x="0.0" y="362" width="414" height="500"/>
<subviews>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Gu-jE-2jb">
<rect key="frame" x="375" y="8" 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="OfN-G4-xzl"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KP0-Ot-okp">
<rect key="frame" x="8" y="8" 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="1EJ-AL-hPN"/>
</connections>
</button>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uuF-Pb-896">
<rect key="frame" x="8" y="40" width="398" height="460"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" indicatorStyle="white" editable="NO" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GHh-c0-Wjg">
<rect key="frame" x="0.0" y="0.0" width="398" height="460"/>
<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 firstAttribute="trailing" secondItem="GHh-c0-Wjg" secondAttribute="trailing" id="5GX-ku-ALY"/>
<constraint firstItem="GHh-c0-Wjg" firstAttribute="top" secondItem="uuF-Pb-896" secondAttribute="top" id="ImL-ya-rrZ"/>
<constraint firstItem="GHh-c0-Wjg" firstAttribute="leading" secondItem="uuF-Pb-896" secondAttribute="leading" id="TGU-Uo-xyG"/>
<constraint firstAttribute="bottom" secondItem="GHh-c0-Wjg" secondAttribute="bottom" id="wSu-a4-VlU"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="3Gu-jE-2jb" firstAttribute="top" secondItem="Yl9-ZE-Kry" secondAttribute="top" constant="8" id="35c-rh-qK1"/>
<constraint firstItem="uuF-Pb-896" firstAttribute="top" secondItem="Yl9-ZE-Kry" secondAttribute="top" constant="40" id="K4g-O6-yhA"/>
<constraint firstAttribute="trailing" secondItem="uuF-Pb-896" secondAttribute="trailing" constant="8" id="Vzh-JM-ZmP"/>
<constraint firstItem="uuF-Pb-896" firstAttribute="leading" secondItem="Yl9-ZE-Kry" secondAttribute="leading" constant="8" id="WWk-ml-mVT"/>
<constraint firstItem="KP0-Ot-okp" firstAttribute="leading" secondItem="Yl9-ZE-Kry" secondAttribute="leading" constant="8" id="XM1-ox-R8U"/>
<constraint firstItem="KP0-Ot-okp" firstAttribute="top" secondItem="Yl9-ZE-Kry" secondAttribute="top" constant="8" id="a7e-N1-xYn"/>
<constraint firstAttribute="bottom" secondItem="uuF-Pb-896" secondAttribute="bottom" id="aqN-yF-Gy7"/>
<constraint firstAttribute="trailing" secondItem="3Gu-jE-2jb" secondAttribute="trailing" constant="8" id="mvs-ec-Zo8"/>
<constraint firstAttribute="height" constant="500" id="t8y-fG-jGh"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="8z3-vr-ygd" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="52b-xf-auY"/>
<constraint firstItem="VwK-CG-OF6" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="8" id="E4P-7k-NF0"/>
<constraint firstItem="Yl9-ZE-Kry" firstAttribute="trailing" secondItem="Q5M-cg-NOt" secondAttribute="trailing" id="QQb-Uq-bn9"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="Yl9-ZE-Kry" secondAttribute="bottom" id="Rxg-wZ-5R0"/>
<constraint firstItem="VwK-CG-OF6" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="VR9-ll-PVV"/>
<constraint firstItem="8z3-vr-ygd" firstAttribute="top" secondItem="VwK-CG-OF6" secondAttribute="bottom" id="bd5-qo-9la"/>
<constraint firstItem="Yl9-ZE-Kry" firstAttribute="top" secondItem="8z3-vr-ygd" secondAttribute="bottom" id="gUC-Q1-aih"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="8z3-vr-ygd" secondAttribute="trailing" id="oYg-QB-UYJ"/>
<constraint firstItem="Yl9-ZE-Kry" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="vch-Xs-qPf"/>
</constraints>
<point key="canvasLocation" x="97.101449275362327" y="20.758928571428569"/>
</view>
</objects>
<resources>
<systemColor name="labelColor">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="opaqueSeparatorColor">
<color red="0.77647058820000003" green="0.77647058820000003" blue="0.7843137255" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>

+ 2
- 1
AILinkBleSDKDemo/Others/ViewController.m Прегледај датотеку

@@ -46,7 +46,7 @@

#import "MeatProbeVC.h"
#import "MeatProbeBoxVC.h"
#import "HygrothermographVC.h"


@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
@@ -106,6 +106,7 @@
[ELDemoDeviceModel modelWithIndex:@"26" imageName:@"meat_probe_type_ic" title:@"MeatProbe" subtitle:@"食物探针" entryVCName:NSStringFromClass(MeatProbeVC.class) cids:@[@(ELSupportDeviceTypeMeatProbe)]],
[ELDemoDeviceModel modelWithIndex:@"27" imageName:@"ailink_cid85_type_ic" title:@"MeatProbeBox" subtitle:@"食物探针盒子" entryVCName:NSStringFromClass(MeatProbeBoxVC.class) cids:@[@(ELSupportDeviceTypeMeatProbeBox)]],
[ELDemoDeviceModel modelWithIndex:@"28" imageName:@"Hygrothermograph_add_icon2_100" title:@"Hygrothermograph" subtitle:@"温湿度计" entryVCName:NSStringFromClass(HygrothermographVC.class) cids:@[@(ELSupportDeviceTypeHygrothermograph)]],
];
}


+ 1
- 0
README.md Прегледај датотеку

@@ -14,4 +14,5 @@
| 1.7.0 | 20231007 | larry | 修改 增加 WIFI_BLE 血压计 支持 |
| 1.8.0 | 20240313 | larry | 修改 增加 readRSSI 接口 |
| 1.9.0 | 20240603 | larry | 修改 增加 Privacy Manifest |
| 1.9.0(Demo v1.9.2) | 20240628 | larry | 修改 增加 温湿度计 Demo |


Loading…
Откажи
Сачувај