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.

73 lines
0 B

//
// JL_RCSP.h
// JL_BLEKit
//
// Created by zhihui liang on 2018/11/9.
// Copyright © 2018 www.zh-jieli.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <JL_BLEKit/JL_OpCode.h>
NS_ASSUME_NONNULL_BEGIN
@class JL_PKG;
@interface JL_RCSP : NSObject
/**
JL数据包
@param data JL_PKG模型
@return JL_PKG数据模型
*/
+(JL_PKG*)rcspAnalysisData:(NSData*)data;
/**
XM数据包
@param pkg JL_PKG模型转成data
@return
*/
+(NSData*)rcspMakePackage:(JL_PKG*)pkg;
/**
JL_PKG参数
@param pkg JL_PKG的xmData参数部分解析成一列数组
@return
*/
+(NSArray*)rcspAnalysisParams:(JL_PKG*)pkg;
/**
dJL_PKG信息
@param data JL_PKG中的信息数据
@return c数组
*/
+(NSArray*)rcspInfoArrFromData:(NSData*)data;
/// 拆分LTV数据
/// 当前方法针对的是 L 长度为 2Byte
/// @param data LTV数据
+(NSArray*)rcspInfoFromData2ByteSize:(NSData*)data;
/**
JL_PKG参数
@param array dataNSData类型
@return
*/
+(NSData*)rcspMakeParams:(NSArray*)array;
@end
@interface JL_PKG : NSObject
@property(assign,nonatomic) uint16_t pkgIsCommand; //1Bit
@property(assign,nonatomic) uint16_t pkgNeedResponse; //1Bit
@property(assign,nonatomic) uint16_t pkgUnused; //6Bits
@property(assign,nonatomic) uint16_t pkgOpCode; //8Bits
@property(assign,nonatomic) uint16_t pkgLength; //参数长度(本身不计)
@property(strong,nonatomic) NSData *pkgData; //参数数据
@end
NS_ASSUME_NONNULL_END