[PATCH BlueZ] gatt: allow 'notify' and 'indicate' flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is possible that some characteristics use the Notify as well as Indicate property.
In this case the CCC value is 3 and BlueZ returns BT_ERROR_CCC_IMPROPERLY_CONFIGURED.
This should be the behavior for values > 3.
---
 src/gatt-database.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gatt-database.c b/src/gatt-database.c
index be6dfb265..8e16c1d79 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -2648,9 +2648,9 @@ static uint8_t ccc_write_cb(struct pending_op *op, void *user_data)
    return BT_ATT_ERROR_INSUFFICIENT_RESOURCES;

  /* Don't support undefined CCC values yet */
- if (value > 2 ||
-   (value == 1 && !(chrc->props & BT_GATT_CHRC_PROP_NOTIFY)) ||
-   (value == 2 && !(chrc->props & BT_GATT_CHRC_PROP_INDICATE)))
+ if (value > 3 ||
+   (value & 0x1 && !(chrc->props & BT_GATT_CHRC_PROP_NOTIFY)) ||
+   (value & 0x2 && !(chrc->props & BT_GATT_CHRC_PROP_INDICATE)))
    return BT_ERROR_CCC_IMPROPERLY_CONFIGURED;

  if (chrc->notify_io) {
--
2.31.0
_____________________________________________________________________________________

Expleo Germany GmbH
Sitz der Gesellschaft | Corporate Headquarters: München
Handelsregister | Commercial Register: Amtsgericht München HRB 83252
Geschäftsführung | Management: Ralph Gillessen, Marcus Ganguin

This message contains information that may be privileged or confidential. It is intended only for the person to whom it is addressed.
If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof.
If you receive this message in error, please notify the sender immediately and delete all copies of this message.
_________________________________________________________

EMAIL LEGAL MENTION / DISCLAIMER

This message contains information that may be privileged or confidential and is the property of the Expleo Services SAS, RCS Versailles 831 178 348, located, 3 avenue des Prés, 78180 Montigny Le Bretonneux - France. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Ce message contient des informations qui peuvent être privilégiées ou confidentielles et elles sont de la propriété d'Expleo Services SAS, RCS Versailles 831 178 348, situé, 3 avenue des Prés, 78180 Montigny le Bretonneux-France. Il est destiné uniquement à la personne à qui est adressé. Si vous n'êtes pas le destinataire visé, vous n'êtes pas autorisé à lire, imprimer, conserver, copier, diffuser, distribuer ou utiliser ce message ou toute partie de celui-ci. Si vous recevez ce message par erreur, veuillez en avertir immédiatement l'expéditeur et supprimer toutes les copies de ce message.




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux