Bluetooth: host: Make bt_conn_ref return NULL if the ref count is zero
Make bt_conn_ref return NULL if the reference count has reached zero. This makes it possible to re-use bt_conn_ref internally to re-use the reference count mechanism to check if the reference is in use. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
76789883e2
commit
fae964c008
2 changed files with 19 additions and 4 deletions
|
@ -197,9 +197,12 @@ struct bt_conn_le_data_len_param {
|
|||
*
|
||||
* Increment the reference count of a connection object.
|
||||
*
|
||||
* @note Will return NULL if the reference count is zero.
|
||||
*
|
||||
* @param conn Connection object.
|
||||
*
|
||||
* @return Connection object with incremented reference count.
|
||||
* @return Connection object with incremented reference count, or NULL if the
|
||||
* reference count is zero.
|
||||
*/
|
||||
struct bt_conn *bt_conn_ref(struct bt_conn *conn);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue