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.

ELTLVModel.h 897B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // ELTLVModel.h
  3. // AILinkBleSDK
  4. //
  5. // Created by LarryZhang on 2022/9/6.
  6. // Copyright © 2022 IOT. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. //***** type 1 Byte lengh 1 Byte
  11. @interface ELTLVModel : NSObject
  12. @property(nonatomic, assign) UInt8 type; //T
  13. @property(nonatomic, assign, readonly) UInt8 length; //L
  14. @property(nonatomic, strong) NSData *value; //V
  15. //@property(nonatomic, strong) NSNumber *_Nullable cmd; //cmd属性 (独立属性,不包含在tlvData)
  16. @property(nonatomic, strong, readonly) NSData *data;
  17. @property(nonatomic, strong, readonly) NSData *tlvData; //same as data
  18. - (instancetype)initWithType:(UInt8)type;
  19. - (instancetype)initWithType:(UInt8)type value:(NSData *)value;
  20. @end
  21. @interface ELTLVModel (Tool)
  22. + (NSArray<ELTLVModel *> *)objectArrayWithData:(NSData * _Nonnull)payloadData;
  23. @end
  24. NS_ASSUME_NONNULL_END