Skip to content

Function Ttlock.getBluetoothState((state) => console.log(state)) returns incorrect states #36

Description

@PasterIvan

I can't check the bluetooth status on my phone correctly.
Function Ttlock.getBluetoothState((state) => console.log(state)) returns states:

enum BluetoothState {
Unknown = 0,
Resetting = 1,
Unsupported = 2,
Unauthorized = 3,
On = 4,
Off = 5
}

In theory, if the Bluetooth on the phone is turned off, it should return 5, and if it is turned on, then 4. but it does exactly the opposite. And on android, it's generally 0.

At the same time, if Bluetooth is enabled on the android, then working with the Bluetooth lock passes without any errors.

Because of this, I can't properly notify the user to turn on bluetooth.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions