iOS AILinkBleSDK - 蓝牙SDK
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ELPeripheralModel.h 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // ELPeripheralModel.h
  3. // Elink
  4. //
  5. // Created by iot_user on 2019/4/22.
  6. // Copyright © 2019 iot_iMac. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <CoreBluetooth/CoreBluetooth.h>
  10. #import "ELSDKHeader.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. Bluetooth peripheral out model(蓝牙扫描出来的外设模型)
  14. */
  15. @interface ELPeripheralModel : NSObject
  16. /**
  17. CID
  18. */
  19. @property (nonatomic, assign) ELSupportDeviceType deviceType;// DEPRECATED_MSG_ATTRIBUTE("use ‘cid’ instead");
  20. @property (nonatomic, assign) ELSupportDeviceType cid;
  21. /**
  22. VID
  23. */
  24. @property (nonatomic, assign) NSInteger vendorID;
  25. @property (nonatomic, assign) NSInteger vid;
  26. /**
  27. PID
  28. */
  29. @property (nonatomic, assign) NSInteger productID;
  30. @property (nonatomic, assign) NSInteger pid;
  31. @property (nonatomic, copy) NSString *deviceName;
  32. @property (nonatomic, copy) NSString *macAddress;
  33. @property (nonatomic, assign) NSInteger rssi;
  34. @property (nonatomic, strong) CBPeripheral *peripheral;
  35. /**
  36. 6 bytes: small endian(6个byte:小端序)
  37. */
  38. @property (nonatomic, copy) NSData *macData;
  39. /**
  40. 2 bytes
  41. */
  42. @property (nonatomic, copy) NSData *deviceTypeData;
  43. /** Device with unit: support unit string
  44.      Unitless equipment
  45.         Smart Door Lock: Supported unlock type
  46. 有单位的设备:支持单位字符串
  47. 无单位的设备
  48. 智能门锁:支持的开锁类型
  49. */
  50. @property (nonatomic, copy) NSString *supportUnit;
  51. /** Device version numbe(设备版本号) */
  52. @property (nonatomic, copy) NSString *version;
  53. /**
  54. * 华盛达手表要用这个属性: 是否已经跟系统配对
  55. */
  56. @property(nonatomic, assign) BOOL paired;
  57. /** 广播秤的广播数据 */
  58. @property (nonatomic, strong) NSData *manufactureData;
  59. /**
  60. Screening equipment(筛选设备)
  61. @param peripherals All devices scanned by the parent class(父类扫描到的所有设备)
  62. @param type Equipment type(设备类型)
  63. @return Array of corresponding devices(对应设备的数组)
  64. */
  65. +(NSArray<ELPeripheralModel *> *)getDevicesWithPeripherals:(NSArray<__kindof ELPeripheralModel *> *)peripherals supportDeviceType:(ELSupportDeviceType)type;
  66. #pragma mark Screen multiple devices(筛选多个设备)
  67. +(NSArray<ELPeripheralModel *> *)getDevicesWithPeripherals:(NSArray<__kindof ELPeripheralModel *> *)peripherals supportDeviceTypes:(NSArray<NSNumber *> *)types;
  68. //Descending order(降序)
  69. -(NSComparisonResult)compareRSSI:(ELPeripheralModel *)model;
  70. @end
  71. NS_ASSUME_NONNULL_END