Skip to content
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

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from
Draft

feature/node-identity #84

wants to merge 34 commits into from

Conversation

decanus
Copy link
Contributor

@decanus decanus commented Oct 16, 2019

No description provided.

@@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODOs should be resolved.

type: CBUUID(string: "BEA3B031-76FB-4889-B3C7-000000000001"),
properties: [.read, .writeWithoutResponse, .notify],
value: nil,
permissions: [.writeable, .readable]
Copy link

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))
Copy link

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;
Copy link

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 {
Copy link

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])
Copy link

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

@codeclimate
Copy link

codeclimate bot commented Oct 22, 2019

Code Climate has analyzed commit e37e58f and detected 7 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 7

View more on Code Climate.

@decanus decanus mentioned this pull request May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant