mynewt-nimble icon indicating copy to clipboard operation
mynewt-nimble copied to clipboard

ble_gatt: Add subscribing helper functions

Open KKopyscinski opened this issue 4 years ago • 3 comments

Adds 2 helper functions for subscribing to notification/indication. Using these functions, app developer doesn't need to know what values to write to CCCD to subscribe and how these values have to be formatted.

Adds functions mentioned in issue https://github.com/apache/mynewt-nimble/issues/24

KKopyscinski avatar Jan 12 '21 08:01 KKopyscinski

Style check summary

Our coding style is here!

apps/btshell/src/cmd.c

@@ -3481,8 +3482,8 @@
 };
 
 /*****************************************************************************
- * cmd-gatt-subscribe-notification                                            *
- *****************************************************************************/
+* cmd-gatt-subscribe-notification                                            *
+*****************************************************************************/
 
 static const struct shell_param cmd_gatt_subscribe_notification_params[] = {
     {"conn", "connection handle, usage: =<UINT16>"},
@@ -3497,8 +3498,8 @@
 };
 
 /*****************************************************************************
- * cmd-gatt-subscribe-indication                                            *
- *****************************************************************************/
+* cmd-gatt-subscribe-indication                                            *
+*****************************************************************************/
 
 static const struct shell_param cmd_gatt_subscribe_indication_params[] = {
     {"conn", "connection handle, usage: =<UINT16>"},

nimble/host/src/ble_gattc.c

@@ -4391,8 +4391,8 @@
 }
 
 /*****************************************************************************
- * $rx                                                                       *
- *****************************************************************************/
+* $rx                                                                       *
+*****************************************************************************/
 
 /**
  * Dispatches an incoming ATT error-response to the appropriate active GATT

apache-mynewt-bot avatar Jan 13 '21 08:01 apache-mynewt-bot

@rymanluk Could you review this?

KKopyscinski avatar Feb 11 '21 13:02 KKopyscinski

As disgussed offline this would be better to do after implementation of GATT caching, as then user could use handle to characteristic not CCCD

KKopyscinski avatar May 24 '21 09:05 KKopyscinski