DrAma999 / LittleBlueTooth

A simple library that helps you in connecting with BLE devices
MIT License
79 stars 17 forks source link

Having trouble writing without response to esp32 #41

Closed jaksatomovic closed 1 year ago

jaksatomovic commented 1 year ago

For some reason when i use your library i cant send data to esp32. using pure corebluetooth i could send data so characteristics etc are correct. I noticed you use peripheral.write instead writeValue. could this be issue?

` @objc func onTapWriteCharacteristic(_ sender: Any) { let data = HeartRateSensorPositionRequest(position: HRMSensorPosition(rawValue: 1)!)

    StartLittleBlueTooth
        .write(for: self.littleBT, to: hrmControlPointChar, value: data, response: false)
        .sink(receiveCompletion: { completion in
            self.appendLog("Completion \(completion)")
        }) { (answer) in
            self.appendLog("Answer \(answer)")
        }
        .store(in: &disposeBag)

}`