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.

100 lines
2.6 KiB

2 years ago
//
// HPlusBluetoothManager.h
// HPlusBluetooth_Example
//
// Created by lemo. on 2019/5/14.
// Copyright © 2019 chentingfeng. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import <ECellBluetooth/ECellBluetoothDelegate.h>
#import <ECellBluetooth/ECellPeripheralModel.h>
NS_ASSUME_NONNULL_BEGIN
@interface ECellBluetoothManager : NSObject
/**
| Setting up the agent
*/
@property (nonatomic,weak) id<ECellBluetoothDelegate> delegate;
/**
| Bluetooth Management Center
*/
@property (nonatomic,strong) CBCentralManager *centralManager;
/**
| Peripherals
*/
@property (nullable, nonatomic,strong) CBPeripheral *currenPeripheral;
/**
| Is Bluetooth enabled?
*/
@property (nonatomic,assign,readonly) BOOL poweredOn;
/**
| Bluetooth is connected
*/
@property (nonatomic,assign,readonly) BOOL connected;
/**
| Is the current connected device bound?
*/
@property (nonatomic,assign) BOOL isBind;
/**
* 80 80
* Set the device with weak scan filtering signal. Default value 80 is greater than 80 will be filtered.
*/
@property (nonatomic,assign) NSInteger rssiNum;
/**
* 5
* Send command timeout defaults to 5 seconds by default
*/
@property (nonatomic, assign) NSInteger commandTimeOutNumber;
/**
| Start scanning
*/
- (void)startScan;
/**
| Stop scanning
*/
- (void)stopScan;
/**
* @brief | Select peripheral connection
* @param model ECellPeripheralModel | ECellPeripheralModel object
*/
- (void)connectDeviceWithModel:(ECellPeripheralModel *)model;
/**
() | Disconnect the current peripheral device (The device information will be cleared and will not be reconnected)
*/
- (void)cancelCurrentPeripheralConnection;
/**
SDK服务 | Register for SDK service
@param outputSdkLog (NO) | Whether to output the Bluetooth protocol running log (default NO)
@param isReconnect (YES) | Whether a reconnect mechanism is required (default YES)
*/
- (void)registrationServices:(BOOL)outputSdkLog
IsReconnect:(BOOL)isReconnect;
/**
* @brief
* Initialize the Bluetooth Management Center object
* @return HPlusBluetoothManager
*/
+ (__kindof ECellBluetoothManager *)shareInstance;
@end
NS_ASSUME_NONNULL_END