Comments (4)
I'm in a similar situation to the one described above, I use my Android app to write the CCC descriptor to 0100 in order to enable notifications, but when I run my BLE server on the RaspberryPi it sometimes seems to misinterpret the writing of that descriptor and not enable the characteristic notifications. I found this out by monitoring the DBUS Bluez messages:
When notifications get enabled and things work fine, the StartNotify method gets called when I write the CCC descriptor:
Type=method_call Endian=l Flags=1 Version=1 Cookie=2651 Sender=:1.16 Destination=:1.99 Path=/org/bluez/dbz_application/service_0/char_1 Interface=org.bluez.GattCharacteristic1 Member=StartNotify UniqueName=:1.16 MESSAGE "" { };
When the notifications don't trigger, the WriteValue for the descriptor method gets called:
Type=method_call Endian=l Flags=0 Version=1 Cookie=2844 Sender=:1.16 Destination=:1.107 Path=/org/bluez/dbz_application/service_0/char_1/desc_0 Interface=org.bluez.GattDescriptor1 Member=WriteValue UniqueName=:1.16 MESSAGE "aya{sv}" { ARRAY "y" { BYTE 1; BYTE 0; }; ARRAY "{sv}" { DICT_ENTRY "sv" { STRING "device"; VARIANT "o" { OBJECT_PATH "/org/bluez/hci0/dev_74_B0_0A_B8_27_BF"; }; }; DICT_ENTRY "sv" { STRING "link"; VARIANT "s" { STRING "LE"; }; }; DICT_ENTRY "sv" { STRING "mtu"; VARIANT "q" { UINT16 517; }; }; }; };
The problem gets encountered randomly, when I run my program notifications either work fine or not at all and I didn't find any particular reason for this.
I have also noticed that running the BLE server functionality by itself never made me run into this issue. I use the library to create a BLE server into a program that does many other things, and works on several threads. This is the cases in which the issue appears infrequently.
Did you find any cause for the problem ?
I'll try my best to find a solution and reach you out if I discover something.
from bluez_inc.
Please share the code where you create your services and characteristics so that I can try to reproduce the issue.
from bluez_inc.
Please share the code where you create your services and characteristics so that I can try to reproduce the issue.
I have found the problem for my case. Bluez automatically creates CCC notification descriptor when you create a characteristic that has the 'notify' flag, but I thought that I have to manually create the CCC descriptor in code. Once I removed the code that creates the descriptor, the notifications started to work fine. It must have had a conflict between the 2 descriptors, the CCC one and the one that I was creating.
from bluez_inc.
Hi everyone, I found out the issue after I got access to Android application source code. It turned out that the Android application is made with wrong approach. All requests are handled with Thread.sleep() which can probably work with rtos, but not with linux. I tried to make some changes there and made it work.
The second problem is that notification are actually enabled only on android side and there were no actual write requests to ccc descriptors for enabling them on linux side.
from bluez_inc.
Related Issues (20)
- How to get the example applications to work? HOT 10
- `on_char_start_notify` is not being called when using `GATT_CHR_PROP_ENCRYPT_NOTIFY`. HOT 2
- Get CompanyID and Manufacturer Data on discovery callback HOT 3
- Handling RSSI threshold for device pair requests in peripheral mode HOT 2
- User data on all top-level `bluez_inc` types? HOT 3
- User-supplied log handler HOT 2
- scope enums with `BINC_` HOT 1
- GitHub CI HOT 1
- Does it support classic Bluetooth? HOT 1
- Raspberry Pi - Service Discovery Slow / Disconnect HOT 27
- Advertising, scan and connection parameters HOT 3
- Add Device into characteristic callbacks? HOT 2
- A couple more callbacks that I think should have a device object in them HOT 1
- Register multiple adveritisements HOT 1
- Concern about peripheral example. HOT 2
- How to rename bluetooth HOT 3
- Issue with scanning after turning bluetooth of and then back on HOT 3
- Reconnect to a previous device causes strange behavior HOT 5
- Peripheral - Device Information Service HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bluez_inc.