Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions adapter_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ func (cmd *centralManagerDelegate) DidConnectPeripheral(cmgr cbgo.CentralManager
}
}

// DidFailToConnectPeripheral when peripheral connection fails.
func (cmd *centralManagerDelegate) DidFailToConnectPeripheral(cmgr cbgo.CentralManager, prph cbgo.Peripheral, err error) {
id := prph.Identifier().String()

// Send the peripheral through so ConnectWithContext can check its state
// and return the appropriate error.
if ch, ok := cmd.a.connectMap.LoadAndDelete(id); ok {
ch.(chan cbgo.Peripheral) <- prph
}
}

// makeScanResult creates a ScanResult when peripheral is found.
func makeScanResult(prph cbgo.Peripheral, advFields cbgo.AdvFields, rssi int) ScanResult {
uuid, _ := ParseUUID(prph.Identifier().String())
Expand Down
Loading