mynewt-nimble
mynewt-nimble copied to clipboard
ble_gatt: Add subscribing helper functions
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
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
@rymanluk Could you review this?
As disgussed offline this would be better to do after implementation of GATT caching, as then user could use handle to characteristic not CCCD