bluetooth-le | Capacitor plugin for Bluetooth Low Energy
kandi X-RAY | bluetooth-le Summary
kandi X-RAY | bluetooth-le Summary
This is a Capacitor plugin for Bluetooth Low Energy. It supports the web, Android and iOS. The goal is to support the same features on all platforms. Therefore the Web Bluetooth API is taken as a guidline for what features to implement.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bluetooth-le
bluetooth-le Key Features
bluetooth-le Examples and Code Snippets
Community Discussions
Trending Discussions on bluetooth-le
QUESTION
I'm using the Bluetooth-LE community plugin in a Ionic React project.
I'm writing a value to the GATT server with the following code:
...ANSWER
Answered 2022-Mar-17 at 22:36I need to be able to set a flag variable to indicate whether the write was a success or failure. There is nothing in the docs to indicate how this can be done.
You linked/shared right what the docs say is returned.
QUESTION
I'm working with an ESP32 chip and am trying to create an Android app (using Ionic) which allows user to send wifi credentials to the ESP32 chip via BLE. I'd like to be able to update the status of the wifi sending process for the user in the UI (which I'm developing using Angular and then converting it to an Android webapp using Ionic). To do this, I'm also using the capacitor-community/bluetooth-le library.
Can anyone explain to me what this.queue does in the async write function (code shown below) does? I thought this function returns a response from a remote BLE device after writing to a GATT characteristic, but I get absolutely nothing at all for a response.
...ANSWER
Answered 2022-Mar-18 at 01:42Here's how I'm using BleClient.write to transmit information to a BLE device (recipient):
QUESTION
I'm stuck with this task about reading some data from my BLE Device.
I have a HM-19 DSD Tech Bluetooth LE module on my target machine, and I want communicate with it with my smartphone.
I'm using Xamarin with Plugin.BLE to try to achieve this.
There is my BluetoothPage.xaml.cs
code
ANSWER
Answered 2021-Oct-27 at 10:03BLE communication can be a pain particularly with Xamarin.
In any case asynchronous calls from your application may return before data has actually been sent to your end device. This is due to several factors:
- Operating system BLE driver behaviour - Any call that you make in your application code is handled by the operating system drivers. These may return before any data is actually handled by the BLE hardware.
- BLE transport layer delays - BLE transmission of data is not instant. The data connection between two devices actually occurs within discrete time slots, between which the BLE transceiver is turned off to save power.
- End device response time.
Most implementations of two way communication between devices using BLE use a minimum of two characteristics, one for data being sent and the other for data being received by a device e.g. device 1 receives data on the characteristic that device 2 sends on and vice versa. This avoids the possibility of any collision of data being sent by both parties.
You could try placing a delay in your code prior to polling for characteristic data and see if that helps, but its not an optimal solution.
I see that you are using your characteristic "anonymously", rather than using its uuid to select it. If the Bluetooth service supports more than one characteristic then you will need to use the uuid to ensure that you are using the correct one. The list of characteristics, much like the list of services and devices may not be returned in the same order whenever you request them.
You have the option of polling characteristics by reading them on a timed basis or setting up handlers for characteristic notification/indication events if the characteristic supports it and your BLE device uses that mechanism to show that data is ready.
QUESTION
I need to connect my app to a BLE device (not another smartphone). I'm searching for a bluetooth ionic plugin and I saw that there are three of them but I don't understand the differences very well. There are some resources / tutorials about ionic bluetooth plugins that can help understand these?
https://ionicframework.com/docs/native/ble
https://ionicframework.com/docs/native/bluetooth-le
https://ionicframework.com/docs/native/bluetooth-serial -> is to be used only to connect to an Arduino device right?
Thank you
...ANSWER
Answered 2021-Feb-16 at 12:42- ble: Only allows Connecting to a peripheral. You will find examples on their Github page
- bluetooth-le: Also enables your device to become a peripheral itself. The description states it
covers most of the API methods available on Android and iOS
They also offer help and examples on Github
- bluetooth-serial: This is not a plugin for Bluetooth Low Energy (BLE) but for Bluetooth Classic.
You need to select the most fitting plugin for your application
QUESTION
I have been working through several BLE tutorials to develop an app to connect to an ESP32, but I cannot get the code to connect to the ESP32. I am using a Samsung phone which requires a time delay, but I have tried other phones and still cannot connect the ESP32 to the mobile app.
If I run a BLE scanner app I can connect to the ESP32, so I believe the ESP32 side is okay. If we scan for devices we can see it in the bluetooth device list.
The code is setup to detect and connect, I have tried a UUID and device name filer, but it will not connect. The ScanCallback is been triggered and we get the function onBatchScanResults been called, so we can see a list of devices but it will not connect to the ESP32. I think it should connect automatically with the gatt functions.
I cannot workout why it will not auto connect to the ESP32, as it's seen the devices and the scan connect is been trigged. Any help would be highly appreciated to fix this issue, as I have ran out of idea to fix it.
...ANSWER
Answered 2020-Oct-28 at 20:28From the logs I see "found something 2" is logged in onBatchScanResults() method of ScanCallback. You should handle this event. Call the same connectGatt which is used in onScanResult() method.
When device connection successful in order to read messages from device you should subscribe to services and setCharacteristicNotification for PROPERTY_NOTIFY type characteristics.
QUESTION
I worked on a Ble peripheral, I used a queue from this article to send data, but it works only one time.
I received a request from Central after a successful connection with the value "0301" then in the same characterstic I set the data (ssid) and I notify it, so right now everything works fine, and the app (peropheral) stop receiving request.
...ANSWER
Answered 2020-Sep-15 at 21:52As the documentation says: "An application must call BluetoothGattServer#sendResponse to complete the request."
QUESTION
I need to transfer data from android phone to each other through my application using BLE. When a device comes near to me and my application is already installed in it, So my phone will establish a connection and send some data in strings and also receive from that device without notify user. Is it possible to do with BLE and I have studied BLE from
https://developer.android.com/guide/topics/connectivity/bluetooth-le
But I am new so I dont know from where to start and what should i have to do? Kindly let me know about BLE more easy for my better understanding and refer me some tutorials where I can learn that how will fulfill my application functionalities.
Thanks
...ANSWER
Answered 2020-Apr-20 at 17:28I suggest starting with the Central-Peripheral example. Here you have an simple application:
https://github.com/itanbp/android-ble-peripheral-central
And tutorial with basis:
https://www.bignerdranch.com/blog/bluetooth-low-energy-on-android-part-1/
In the case you described, if there are not defined roles for the android phones (master, slave), the program will have to work in alternately in two modes: central and peripheral.
This is possible form the BLE side. However, there may be a problem with the application wroking as a background service. Since Android 8 there are new restrictions and limitations in background sericves:
https://developer.android.com/about/versions/oreo/background
Bluetooth Low Energy on Adnroid is very troublesome technology. A lot depends on the version of Android, processor and antenna system of the phone.
QUESTION
I have been fighting a bug for a few days now. I have been looking everywhere on a solution to this. I am at my end on what I can do.
Basically, my iOS app is crashing on startup. I am getting a SIGABT fault code with an error: FIXME: ftnptr_arg page trampolines
. I will attach a copy of the crash report below. I found some posts that are a little similar to my issue on this site:
Got a SIGABRT while executing native code xamarin.ios
SIGABRT error after last Xamarin.iOS update
Xamarin IOS app crashes with exception: EXC_BAD_ACCESS (SIGABRT)
and on GitHub: https://github.com/mono/mono/issues/9871
I have tried these solutions and they do not work for me. I would also like to add that I am using the Bluetooth on the device. I did add the correct permissions in the Info.plist file. The Bluetooth library that I am using is Plugin.BLE: https://github.com/xabre/xamarin-bluetooth-le
Anyways, the crash is happening on a page that does not access the bluetooth device. It is happening on a log in page (which is the first page that is displayed to the user). I do not think that the issue is related to the bluetooth. Like I said previously, I am pretty much at the end of what I can do. Not sure what is going on. Has anyone else out there ran into the issue?
Additional Note:
I would like to also add that I am able to debug the initialization of the form and step through the code without it crashing. I only have 3 functions. One for initialization, another for when the form appears, and a third for when a button is pressed. I can step through the code on the first 2 functions. After the program executes these two, the app crashes. I know that it is not an issue with my code because the same code runs fine on Android.
Also, I would create a minimalist code to post, however, the app includes a number of pictures and graphics that I think would be too large to post here. And I do not think that the issue is related to the code that I wrote. As said above, the code runs fine on Android.
Crash debug report:
...ANSWER
Answered 2020-Apr-16 at 15:45OK so for now the answer that I used to solve this was that I changed iPhones. I was running on a iPhone 5C. Now doing an iPhone SE (Not the 2020 model).
For now, this will be the answer. However, I will leave the question open as I would like to know why the code did not execute on the iPhone 5C.
QUESTION
I am trying to build a BLE provisioning app using Ionic and the BluetoothLE plugin. But, when I import the plugin, it gives me a blank screen. I've updated to ionic 5 and everything is up to date. I'm trying to build it through the usb debugging mode on android studio. And it works fine until I add the import statement.
I'm importing it the way the docs have it import { BluetoothLE } from '@ionic-native/bluetooth-le/ngx';
The plugin is installed properly and it is recognized as something to import. But for some reason it just bricks the app.
here's the package-lock.json:
...ANSWER
Answered 2020-Mar-06 at 14:47It's not documented anywhere that I could find. And maybe that's because I'm new to Ionic and this is common knowledge (I feel like anything like this in software should never be considered common knowledge) but when using a plugin, you need to import the plugin into app.module.ts and add it under providers like so:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bluetooth-le
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page