Skip to content

feature/node-identity - #84

Draft
decanus wants to merge 34 commits into
masterfrom
feature/node-identity
Draft

feature/node-identity#84
decanus wants to merge 34 commits into
masterfrom
feature/node-identity

Conversation

@decanus

@decanus decanus commented Oct 16, 2019

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread Sources/UB/Node.swift Outdated
transports[id] = transport
transports[id]?.delegate = self
transport.listen()
transport.listen(identity: UBID(repeating: 0, count: 0)) // @TODO

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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.

Comment thread Sources/UB/Node.swift
let sends = flood(message, data: data, transport: transport, peers: filtered)
if sends > 0 {
return
return filtered.forEach {

Copy link
Copy Markdown

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
Copy Markdown

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

@qlty-cloud-legacy

Copy link
Copy Markdown

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