buildSettings = { | buildSettings = { | ||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||||
CODE_SIGN_STYLE = Automatic; | CODE_SIGN_STYLE = Automatic; | ||||
CURRENT_PROJECT_VERSION = 20230327; | |||||
CURRENT_PROJECT_VERSION = 20230427; | |||||
DEVELOPMENT_TEAM = YEU77XR292; | DEVELOPMENT_TEAM = YEU77XR292; | ||||
FRAMEWORK_SEARCH_PATHS = ( | FRAMEWORK_SEARCH_PATHS = ( | ||||
"$(inherited)", | "$(inherited)", | ||||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | "$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | ||||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | "$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | ||||
); | ); | ||||
MARKETING_VERSION = 1.5.11; | |||||
MARKETING_VERSION = 1.5.15; | |||||
OTHER_LDFLAGS = "-ObjC"; | OTHER_LDFLAGS = "-ObjC"; | ||||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AILinkBleSDKDemo; | PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AILinkBleSDKDemo; | ||||
PRODUCT_NAME = "$(TARGET_NAME)"; | PRODUCT_NAME = "$(TARGET_NAME)"; | ||||
buildSettings = { | buildSettings = { | ||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||||
CODE_SIGN_STYLE = Automatic; | CODE_SIGN_STYLE = Automatic; | ||||
CURRENT_PROJECT_VERSION = 20230327; | |||||
CURRENT_PROJECT_VERSION = 20230427; | |||||
DEVELOPMENT_TEAM = YEU77XR292; | DEVELOPMENT_TEAM = YEU77XR292; | ||||
FRAMEWORK_SEARCH_PATHS = ( | FRAMEWORK_SEARCH_PATHS = ( | ||||
"$(inherited)", | "$(inherited)", | ||||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | "$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | ||||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | "$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | ||||
); | ); | ||||
MARKETING_VERSION = 1.5.11; | |||||
MARKETING_VERSION = 1.5.15; | |||||
OTHER_LDFLAGS = "-ObjC"; | OTHER_LDFLAGS = "-ObjC"; | ||||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AILinkBleSDKDemo; | PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AILinkBleSDKDemo; | ||||
PRODUCT_NAME = "$(TARGET_NAME)"; | PRODUCT_NAME = "$(TARGET_NAME)"; |
#endif | #endif | ||||
#endif | #endif | ||||
#import "ELAILinkBleManager+WIFI.h" | |||||
#import "ELAILinkBleManager.h" | #import "ELAILinkBleManager.h" | ||||
#import "ELAILinkBleManagerProtocol.h" | |||||
#import "ELAILinkPeripheral.h" | |||||
#import "ELTLVModel.h" | #import "ELTLVModel.h" | ||||
#import "NELBleManagerHeader.h" | #import "NELBleManagerHeader.h" | ||||
#import "NELMacAddressModel.h" | #import "NELMacAddressModel.h" | ||||
#import "ELAirDetectorBleSettingModel.h" | #import "ELAirDetectorBleSettingModel.h" | ||||
#import "ELAirDetectorBleStatusModel.h" | #import "ELAirDetectorBleStatusModel.h" | ||||
#import "ELAILinkBleManager+MeatProbe.h" | #import "ELAILinkBleManager+MeatProbe.h" | ||||
#import "ELMeatProbeBleModel.h" | |||||
#import "ELMeatProbeBleTool.h" | #import "ELMeatProbeBleTool.h" | ||||
#import "ELAILinkBleManager+MeatProbeBox.h" | |||||
#import "ELMeatProbeBoxBleModel.h" | |||||
#import "ELMeatProbeBoxBleParser.h" | |||||
#import "ELAILinkBleManager+NoiseMeter.h" | #import "ELAILinkBleManager+NoiseMeter.h" | ||||
#import "ELNoiseMeterBleFunctionModel.h" | #import "ELNoiseMeterBleFunctionModel.h" | ||||
#import "ELNoiseMeterBleHeader.h" | #import "ELNoiseMeterBleHeader.h" | ||||
#import "AILinkBleSDK_Version.h" | #import "AILinkBleSDK_Version.h" | ||||
#import "ELBleDisposeDataTool.h" | #import "ELBleDisposeDataTool.h" | ||||
#import "ELBleWifiDetailModel.h" | #import "ELBleWifiDetailModel.h" | ||||
#import "ELExSupportDeviceType.h" | |||||
#import "ELSDKHeader.h" | #import "ELSDKHeader.h" | ||||
FOUNDATION_EXPORT double AILinkBleSDKVersionNumber; | FOUNDATION_EXPORT double AILinkBleSDKVersionNumber; |
#define AILinkBleSDK_Version_h | #define AILinkBleSDK_Version_h | ||||
//版本号 SDK Version | //版本号 SDK Version | ||||
#define AiLinkBleSDKVersion @"1.5.11" //20230327 增加 蓝牙体重秤 | |||||
#define AiLinkBleSDKVersion @"1.5.15" //20230427 增加 蓝牙牙刷防飞溅 | |||||
#endif /* AILinkBleSDK_Version_h */ | #endif /* AILinkBleSDK_Version_h */ |
//关闭自动关机指令 A7 **调试阶段使用 | //关闭自动关机指令 A7 **调试阶段使用 | ||||
- (void)meatProbeCloseAutoOff; | |||||
//- (void)meatProbeCloseAutoOff; | |||||
@end | @end |
// | |||||
// ELAILinkBleManager+MeatProbeBox.h | |||||
// AILinkBleSDK | |||||
// | |||||
// Created by LarryZhang on 2023/2/16. | |||||
// | |||||
#import "ELAILinkBleManager.h" | |||||
NS_ASSUME_NONNULL_BEGIN | |||||
@interface ELAILinkBleManager (MeatProbeBox) | |||||
@end | |||||
NS_ASSUME_NONNULL_END |
// | |||||
// ELAILinkBleManager+WIFI.h | |||||
// AILinkBleSDK | |||||
// | |||||
// Created by LarryZhang on 2023/3/31. | |||||
// | |||||
#import "ELAILinkBleManager.h" | |||||
NS_ASSUME_NONNULL_BEGIN | |||||
@interface ELAILinkBleManager (WIFI) | |||||
//============ wifi 分包数据 ============== | |||||
@property(nonatomic, strong) ELBleWifiDetailModel *_Nullable wifiDetailModel; | |||||
@property(nonatomic, strong) NSMutableData *_Nullable urlBuffData; | |||||
@property(nonatomic, strong) NSMutableData *_Nullable pathBuffData; | |||||
//============ Bluetooth WIFI calling method(蓝牙WIFI 设置命令) ============== | |||||
/** | |||||
WIFI initiate connection and disconnect(WIFI 发起连接、断开连接) | |||||
@param connect YES: initiate connection NO: disconnect(YES:发起连接 NO:断开连接) | |||||
*/ | |||||
- (void)bleWifiSetupWifiConnect:(BOOL)connect; | |||||
/** | |||||
Set WIFI access URL(设置WIFI访问URL) | |||||
@param url url(Not more than 56chars(不超过56chars)) | |||||
*/ | |||||
- (void)bleWifiSetURL:(NSString *)url; | |||||
/** | |||||
Set Wifi access port number(设置Wifi访问端口号) | |||||
@param port 端口号 | |||||
*/ | |||||
- (void)bleWifiSetPort:(int)port; | |||||
/** | |||||
Set WIFI access path(设置WIFI访问path) | |||||
@param path path(Not more than 56chars(不超过56chars)) | |||||
*/ | |||||
- (void)bleWifiSetPath:(NSString *)path; | |||||
//Get WIFI access URL(设置WIFI访问URL) | |||||
- (void)bleWifiGetURL; | |||||
//Get Wifi access port number(设置Wifi访问端口号) | |||||
- (void)bleWifiGetPort; | |||||
//Get WIFI access path(设置WIFI访问path) | |||||
- (void)bleWifiGetPath; | |||||
/** | |||||
Set DTIM interval(设置DTIM间隔) | |||||
@param interval 间隔 | |||||
*/ | |||||
- (void)bleWifiSetDTIMInterval:(int)interval; | |||||
/** | |||||
Set WIFI password(设置WIFI密码) | |||||
@param pwd WIFI password (8 ~ 56 chars)(WIFI密码(8~56 个chars)) | |||||
*/ | |||||
- (void)bleWifiSetWifiPwd:(NSString *)pwd; | |||||
/** | |||||
Set up connected WIFI(设置连接的WIFI) | |||||
@param macData wifi MAC (little endian)(wifi的MAC(小端序)) | |||||
*/ | |||||
- (void)bleWifiSetConnectWifiMac:(NSData *)macData; | |||||
//解析 | |||||
- (void)parseA6WifiPacket:(NSData *)packet; | |||||
@end | |||||
NS_ASSUME_NONNULL_END |
#import "ELSDKHeader.h" | #import "ELSDKHeader.h" | ||||
#import "AILinkBleSDK_Version.h" | #import "AILinkBleSDK_Version.h" | ||||
#import "ELAILinkBleManagerProtocol.h" | |||||
#import "ELAILinkPeripheral.h" | |||||
NS_ASSUME_NONNULL_BEGIN | NS_ASSUME_NONNULL_BEGIN | ||||
@class ELAILinkPeripheral; | @class ELAILinkPeripheral; | ||||
@property (nonatomic, weak) id<ELAILinkBleManagerDelegate> delegate DEPRECATED_MSG_ATTRIBUTE("use 'ailinkDelegate' only"); | @property (nonatomic, weak) id<ELAILinkBleManagerDelegate> delegate DEPRECATED_MSG_ATTRIBUTE("use 'ailinkDelegate' only"); | ||||
@property (nonatomic, strong) CBPeripheral *peripheral; | |||||
@property (nonatomic, weak) id<ELAILinkBleManagerDelegate> ailinkDelegate; | @property (nonatomic, weak) id<ELAILinkBleManagerDelegate> ailinkDelegate; | ||||
//Bluetooth wifi proxy(蓝牙wifi代理) | //Bluetooth wifi proxy(蓝牙wifi代理) | ||||
@interface ELAILinkBleManager (send) | @interface ELAILinkBleManager (send) | ||||
- (void)sendA7Payload:(NSData *)payload; | - (void)sendA7Payload:(NSData *)payload; | ||||
- (void)sendA7PayloadNoEncryption:(NSData *)payload; | |||||
- (void)sendA6Payload:(NSData *)payload; | - (void)sendA6Payload:(NSData *)payload; | ||||
/// base method of 'sendA7Payload' & 'sendA6Payload' | /// base method of 'sendA7Payload' & 'sendA6Payload' | ||||
- (void)sendCmd:(NSData *)cmdData; | - (void)sendCmd:(NSData *)cmdData; | ||||
//最大发送payload长度 | |||||
//- (NSUInteger)maximumWritePayloadLength; | |||||
//OTA最大发送payload长度 | |||||
//- (NSUInteger)maximumWriteOTAPayloadLength; | |||||
//最大发送数据长度 | |||||
- (NSUInteger)maximumWriteValueLength; | |||||
//最大发送A7 payload长度 | |||||
- (NSUInteger)maximumWriteA7PayloadLength; | |||||
//最大发送A6 payload长度 | |||||
- (NSUInteger)maximumWriteA6PayloadLength; | |||||
//发送队列发送周期 | //发送队列发送周期 | ||||
- (void)configWriteDataQueueInterval:(CGFloat)interval; | - (void)configWriteDataQueueInterval:(CGFloat)interval; | ||||
@end | @end | ||||
#pragma mark - Special | |||||
@interface ELAILinkBleManager (Special) | |||||
#pragma mark - Open | |||||
@interface ELAILinkBleManager (Open) | |||||
//解析指令 外部开放 Method | |||||
- (void)processA7Data:(NSMutableData *)rawData withMac:(NSData *)mac withCid:(UInt16)cid; | - (void)processA7Data:(NSMutableData *)rawData withMac:(NSData *)mac withCid:(UInt16)cid; | ||||
- (void)processA6Data:(NSMutableData *)rawData; | - (void)processA6Data:(NSMutableData *)rawData; | ||||
//生成数据包 外部开放 Method | |||||
- (NSData * _Nullable)makePacketA7Payload:(NSData *)payload withMac:(NSData *)mac withCid:(UInt16)cid; | - (NSData * _Nullable)makePacketA7Payload:(NSData *)payload withMac:(NSData *)mac withCid:(UInt16)cid; | ||||
- (NSData * _Nullable)makePacketA6Payload:(NSData *)payload; | - (NSData * _Nullable)makePacketA6Payload:(NSData *)payload; | ||||
@end | @end | ||||
#pragma mark - BleWifi | |||||
@interface ELAILinkBleManager (BleWifi) | |||||
//============ Bluetooth WIFI calling method(蓝牙WIFI 设置命令) ============== | |||||
/** | |||||
WIFI initiate connection and disconnect(WIFI 发起连接、断开连接) | |||||
@param connect YES: initiate connection NO: disconnect(YES:发起连接 NO:断开连接) | |||||
*/ | |||||
- (void)bleWifiSetupWifiConnect:(BOOL)connect; | |||||
/** | |||||
Set WIFI access URL(设置WIFI访问URL) | |||||
@param url url(Not more than 56chars(不超过56chars)) | |||||
*/ | |||||
- (void)bleWifiSetWifiURL:(NSString *)url; | |||||
/** | |||||
Set Wifi access port number(设置Wifi访问端口号) | |||||
@param port 端口号 | |||||
*/ | |||||
- (void)bleWifiSetPort:(int)port; | |||||
/** | |||||
Set DTIM interval(设置DTIM间隔) | |||||
@param interval 间隔 | |||||
*/ | |||||
- (void)bleWifiSetDTIMInterval:(int)interval; | |||||
/** | |||||
Set WIFI password(设置WIFI密码) | |||||
@param pwd WIFI password (8 ~ 56 chars)(WIFI密码(8~56 个chars)) | |||||
*/ | |||||
- (void)bleWifiSetWifiPwd:(NSString *)pwd; | |||||
/** | |||||
Set up connected WIFI(设置连接的WIFI) | |||||
@param macData wifi MAC (little endian)(wifi的MAC(小端序)) | |||||
*/ | |||||
- (void)bleWifiSetConnectWifiMac:(NSData *)macData; | |||||
@end | |||||
#pragma mark - ELAILinkBleManagerDelegate | |||||
@protocol ELAILinkBleManagerDelegate <NSObject> | |||||
@optional | |||||
//扫描 | |||||
- (void)managerDidUpdateState:(CBCentralManager *)central; | |||||
- (void)managerScanState:(BOOL)scanning; | |||||
- (void)managerDidDiscoverPeripheral:(ELAILinkPeripheral *)peripheral; | |||||
- (void)managerDidDiscoverMorePeripheral:(NSDictionary<NSUUID *, ELAILinkPeripheral *> *)peripherals; | |||||
//连接 | |||||
- (void)managerDidConnectPeripheral:(CBPeripheral *)peripheral; | |||||
- (void)managerDidFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error; | |||||
- (void)managerDidDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error; | |||||
- (void)managerDidUpdateConnect:(NELBleManagerConnectState)state; | |||||
//服务 & 特征 | |||||
- (void)peripheralDidDiscoverServices:(NSArray<CBService *> *)services; | |||||
- (void)peripheralDidDiscoverCharacteristicsForService:(NSArray<CBCharacteristic *> *)characteristics; | |||||
- (void)peripheralDidUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic; | |||||
- (void)peripheralDidUpdateValueForCharacteristic:(CBCharacteristic *)characteristic; | |||||
- (void)didWriteValueForCharacteristic:(CBCharacteristic *)characteristic; | |||||
- (void)peripheralDidReadRSSI:(nonnull NSNumber *)RSSI; | |||||
@optional | |||||
//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; | |||||
//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; | |||||
- (void)aiLinkBleReceiveRawData:(NSData *)rawData aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral; | |||||
@end | |||||
#pragma mark - Bluetooth Wifi protocol(蓝牙Wifi协议) | |||||
@protocol ELAILinkBleWifiDelegate <NSObject> | |||||
@optional | |||||
/** | |||||
Callback Wifi details(回调Wifi详情) | |||||
@param model 模型 | |||||
*/ | |||||
- (void)bleWifiReceiveWifiDetailModel:(ELBleWifiDetailModel *_Nonnull)model; | |||||
/** | |||||
Scan nearby wifi results(扫描附近wifi结果) | |||||
@param count Number of nearby wifi(附近wifi数量) | |||||
*/ | |||||
- (void)bleWifiReceiveScanedWifiCount:(int)count; | |||||
/** | |||||
Callback Wifi MAC address(回调Wifi MAC地址) | |||||
@param macData mac | |||||
*/ | |||||
- (void)bleWifiReceiveWifiMacData:(NSData *_Nullable)macData; | |||||
/** | |||||
Callback WIFI password(回调WIFI密码) | |||||
@param pwd password(密码) | |||||
*/ | |||||
- (void)bleWifiReceiveWifiPwd:(NSString *_Nonnull)pwd; | |||||
/** | |||||
Get DTIM interval (unit: ms)(获取DTIM间隔(单位:ms)) | |||||
@param interval Interval (unit: ms)(间隔(单位:ms)) | |||||
*/ | |||||
- (void)bleWifiReceiveWifiDTIMInterval:(NSInteger)interval; | |||||
/** | |||||
Returns the visited URL(返回访问的url) | |||||
@param url url | |||||
*/ | |||||
- (void)bleWifiReceiveWifiAccessURL:(NSString *_Nonnull)url; | |||||
/** | |||||
Call back wifi port number(回调wifi的端口号) | |||||
@param port 端口号 | |||||
*/ | |||||
- (void)bleWifiReceiveWifiPort:(int)port; | |||||
/** | |||||
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; | |||||
/** | |||||
获取会话码(deviceId) | |||||
@param code (deviceId) deviceId(0 means no:为0时表示不存在) | |||||
*/ | |||||
- (void)bleWifiReceiveWifiSNCode:(int)code; | |||||
/** 返回wifi名称 */ | |||||
- (void)bleWifiName:(NSString *)wifiName; | |||||
@end | |||||
#pragma mark - ELAILinkPeripheral | |||||
@interface ELAILinkPeripheral : NSObject | |||||
@property (nonatomic, strong) CBPeripheral *peripheral; | |||||
@property (nonatomic, strong) NSDictionary *advertisementData; | |||||
@property (nonatomic, strong) NSNumber *RSSI; | |||||
@property (nonatomic, assign) NSTimeInterval timestamp; | |||||
@property (nonatomic, copy) NSString *macAddressString; | |||||
@property (nonatomic, strong) NSData *macData; | |||||
@property (nonatomic, assign) UInt16 cid; | |||||
@property (nonatomic, assign) UInt16 vid; | |||||
@property (nonatomic, assign) UInt16 pid; | |||||
@property (nonatomic, strong) NSUUID *identifier; | |||||
@end | |||||
NS_ASSUME_NONNULL_END | NS_ASSUME_NONNULL_END |
// | |||||
// ELAILinkBleManagerProtocol.h | |||||
// AILinkBleSDK | |||||
// | |||||
// Created by LarryZhang on 2023/3/31. | |||||
// | |||||
#import "ELAILinkBleManager.h" | |||||
@class ELAILinkPeripheral, ELBleWifiDetailModel, ELAILinkBleManager; | |||||
NS_ASSUME_NONNULL_BEGIN | |||||
#pragma mark - ELAILinkBleManagerDelegate | |||||
@protocol ELAILinkBleManagerDelegate <NSObject> | |||||
@optional | |||||
//扫描 | |||||
- (void)managerDidUpdateState:(CBCentralManager *)central; | |||||
- (void)managerScanState:(BOOL)scanning; | |||||
- (void)managerDidDiscoverPeripheral:(ELAILinkPeripheral *)peripheral; | |||||
- (void)managerDidDiscoverMorePeripheral:(NSDictionary<NSUUID *, ELAILinkPeripheral *> *)peripherals; | |||||
//连接 | |||||
- (void)managerDidConnectPeripheral:(CBPeripheral *)peripheral; | |||||
- (void)managerDidFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error; | |||||
- (void)managerDidDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error; | |||||
- (void)managerDidUpdateConnect:(NELBleManagerConnectState)state; | |||||
//服务 & 特征 | |||||
- (void)peripheralDidDiscoverServices:(NSArray<CBService *> *)services; | |||||
- (void)peripheralDidDiscoverCharacteristicsForService:(NSArray<CBCharacteristic *> *)characteristics; | |||||
- (void)peripheralDidUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic; | |||||
- (void)peripheralDidUpdateValueForCharacteristic:(CBCharacteristic *)characteristic; | |||||
- (void)didWriteValueForCharacteristic:(CBCharacteristic *)characteristic; | |||||
- (void)peripheralDidReadRSSI:(nonnull NSNumber *)RSSI; | |||||
@optional | |||||
//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 *)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 *)rawData manager:(ELAILinkBleManager *)manager; | |||||
//原始数据 | |||||
- (void)aiLinkBleReceiveRawData:(NSData *)rawData aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveRawData:manager' instead"); | |||||
- (void)aiLinkBleReceiveRawData:(NSData *)rawData manager:(ELAILinkBleManager *)manager; | |||||
@end | |||||
#pragma mark - Bluetooth Wifi protocol(蓝牙Wifi协议) | |||||
@protocol ELAILinkBleWifiDelegate <NSObject> | |||||
@optional | |||||
/** | |||||
Callback Wifi details(回调Wifi详情) | |||||
@param model 模型 | |||||
*/ | |||||
- (void)bleWifiReceiveWifiDetailModel:(ELBleWifiDetailModel *)model; | |||||
/** | |||||
Scan nearby wifi results(扫描附近wifi结果) | |||||
@param count Number of nearby wifi(附近wifi数量) | |||||
*/ | |||||
- (void)bleWifiReceiveScanedWifiCount:(int)count; | |||||
/** | |||||
Callback Wifi MAC address(回调Wifi MAC地址) | |||||
@param macData mac | |||||
*/ | |||||
- (void)bleWifiReceiveWifiMacData:(NSData *_Nullable)macData; | |||||
/** | |||||
Callback WIFI password(回调WIFI密码) | |||||
@param pwd password(密码) | |||||
*/ | |||||
- (void)bleWifiReceiveWifiPwd:(NSString *)pwd; | |||||
/** | |||||
Get DTIM interval (unit: ms)(获取DTIM间隔(单位:ms)) | |||||
@param interval Interval (unit: ms)(间隔(单位:ms)) | |||||
*/ | |||||
- (void)bleWifiReceiveWifiDTIMInterval:(NSInteger)interval; | |||||
/** | |||||
Returns the visited URL(返回访问的url) | |||||
@param url url | |||||
*/ | |||||
- (void)bleWifiReceiveURL:(NSString *)url; | |||||
/** | |||||
Call back wifi port number(回调wifi的端口号) | |||||
@param port 端口号 | |||||
*/ | |||||
- (void)bleWifiReceivePort:(UInt16)port; | |||||
//Returns the visited path(返回访问的path) | |||||
- (void)bleWifiReceivePath:(NSString *)path; | |||||
/** | |||||
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; | |||||
/** | |||||
获取会话码(deviceId) | |||||
@param code (deviceId) deviceId(0 means no:为0时表示不存在) | |||||
*/ | |||||
- (void)bleWifiReceiveWifiSNCode:(int)code; | |||||
/** 返回wifi名称 */ | |||||
- (void)bleWifiName:(NSString *)wifiName; | |||||
@end | |||||
NS_ASSUME_NONNULL_END |
// | |||||
// ELAILinkPeripheral.h | |||||
// AILinkBleSDK | |||||
// | |||||
// Created by LarryZhang on 2023/3/31. | |||||
// | |||||
#import <Foundation/Foundation.h> | |||||
@class CBPeripheral; | |||||
NS_ASSUME_NONNULL_BEGIN | |||||
@interface ELAILinkPeripheral : NSObject | |||||
@property (nonatomic, strong) CBPeripheral *peripheral; | |||||
@property (nonatomic, strong) NSDictionary *advertisementData; | |||||
@property (nonatomic, strong) NSNumber *RSSI; | |||||
@property (nonatomic, assign) NSTimeInterval timestamp; | |||||
@property (nonatomic, copy) NSString *macAddressString; | |||||
@property (nonatomic, strong) NSData *macData; | |||||
@property (nonatomic, assign) UInt16 cid; | |||||
@property (nonatomic, assign) UInt16 vid; | |||||
@property (nonatomic, assign) UInt16 pid; | |||||
@property (nonatomic, strong) NSUUID *identifier; | |||||
@end | |||||
NS_ASSUME_NONNULL_END |
//设置appkey和secret | //设置appkey和secret | ||||
+(void)setAppKey:(NSString *)key appSecret:(NSString *)secret; | +(void)setAppKey:(NSString *)key appSecret:(NSString *)secret; | ||||
//设置支持设备列表 - 扫描过滤 | |||||
- (void)setSupportDeviceCids:(NSArray<NSNumber *> *)cids; | |||||
// | // | ||||
+(__kindof ELBluetoothManager * _Nonnull)shareManager; | +(__kindof ELBluetoothManager * _Nonnull)shareManager; | ||||
//Start scanning(开始扫描) | //Start scanning(开始扫描) | ||||
-(void)startScan; | -(void)startScan; | ||||
//Start scanning(开始扫描)- 过滤 cid 列表 | |||||
-(void)startScanFilterCids:(NSArray<NSNumber *> *)cids; | |||||
//Start scanning all (开始扫描附近所有设备) | //Start scanning all (开始扫描附近所有设备) | ||||
- (void)startScanAll; | - (void)startScanAll; | ||||
//Stop scanning(停止扫描) | //Stop scanning(停止扫描) |
// | |||||
// ELExSupportDeviceType.h | |||||
// AILinkSDKDemo | |||||
// | |||||
// Created by iot_user on 2023/4/11. | |||||
// Copyright © 2019 IOT. All rights reserved. | |||||
// | |||||
#ifndef ELExSupportDeviceType_h | |||||
#define ELExSupportDeviceType_h | |||||
/**** | |||||
ELSupportDeviceType 将转移到 App 层更新维护,不再SDK中更新2023/4/11 | |||||
****/ | |||||
//Device types supported by Elink: Please communicate with the hardware to set(Elink支持的设备类型:请与硬件沟通后设置) | |||||
typedef NS_ENUM(NSUInteger, ELSupportDeviceType) { | |||||
ELSupportDeviceTypeUnkonwn = 0x0000 , //unknown(未知) | |||||
ELSupportDeviceTypeBlood = 0x0001 , //sphygmomanometer(血压计) | |||||
ELSupportDeviceTypeForehead = 0x0002 , //Temperature gun(额温枪) | |||||
ELSupportDeviceTypeThermometer = 0x0003 , //thermometer(体温计) | |||||
ELSupportDeviceTypeBabyScale = 0x0004 , //Baby scale(婴儿秤) | |||||
ELSupportDeviceTypeHeightGauge = 0x0005 , //Height meter(身高仪) | |||||
ELSupportDeviceTypeSmartLock = 0x000B , //Smart door lock(智能门锁) | |||||
ELSupportDeviceTypeRemoteControl = 0x000C , //Internal projection vision tester(内投影视力检查仪) | |||||
ELSupportDeviceTypeWheelMonitor = 0x000D , //TPMS(胎压转接板) | |||||
ELSupportDeviceTypeBodyFatScale = 0x000E , //Body fat scale(体脂秤) | |||||
ELSupportDeviceTypeSmatLockRemote = 0x0010 , //Smart door lock remote control(智能门锁遥控器) | |||||
ELSupportDeviceTypeBLE_WIFIScale = 0x0011 , //Ble and wifi Scale(蓝牙Wifi体脂秤) | |||||
ELSupportDeviceTypeBLE_WIFIToothbrush = 0x0012, //Bluetooth and wifi toothbrush(蓝牙wifi牙刷) | |||||
ELSupportDeviceTypeBLE_EightScale = 0x0013 , //Eight electrode scale(八电极蓝牙秤) | |||||
ELSupportDeviceTypeAnemometer = 0x0014 , //anemometer(风速计),0x0014 | |||||
ELSupportDeviceTypeClampMeter = 0x0015 , //clamp meter(钳表) | |||||
ELSupportDeviceTypeWatch = 0x001D , //华盛达手表 | |||||
ELSupportDeviceTypeBloodSugar = 0x001C , //blood sugar(血糖仪) | |||||
ELSupportDeviceTypeInfThermt = 0x0020 , //Infrared Thermometer(红外测温仪) | |||||
ELSupportDeviceTypeOximeter = 0x0021 , //Oximeter (血氧仪) | |||||
ELSupportDeviceTypeFaceMask = 0x0022 , //face mask(智能口罩) | |||||
ELSupportDeviceTypeCoffeeScale = 0x0024 , //咖啡秤 | |||||
ELSupportDeviceTypeHeightBodyFatScale = 0x0026 , //身高体脂秤 | |||||
ELSupportDeviceTypeHeightScale = 0x0028 , //身高体重仪,CID:40 (0x0028) | |||||
ELSupportDeviceTypeFoodThermometer = 0x002B, //Food Thermometer(食品温度计) | |||||
ELSupportDeviceTypeBLEToothbrush = 0x002D, //Bluetooth toothbrush(蓝牙牙刷) | |||||
ELSupportDeviceTypeHygrothermograph = 0x002E , //温湿度计 | |||||
ELSupportDeviceTypeSkip = 0x002F , //跳绳 | |||||
ELSupportDeviceTypeBLE_BfrEightScale = 0x0032, //MCU会计算体脂信息的八电极蓝牙秤 | |||||
ELSupportDeviceTypeElectricScooter= 0x0033 , //滑板车 | |||||
ELSupportDeviceTypeNutritionScale = 0x0034 , //营养秤(蓝牙连接) | |||||
ELSupportDeviceType_WiFi_Hygrothermograph = 0x0036 , //wifi温湿度计 | |||||
ELSupportDeviceTypeAiFreshNutritionScale = 0x0037 , //好营养营养秤(蓝牙连接) | |||||
ELSupportDeviceTypeBLE_WIFIBlood = 0x0038 , //Bluetooth and wifi Blood(蓝牙wifi智能血压计) | |||||
ELSupportDeviceTypeFasciaGun = 0x003B , //筋膜枪 | |||||
ELSupportDeviceType_4G_Hygrothermograph = 0x003A , //4g温湿度计 | |||||
ELSupportDeviceTypeAutomaticThermometer = 0x003D , //61 //测温仪(蓝牙) | |||||
ELSupportDeviceType_BraceletWatch = 0x003E, //Leap手环 | |||||
ELSupportDeviceTypeMeatProbe = 0x003F, //食物探针 | |||||
ELSupportDeviceTypeVictorClampMeter = 0x0040, //Victor钳表 | |||||
ELSupportDeviceTypeVictorNoiseMeter = 0x0043, //胜利噪音计 | |||||
ELSupportDeviceTypeVictorAnemometer = 0x0044, //胜利风速计 | |||||
ELSupportDeviceTypeVictorLuxMeter = 0x0045, //胜利照度计 | |||||
ELSupportDeviceTypeAirDetector = 0x0048, //环境气体检测仪 | |||||
ELSupportDeviceTypeTPMS智能胎压 = 0x0049, //智能胎压 | |||||
ELSupportDeviceType电动自行车 = 0x004A, //电动自行车 | |||||
ELSupportDeviceType电动自行车4G = 0x004B, //电动自行车 4G | |||||
ELSupportDeviceType电动车 = 0x004C, //电动车 | |||||
ELSupportDeviceType电动车4G = 0x004D, //电动车 4G | |||||
ELSupportDeviceType电动平衡车 = 0x004E, //电动平衡车 | |||||
ELSupportDeviceType电动平衡车4G = 0x004F, //电动平衡车 4G | |||||
ELSupportDeviceTypeBLEWiFiNoiseMeter = 0x0050, //噪音计(WiFi+BLE) | |||||
ELSupportDeviceType智能仪表 = 0x0051, //CM01-C02智能仪表 | |||||
ELSupportDeviceType双频八电极体脂秤 = 0x0052, //双频八电极体脂秤 | |||||
ELSupportDeviceTypeAirDetectorLite = 0x0053, //环境气体检测仪 不支持MQTT | |||||
ELSupportDeviceTypeHPLuxMeter = 0x0054, //华普照度计 | |||||
ELSupportDeviceTypeMeatProbeBox = 0x0055, //食物探针充电盒 | |||||
ELSupportDeviceTypeBodyScale = 0x0056, //Body scale(no body fat) 体重秤(无体脂) | |||||
ELSupportDeviceTypeBroadcastScale = (0xffff +0x01) , //655536 Broadcast body fat scale(AILink广播体脂秤) | |||||
ELSupportDeviceTypeBroadcastHeightGauge = (0xffff + 0x03) , //65538 广播身高仪 | |||||
ELSupportDeviceTypeBroadcastScale_Lingyang = (0xffff +0x16) , //65557 凌阳广播体脂秤 | |||||
ELSupportDeviceTypeBroadcastNutritionFoodScale = (0xffff + 0x04) , //65539 广播营养秤 | |||||
ELSupportDeviceTypeBroadcastHygrothermograph = (0xffff + 0x06) , //65541 广播温湿度计 | |||||
}; | |||||
#endif /* ELExSupportDeviceType_h */ |
// | |||||
// ELMeatProbeBleModel.h | |||||
// AILinkBleSDK | |||||
// | |||||
// Created by LarryZhang on 2022/11/22. | |||||
// | |||||
#import <Foundation/Foundation.h> | |||||
#import "ELMeatProbeBleTool.h" | |||||
NS_ASSUME_NONNULL_BEGIN | |||||
/// | |||||
@interface ELMeatProbeBleModel : NSObject | |||||
@property (nonatomic, assign, readonly) UInt8 ver; //数据版本 (当前版本 0x01) //数据总长度: modelSize() | |||||
@property (nonatomic, assign) UInt32 cookingId; //烧烤id (选择食物的时间戳) | |||||
@property (nonatomic, assign) UInt8 foodType; //食物类型 | |||||
@property (nonatomic, assign) UInt8 foodRawness; //食物熟度 | |||||
@property (nonatomic, assign) UInt16 targetRawTemperature; //食物目标温度 Bit15: 单位(0:℃ 。 1:℉) Bit14:正负(0:温度为正值。1:温度为负值) Bit13-Bit0:温度值。 | |||||
@property (nonatomic, assign, readonly) NSInteger targetTemperature; | |||||
@property (nonatomic, assign, readonly) ELDeviceTemperatureUnit targetTemperatureUnit; | |||||
@property (nonatomic, assign) UInt16 ambientMinRawTemperature; //炉温目标下限 Bit15: 单位(0:℃ 。 1:℉) Bit14:正负(0:温度为正值。1:温度为负值) Bit13-Bit0:温度值。 | |||||
@property (nonatomic, assign, readonly) NSInteger ambientMinTemperature; | |||||
@property (nonatomic, assign, readonly) ELDeviceTemperatureUnit ambientMinTemperatureUnit; | |||||
@property (nonatomic, assign) UInt16 ambientMaxRawTemperature; //炉温目标上限 Bit15: 单位(0:℃ 。 1:℉) Bit14:正负(0:温度为正值。1:温度为负值)Bit13-Bit0:温度值。 | |||||
@property (nonatomic, assign, readonly) NSInteger ambientMaxTemperature; | |||||
@property (nonatomic, assign, readonly) ELDeviceTemperatureUnit ambientMaxTemperatureUnit; | |||||
@property (nonatomic, assign) UInt32 timerStart;//计时开始时间戳 | |||||
@property (nonatomic, assign) UInt32 timerEnd;//计时结束时间戳 | |||||
@property (nonatomic, assign) ELDeviceTemperatureUnit currentUnit; //当前温度单位 | |||||
- (instancetype)initWithData:(NSData *)data; | |||||
+ (ELMeatProbeBleModel *)modelWithData:(NSData *)data; | |||||
- (NSData *)dataValue; | |||||
@end | |||||
NS_ASSUME_NONNULL_END |
// | |||||
// ELMeatProbeBoxBleModel.h | |||||
// AILinkBleSDK | |||||
// | |||||
// Created by LarryZhang on 2023/2/16. | |||||
// | |||||
#import <Foundation/Foundation.h> | |||||
NS_ASSUME_NONNULL_BEGIN | |||||
@interface ELMeatProbeBoxBleModel : NSObject | |||||
@end | |||||
NS_ASSUME_NONNULL_END |
// | |||||
// ELMeatProbeBoxBleParser.h | |||||
// AILinkBleSDK | |||||
// | |||||
// Created by LarryZhang on 2023/2/16. | |||||
// | |||||
#import <Foundation/Foundation.h> | |||||
NS_ASSUME_NONNULL_BEGIN | |||||
@interface ELMeatProbeBoxBleParser : NSObject | |||||
@end | |||||
NS_ASSUME_NONNULL_END |
#ifndef ELSDKHeader_h | #ifndef ELSDKHeader_h | ||||
#define ELSDKHeader_h | #define ELSDKHeader_h | ||||
#import "ELExSupportDeviceType.h" | |||||
//Bluetooth command type(蓝牙指令类型) | //Bluetooth command type(蓝牙指令类型) | ||||
typedef NS_ENUM(NSUInteger, ELInetBleDataType) { | typedef NS_ENUM(NSUInteger, ELInetBleDataType) { | ||||
ELSetBluetoothResponseTypeNoSupport =2 , //not support(不支持) | ELSetBluetoothResponseTypeNoSupport =2 , //not support(不支持) | ||||
}; | }; | ||||
//Device types supported by Elink: Please communicate with the hardware to set(Elink支持的设备类型:请与硬件沟通后设置) | |||||
typedef NS_ENUM(NSUInteger, ELSupportDeviceType) { | |||||
ELSupportDeviceTypeUnkonwn = 0x0000 , //unknown(未知) | |||||
ELSupportDeviceTypeBlood = 0x0001 , //sphygmomanometer(血压计) | |||||
ELSupportDeviceTypeForehead = 0x0002 , //Temperature gun(额温枪) | |||||
ELSupportDeviceTypeThermometer = 0x0003 , //thermometer(体温计) | |||||
ELSupportDeviceTypeBabyScale = 0x0004 , //Baby scale(婴儿秤) | |||||
ELSupportDeviceTypeHeightGauge = 0x0005 , //Height meter(身高仪) | |||||
ELSupportDeviceTypeSmartLock = 0x000B , //Smart door lock(智能门锁) | |||||
ELSupportDeviceTypeRemoteControl = 0x000C , //Internal projection vision tester(内投影视力检查仪) | |||||
ELSupportDeviceTypeWheelMonitor = 0x000D , //TPMS(胎压转接板) | |||||
ELSupportDeviceTypeBodyFatScale = 0x000E , //Body fat scale(体脂秤) | |||||
ELSupportDeviceTypeSmatLockRemote = 0x0010 , //Smart door lock remote control(智能门锁遥控器) | |||||
ELSupportDeviceTypeBLE_WIFIScale = 0x0011 , //Ble and wifi Scale(蓝牙Wifi体脂秤) | |||||
ELSupportDeviceTypeBLE_WIFIToothbrush = 0x0012, //Bluetooth and wifi toothbrush(蓝牙wifi牙刷) | |||||
ELSupportDeviceTypeBLE_EightScale = 0x0013 , //Eight electrode scale(八电极蓝牙秤) | |||||
ELSupportDeviceTypeAnemometer = 0x0014 , //anemometer(风速计),0x0015 | |||||
ELSupportDeviceTypeClampMeter = 0x0015 , //clamp meter(钳表) | |||||
ELSupportDeviceTypeWatch = 0x001D , //华盛达手表 | |||||
ELSupportDeviceTypeBloodSugar = 0x001C , //blood sugar(血糖仪) | |||||
ELSupportDeviceTypeInfThermt = 0x0020 , //Infrared Thermometer(红外测温仪) | |||||
ELSupportDeviceTypeOximeter = 0x0021 , //Oximeter (血氧仪) | |||||
ELSupportDeviceTypeFaceMask = 0x0022 , //face mask(智能口罩) | |||||
ELSupportDeviceTypeCoffeeScale = 0x0024 , //咖啡秤 | |||||
ELSupportDeviceTypeHeightBodyFatScale = 0x0026 , //身高体脂秤 | |||||
ELSupportDeviceTypeHeightScale = 0x0028 , //身高体重仪,CID:40 (0x0028) | |||||
ELSupportDeviceTypeFoodThermometer = 0x002B, //Food Thermometer(食品温度计) | |||||
ELSupportDeviceTypeBLEToothbrush = 0x002D, //Bluetooth toothbrush(蓝牙牙刷) | |||||
ELSupportDeviceTypeHygrothermograph = 0x002E , //温湿度计 | |||||
ELSupportDeviceTypeSkip = 0x002F , //跳绳 | |||||
ELSupportDeviceTypeBLE_BfrEightScale = 0x0032, //MCU会计算体脂信息的八电极蓝牙秤 | |||||
ELSupportDeviceTypeElectricScooter= 0x0033 , //滑板车 | |||||
ELSupportDeviceTypeNutritionScale = 0x0034 , //营养秤(蓝牙连接) | |||||
ELSupportDeviceType_WiFi_Hygrothermograph = 0x0036 , //wifi温湿度计 | |||||
ELSupportDeviceTypeAiFreshNutritionScale = 0x0037 , //好营养营养秤(蓝牙连接) | |||||
ELSupportDeviceTypeBLE_WIFIBlood = 0x0038 , //Bluetooth and wifi Blood(蓝牙wifi智能血压计) | |||||
ELSupportDeviceTypeFasciaGun = 0x003B , //筋膜枪 | |||||
ELSupportDeviceType_4G_Hygrothermograph = 0x003A , //4g温湿度计 | |||||
ELSupportDeviceTypeAutomaticThermometer = 0x003D , //61 //测温仪(蓝牙) | |||||
ELSupportDeviceType_BraceletWatch = 0x003E, //Leap手环 | |||||
ELSupportDeviceTypeMeatProbe = 0x003F, //食物探针 | |||||
ELSupportDeviceTypeVictorClampMeter = 0x0040, //Victor钳表 | |||||
ELSupportDeviceTypeVictorNoiseMeter = 0x0043, //胜利噪音计 | |||||
ELSupportDeviceTypeVictorAnemometer = 0x0044, //胜利风速计 | |||||
ELSupportDeviceTypeVictorLuxMeter = 0x0045, //胜利照度计 | |||||
ELSupportDeviceTypeAirDetector = 0x0048, //环境气体检测仪 | |||||
ELSupportDeviceTypeTPMS智能胎压 = 0x0049, //智能胎压 | |||||
ELSupportDeviceType电动自行车 = 0x004A, //电动自行车 | |||||
ELSupportDeviceType电动自行车4G = 0x004B, //电动自行车 4G | |||||
ELSupportDeviceType电动车 = 0x004C, //电动车 | |||||
ELSupportDeviceType电动车4G = 0x004D, //电动车 4G | |||||
ELSupportDeviceType电动平衡车 = 0x004E, //电动平衡车 | |||||
ELSupportDeviceType电动平衡车4G = 0x004F, //电动平衡车 4G | |||||
ELSupportDeviceTypeBLEWiFiNoiseMeter = 0x0050, //噪音计(WiFi+BLE) | |||||
ELSupportDeviceType智能仪表 = 0x0051, //CM01-C02智能仪表 | |||||
ELSupportDeviceType双频八电极体脂秤 = 0x0052, //双频八电极体脂秤 | |||||
ELSupportDeviceTypeAirDetectorLite = 0x0053, //环境气体检测仪 不支持MQTT | |||||
ELSupportDeviceType华普照度计 = 0x0054, //华普照度计 | |||||
ELSupportDeviceTypeMeatProbeBox = 0x0055, //食物探针充电盒 | |||||
ELSupportDeviceTypeBodyScale = 0x0056, //Body scale(no body fat) 体重秤(无体脂) | |||||
// ELSupportDeviceType57 = 0x0057, | |||||
// ELSupportDeviceType58 = 0x0058, | |||||
// ELSupportDeviceType59 = 0x0059, | |||||
ELSupportDeviceTypeBroadcastScale = (0xffff +0x01) , //655536 Broadcast body fat scale(AILink广播体脂秤) | |||||
ELSupportDeviceTypeBroadcastHeightGauge = (0xffff + 0x03) , //65538 广播身高仪 | |||||
ELSupportDeviceTypeBroadcastScale_Lingyang = (0xffff +0x16) , //65557 凌阳广播体脂秤 | |||||
ELSupportDeviceTypeBroadcastNutritionFoodScale = (0xffff + 0x04) , //65539 广播营养秤 | |||||
ELSupportDeviceTypeBroadcastHygrothermograph = (0xffff + 0x06) , //65541 广播温湿度计 | |||||
}; | |||||
//Communication mode(通信模式) | //Communication mode(通信模式) | ||||
typedef NS_ENUM(NSInteger, ELCommunicationModeType) { | typedef NS_ENUM(NSInteger, ELCommunicationModeType) { | ||||
ELCommunicationModeTypeSerialPort = 0, //Serial port mode(串口模式) | ELCommunicationModeTypeSerialPort = 0, //Serial port mode(串口模式) |
*/ | */ | ||||
- (void)toothbrushManagerCallBackSetIPAddressResult:(NSInteger)result; | - (void)toothbrushManagerCallBackSetIPAddressResult:(NSInteger)result; | ||||
//MCU response Prevent Splashing mode 防飞溅 | |||||
- (void)toothbrushtReceivePreventSplashing:(Byte)support on:(Byte)on; | |||||
@end | @end | ||||
/** app查询BLE工作状态 0xFC */ | /** app查询BLE工作状态 0xFC */ | ||||
- (void)getDevBleWorkState:(enum ELSupportDeviceType)cid; | - (void)getDevBleWorkState:(enum ELSupportDeviceType)cid; | ||||
//APP request Prevent Splashing mode 防飞溅 (cid 0x002D BLE only) | |||||
- (void)getPreventSplashingMode; | |||||
- (void)setPreventSplashingMode:(BOOL)on; | |||||
@end | @end | ||||
NS_ASSUME_NONNULL_END | NS_ASSUME_NONNULL_END |
ToothbrushDataTypeSwitchWork_A70B = 0x0B,//Switch toothbrush(开关牙刷) | ToothbrushDataTypeSwitchWork_A70B = 0x0B,//Switch toothbrush(开关牙刷) | ||||
ToothbrushDataTypeSetTwoGearDefault_A70C = 0x0C,//Set second gear default(设置二档默认) | ToothbrushDataTypeSetTwoGearDefault_A70C = 0x0C,//Set second gear default(设置二档默认) | ||||
ToothbrushDataTypeGetTwoGearDefault_A70D = 0x0D,//Get second gear default(获取二档默认) | ToothbrushDataTypeGetTwoGearDefault_A70D = 0x0D,//Get second gear default(获取二档默认) | ||||
ToothbrushDataTypeAppPreventSplashing_A710 = 0x10,//APP request Prevent Splashing mode 防飞溅 | |||||
ToothbrushDataTypeMcuPreventSplashing_A711 = 0x11,//MCU response Prevent Splashing mode 防飞溅 | |||||
ToothbrushDataTypeGetTwoGearDefault_A7FC = 0xFC,//获取当前工作状态(针对获取已工作时长) | ToothbrushDataTypeGetTwoGearDefault_A7FC = 0xFC,//获取当前工作状态(针对获取已工作时长) | ||||
ToothbrushDataTypeToothbrushData_A7FD = 0xFD,//Brushing data(刷牙数据) | ToothbrushDataTypeToothbrushData_A7FD = 0xFD,//Brushing data(刷牙数据) | ||||
ToothbrushDataTypeReportResult_A7FE = 0xFE,//Report received data result(上报接收数据结果) | ToothbrushDataTypeReportResult_A7FE = 0xFE,//Report received data result(上报接收数据结果) |
- (UInt16)valueU16LEAtLoc:(NSUInteger)loc; | - (UInt16)valueU16LEAtLoc:(NSUInteger)loc; | ||||
- (UInt16)u16LE:(NSUInteger)loc; //简化版 | - (UInt16)u16LE:(NSUInteger)loc; //简化版 | ||||
//转换 HexString | |||||
- (NSString *)elHexString; | |||||
+ (NSData *)elDataWithHexString:(NSString *)hexStr; | |||||
@end | @end | ||||
//MARK:上报接收数据结果 | //MARK:上报接收数据结果 | ||||
[self addLog:@"上报接收数据结果"]; | [self addLog:@"上报接收数据结果"]; | ||||
[[ELToothbrushBleManager shareManager] reportReceiveResultOfToothbrushData:YES]; | [[ELToothbrushBleManager shareManager] reportReceiveResultOfToothbrushData:YES]; | ||||
} else if (tag == 17) { | |||||
[[ELToothbrushBleManager shareManager] getPreventSplashingMode]; | |||||
[self addLog:@"获取防飞溅模式"]; | |||||
} else if (tag == 18) { | |||||
[[ELToothbrushBleManager shareManager] setPreventSplashingMode:YES]; | |||||
[self addLog:@"设置防飞溅模式 on"]; | |||||
} else if (tag == 19) { | |||||
[[ELToothbrushBleManager shareManager] setPreventSplashingMode:NO]; | |||||
[self addLog:@"设置防飞溅模式 off"]; | |||||
} | } | ||||
else{ | else{ | ||||
make.height.mas_equalTo(30); | make.height.mas_equalTo(30); | ||||
}]; | }]; | ||||
UIButton *button17 = [self getButtonWithTitle:@"获取防飞溅" withTag:17]; | |||||
[self.view addSubview:button17]; | |||||
[button17 mas_makeConstraints:^(MASConstraintMaker *make) { | |||||
make.left.equalTo(button13); | |||||
make.top.equalTo(button13.mas_bottom).mas_offset(10); | |||||
make.width.mas_equalTo(70); | |||||
make.height.mas_equalTo(30); | |||||
}]; | |||||
UIButton *button18 = [self getButtonWithTitle:@"设置防飞溅On" withTag:18]; | |||||
[self.view addSubview:button18]; | |||||
[button18 mas_makeConstraints:^(MASConstraintMaker *make) { | |||||
make.left.equalTo(button17.mas_right).mas_offset(5); | |||||
make.top.equalTo(button17); | |||||
make.width.mas_equalTo(70); | |||||
make.height.mas_equalTo(30); | |||||
}]; | |||||
UIButton *button19 = [self getButtonWithTitle:@"设置防飞溅Off" withTag:19]; | |||||
[self.view addSubview:button19]; | |||||
[button19 mas_makeConstraints:^(MASConstraintMaker *make) { | |||||
make.left.equalTo(button18.mas_right).mas_offset(5); | |||||
make.top.equalTo(button17); | |||||
make.width.mas_equalTo(70); | |||||
make.height.mas_equalTo(30); | |||||
}]; | |||||
// | // | ||||
self.textView = [[UITextView alloc] init]; | self.textView = [[UITextView alloc] init]; | ||||
self.textView.backgroundColor = [UIColor blackColor]; | self.textView.backgroundColor = [UIColor blackColor]; | ||||
[self addLog:[NSString stringWithFormat:@"%@\n%@",onegearStr,twogearStr]]; | [self addLog:[NSString stringWithFormat:@"%@\n%@",onegearStr,twogearStr]]; | ||||
} | } | ||||
//MCU response Prevent Splashing mode 防飞溅 | |||||
- (void)toothbrushtReceivePreventSplashing:(Byte)support on:(Byte)on { | |||||
if (support == 0) { | |||||
[self addLog:@"not support Prevent Splashing"]; | |||||
return; | |||||
} | |||||
[self addLog:[NSString stringWithFormat:@"Prevent Splashing: %@", on == 0 ? @"Off" : @"On"]]; | |||||
} | |||||
-(void)toothbrushReceiveDevices:(NSArray<ELPeripheralModel *> *)devices{ | -(void)toothbrushReceiveDevices:(NSArray<ELPeripheralModel *> *)devices{ | ||||
ELPeripheralModel * connectModel; | ELPeripheralModel * connectModel; | ||||
for (ELPeripheralModel *deviceModel in devices) { | for (ELPeripheralModel *deviceModel in devices) { |
cell = [[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId]; | cell = [[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId]; | ||||
} | } | ||||
ELPeripheralModel *p = self.devices[indexPath.row]; | ELPeripheralModel *p = self.devices[indexPath.row]; | ||||
cell.textLabel.text = [NSString stringWithFormat:@"Name:%@---Mac:%@\nCID:%ld---VID:%ld---PID:%ld",p.deviceName,p.macAddress,p.deviceType,p.vendorID,p.productID]; | |||||
cell.textLabel.text = [NSString stringWithFormat:@"Name:%@ Mac:%@ rssi:%ld \nCID:0x%04lX(%ld) VID:0x%04lX(%ld) PID:0x%04lX(%ld)", p.deviceName, p.macAddress, p.rssi, (unsigned long)p.cid, p.cid, (long)p.vid, p.vid, (long)p.pid, p.pid]; | |||||
cell.textLabel.numberOfLines = 2; | cell.textLabel.numberOfLines = 2; | ||||
cell.textLabel.textColor = [UIColor blackColor]; | cell.textLabel.textColor = [UIColor blackColor]; | ||||
<array> | <array> | ||||
<string>UIInterfaceOrientationPortrait</string> | <string>UIInterfaceOrientationPortrait</string> | ||||
</array> | </array> | ||||
<key>UISupportedInterfaceOrientations~ipad</key> | |||||
<array> | |||||
<string>UIInterfaceOrientationPortrait</string> | |||||
<string>UIInterfaceOrientationPortraitUpsideDown</string> | |||||
<string>UIInterfaceOrientationLandscapeLeft</string> | |||||
<string>UIInterfaceOrientationLandscapeRight</string> | |||||
</array> | |||||
<key>UIUserInterfaceStyle</key> | <key>UIUserInterfaceStyle</key> | ||||
<string>Light</string> | <string>Light</string> | ||||
</dict> | </dict> |
| 1.5.6| 20221221 | larry | 增加:Demo增加八电极秤新算法 增加四电极体脂秤身体指标算法SDK| | | 1.5.6| 20221221 | larry | 增加:Demo增加八电极秤新算法 增加四电极体脂秤身体指标算法SDK| | ||||
| 1.5.9| 20230206 | larry | 增加 身高体脂秤,优化 Demo UI | | | 1.5.9| 20230206 | larry | 增加 身高体脂秤,优化 Demo UI | | ||||
| 1.5.11 | 20230327 | larry | 增加 蓝牙体重秤 | | | 1.5.11 | 20230327 | larry | 增加 蓝牙体重秤 | | ||||
| 1.5.15 | 20230427 | larry | 修改 增加 蓝牙牙刷防飞溅 | | |||||