-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1115 from dotintent/ios-monorepo
refactor: Move MultiplatformBleAdapter to iOS folder
- Loading branch information
Showing
220 changed files
with
26,990 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// | ||
// Use this file to import your target's public headers that you would like to expose to Swift. | ||
// | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,228 @@ | ||
import Foundation | ||
|
||
@objc public protocol BleAdapter { | ||
|
||
// MARK: - Properties | ||
|
||
var delegate: BleClientManagerDelegate? { get set } | ||
|
||
// MARK: - Initializers | ||
|
||
init(queue: DispatchQueue, restoreIdentifierKey: String?) | ||
func invalidate() | ||
|
||
// MARK: - Functions | ||
|
||
func cancelTransaction(_ transactionId: String) | ||
|
||
func setLogLevel(_ logLevel: String) | ||
|
||
func logLevel(_ resolve: Resolve, | ||
reject: Reject) | ||
|
||
func enable(_ transactionId: String, | ||
resolve: Resolve, | ||
reject: Reject) | ||
|
||
func disable(_ transactionId: String, | ||
resolve: Resolve, | ||
reject: Reject) | ||
|
||
func state(_ resolve: Resolve, | ||
reject: Reject) | ||
|
||
func startDeviceScan(_ filteredUUIDs: [String]?, | ||
options:[String:AnyObject]?) | ||
|
||
func stopDeviceScan() | ||
|
||
func readRSSIForDevice(_ deviceIdentifier: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func requestMTUForDevice(_ deviceIdentifier: String, | ||
mtu: Int, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func requestConnectionPriorityForDevice(_ deviceIdentifier: String, | ||
connectionPriority: Int, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func devices(_ deviceIdentifiers: [String], | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func connectedDevices(_ serviceUUIDs: [String], | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func connectToDevice(_ deviceIdentifier: String, | ||
options:[String: AnyObject]?, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func cancelDeviceConnection(_ deviceIdentifier: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func isDeviceConnected(_ deviceIdentifier: String, | ||
resolve: Resolve, | ||
reject: Reject) | ||
|
||
func discoverAllServicesAndCharacteristicsForDevice(_ deviceIdentifier: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func servicesForDevice(_ deviceIdentifier: String, | ||
resolve: Resolve, | ||
reject: Reject) | ||
|
||
func characteristicsForDevice(_ deviceIdentifier: String, | ||
serviceUUID: String, | ||
resolve: Resolve, | ||
reject: Reject) | ||
|
||
func characteristicsForService(_ serviceIdentifier: Double, | ||
resolve: Resolve, | ||
reject: Reject) | ||
|
||
func descriptorsForDevice(_ deviceIdentifier: String, | ||
serviceUUID: String, | ||
characteristicUUID: String, | ||
resolve: Resolve, | ||
reject: Reject) | ||
|
||
func descriptorsForService(_ serviceIdentifier: Double, | ||
characteristicUUID: String, | ||
resolve: Resolve, | ||
reject: Reject) | ||
|
||
func descriptorsForCharacteristic(_ characteristicIdentifier: Double, | ||
resolve: Resolve, | ||
reject: Reject) | ||
|
||
|
||
func readCharacteristicForDevice(_ deviceIdentifier: String, | ||
serviceUUID: String, | ||
characteristicUUID: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func readCharacteristicForService(_ serviceIdentifier: Double, | ||
characteristicUUID: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func readCharacteristic(_ characteristicIdentifier: Double, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func writeCharacteristicForDevice(_ deviceIdentifier: String, | ||
serviceUUID: String, | ||
characteristicUUID: String, | ||
valueBase64: String, | ||
response: Bool, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func writeCharacteristicForService(_ serviceIdentifier: Double, | ||
characteristicUUID: String, | ||
valueBase64: String, | ||
response: Bool, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func writeCharacteristic(_ characteristicIdentifier: Double, | ||
valueBase64: String, | ||
response: Bool, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func monitorCharacteristicForDevice(_ deviceIdentifier: String, | ||
serviceUUID: String, | ||
characteristicUUID: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func monitorCharacteristicForService(_ serviceIdentifier: Double, | ||
characteristicUUID: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func monitorCharacteristic(_ characteristicIdentifier: Double, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func readDescriptorForDevice(_ deviceIdentifier: String, | ||
serviceUUID: String, | ||
characteristicUUID: String, | ||
descriptorUUID: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func readDescriptorForService(_ serviceId: Double, | ||
characteristicUUID: String, | ||
descriptorUUID: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func readDescriptorForCharacteristic(_ characteristicID: Double, | ||
descriptorUUID: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func readDescriptor(_ descriptorID: Double, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func writeDescriptorForDevice(_ deviceIdentifier: String, | ||
serviceUUID: String, | ||
characteristicUUID: String, | ||
descriptorUUID: String, | ||
valueBase64: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func writeDescriptorForService(_ serviceID: Double, | ||
characteristicUUID: String, | ||
descriptorUUID: String, | ||
valueBase64: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func writeDescriptorForCharacteristic(_ characteristicID: Double, | ||
descriptorUUID: String, | ||
valueBase64: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
|
||
func writeDescriptor(_ descriptorID: Double, | ||
valueBase64: String, | ||
transactionId: String, | ||
resolve: @escaping Resolve, | ||
reject: @escaping Reject) | ||
} | ||
|
||
extension BleClientManager: BleAdapter { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Foundation | ||
|
||
public typealias BleAdapterCreator = (_ queue: DispatchQueue, _ restoreIdentifierKey: String?) -> BleAdapter | ||
|
||
// MARK: - BleAdapterFactory | ||
|
||
@objc | ||
public class BleAdapterFactory: NSObject { | ||
|
||
private static var bleAdapterCreator: BleAdapterCreator = { (queue, restoreIdentifierKey) in | ||
return BleClientManager(queue: queue, restoreIdentifierKey: restoreIdentifierKey) | ||
} | ||
|
||
@objc | ||
public static func getNewAdapterWithQueue(_ queue: DispatchQueue, restoreIdentifierKey: String?) -> BleAdapter { | ||
return bleAdapterCreator(queue, restoreIdentifierKey) | ||
} | ||
|
||
@objc | ||
public static func setBleAdapterCreator(_ bleAdapterCreator: @escaping BleAdapterCreator) { | ||
self.bleAdapterCreator = bleAdapterCreator | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// BleClientManager.h | ||
// | ||
// Created by Przemysław Lenart on 27/07/16. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
//! Project version number for BleClientManager. | ||
FOUNDATION_EXPORT double BleClientManagerVersionNumber; | ||
|
||
//! Project version string for BleClientManager. | ||
FOUNDATION_EXPORT const unsigned char BleClientManagerVersionString[]; | ||
|
||
// In this header, you should import all the public headers of your framework using statements like #import <BleClientManager/PublicHeader.h> |
Oops, something went wrong.