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.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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;
  20. /**
  21. VID
  22. */
  23. @property (nonatomic, assign) NSInteger vendorID;
  24. /**
  25. PID
  26. */
  27. @property (nonatomic, assign) NSInteger productID;
  28. @property (nonatomic, copy) NSString *deviceName;
  29. @property (nonatomic, copy) NSString *macAddress;
  30. @property (nonatomic, assign) NSInteger rssi;
  31. @property (nonatomic, strong) CBPeripheral *peripheral;
  32. /**
  33. 6 bytes: small endian(6个byte:小端序)
  34. */
  35. @property (nonatomic, copy) NSData *macData;
  36. /**
  37. 2 bytes
  38. */
  39. @property (nonatomic, copy) NSData *deviceTypeData;
  40. /** Device with unit: support unit string
  41.      Unitless equipment
  42.         Smart Door Lock: Supported unlock type
  43. 有单位的设备:支持单位字符串
  44. 无单位的设备
  45. 智能门锁:支持的开锁类型
  46. */
  47. @property (nonatomic, copy) NSString *supportUnit;
  48. /** Device version numbe(设备版本号) */
  49. @property (nonatomic, copy) NSString *version;
  50. /**
  51. * 华盛达手表要用这个属性: 是否已经跟系统配对
  52. */
  53. @property(nonatomic, assign) BOOL paired;
  54. /**
  55. Screening equipment(筛选设备)
  56. @param peripherals All devices scanned by the parent class(父类扫描到的所有设备)
  57. @param type Equipment type(设备类型)
  58. @return Array of corresponding devices(对应设备的数组)
  59. */
  60. +(NSArray<ELPeripheralModel *> *)getDevicesWithPeripherals:(NSArray<__kindof ELPeripheralModel *> *)peripherals supportDeviceType:(ELSupportDeviceType)type;
  61. //MARK:Screen multiple devices(筛选多个设备)
  62. +(NSArray<ELPeripheralModel *> *)getDevicesWithPeripherals:(NSArray<__kindof ELPeripheralModel *> *)peripherals supportDeviceTypes:(NSArray<NSNumber *> *)types;
  63. //Descending order(降序)
  64. -(NSComparisonResult)compareRSSI:(ELPeripheralModel *)model;
  65. @end
  66. NS_ASSUME_NONNULL_END