//
//  RDSBabyBluetooth.h
//  RuiZhi
//
//  Created by Rayson on 2020/6/13.
//  Copyright © 2020 RDIOT. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "RDSDeviceCmd.h"

#define TheBabyBluetooth [RDSBabyBluetooth sharedInstance]


typedef void(^RDSCmdTouchResponce)(RDSDeviceReply *reply);
typedef void(^RDSDisconnectDeviceBlock)(void);


@interface RDSBabyBluetooth : NSObject

AS_SINGLETON(RDSBabyBluetooth)


@property (nonatomic, copy) void(^onConnectDeviceSuccessAndCanWrite)(void);
@property (nonatomic, copy) NSString *curMac;
@property(nonatomic, assign) CBManagerState bleState;

- (void)rds_writeValue:(NSData *)data;

// 一对多 block监听设备信息回调
- (void)rds_cmdResponceObserve:(id)observe responce:(RDSCmdTouchResponce)responceBlock;

// 一对多 block监听断开连接回调
- (void)rds_disconnectDeviceObserve:(id)observe block:(RDSDisconnectDeviceBlock)block;


/// 开始扫描
- (void)rds_beginScan;

/// 停止扫描
- (void)rds_cancelScan;

/// 断开链接
- (void)rds_cancelConnection;

/// 重新扫描
- (void)rds_refreshScanDeviceName:(NSString *)name;


#pragma mark - 发送设备指令



@end




