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

Successful Write but Disconnection on Data Retrieval #272

Open
pksa opened this issue Mar 8, 2024 · 0 comments
Open

Successful Write but Disconnection on Data Retrieval #272

pksa opened this issue Mar 8, 2024 · 0 comments

Comments

@pksa
Copy link

pksa commented Mar 8, 2024

Summary:
Device: Buerer BM96
The connection is lost when attempting to write to the characteristic.

`let writeHeartRateCharacteristic = CharacteristicIdentifier(
uuid: BM96CharacteristicUUID.heartServiceUUID.rawValue,
service: ServiceIdentifier(uuid: BM96CharacteristicUUID.customServiceUUID.rawValue)
)

private func writeGetAllHeartUser1Measurements() {
    let OP_CODE_REPORT_STORED_RECORDS: UInt8 = 0x02
    let OPERATOR_SENDING_RECORD_1: UInt8 = 0x00
    let OPERATOR_SENDING_RECORD_2: UInt8 = 0x00
    
    let command = [OP_CODE_REPORT_STORED_RECORDS, OPERATOR_SENDING_RECORD_1, OPERATOR_SENDING_RECORD_2]
    
    bluejay.write(to: writeHeartRateCharacteristic, value: Data(command), type: .withoutResponse) { result in
        switch result {
        case .success:
            Logger.shared.log("Write to sensor location is successful.")
            self.listenHeartRateData()
            
        case .failure(let error):
            print("Failed to write sensor location with error: \(error.localizedDescription)")
        }
    }
}`

Actual Result:
Write to sensor location is successful.
failure(Bluejay.BluejayError.notConnected)
Failed to listen to heart rate with error: Not connected to a peripheral

Expected Result:
Retrieve data upon successful write. Also, do not disconnect device.

Device, Build, OS:

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

No branches or pull requests

1 participant