iOS AILinkBleSDK - 蓝牙SDK
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

BodyFatScaleConnectViewController.m 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. //
  2. // BodyFatScaleConnectViewController.m
  3. // AILinkBleSDKSourceCode
  4. //
  5. // Created by iot_user on 2020/4/8.
  6. // Copyright © 2020 IOT. All rights reserved.
  7. //
  8. #import "BodyFatScaleConnectViewController.h"
  9. #import "Masonry.h"
  10. #import <AILinkBleSDK/ELBodyFatScaleBleManager.h>
  11. #import <AILinkBleSDK/ELBodyFatScaleBleUserModel.h>
  12. #import <AILinkBleSDK/ELBodyFatScaleBleWeightModel.h>
  13. #import <AILinkBleSDK/ELBluetoothManager+Settings.h>
  14. #import <AILinkBleSDK/OEMAlgorithmSDK.h>
  15. #import <AILinkBleSDK/ELUnitConvertTool.h>
  16. @interface BodyFatScaleConnectViewController () <ELBluetoothManagerDelegate, ELBodyFatScaleBleDelegate>
  17. @property(nonatomic, strong) UITextView *textView;
  18. @property(nonatomic, copy) NSArray<NSNumber *> *units;
  19. @end
  20. @implementation BodyFatScaleConnectViewController
  21. - (void)viewDidLoad {
  22. [super viewDidLoad];
  23. self.view.backgroundColor = [UIColor whiteColor];
  24. [ELBodyFatScaleBleManager shareManager].bodyFatScaleDelegate = self;
  25. [ELBodyFatScaleBleManager shareManager].delegate = self;
  26. [[ELBodyFatScaleBleManager shareManager] connectPeripheral:self.p];
  27. [self setupUIView];
  28. }
  29. - (void)viewWillDisappear:(BOOL)animated {
  30. [super viewWillDisappear:animated];
  31. [[ELBodyFatScaleBleManager shareManager] disconnectPeripheral];
  32. }
  33. - (void)addLog:(NSString *)log {
  34. self.textView.text = [NSString stringWithFormat:@"%@\n%@", log, self.textView.text];
  35. }
  36. - (void)buttonAction:(UIButton *)sender {
  37. if ([ELBodyFatScaleBleManager shareManager].state != ELBluetoothStateDidValidationPass) {
  38. [self addLog:@"Disconnected"];
  39. return;
  40. }
  41. [self addLog:sender.titleLabel.text];
  42. NSInteger tag = sender.tag;
  43. if (tag == 1) {
  44. //getBluetoothInfoWithELInetGetCmdType是获取设备信息的方法
  45. [[ELBodyFatScaleBleManager shareManager] getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdTypeGetBMVersion)];
  46. } else if (tag == 2) {
  47. [[ELBodyFatScaleBleManager shareManager] getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdTypeGetC_V_P_ID)];
  48. } else if (tag == 3) {
  49. [[ELBodyFatScaleBleManager shareManager] getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdTypeGetName)];
  50. } else if (tag == 4) {
  51. [[ELBodyFatScaleBleManager shareManager] setBluetoothName:@"AILink"];
  52. } else if (tag == 5) {
  53. if (self.units.count == 0) {
  54. [self addLog:@"No units obtained"];
  55. return;
  56. }
  57. // [[ELBodyFatScaleBleManager shareManager] changeBodyFatScaleUnit:(ELDeviceWeightUnit_KG)];
  58. UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Change Unit" message:@"" preferredStyle:(UIAlertControllerStyleAlert)];
  59. for (int i = 0; i < self.units.count; i++) {
  60. UIAlertAction *action = [UIAlertAction actionWithTitle:AiLinkBleWeightUnitDic[self.units[i]] style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *_Nonnull action) {
  61. [[ELBodyFatScaleBleManager shareManager] changeBodyFatScaleUnit:self.units[i].integerValue];
  62. }];
  63. [alert addAction:action];
  64. }
  65. [self presentViewController:alert animated:YES completion:nil];
  66. } else if (tag == 6) {
  67. } else if (tag == 7) {
  68. } else if (tag == 8) {
  69. } else if (tag == 9) {
  70. }
  71. }
  72. - (void)setupUIView {
  73. UIButton *button1 = [UIButton buttonWithType:(UIButtonTypeCustom)];
  74. [button1 setTitle:@"Get BM Version" forState:(UIControlStateNormal)];
  75. button1.tag = 1;
  76. button1.titleLabel.adjustsFontSizeToFitWidth = YES;
  77. button1.titleLabel.numberOfLines = 2;
  78. button1.backgroundColor = [UIColor blackColor];
  79. [button1 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)];
  80. [self.view addSubview:button1];
  81. [button1 mas_makeConstraints:^(MASConstraintMaker *make) {
  82. make.left.mas_equalTo(10);
  83. make.top.mas_equalTo(80);
  84. make.width.mas_equalTo(100);
  85. make.height.mas_equalTo(40);
  86. }];
  87. UIButton *button2 = [UIButton buttonWithType:(UIButtonTypeCustom)];
  88. [button2 setTitle:@"Get C V P ID" forState:(UIControlStateNormal)];
  89. button2.tag = 2;
  90. button2.titleLabel.adjustsFontSizeToFitWidth = YES;
  91. button2.titleLabel.numberOfLines = 2;
  92. button2.backgroundColor = [UIColor blackColor];
  93. [button2 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)];
  94. [self.view addSubview:button2];
  95. [button2 mas_makeConstraints:^(MASConstraintMaker *make) {
  96. make.left.equalTo(button1.mas_right).mas_offset(10);
  97. make.top.mas_equalTo(80);
  98. make.width.mas_equalTo(100);
  99. make.height.mas_equalTo(40);
  100. }];
  101. UIButton *button3 = [UIButton buttonWithType:(UIButtonTypeCustom)];
  102. [button3 setTitle:@"Get Name" forState:(UIControlStateNormal)];
  103. button3.tag = 3;
  104. button3.titleLabel.adjustsFontSizeToFitWidth = YES;
  105. button3.titleLabel.numberOfLines = 2;
  106. button3.backgroundColor = [UIColor blackColor];
  107. [button3 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)];
  108. [self.view addSubview:button3];
  109. [button3 mas_makeConstraints:^(MASConstraintMaker *make) {
  110. make.left.equalTo(button2.mas_right).mas_offset(10);
  111. make.top.mas_equalTo(80);
  112. make.width.mas_equalTo(100);
  113. make.height.mas_equalTo(40);
  114. }];
  115. //
  116. UIButton *button4 = [UIButton buttonWithType:(UIButtonTypeCustom)];
  117. [button4 setTitle:@"Set Name" forState:(UIControlStateNormal)];
  118. button4.tag = 4;
  119. button4.titleLabel.adjustsFontSizeToFitWidth = YES;
  120. button4.titleLabel.numberOfLines = 2;
  121. button4.backgroundColor = [UIColor blackColor];
  122. [button4 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)];
  123. [self.view addSubview:button4];
  124. [button4 mas_makeConstraints:^(MASConstraintMaker *make) {
  125. make.left.mas_equalTo(10);
  126. make.top.equalTo(button1.mas_bottom).mas_offset(10);
  127. make.width.mas_equalTo(100);
  128. make.height.mas_equalTo(40);
  129. }];
  130. //
  131. UIButton *button5 = [UIButton buttonWithType:(UIButtonTypeCustom)];
  132. [button5 setTitle:@"Change unit" forState:(UIControlStateNormal)];
  133. button5.tag = 5;
  134. button5.titleLabel.adjustsFontSizeToFitWidth = YES;
  135. button5.titleLabel.numberOfLines = 2;
  136. button5.backgroundColor = [UIColor blackColor];
  137. [button5 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)];
  138. [self.view addSubview:button5];
  139. [button5 mas_makeConstraints:^(MASConstraintMaker *make) {
  140. make.left.equalTo(button4.mas_right).mas_offset(10);
  141. make.top.equalTo(button1.mas_bottom).mas_offset(10);
  142. make.width.mas_equalTo(100);
  143. make.height.mas_equalTo(40);
  144. }];
  145. //
  146. self.textView = [[UITextView alloc] init];
  147. self.textView.backgroundColor = [UIColor blackColor];
  148. self.textView.text = @"Log";
  149. self.textView.textColor = [UIColor redColor];
  150. [self.view addSubview:self.textView];
  151. [self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
  152. make.left.mas_equalTo(10);
  153. make.right.bottom.mas_equalTo(-10);
  154. make.height.mas_equalTo(200);
  155. }];
  156. }
  157. - (void)bluetoothManagerReceiceResponseType:(ELInetSetCmdType)type result:(ELSetBluetoothResponseType)result {
  158. if (type == ELInetSetCmdTypeSetName) {
  159. if (result == ELSetBluetoothResponseTypeSuccess) {
  160. [self addLog:@"Set name Success "];
  161. } else if (result == ELSetBluetoothResponseTypeFailure) {
  162. [self addLog:@"Set name failure "];
  163. } else if (result == ELSetBluetoothResponseTypeNoSupport) {
  164. [self addLog:@"Set name unsupport "];
  165. }
  166. }
  167. }
  168. - (void)bluetoothManagerReceiceName:(NSString *)name {
  169. [self addLog:name];
  170. }
  171. - (void)bluetoothManagerReceiveDID:(struct ELDIDStruct)did {
  172. [self addLog:[NSString stringWithFormat:@"CID = %d,VID = %d,PID = %d", did.deviceType, did.vendorID, did.productID]];
  173. }
  174. - (void)bluetoothManagerReceiveBMVersion:(NSString *)bmVersion {
  175. [self addLog:bmVersion];
  176. }
  177. - (void)bluetoothManagerBackDeviceSupportUnitWithWeight:(NSArray<NSNumber *> *)weightArray Height:(NSArray<NSNumber *> *)heightArray Temperature:(NSArray<NSNumber *> *)temperatureArray BloodPressure:(NSArray<NSNumber *> *)bloodPressureArray Pressure:(NSArray<NSNumber *> *)pressureArray {
  178. //这里只要体重数据
  179. self.units = weightArray;
  180. }
  181. - (void)bluetoothManagerReceiveMCUConnectedState:(struct ELMCUStateStruct)stateStrct {
  182. }
  183. /**
  184. Callback to set unit result(回调设置单位结果)
  185. @param result 结果
  186. */
  187. - (void)bodyFatScaleManagerCallBackSetUnitResult:(ELSetBluetoothResponseType)result {
  188. switch (result) {
  189. case ELSetBluetoothResponseTypeSuccess: {
  190. [self addLog:@"Change Unit Success"];
  191. }
  192. break;
  193. case ELSetBluetoothResponseTypeFailure: {
  194. [self addLog:@"Change Unit Failure"];
  195. }
  196. break;
  197. case ELSetBluetoothResponseTypeNoSupport: {
  198. [self addLog:@"Unsupport Change Unit"];
  199. }
  200. break;
  201. default:
  202. break;
  203. }
  204. }
  205. /**
  206. MCU requests user information( MCU 请求用户信息)
  207. @param status 请求状态
  208. */
  209. - (void)bodyFatScaleManagerMCURequestAppUserInfoType:(BodyFatScaleMCURequestUserInfoStatus)status {
  210. if (status == BodyFatScaleMCURequestUserInfoStatus_Get) {
  211. //下发当前用户给秤
  212. [[ELBodyFatScaleBleManager shareManager] sendCurrentUserToBle:[self getOneUser]];
  213. } else if (status == BodyFatScaleMCURequestUserInfoStatus_Success) {
  214. [self addLog:@"MCU requests user information success"];
  215. } else if (BodyFatScaleMCURequestUserInfoStatus_Fail) {
  216. [self addLog:@"MCU requests user information failure"];
  217. }
  218. }
  219. /**
  220. Return weight and body fat model(返回重量及体脂model)
  221. */
  222. - (void)bodyFatScaleManagerCallBackWeight:(ELBodyFatScaleBleWeightModel *)weightModel state:(BodyFatScaleMeasureStatus)status {
  223. switch (status) {
  224. case BodyFatScaleMeasureStatus_Unstable: {
  225. [self addLog:[NSString stringWithFormat:@"Unstable data weight = %ld unit = %@ point = %ld adc = %ld", weightModel.weight, AiLinkBleWeightUnitDic[@(weightModel.weightUnit)], weightModel.weightPoint, weightModel.adc]];
  226. }
  227. break;
  228. case BodyFatScaleMeasureStatus_Stable: {
  229. [self addLog:[NSString stringWithFormat:@"Stable data weight = %ld unit = %@ point = %ld adc = %ld", weightModel.weight, AiLinkBleWeightUnitDic[@(weightModel.weightUnit)], weightModel.weightPoint, weightModel.adc]];
  230. }
  231. break;
  232. case BodyFatScaleMeasureStatus_Failed: {
  233. [self addLog:@"Test failure"];
  234. }
  235. break;
  236. case BodyFatScaleMeasureStatus_Complete: {
  237. [self addLog:[NSString stringWithFormat:@"Tested weight = %ld unit = %@ point = %ld adc = %ld", weightModel.weight, AiLinkBleWeightUnitDic[@(weightModel.weightUnit)], weightModel.weightPoint, weightModel.adc]];
  238. NSLog(@"weightModel:%@", weightModel);
  239. //App算法
  240. [self algorithmWithBleModel:weightModel user:self.getOneUser];
  241. //更新用户信息给秤
  242. [[ELBodyFatScaleBleManager shareManager] sendCurrentUserToBle:[self getOneUser]];
  243. //下发用户列表
  244. [[ELBodyFatScaleBleManager shareManager] sendOfflineUserListToBle:[self get8Users]];
  245. }
  246. break;
  247. default:
  248. break;
  249. }
  250. }
  251. - (void)algorithmWithBleModel:(ELBodyFatScaleBleWeightModel *)weightModel user:(ELBodyFatScaleBleUserModel *)user {
  252. NSString *weightKg = [ELUnitConvertTool getWeightShowStrWithTargetUnit:ELDeviceWeightUnit_KG bleWeightInt:weightModel.weight bleWeightUnit:weightModel.weightUnit bleWeightPoint:weightModel.weightPoint];
  253. OEMAlgorithmModel *algorithmModel = [OEMAlgorithmSDK getBodyfatWithWeight:weightKg.floatValue adc:(int) weightModel.adc sex:user.sex age:(int) user.age height:(int) user.height];
  254. NSLog(@"algorithmModel:%@", algorithmModel);
  255. }
  256. /**
  257. Return temperature (unit: ° C)(返回温度(单位:°C))
  258. @param temp 温度(单位:°C)
  259. */
  260. - (void)bodyFatScaleManagerCallBackTemp:(NSString *)temp {
  261. [self addLog:[NSString stringWithFormat:@"temperature is %@", temp]];
  262. }
  263. /**
  264. Back to impedance measurement(返回阻抗测量)
  265. @param status 阻抗测量状态
  266. @param adc 阻抗
  267. */
  268. - (void)bodyFatScaleManagerCallBackAdcMeasureStatus:(BodyFatScaleAdcMeasureStatus)status adcValue:(NSInteger)adc {
  269. switch (status) {
  270. case BodyFatScaleAdcMeasureStatus_Testing: {
  271. [self addLog:@"adc testing"];
  272. }
  273. break;
  274. case BodyFatScaleAdcMeasureStatus_Success: {
  275. [self addLog:[NSString stringWithFormat:@"adc is %ld", adc]];
  276. }
  277. break;
  278. case BodyFatScaleAdcMeasureStatus_Fail: {
  279. [self addLog:@"adc test failure"];
  280. }
  281. break;
  282. case BodyFatScaleAdcMeasureStatus_SuccessCustom: {
  283. [self addLog:[NSString stringWithFormat:@"adc is %ld and user app algum", adc]];
  284. }
  285. break;
  286. default:
  287. break;
  288. }
  289. }
  290. /**
  291. Callback heart rate measurement(回调心率测量)
  292. @param status 心率测量状态
  293. @param heartRate 心率
  294. */
  295. - (void)bodyFatScaleManagerCallBackHeartRateMeasureStatus:(BodyFatScaleHeartRateMeasureStatus)status heartRateValue:(NSInteger)heartRate {
  296. switch (status) {
  297. case BodyFatScaleHeartRateMeasureStatus_Testing: {
  298. [self addLog:@"Heart Rate Testing"];
  299. }
  300. break;
  301. case BodyFatScaleHeartRateMeasureStatus_Success: {
  302. [self addLog:[NSString stringWithFormat:@"Heart Rate is %ld", heartRate]];
  303. }
  304. break;
  305. case BodyFatScaleHeartRateMeasureStatus_Fail: {
  306. [self addLog:@"Heart Rate Test failure"];
  307. }
  308. break;
  309. default:
  310. break;
  311. }
  312. }
  313. /**
  314. Return error code(返回错误码)
  315. @param code 错误码
  316. 1:超重
  317. */
  318. - (void)bodyFatScaleManagerCallBackErrorCode:(NSInteger)code {
  319. [self addLog:[NSString stringWithFormat:@"error code = %ld", code]];
  320. }
  321. //MARK:回调A6指令数据
  322. /**
  323. Send success or failure callback for offline user list(发送离线用户列表的成功或失败回调)
  324. @param status 状态
  325. */
  326. - (void)bodyFatScaleManagerCallBackUpdateRecordStatus:(BodyFatScaleUpdateRecordStatus)status {
  327. switch (status) {
  328. case BodyFatScaleUpdateRecordStatus_AllSuccess: {
  329. [self addLog:@"Update All Users Success"];
  330. }
  331. break;
  332. case BodyFatScaleUpdateRecordStatus_OneSuccess: {
  333. [self addLog:@"Update A User Success"];
  334. }
  335. break;
  336. case BodyFatScaleUpdateRecordStatus_OneFail: {
  337. [self addLog:@"Update A User Failure"];
  338. }
  339. break;
  340. case BodyFatScaleUpdateRecordStatus_AllFail: {
  341. [self addLog:@"Update All Users Failure"];
  342. }
  343. break;
  344. default:
  345. break;
  346. }
  347. }
  348. /**
  349. Request callback for offline history(请求离线历史记录的回调)
  350. @param status 状态
  351. */
  352. - (void)bodyFatScaleManagerCallBackSendHistoryDataStatus:(BodyFatScaleSendHistoryDataStatus)status {
  353. if (status == BodyFatScaleSendHistoryDataStatus_No) {
  354. [self addLog:@"No offline datas"];
  355. } else if (status == BodyFatScaleSendHistoryDataStatus_Begin) {
  356. [self addLog:@"Begin receive offline datas"];
  357. } else if (status == BodyFatScaleSendHistoryDataStatus_End) {
  358. [self addLog:@"End receive offline datas"];
  359. }
  360. }
  361. /**
  362. APP algorithm-offline history data(APP 算法-离线历史记录数据)
  363. @param user 用户信息
  364. */
  365. - (void)bodyFatScaleManagerCallBackBleUserHistoryDataCustomADCModel:(ELBodyFatScaleBleUserModel *)user bodyDataModel:(ELBodyFatScaleBleWeightModel *)bodyModel {
  366. //这里的身体指标等数据由app自定义算法计算得到,请区分bodyModel.algNum来调用算法
  367. [self addLog:[NSString stringWithFormat:@"App algorithm-offline history data:userId = %ld weight = %ld unit =%@ point = %ld", user.usrID, bodyModel.weight, AiLinkBleWeightUnitDic[@(bodyModel.weightUnit)], bodyModel.weightPoint]];
  368. }
  369. /**
  370. MCU algorithm-offline history data(MCU 算法-离线历史记录数据)
  371. @param user 用户信息
  372. @param bodyModel 体脂数据
  373. */
  374. - (void)bodyFatScaleManagerCallBackBleUserHistoryDataModel:(ELBodyFatScaleBleUserModel *)user bodyDataModel:(ELBodyFatScaleBleWeightModel *)bodyModel {
  375. //这里的身体指标数据由秤计算得到
  376. [self addLog:[NSString stringWithFormat:@"MCU algorithm-offline history data:userId = %ld weight = %ld unit =%@ point = %ld", user.usrID, bodyModel.weight, AiLinkBleWeightUnitDic[@(bodyModel.weightUnit)], bodyModel.weightPoint]];
  377. }
  378. - (void)bodyFatScaleManagerUpdateState:(ELBluetoothState)state {
  379. switch (state) {
  380. case ELBluetoothStateUnavailable: {
  381. self.title = @"Please open the bluetooth";
  382. }
  383. break;
  384. case ELBluetoothStateAvailable: {
  385. self.title = @"Bluetooth is open";
  386. }
  387. break;
  388. case ELBluetoothStateScaning: {
  389. self.title = @"Scaning";
  390. }
  391. break;
  392. case ELBluetoothStateConnectFail: {
  393. self.title = @"Connect fail";
  394. }
  395. break;
  396. case ELBluetoothStateDidDisconnect: {
  397. self.title = @"Disconnected";
  398. }
  399. break;
  400. case ELBluetoothStateDidValidationPass: {
  401. self.title = @"Connected";
  402. //获取设备支持的单位
  403. [[ELBodyFatScaleBleManager shareManager] getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdTypeReadDeviceSupportUnit)];
  404. //将你自己设置的单位发给秤
  405. ELDeviceWeightUnit unit = ELDeviceWeightUnit_KG;
  406. [[ELBodyFatScaleBleManager shareManager] changeBodyFatScaleUnit:unit];
  407. //请求历史记录
  408. [[ELBodyFatScaleBleManager shareManager] sendCmd_RequestHistory];
  409. //下发用户列表
  410. [[ELBodyFatScaleBleManager shareManager] sendOfflineUserListToBle:[self get8Users]];
  411. }
  412. break;
  413. case ELBluetoothStateFailedValidation: {
  414. self.title = @"Illegal equipment";
  415. }
  416. break;
  417. case ELBluetoothStateWillConnect:
  418. self.title = @"Connecting";
  419. break;
  420. default:
  421. break;
  422. }
  423. }
  424. - (NSArray<ELBodyFatScaleBleUserModel *> *)get8Users {
  425. NSMutableArray *users = [[NSMutableArray alloc] init];
  426. for (int i = 0; i < 8; i++) {
  427. ELBodyFatScaleBleUserModel *user = [[ELBodyFatScaleBleUserModel alloc] init];
  428. user.createTime = [[NSDate date] timeIntervalSince1970];
  429. user.usrID = i;
  430. user.role = i % 4;
  431. user.sex = i % 2;
  432. user.age = 26 + i;
  433. user.height = 170 + i;
  434. user.weight = 600 + i;
  435. user.adc = 560 + i;
  436. [users addObject:user];
  437. }
  438. return users.copy;
  439. }
  440. - (ELBodyFatScaleBleUserModel *)getOneUser {
  441. ELBodyFatScaleBleUserModel *user = [[ELBodyFatScaleBleUserModel alloc] init];
  442. user.createTime = [[NSDate date] timeIntervalSince1970];
  443. user.usrID = 0;
  444. user.role = BodyFatScaleRole_Ordinary;
  445. user.sex = ELBluetoothUserSex_Woman;
  446. user.age = 26;
  447. user.height = 170;
  448. user.weight = 600;
  449. user.adc = 560;
  450. return user;
  451. }
  452. - (void)dealloc {
  453. }
  454. @end