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.

NSData+AILinkBle.h 738B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // NSData+AILinkBle.h
  3. // AILinkBleSDK
  4. //
  5. // Created by LarryZhang on 2022/11/24.
  6. //
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. @interface NSData (AILinkBle)
  10. - (UInt32)valueU32AtLoc:(NSUInteger)loc;
  11. - (UInt32)u32:(NSUInteger)loc; //简化版
  12. - (UInt16)valueU16AtLoc:(NSUInteger)loc;
  13. - (UInt16)u16:(NSUInteger)loc; //简化版
  14. - (UInt8)valueU8AtLoc:(NSUInteger)loc;
  15. - (UInt8)u8:(NSUInteger)loc; //简化版
  16. - (UInt32)valueU32LEAtLoc:(NSUInteger)loc;
  17. - (UInt32)u32LE:(NSUInteger)loc; //简化版
  18. - (UInt16)valueU16LEAtLoc:(NSUInteger)loc;
  19. - (UInt16)u16LE:(NSUInteger)loc; //简化版
  20. //转换 HexString
  21. - (NSString *)elHexString;
  22. + (NSData *)elDataWithHexString:(NSString *)hexStr;
  23. @end
  24. NS_ASSUME_NONNULL_END