Bluetooth readRSSI not working


#1

Hi,

I’m trying to use Bluetooth Serial and read the RSSI data. I have no problem connecting, reading and writing data, however, readRSSI function simply returns “Invalid Action”.

Here’s the code:

			this.bluetoothSerial.readRSSI().then((success) => {
				console.log(success);
			}, (error) => {
			       console.log(error);
			});

That’s after importing bluetoothSerial and injecting it into the constructor. As I said, no issues with connecting to a device, reading and writing. Am I using the readRSSI function incorrectly?

Ionic Info:
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : not installed

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 25.2.5
Node              : v6.11.2
npm               : 3.10.10
OS                : Windows 8.1

Environment Variables:

ANDROID_HOME : C:\Program Files (x86)\Android\android-sdk

Misc:

backend : legacy

#2

I join this problem, adding that it does not return an error until I disconnect the bluetooth link. That’s when I get back the error console.log

Ionic:

ionic (Ionic CLI) : 4.1.2
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : not installed
Cordova Platforms : not available
Cordova Plugins : not available

System:

Android SDK Tools : 26.1.1 (c:\android\sdk)
NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe)
npm : 5.6.0
OS : Windows 7