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.
48 lines
1.2 KiB
48 lines
1.2 KiB
1 year ago
|
//
|
||
|
// BlueToothItem.h
|
||
|
// BluetoothDemo
|
||
|
//
|
||
|
// Created by mac on 17/3/10.
|
||
|
// Copyright © 2017年 . All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import <Foundation/Foundation.h>
|
||
|
#import "BLEConst.h"
|
||
|
#import "BluetoothDataSource.h"
|
||
|
#import "BlueToothEume.h"
|
||
|
|
||
|
|
||
|
@interface BlueToothItem : NSObject
|
||
|
|
||
|
/** 字节流数据 */
|
||
|
@property (nonatomic, strong) NSMutableData *byteBuffer;
|
||
|
/** 序号 */
|
||
|
@property (nonatomic, assign) NSInteger sid;
|
||
|
/** 命令类型 */
|
||
|
@property (nonatomic, assign) BleCMD cmd;
|
||
|
/** 是否正在执行 */
|
||
|
@property (nonatomic, assign) BOOL isExecuting;
|
||
|
/** 请求次数 */
|
||
|
@property (nonatomic, assign) NSInteger requestCount;
|
||
|
|
||
|
@property (nonatomic, weak ) id<BluetoothDataSource> dataSource;
|
||
|
|
||
|
/** 同步联系人时使用:是否结束发送 */
|
||
|
@property (nonatomic, assign) BOOL isEnd;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 构建一个蓝牙请求体
|
||
|
*
|
||
|
* @param byteBuffer 数据
|
||
|
* @param sid 外设的返回值
|
||
|
* @param cmd 类型
|
||
|
* @param dataSource 代理
|
||
|
*/
|
||
|
- (instancetype)initWithbyteBuffer:(NSMutableData *)byteBuffer
|
||
|
sid:(NSInteger)sid
|
||
|
cmd:(BleCMD)cmd
|
||
|
dataSource:(id<BluetoothDataSource>)dataSource;
|
||
|
|
||
|
@end
|