Reputation: 1
In my ionic project I have installed cordova-plugin-bluetooth-yuflow using command:
cordova plugin add cordova-plugin-bluetooth-yuflow
as mentioned in the plugin repo.
But I coudn't execute function that allows me to enable bluetooth from my smartphone. I have a 5.1 android version. I want to use this plugin to connect to multiple serial bluetooth HC05
I don't understand what it is means:
You can reach the plugin in your scripts at "window.bluetoothyuflow"
mentioned in the plugin repo
Upvotes: 0
Views: 232
Reputation: 1
Try to type this in your javascript:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
bluetoothYuflow = window.bluetoothyuflow
bluetoothYuflow.bluetooth(success, failure)
}
Now on, when you have to call a function from yuflow type
bluetoothYuflow."yourfuncton"()
Upvotes: 0
Reputation: 644
You may be better of using a well documented and often used plugin, I recommend to use this Cordova plugin: https://github.com/don/BluetoothSerial (also take a look at the examples folder of this repo)
Upvotes: 1