iOS AILinkBleSDK - 蓝牙SDK
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ViewController.m 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. //
  2. // ViewController.m
  3. // AILinkBleSDKSourceCode
  4. //
  5. // Created by iot_user on 2020/4/7.
  6. // Copyright © 2020 IOT. All rights reserved.
  7. //
  8. #import "ViewController.h"
  9. #import "Masonry.h"
  10. #import "AiLinkSuperViewController.h"
  11. #import "InheritScanViewController.h"
  12. #import "BabyScaleViewController.h"
  13. #import "BloodScanViewController.h"
  14. #import "HeightGuageScanViewController.h"
  15. #import "RemoteControlScanViewController.h"
  16. #import "ForeheadScanViewController.h"
  17. #import "ThermometerScanViewController.h"
  18. #import "WheelMonitorScanViewController.h"
  19. #import "BodyFatScaleScanViewController.h"
  20. #import "BroadcastScaleViewController.h"
  21. #import "EightScaleScanViewController.h"
  22. #import "ToothbrushScanViewController.h"
  23. #import "ELBfsWifiScanVC.h"
  24. #import "OximeterScanViewController.h"
  25. #import "BloodSugarScanViewController.h"
  26. #import "CoffeeScaleScanViewController.h"
  27. #import "FoodThermometerScanViewController.h"
  28. #import "BroadcastNutritionScaleViewController.h"
  29. #import "NutritionScaleScanViewController.h"
  30. #import "AiFreshNutritionScaleScanViewController.h"
  31. #import "FaceMaskScanViewController.h"
  32. @interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
  33. @property (nonatomic, strong) UITableView *tableView;
  34. @property (nonatomic, copy) NSArray *datas;
  35. @property (nonatomic, copy) NSArray *vcsArray;
  36. @end
  37. @implementation ViewController
  38. - (void)viewDidLoad {
  39. [super viewDidLoad];
  40. self.datas = @[
  41. @"Parse data yourself(有AILink协议自己解析数据)",
  42. @"04_Baby Scale(婴儿秤)",
  43. @"05_Sphygmomanometer(血压计)",
  44. @"06_Height Guage(身高仪)",
  45. @"07_Remote Control(遥控器)",
  46. @"08_Forehead thermometer(额温枪)",
  47. @"09_Digital thermometer(温度计)",
  48. @"10_TPMS(胎压监测)",
  49. @"11_Bluetooth BodyfatScale(体脂秤)",
  50. @"12_Bluetooth BroadcastScale(广播秤)",
  51. @"13_Eight-electrode scale(八电极体脂秤)",
  52. @"14_wifi-ble toothbrush(WiFi-ble牙刷)",
  53. @"15_wifi-ble bodyfatScale(WiFi-ble体脂秤)",
  54. @"16_Bluetooth Oximeter(血氧仪)",
  55. @"17_Bluetooth BloodGlucoseMeter(血糖仪)",
  56. @"18_CoffeeScale(咖啡秤)",
  57. @"19_FoodThermometer(食物温度计)",
  58. @"20_BrodcastNutritionScale(广播营养秤)",
  59. @"21_NutritionScale(连接营养秤)",
  60. @"22_AiFreshNutritionScale(好营养营养秤)",
  61. @"23_FaceMask(智能口罩)",
  62. ];
  63. self.vcsArray = @[
  64. [[InheritScanViewController alloc] init],
  65. [[BabyScaleViewController alloc] init],
  66. [[BloodScanViewController alloc] init],
  67. [[HeightGuageScanViewController alloc] init],
  68. [[RemoteControlScanViewController alloc] init],
  69. [[ForeheadScanViewController alloc] init],
  70. [[ThermometerScanViewController alloc] init],
  71. [[WheelMonitorScanViewController alloc] init],
  72. [[BodyFatScaleScanViewController alloc] init],
  73. [[BroadcastScaleViewController alloc] init],
  74. [[EightScaleScanViewController alloc] init],
  75. [[ToothbrushScanViewController alloc] init],
  76. [[ELBfsWifiScanVC alloc] init],
  77. [[OximeterScanViewController alloc] init],
  78. [[BloodSugarScanViewController alloc] init],
  79. [[CoffeeScaleScanViewController alloc] init],
  80. [[FoodThermometerScanViewController alloc] init],
  81. [[BroadcastNutritionScaleViewController alloc] init],
  82. [[NutritionScaleScanViewController alloc] init],
  83. [[AiFreshNutritionScaleScanViewController alloc] init],
  84. [[FaceMaskScanViewController alloc] init],
  85. ];
  86. [self.view addSubview:self.tableView];
  87. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  88. make.top.left.right.bottom.mas_equalTo(0);
  89. }];
  90. }
  91. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  92. return self.datas.count;
  93. }
  94. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  95. return 50;
  96. }
  97. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  98. static NSString *cellId = @"cellid";
  99. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
  100. if (!cell) {
  101. cell = [[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
  102. }
  103. cell.textLabel.text = self.datas[indexPath.row];
  104. return cell;
  105. }
  106. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  107. UIViewController *vc = self.vcsArray[indexPath.row];
  108. vc.title = self.datas[indexPath.row];
  109. [self.navigationController pushViewController:vc animated:YES];
  110. }
  111. -(UITableView *)tableView{
  112. if (_tableView == nil) {
  113. _tableView = [[UITableView alloc] init];
  114. _tableView.delegate = self;
  115. _tableView.dataSource = self;
  116. }
  117. return _tableView;
  118. }
  119. @end