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.

NELMacAddressModel.h 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // NELMacAddressModel.h
  3. // Elink
  4. //
  5. // Created by LarryZhang on 2022/8/15.
  6. // Copyright © 2022 iot_iMac. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface NELMacAddressModel : NSObject
  11. @property (nonatomic, copy, readonly) NSString *macAddressString;
  12. // 例:{0xA1, 0xB2, 0xC3, 0xD4, 0xE5, 0xF6} ==> "A1:B2:C3:D4:E5:F6"
  13. + (instancetype)macWithBigEndianBytes:(Byte *)bytes;
  14. // 例:{0xF6, 0xE5, 0xD4, 0xC3, 0xB2, 0xA1} ==> "A1:B2:C3:D4:E5:F6"
  15. + (instancetype)macWithLittleEndianBytes:(Byte *)bytes;
  16. // 例:<A1B2C3D4 E5F6> ==> "A1:B2:C3:D4:E5:F6"
  17. + (instancetype)macWithBigEndianData:(NSData *)data;
  18. // 例:<F6E5D4C3 B2A1> ==> "A1:B2:C3:D4:E5:F6"
  19. + (instancetype)macWithLittleEndianData:(NSData *)data;
  20. // 只支持格式:"A1:B2:C3:D4:E5:F6"
  21. + (instancetype)macWithMacString:(NSString *)macString;
  22. // 例:0xA1B2C3D4E5F6 ==> "A1:B2:C3:D4:E5:F6"
  23. + (instancetype)macWithUIntValue:(UInt64)value;
  24. //// 例:0xF6E5D4C3B2A1 ==> "A1:B2:C3:D4:E5:F6"
  25. //+ (instancetype)macWithBigEndianUIntValue:(UInt64)value;
  26. //
  27. //// 例:0xA1B2C3D4E5F6 ==> "A1:B2:C3:D4:E5:F6"
  28. //+ (instancetype)macWithLittleEndianUIntValue:(UInt64)value;
  29. //+ (BOOL)isEqual:(ZZMacAddressModel *)mac with:(ZZMacAddressModel *)otherMac;
  30. - (BOOL)isEqualToMac:(NELMacAddressModel *)mac;
  31. #ifdef DEBUG
  32. + (void)demo;
  33. #endif
  34. @end
  35. NS_ASSUME_NONNULL_END