Skip to content

Successful Write but Disconnection on Data Retrieval #272

Description

@pksa

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions