-
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
feature/node-identity #84
base: master
Are you sure you want to change the base?
Conversation
Sources/UB/Node.swift
Outdated
@@ -27,7 +30,7 @@ public class Node { | |||
|
|||
transports[id] = transport | |||
transports[id]?.delegate = self | |||
transport.listen() | |||
transport.listen(identity: UBID(repeating: 0, count: 0)) // @TODO |
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.
…-beam/UB.swift into feature/node-identity
…-beam/UB.swift into feature/node-identity
type: CBUUID(string: "BEA3B031-76FB-4889-B3C7-000000000001"), | ||
properties: [.read, .writeWithoutResponse, .notify], | ||
value: nil, | ||
permissions: [.writeable, .readable] |
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.
Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
} | ||
|
||
if request.characteristic.uuid == identityCharacteristic.uuid { | ||
delegate?.transport(self, didConnectToPeer: Addr(data), withAddr: Addr(request.central.identifier.bytes)) |
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 121 characters
if characteristic.uuid == identityCharacteristic.uuid { | ||
if let data = characteristic.value { | ||
let addr = Addr(data) | ||
peers[id] = addr; |
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.
Lines should not have trailing semicolons.
let sends = flood(message, data: data, transport: transport, peers: filtered) | ||
if sends > 0 { | ||
return | ||
return filtered.forEach { |
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.
Avoid too many return
statements within this function.
) { | ||
add(central: central) | ||
if characteristic.uuid == CoreBluetoothTransport.identityCharacteristic.uuid { | ||
peripheral.updateValue(Data(identity), for: CoreBluetoothTransport.identityCharacteristic, onSubscribedCentrals: [central]) |
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 135 characters
Code Climate has analyzed commit e37e58f and detected 7 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
No description provided.