BabyBluetooth-swift
BabyBluetooth-swift copied to clipboard
puzzle
.cancelAllPeripheralsConnection() .scanForPeripherals() .enjoy() ` connect ble device once
.cancelAllPeripheralsConnection() .scanForPeripherals() .begin() .having(currentConnectedPeripheral).connectToPeripherals().discoverServices().discoverCharacteristics().readValueForCharacteristic().begin()
` but methods will connect twice,that make me confused,can you solve my puzzle Thanks!
there has some problem in you code.
- 1: if you use
having(currentConnectedPeripheral)
method ,you no need use .scanForPeripherals(), it's immediate cause you connect twice. - 2: begin() only use in end of the method 's chain, only once