Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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