readRssi

suspend fun readRssi(): Int

Reads the received signal strength indicator (RSSI) of the peripheral.

Usually, the RSSI value is between -120 dBm (vary far) and -30 dBm (very close), but the exact value depends on the TX power, antenna, environment, and other factors.

Return

The RSSI value in dBm.

Throws

if the peripheral is not connected.

If reading RSSI could not be initiated.

If BLUETOOTH_CONNECT permission is denied.