bluetoothle | cross platform , REACTIVE BluetoothLE Plugin
kandi X-RAY | bluetoothle Summary
kandi X-RAY | bluetoothle Summary
Easy to use, cross platform, REACTIVE BluetoothLE Plugin for Xamarin
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 bluetoothle
bluetoothle Key Features
bluetoothle Examples and Code Snippets
Community Discussions
Trending Discussions on bluetoothle
QUESTION
Maybe someone can help me out because I have a really tricky situation with Bluetooth LE using WinRT on Windows 10 (like supposed here: Bluetooth Low Energy in .Net (C#)).
I need BLE within a Win32 classic desktop application.
Our code is running in a 32 Bit frame application using the .NET runtime (v4.0.30319, .NET Framework 4.6.2). I was able to manage all the other issues (strong naming some NuGet assemblies (Shiny.BluetoothLE), running BluetoothAdapter.GetRadioAsync()
in a 64 Bit COM surrogate DLL when running on 64 Bit Windows) but now I am totally stuck with this and here’s where:
The problem occurrs when executing var result = await gattDeviceService.GetCharacteristicsForUuidAsync(uuid, BluetoothCacheMode.Cached);
see here https://docs.microsoft.com/de-de/uwp/api/windows.devices.bluetooth.genericattributeprofile.gattdeviceservice.getcharacteristicsforuuidasync?view=winrt-20348.
When getting the read characteristics, the result.Status
is GattCommunicationStatus.Success
and the result contains the desired characteristic.
But of course I also need to get the write characteristic and I am ALWAYS getting GattCommunicationStatus.AccessDenied
!
Because of that the result contains NO characteristic.
Has anybody a clue why is that? I really need help here because I am kinda lost right now…
I also tried to set AccessPermission
via registry like supposed here but no luck at all…
PS: I use Windows 10 SDK Kit Build 20348 and like stated above it is a C# .NET Framework 4.6.2 project and all our assemblies are strong named because of using GAC. If I am missing anything don’t hesitate to contact me.
...ANSWER
Answered 2022-Mar-26 at 15:26For anyone who stumbles over the same stupid issue...Here's the solution:
On Windows, using .NET Framework 4.6.1+ and the WinRT libraries inside a Non-UWP application, you can only call ONCE for getting the characteristics, no matter if you call for all at once via gattDeviceService.GetCharacteristicsAsync(BluetoothCacheMode.Uncached)
or for a specific one via gattDeviceService.GetCharacteristicsForUuidAsync(uuid, BluetoothCacheMode.Cached)
.
Any subsequent calls will fail with GattCommunicationStatus.AccessDenied
...
So my solution now is to retrieve all characteristics at once and filter them locally.
That did the trick! Anyways, this is so stupid...It wasted a lot of my time now!
As it seems, I also do not need to set any AccessPermission
via registry.
PS: I will call out to you, if I stumble over another tricky situation, just to let you guyz know.
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
Before we even start: In researching this problem I've looked at dozens of posts here and elsewhere, and realize that VB is the worst for Bluetooth programming. However, this is for a client who has a massive legacy VB system and I have no choice.
According to MS documentation, the BluetoothLEDevice.FromIdAsync
is supposed to return a BluetoothLEDevice object but on my system it returns a generic System.__ComObject
that I can't cast to a BluetoothLEDevice. I have tried Cast and DirectCast but neither work. The sample C++ code I've looked at doesn't require any type of casting; the variable is declared and set using the BluetoothLEDevice.FromIdAsync
function without any dramas.
Here is my test code.
...ANSWER
Answered 2021-Dec-06 at 20:51The FromIdAsync needs to be run async which I couldn't do because I got an error stating it didn't have an awaiter. It turns out that I needed to NuGet the System.Runtime.Windowsruntime dll. I added the Await and it's working now.
Thanks to Andrew for pointing me in the right direction.
QUESTION
First of all, Sorry for my bad English. I'm studying about BluetoothLE under the UWP. Now, I can pair with my Bluetooth Low-Energy device and i can get services. And then, I want to get the all characteristics from my Bluetooth(LE) device.
I can get all service's characteristics except Human Interface Device(HID)'s characteristics. Below is the code get the characteristic( when change the service in combobox event)
...ANSWER
Answered 2021-Aug-02 at 09:57I can get all service's characteristics except Human Interface Device(HID)'s characteristics.
Please check the document here. At Support for Bluetooth RFCOMM services part you will find Human Interface Device
does not support, I'm afraid you can't get hid device characteristics within ble, if you do want this feature, please feel free post your requirement with Windows Feed Back Hub.
QUESTION
I am new to this business and I want to make an application related to Bluetooth LE. I don't know where to start, I want to do it using a library. I searched libraries such as 32feet.Net, InTheHand.BluetoothLe, Plugin.BluetoothLe, ble.net but I could not figure out how to make a windows form app or what can I do and where to start. Can anyone help?
...ANSWER
Answered 2021-May-26 at 15:33Bluetooth on windows has always been difficult with very few examples to learn from.
I think the most up to date way is probably to make a UWP application and use the Windows.Devices namespace. I've never tried it that way though.
There are examples of this here: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE
If you want to use 32feet.net, you will find some sample code in an old question of mine here: Bluetooth Pairing (SSP) on Windows 10 with 32feet.NET
I got the basics of searching for devices working, but never got the pairing to work how I wanted, and the question never got an answer despite someone placing a bounty on it. Hopefully it at least puts you on the right path.
QUESTION
I've set up a UWP sample BluetoothLE server using the code provided here. I'm using LightBlue on my iPhone as a client to read/write data to the characteristics exposed by the server.
Here's a description of the service:
This scenario allows the system to publish a calculator service. Remote clients (including this sample on another machine) can supply 2 operands and an operator and get a result.
Valid range for Operand is integer values. Valid range for Operator is 1-4 corresponding to +,-,*,/ respectively.
So there are 3 write characteristics, and 1 read characteristic. Using LightBlue on my iPhone, I write data to the operand characteristics in hexadecimal format, however I'm a little confused.
I expected to write the hexadecimal representation of a 32 unsigned integer, eg:
...ANSWER
Answered 2021-Mar-14 at 14:40You should change this line
QUESTION
I am trying to create a Xamarin.Forms app that will run on both iOS and Android. Eventually I need instances of the app to communicate with each other via Bluetooth, but I'm stuck on getting the iOS side to do anything with Bluetooth. I originally tried to work with Plugin.BluetoothLE and Plugin.BLE, but after a week and a half I was not able to get advertising or scanning to work on either OS with either plugin, so I decided to try implementing simple Bluetooth interaction using the .NET wrappers of the platform APIs, which at least are well documented. I did get scanning to work fine on the Android side. With iOS, though, what I have right now builds just fine, and runs on my iPad without errors, but the DiscoveredPeripheral handler is never called, even though the iPad is just a few inches from the Android tablet and presumably should be able to see the same devices. I have verified this by setting a breakpoint in that method, which is never reached; and when I open the Bluetooth Settings on the iPad to make it discoverable the app version on the Android tablet can see it, so I don't think it's an iPad hardware issue.
It seems obvious that there is simply some part of the process I don't know to do, but it's not obvious (to me) where else to look to find out what it is. Here is the code for the class that interacts with the CBCentralManager (as far as I understand from what I've read, this should include everything necessary to return a list of peripherals):
...ANSWER
Answered 2021-Mar-13 at 17:01The underlying problem was that in the first instantiation of PeripheralScanner, ScanForService was being called before State was updated. I tried many ways of waiting for that event to be raised so I could be sure the state was PoweredOn, but nothing seemed to work; polling loops simply never reached the desired state, but if I threw an Exception in the UpdatedState handler it was thrown within milliseconds of launch and the state at that time was always PoweredOn. (Breakpoints in that handler caused the debugging to freeze with the output Resolved pending breakpoint, which not even the VS team seems to be able to explain).
Reading some of the Apple developer blogs I found that this situation is most often avoided by having the desired action occur within the UpdatedState handler. It finally soaked into my thick head that I was never seeing any effects from that handler running because the event was being raised and handled on a different thread. I really need to pass the service UUID to the scanning logic, and to interact with a generic List that I can return from ScanForService, so just moving it all to the handler didn't seem like a promising direction. So I created a singleton for flagging the state:
QUESTION
This is how I call this. to resize window of the app
...ANSWER
Answered 2020-Dec-25 at 14:21This is how I call this. to resize window of the app
If you want to resize your app, please call TryResizeView
method after setting preferred min Size.
QUESTION
I have an application scanning BluetoothLE devices (temperature). The application is whitelisted in the list for battery optimizations and uses a PARTIAL_WAKE_LOCK.
It works like a charm with a Zebra TC25 Android 7.1.2 using a thread scanning BLE devices every 10 minutes independently of the android device state.
However the same application does not work at all with a samsung galaxy S10+ Android 10 when the screen is off (it works when screen is on). I know that the simple thread method will not work because of doze mode. So I also tried these ways :
setExactAndAllowWhileIdle(TJAlarmManager.JavaClass.RTC_WAKEUP, time,PendingIntent) and firebase cloud messaging sending high priority message. Alarm method has limitations but fcm has not as far as I know.
These 2 ways also failed. The fcm message is received and the alarm triggers, both run the BLEDiscover procedure below to run a bluetooth scan, but no bluetooth device are discovered.
Here is what happens in two situations. In the fisrt one, the screen is on, it always works :
...ANSWER
Answered 2020-Dec-08 at 20:20Android 10+ requires ACCESS_BACKGROUND_LOCATION permission for Bluetooth scanning in the background.
If you're using Delphi 10.4.1, check the Access background location checkbox in the Application > Uses Permissions section of the Project Options. For earlier versions of Delphi you may need to modify AndroidManifest.template.xml to add the permission:
QUESTION
I'm trying to send data between two phones (e.g. two iPhones, or maybe even cross platform) via bluetooth.
I've been trying to use Plugin.BluetoothLE from NuGet, which appears to have been updated recently (March 2020), however I can't seem to get any of the sample code working (details below).
I'd be grateful if anyone can point out what's wrong below, and/or if there's a better way of sending data between two phones through bluetooth. My application is time dependent, and there may not be a wifi network, so bluetooth seems to be the best option...
When I implement the demo server code available at https://github.com/aritchie/bluetoothle, I get the following errors:
No 'AddService' method within
CrossBleAdapter.Current.CreateGattServer()
.
No 'Start' method within
CrossBleAdapter.Current.CreateGattServer()
.
Here's the code I'm using (which I'm calling from the form).
...ANSWER
Answered 2020-Nov-09 at 10:39Ensure you have the correct key set in the info.plist
. See this link for more details.
There is a problem in that the underlying CBPeripheralManager
is still in an unknown state when trying to create the Gatt Server. To work around this, you have to bypass the CrossBleAdapter
and handle the creation of the top-level objects yourself. There are also some subtle changes to the API from the example given which makes this less than straight forward to get working.
Code
A full working example can be found here: https://github.com/jameswestgate/BleRedux
Define an interface which you can then implement on each platform:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bluetoothle
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