-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement/bluetooth-l2cap #61
Conversation
…B.swift into feature/core-bluetooth
// @todo | ||
} | ||
|
||
public func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
// @todo figure out exactly what we will want to do here. | ||
} | ||
|
||
public func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
@@ -0,0 +1,10 @@ | |||
import Foundation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
@@ -0,0 +1,11 @@ | |||
import CoreBluetooth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
/// - Parameters: | ||
/// - input: The input stream. | ||
/// - output: The output stream. | ||
public init(input: InputStream, output: OutputStream) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
|
||
/// The StreamClient implements generic stream handling for Ultralight Beam transports. | ||
public class StreamClient: NSObject { | ||
// @TODO: We need to figure out how the dependants figure out which address or peer data came from. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODOs should be resolved (We need to figure out how the ...).
// @todo check that this is the characteristic | ||
let id = Addr(central.identifier.bytes) | ||
centrals.removeValue(forKey: id) | ||
peers.removeAll(where: { $0.id == id }) | ||
} | ||
|
||
public func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line should be 120 characters or less: currently 125 characters
update(value: psm?.bytes) | ||
} | ||
|
||
public func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line should be 120 characters or less: currently 127 characters
// @todo | ||
} | ||
|
||
public func peripheralManager(_: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
@@ -220,4 +273,27 @@ extension CoreBluetoothTransport: CBPeripheralDelegate { | |||
) { | |||
// @todo figure out exactly what we will want to do here. | |||
} | |||
|
|||
public func peripheral(_: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
@@ -0,0 +1,9 @@ | |||
import Foundation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit 0c81cca and detected 6 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
on hold cause android does not support. |
closes #58
This PR implements generic stream handling and moves bluetooth over to l2cap implementation.