apache / apache/mynewt-nimble

Helper functions for subscribing to notifications / indications

Open
#24 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C
Stars
893
Forks
512
Avg merge
13d 31m
Merged PRs (30d)
7

Description

Currently, an application subscribes to notifications or indications by performing a GATT write procedure on the appropriate CCCD. Knowing which two-byte pattern to write, and remembering to use little-endian, feels a bit too low-level to impose on the application developer.

I suggest we add two helper functions:
```
int
ble_gattc_subscribe_notifications(uint16_t conn_handle, uint16_t cccd_handle,
ble_gatt_attr_fn *cb, void *cb_arg);
int
ble_gattc_subscribe_indications(uint16_t conn_handle, uint16_t cccd_handle,
ble_gatt_attr_fn *cb, void *cb_arg);
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Start by locating the existing GATT write procedure used for CCCD subscription and trace how notification and indication values are encoded; done means the proposed helpers provide the requested subscription behavior while accepting the callback and argument parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.