Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

RNBluetoothManager.h 1.1KB

1234567891011121314151617181920212223242526272829
  1. //
  2. // RNBluetoothManager.h
  3. // RNBluetoothEscposPrinter
  4. //
  5. // Created by januslo on 2018/9/28.
  6. // Copyright © 2018年 Facebook. All rights reserved.
  7. //
  8. #import <React/RCTBridgeModule.h>
  9. #import <React/RCTEventEmitter.h>
  10. #import <CoreBluetooth/CoreBluetooth.h>
  11. @protocol WriteDataToBleDelegate <NSObject>
  12. @required
  13. - (void) didWriteDataToBle: (BOOL)success;
  14. @end
  15. @interface RNBluetoothManager <CBCentralManagerDelegate,CBPeripheralDelegate> : RCTEventEmitter <RCTBridgeModule>
  16. @property (strong, nonatomic) CBCentralManager *centralManager;
  17. @property (nonatomic,copy) RCTPromiseResolveBlock scanResolveBlock;
  18. @property (nonatomic,copy) RCTPromiseRejectBlock scanRejectBlock;
  19. @property (strong,nonatomic) NSMutableDictionary <NSString *,CBPeripheral *> *foundDevices;
  20. @property (strong,nonatomic) NSString *waitingConnect;
  21. @property (nonatomic,copy) RCTPromiseResolveBlock connectResolveBlock;
  22. @property (nonatomic,copy) RCTPromiseRejectBlock connectRejectBlock;
  23. +(void)writeValue:(NSData *) data withDelegate:(NSObject<WriteDataToBleDelegate> *) delegate;
  24. +(Boolean)isConnected;
  25. -(void)initSupportServices;
  26. -(void)callStop;
  27. @end